diff --git a/dracut/28immucore/module-setup.sh b/dracut/28immucore/module-setup.sh index f27b5ef..0fd3d73 100755 --- a/dracut/28immucore/module-setup.sh +++ b/dracut/28immucore/module-setup.sh @@ -28,7 +28,8 @@ install() { # Add missing elemental binary, drop once we get yip lib inside immucore as its only needed to run the stages inst_multiple immucore elemental # add utils used by elemental or stages - inst_multiple partprobe sync udevadm parted mkfs.ext2 mkfs.ext3 mkfs.ext4 mkfs.vfat mkfs.fat mkfs.xfs blkid e2fsck resize2fs mount xfs_growfs umount sgdisk + inst_multiple partprobe sync udevadm parted mkfs.ext2 mkfs.ext3 mkfs.ext4 mkfs.vfat mkfs.fat blkid e2fsck resize2fs mount umount sgdisk + # missing mkfs.xfs xfs_growfs in image? inst_script "${moddir}/generator.sh" "${systemdutildir}/system-generators/immucore-generator" inst_simple "${moddir}/immucore.service" "${systemdsystemunitdir}/immucore.service" mkdir -p "${initdir}/${systemdsystemunitdir}/initrd-fs.target.requires" diff --git a/dracut/dracut.conf b/dracut/dracut.conf index 35aa080..bbe6458 100644 --- a/dracut/dracut.conf +++ b/dracut/dracut.conf @@ -1,5 +1,6 @@ -# This services should be run from immucore directly, rootfs at start of immucore and initramfs once we mount everything, -# so at the end, just before we let init do the switch_root +# This services should be run from immucore directly, rootfs once we mount /sysroot and initramfs once we mount everything, +# so at the end, just before we let init do the switch_root. Notice that we run really early in the boot with immucore so +# maybe by this time some things are not ready... # Note that initramfs run with RootDirectory=/sysroot install_items+=" /etc/systemd/system/cos-setup-initramfs.service /etc/systemd/system/initrd.target.requires/cos-setup-initramfs.service " # RUN BY IMMUCORE BUT FAILING diff --git a/pkg/mount/mount.go b/pkg/mount/mount.go index b2907d2..d35c2e7 100644 --- a/pkg/mount/mount.go +++ b/pkg/mount/mount.go @@ -88,7 +88,7 @@ func (s *State) RunStageOp(stage string) func(context.Context) error { return func(ctx context.Context) error { log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr}).With().Caller().Logger() if stage == "rootfs" { - err := os.Symlink("/sysroot/system/", "/system/") + err := os.Symlink("/sysroot/system", "/system") if err != nil { s.Logger.Err(err).Msg("creating symlink") return err @@ -278,7 +278,7 @@ func (s *State) Register(g *herd.Graph) error { // TODO: add symlink if Rootdir != "" // TODO: chroot? s.Logger.Debug().Str("what", opRootfsHook).Msg("Add operation") - err = g.Add(opRootfsHook, mountRootCondition, herd.WithDeps(opMountOEM), herd.WithCallback(s.RunStageOp("rootfs"))) + err = g.Add(opRootfsHook, mountRootCondition, herd.WithDeps(opMountRoot), herd.WithCallback(s.RunStageOp("rootfs"))) if err != nil { s.Logger.Err(err).Msg("") }