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

dmsquash-live: add rd.live.join #687

Closed
wants to merge 1 commit into from

Conversation

udeved
Copy link

@udeved udeved commented Nov 19, 2019

Support a union join on rootfs wiih another img.

This makes throw away layers possible, or starting different setups depending on rootfs and the join.img.

Example:

  • the live bootloader features a base system and a desktop system entry, where the desktop fs resides in the join.img, while rootfs would be just a console base system.
  • throw away live layer, the installer extracts the rootfs, while live session fs resides in the join.img, including the installer itself

Usage:

rd.live.join=$name.img

@centos-ci
Copy link
Collaborator

Can one of the admins verify this patch?

@haraldh
Copy link
Collaborator

haraldh commented Mar 6, 2020

@FGrose could you please review?

@haraldh haraldh mentioned this pull request Mar 6, 2020
if [ -e "$SQUASHED" ]; then
if [ -n "$live_ram" ]; then
echo 'Copying live image to RAM...' > /dev/kmsg
echo ' (this may take a minute)' > /dev/kmsg
dd if=$SQUASHED of=/run/initramfs/squashed.img bs=512 2> /dev/null
echo 'Done copying live image to RAM.' > /dev/kmsg
SQUASHED="/run/initramfs/squashed.img"
if [ -n ${join} ];then
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if [ -n ${join} ];then
if [ -n ${join} ]; then

Did you intend to support the live_ram option? If so, please verify that this new code path works.

SQUASHED_JOIN_LOOPDEV=$( losetup -f )
losetup -r $SQUASHED_JOIN_LOOPDEV $SQUASHED_JOIN
mkdir -m 0755 -p /run/initramfs/joinfs
mount -n -t squashfs -o ro $SQUASHED_LOOPDEV /run/initramfs/joinfs
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
mount -n -t squashfs -o ro $SQUASHED_LOOPDEV /run/initramfs/joinfs
mount -n -t squashfs -o ro $SQUASHED_JOIN_LOOPDEV /run/initramfs/joinfs

Did you intend to support an unflat join.img? I would recommend not to as you require an OverlayFS for the union join. (You don't use the /run/initramfs/joinfs mountpoint anyway. This section is superfluous.)

if [ -d /run/initramfs/squashfs/LiveOS ]; then
if [ -f /run/initramfs/squashfs/LiveOS/rootfs.img ]; then
FSIMG="/run/initramfs/squashfs/LiveOS/rootfs.img"
elif [ -f /run/initramfs/squashfs/LiveOS/ext3fs.img ]; then
FSIMG="/run/initramfs/squashfs/LiveOS/ext3fs.img"
fi
if [ -f /run/initramfs/squashfs/LiveOS/${join} ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

This is looking for the join.img inside the squashfs.img. Not correct.

@@ -323,12 +345,22 @@ else
elif [ -e /run/initramfs/live/${live_dir}/ext3fs.img ]; then
FSIMG="/run/initramfs/live/${live_dir}/ext3fs.img"
fi
if [ -e /run/initramfs/live/${live_dir}/${join} ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you intend to support an uncompressed join.img? If so, please verify that this new code path works.

@@ -343,6 +375,15 @@ if [ -n "$FSIMG" ]; then
unpack_archive $FSIMG /run/initramfs/fsimg/
fi
FSIMG=/run/initramfs/fsimg/rootfs.img

if [ -n ${join} ]; then
Copy link
Contributor

@FGrose FGrose Mar 6, 2020

Choose a reason for hiding this comment

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

Did you intend to support the 'writeable_fsimg' option? If so, please verify that this new code path works.
('Writeable_fsimg' configurations use Device-mapper linear devices, which don't support the union join of content. This section seems superfluous.)

@@ -358,12 +399,23 @@ if [ -n "$FSIMG" ]; then
fi
if [ "$FSIMG" = "$SQUASHED" ]; then
BASE_LOOPDEV=$SQUASHED_LOOPDEV
if [ -n ${join} ]; then
Copy link
Contributor

@FGrose FGrose Mar 6, 2020

Choose a reason for hiding this comment

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

Device-mapper based configurations will not support a union join of rootfs content with joinfs. This new code through line 418 is superfluous, no?

fi
mount -r $FSIMG /run/rootfsbase
if [ -n ${join} ]; then
mount -r $FSIMG_JOIN /run/rootfsjoin
fi
if [ -z "$DRACUT_SYSTEMD" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

In order to support DRACUT_SYSTEMD systems, the ovlfs variable in dmsquash-generator.sh must be similarly modified.

@udeved
Copy link
Author

udeved commented May 29, 2020

@FGrose

I am sorry for the late reply, as soon as I have enough time at hand, I will look more closely at it.
We still haven't switched to dracut, and this rough patch did the job to test our install media boot with dracut.
Tested was a flat squash image and a squashed ext image.

@danimo
Copy link
Contributor

danimo commented Aug 4, 2020

@udeved any update?

@johannbg johannbg added dmsquash-live Issues related to the dmsquash-live module modules Issue tracker for all modules labels Aug 5, 2020
@stale
Copy link

stale bot commented Dec 16, 2020

This issue is being marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. If this is still an issue in the latest release of Dracut and you would like to keep it open please comment on this issue within the next 7 days. Thank you for your contributions.

@stale stale bot added the stale communication is stuck label Dec 16, 2020
@stale stale bot closed this Dec 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dmsquash-live Issues related to the dmsquash-live module modules Issue tracker for all modules stale communication is stuck
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants