fix deps of rootfs stage, not working modules, symlink

Signed-off-by: Itxaka <itxaka@spectrocloud.com>
This commit is contained in:
Itxaka
2023-02-07 20:27:31 +01:00
parent 63679b6df1
commit b62a1f2e99
3 changed files with 7 additions and 5 deletions

View File

@@ -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 # Add missing elemental binary, drop once we get yip lib inside immucore as its only needed to run the stages
inst_multiple immucore elemental inst_multiple immucore elemental
# add utils used by elemental or stages # 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_script "${moddir}/generator.sh" "${systemdutildir}/system-generators/immucore-generator"
inst_simple "${moddir}/immucore.service" "${systemdsystemunitdir}/immucore.service" inst_simple "${moddir}/immucore.service" "${systemdsystemunitdir}/immucore.service"
mkdir -p "${initdir}/${systemdsystemunitdir}/initrd-fs.target.requires" mkdir -p "${initdir}/${systemdsystemunitdir}/initrd-fs.target.requires"

View File

@@ -1,5 +1,6 @@
# This services should be run from immucore directly, rootfs at start of immucore and initramfs once we mount everything, # 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 # 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 # 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 " install_items+=" /etc/systemd/system/cos-setup-initramfs.service /etc/systemd/system/initrd.target.requires/cos-setup-initramfs.service "
# RUN BY IMMUCORE BUT FAILING # RUN BY IMMUCORE BUT FAILING

View File

@@ -88,7 +88,7 @@ func (s *State) RunStageOp(stage string) func(context.Context) error {
return func(ctx context.Context) error { return func(ctx context.Context) error {
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr}).With().Caller().Logger() log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr}).With().Caller().Logger()
if stage == "rootfs" { if stage == "rootfs" {
err := os.Symlink("/sysroot/system/", "/system/") err := os.Symlink("/sysroot/system", "/system")
if err != nil { if err != nil {
s.Logger.Err(err).Msg("creating symlink") s.Logger.Err(err).Msg("creating symlink")
return err return err
@@ -278,7 +278,7 @@ func (s *State) Register(g *herd.Graph) error {
// TODO: add symlink if Rootdir != "" // TODO: add symlink if Rootdir != ""
// TODO: chroot? // TODO: chroot?
s.Logger.Debug().Str("what", opRootfsHook).Msg("Add operation") 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 { if err != nil {
s.Logger.Err(err).Msg("") s.Logger.Err(err).Msg("")
} }