+ if [ "${live_dest}" ] && [ -z "$PERSISTENT" ] && [ "$DETACH" ]; then
+ if grep -q '^[^ ]* /root/isodevice ' /proc/mounts; then
+ losetup -d /dev/loop0
+ umount /root/isodevice
+ fi
+ fi
+
# Close the fd's associated with debconf-communicate.
exec 3>&- 4<&-
rm -f /tmp/debconf-in.fifo
There are other options for implementing this, for example:
a) detaching as the default behavior and allowing for a "nodetach" argument in cmdline
b) removing "/root" from the patch (in the 2 lines where it appears), will make this work without fixing https://bugs.launchpad.net/ubuntu/+source/lupin/+bug/1960457/comments/34 first.
Disconnecting the loop device may not always be desired after using "toram": See https:/ /bugs.launchpad .net/ubuntu/ +source/ lupin/+ bug/1960457/ comments/ 33
Thus, it may be advisable to ask for that explicitly. I propose using "detach". So the system should be booted with "toram detach".
Solving this problem requires less than 10 lines. I hope that developers can add the patch below.
For this patch to work it is necessary to fix the issue mentioned previously beforehand: https:/ /bugs.launchpad .net/ubuntu/ +source/ lupin/+ bug/1960457/ comments/ 34 first (4 lines)
Here is the patch:
--- scripts/casper_1477
export TORAM="Yes" ;;
todisk= *)
export TODISK= "${x#todisk= }" ;;
hostname= *)
export CMD_HOST= "${x#hostname= }" ;;
userfulln ame=*) casper- bottom
+++ scripts/casper
@@ -75,6 +75,8 @@
+ detach)
+ export DETACH="Yes" ;;
@@ -1042,6 +1044,13 @@
run_scripts /scripts/
[ "$quiet" != "y" ] && log_end_msg
+ if [ "${live_dest}" ] && [ -z "$PERSISTENT" ] && [ "$DETACH" ]; then communicate. in.fifo
+ if grep -q '^[^ ]* /root/isodevice ' /proc/mounts; then
+ losetup -d /dev/loop0
+ umount /root/isodevice
+ fi
+ fi
+
# Close the fd's associated with debconf-
exec 3>&- 4<&-
rm -f /tmp/debconf-
There are other options for implementing this, for example: /bugs.launchpad .net/ubuntu/ +source/ lupin/+ bug/1960457/ comments/ 34 first.
a) detaching as the default behavior and allowing for a "nodetach" argument in cmdline
b) removing "/root" from the patch (in the 2 lines where it appears), will make this work without fixing https:/