Merge ~crass/casper:fix-toram into casper:main

Proposed by Glenn Washburn
Status: Needs review
Proposed branch: ~crass/casper:fix-toram
Merge into: casper:main
Diff against target: 29 lines (+12/-0)
2 files modified
scripts/casper-bottom/05mountpoints (+7/-0)
scripts/casper-bottom/99casperboot (+5/-0)
Reviewer Review Type Date Requested Status
Steve Langasek Needs Information
Review via email: mp+453084@code.launchpad.net

Description of the change

This is a fix for LP: #684280 and in doing so makes the /isodevice mount user accessible again from overlayfs root if "toram" is on the kernel commandline. This brings back behavior that some people have comes to rely on (that /isodevice is user accessible) and when "toram" is used allows for removing devices that contain the backing iso while the live system is running.

To test, first boot via loopback without "toram" on the kernel commandline and verify that /isodevice exists after boot is complete. Then boot with "toram" on the kernel commandline and verify that the iso file does not exist in the list of loopback devices listed via losetup.

To post a comment you must log in.
Revision history for this message
Steve Langasek (vorlon) wrote :

> This brings back behavior that some people have comes to rely on

But that cannot be bug #684280, which was reported in 2010 and affects all supported releases of Ubuntu for several years now.

Perhaps there has been some mismarking of other bugs as duplicates?

review: Needs Information
Revision history for this message
Glenn Washburn (crass) wrote :

> > This brings back behavior that some people have comes to rely on
>
> But that cannot be bug #684280, which was reported in 2010 and affects all
> supported releases of Ubuntu for several years now.
>
> Perhaps there has been some mismarking of other bugs as duplicates?

What people have been doing is working around the bug as mentioned in the comments of that bug. You can see consistently through the years people working around it. Regardless, this merge request fixes that bug.

Revision history for this message
Glenn Washburn (crass) wrote :

Its unclear to me what other information is needed. Could you please be specific in what more information is required?

Revision history for this message
scmarko (scmarko) wrote :

This bug should get fixed as it seems to affect all current Ubuntu based distributions. Currently when you boot an ISO file from the hard drive using the "toram" option, Ubuntu loads fine into RAM, but the problems start when you try to repartition and install Ubuntu from RAM to the hard drive.

Because the hard drive is left mounted after Ubuntu has loaded into RAM, you can't repartition the hard drive if you started the ISO file from the same hard drive partition.

There are a lot of cases when Ubuntu should be able to boot completely to RAM, allowing unmounting of the hard drive and let it repartition the hard drive, but this bug prevents that. This bug adds a lot complexity when users need to modify their initrds in Ubuntu installations manually.

Unmerged commits

4f0556e... by Glenn Washburn

Allow device with loopback loaded iso to be removed when toram is specified

When running from ram, the iso's backing device should be unused by the
livecd. The expected use case is that a user is loading the iso from a
removable device (eg. usb stick) and wants to start the livecd and remove
the device while the livecd system is running.

LP: #684280

d6b5560... by Glenn Washburn

Make /isodevice accessible from overlay root again

This functionality appears to have been inadvertently removed during
the merging of lupin-casper. To quote from an issue comment[1]:"The problem
without these lines of code is that the partition remains mounted but the
mount point is lost, it can not be unmounted, it locks the partition
(avoiding changes in the disk when toram option is used)".

[1] https://bugs.launchpad.net/ubuntu/+source/lupin/+bug/1960457/comments/34

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/scripts/casper-bottom/05mountpoints b/scripts/casper-bottom/05mountpoints
2index bce0b1f..ecdcc53 100755
3--- a/scripts/casper-bottom/05mountpoints
4+++ b/scripts/casper-bottom/05mountpoints
5@@ -28,4 +28,11 @@ mount -n -o move /cdrom /root/cdrom
6 mkdir -p /root/media
7 ln -s /cdrom /root/media/cdrom
8
9+# Move the mount point for the filesystem containing the ISO when loopback
10+# booting.
11+if grep -q '^[^ ]* /isodevice ' /proc/mounts; then
12+ mkdir -p ${rootmnt}/isodevice
13+ mount -n -o move /isodevice ${rootmnt}/isodevice
14+fi
15+
16 log_end_msg
17diff --git a/scripts/casper-bottom/99casperboot b/scripts/casper-bottom/99casperboot
18index da4909f..aa1575a 100755
19--- a/scripts/casper-bottom/99casperboot
20+++ b/scripts/casper-bottom/99casperboot
21@@ -16,3 +16,8 @@ prereqs)
22 esac
23
24 touch /run/.casper-boot
25+
26+if [ "$TORAM" ] && [ -e "${rootmnt}/isodevice" ]; then
27+ umount -l ${rootmnt}/isodevice
28+ losetup -d /dev/loop0
29+fi

Subscribers

People subscribed via source and target branches