Skip to content

Commit

Permalink
Pass root device to dracut so that it adds its filesystem drivers
Browse files Browse the repository at this point in the history
With `--sysroot`, dracut needs to know the root device to automatically get its
filesystem drivers. Otherwise, they are missing from the initramfs and the
system cannot boot.

Fixes openSUSE#44
  • Loading branch information
aafeijoo-suse committed Feb 9, 2024
1 parent e85e1c0 commit 45f9b47
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sdbootutil
Original file line number Diff line number Diff line change
Expand Up @@ -394,15 +394,15 @@ install_kernel()
local snapshot_dir="/.snapshots/$snapshot/snapshot"
local dracut_args=()
if [ "$subvol" != "$root_subvol" ]; then
dracut_args=('--sysroot' "${snapshot_dir}" '--tmpdir' '/var/tmp')
dracut_args=('--sysroot' "${snapshot_dir}" '--tmpdir' '/var/tmp' '--add-device' "/dev/disk/by-uuid/${root_uuid}")
fi
log_info "generating new initrd"
# In MicroOS we need to be sure to have the same /etc
# inside the snapshot. For example, /etc/crypttab can
# have modifications in the overlay that will be
# visible once the snapshot is active, but the version
# in /.snashots is still the unmodified base
# in /.snapshots is still the unmodified base
is_transactional && mount_etc "${snapshot_dir}"
run_command_live_output dracut --quiet --reproducible "${dracut_args[@]}" "$tmpdir/initrd-0" "$kernel_version"
is_transactional && umount_etc "${snapshot_dir}"
Expand Down

0 comments on commit 45f9b47

Please sign in to comment.