diff --git a/dracut/28immucore/module-setup.sh b/dracut/28immucore/module-setup.sh index 4fd8160..f27b5ef 100755 --- a/dracut/28immucore/module-setup.sh +++ b/dracut/28immucore/module-setup.sh @@ -27,6 +27,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_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/pkg/mount/mount.go b/pkg/mount/mount.go index 03b819e..b2907d2 100644 --- a/pkg/mount/mount.go +++ b/pkg/mount/mount.go @@ -84,10 +84,17 @@ func (s *State) WriteFstab(fstabFile string) func(context.Context) error { } } -// ln -sf -t / /sysroot/system 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/") + if err != nil { + s.Logger.Err(err).Msg("creating symlink") + return err + } + } + cmd := fmt.Sprintf("elemental run-stage %s", stage) log.Logger.Debug().Str("cmd", cmd).Msg("") output, err := utils.SH(cmd) @@ -273,7 +280,7 @@ func (s *State) Register(g *herd.Graph) error { s.Logger.Debug().Str("what", opRootfsHook).Msg("Add operation") err = g.Add(opRootfsHook, mountRootCondition, herd.WithDeps(opMountOEM), herd.WithCallback(s.RunStageOp("rootfs"))) if err != nil { - s.Logger.Err(err) + s.Logger.Err(err).Msg("") } // /run/cos-layout.env