Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring alpine initrd closer to other flavors #1088

Merged
merged 3 commits into from
Oct 2, 2024
Merged

Bring alpine initrd closer to other flavors #1088

merged 3 commits into from
Oct 2, 2024

Conversation

Itxaka
Copy link
Member

@Itxaka Itxaka commented Oct 2, 2024

Set the dirs to be the same as other flavors, especially the livecd one as we read the configs from that dir, so kairos tooling expects the livecd to be mounted there

Fixes: kairos-io/kairos#2912

Set the dirs to be the same as other flavors, especially the livecd one
as we read the configs from that dir, so kairos tooling expects the
livecd to be mounted there

Signed-off-by: Itxaka <itxaka@kairos.io>
@Itxaka Itxaka requested a review from a team October 2, 2024 12:39
Signed-off-by: Itxaka <itxaka@kairos.io>
@@ -375,16 +383,16 @@ if grep -q netboot /proc/cmdline; then
sync
# Create mountpoints
ebegin "Create mountpoints"
mkdir -p /media/root-rw /run/rootfsbase $sysroot/media/root-rw $sysroot/run/rootfsbase
mkdir -p $rootRW $rootfsbase $sysroot$rootRW $sysroot$rootfsbase
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if I understand correctly this:

/media/root-rw /run/rootfsbase $sysroot/media/root-rw $sysroot/run/rootfsbase

Becomes this

/run/overlay /run/rootfsbase $sysroot/run/overlay $sysroot/run/rootfsbase

so that means that /media/root-rw got changed to /run/overlay and same to the one that is prefixed by the $sysroot

why did the location change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to have it in line with what immucore does. We mount a writable /run/overlay and then submounts things there (/etc /var and so on, basically the ephemeral parts)

So in this case, this initrd was just doing its own thing. In this case it should not matter much as nothing should be using that, especially during live boot, but having ti be the same makes it easier to understand both what dracut does and what we do :)

@@ -398,20 +406,20 @@ if grep -q cdroot /proc/cmdline ;then
label=$(grep -o CDLABEL.* /proc/cmdline | cut -f 1 -d ' ' | cut -f 2 -d '=' )
# Create mountpoints
ebegin "Create mountpoints"
mkdir -p /media/root-ro /media/root-rw /run/rootfsbase $sysroot/media/root-ro $sysroot/media/root-rw $sysroot/run/rootfsbase
mkdir -p $liveroot $rootRW $rootfsbase $sysroot$liveroot $sysroot$rootRW $sysroot$rootfsbase
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here similar comment, why did /media/root-ro got moved to /run/initramfs/live?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same thing. On dracut it automounts the livecd under that path but we were mounting it under root-ro because the upstream init from alpine did that. It makes no sense for us to deviate from what we expect and it shows, this was causing alpine to not autoinstall with a config bundled, because the livecd was mounted under that path and agent looks under /run/initramfs/live to read any configs coming from the live media.

Copy link
Member

@mauromorales mauromorales left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

smart approach changing them to variables 👍

Im drunk or something?

Signed-off-by: Itxaka <itxaka@kairos.io>
@Itxaka Itxaka merged commit 3048504 into main Oct 2, 2024
6 checks passed
@Itxaka Itxaka deleted the improve_alpine branch October 2, 2024 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Alpine initrd should mount the livecd under /run/initramfs/live
2 participants