[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Fix several live-installer bugs



Dear live-installer and partman-target maintainers,

I'm sending this to the mailist instead of the respective bug reports to 
avoid spamming the BTS and because this addresses several issues in two 
packages. Sorry if I'm doing this wrong. Please correct me.

live-installer is, ATM, partially broken in both squeeze and and wheezy.

1. In both releases fstab is truncated by the presence of the empty 
fstab that newer live-build versions (> 3.0_a47) create and breaks the 
installed system (partitions are not found because fstab is empty) if 
the user selects a multi partition schema in partman - [1]. Even in "all 
in one partition" fstab is empty.

2. In squeeze only, besides the fstab problem, live-* packages are not 
being removed after the disk installation. That was fixed in version 31 
but somehow it never reached squeeze - [2] and [3].

3. In wheezy only, partman-target is silently breaking live-installer 
postinst by not completing the extracting to disk of several directories 
in /var/ after an error cause by the presence of a /var/run and 
/var/lock directories in the disk created by partman-target [4] and 
probably [5].

I consider all of this issues important, if not RC, because of debian 
policy, and should be corrected as soon as possible in both releases.


partman-target wheezy only
--------------------------

Partman-target is still creating /var/run and /var/lock (#652946 [4] 
and, probably, #673328 [5]). I've commented out the relevant section. I 
leave to the maintainers what to do: remove completly the section [6] or 
just comment the breaking code as I did. For now the section is 
commented in the following patch:

---8<------------------------------------------------------
diff --git a/finish.d/mount_partitions b/finish.d/mount_partitions
index 9c8499e..cc690ab 100755
--- a/finish.d/mount_partitions
+++ b/finish.d/mount_partitions
@@ -62,8 +62,9 @@ for f in $fstab; do
 			    /)
 				# Create these before /var is mounted,
 				# so that they can be mounted as tmpfses
-				mkdir -p /target/var/lock
-				mkdir -p /target/var/run
+				#mkdir -p /target/var/lock
+				#mkdir -p /target/var/run
+				:
 				;;
 			esac
 			continue 2
---8<------------------------------------------------------


live-installer
--------------

live-installer 31 is not in squeeze [3]. It would fix #655198 [2] in 
squeeze.

live-build now leaves an empty fstab (#681261 [1]). This breaks both 
squeeze and wheezy live-installer.

How I've fixed live-installer in both releases: I've created a squeeze 
branch (checkout) from the not uploaded version 31 and made a commit to 
preserve the fstab created by partman and restore it after the image is 
extracted to disk.

---8<------------------------------------------------------
diff --git a/debian/live-installer.postinst b/debian/live-installer.postinst
index 7f76dbf..f16be62 100755
--- a/debian/live-installer.postinst
+++ b/debian/live-installer.postinst
@@ -27,6 +27,9 @@ install_live_system () {
 		. $script
 	done
 
+	# preserve fstab created by partman-target, see #681261
+	[ -e /target/etc/fstab ] && mv /target/etc/fstab /target/etc/fstab.partman
+
 	for place in $PLACES; do
 		[ ! -e $place ] && continue
@@ -76,6 +80,9 @@ install_live_system () {
 		exit 1
 	fi
 
+	# restore fstab created by partman-target, see #681261
+	mv /target/etc/fstab.partman /target/etc/fstab
+
 	# if we're dumping it, we need to set the boot mode
 	if [ "$mode" = live ]; then
 		# which initramfs hook to use
---8<------------------------------------------------------

Then I've also merged that branch to a wheezy branch (checkout) from 
HEAD so it's included in wheezy.

Finally, I've released and build the package of the 31-1 version in 
squeeze branch to fix both #655198 [2] and #681261 [1] in squeeze. Then, 
I've released another package for wheezy (from wheezy branch) to fix 
only #681261 [1] in wheezy.


fstab.d problem
---------------

I don't think that #681261 [1] can be easely fixed in partman-target as 
suggested [7]. I've searched the word fstab in partman-target code [8] 
and it seems to be hardcoded in several places, although something like 
a finish.d/99mv_fstab_to_fstab.d that would mv the file and touch the 
default one (because an empty fstab is needed, if not fstab.d is just 
ignored). But this new 99mv_fstab_to_fstab.d would have to deal with the 
fact that squeeze doesn't support fstab.d. And the new partman-target 
would need to be uploaded to squeeze also.

Besides this, even if partman-target was changed right now for wheezy, 
it would introduce a new unexpected empty fstab for everybody (not 
live-installer only I think). Also, squeeze just doesn't support 
fstab.d, so fixing #681261 [1] in partman-target will leave squeeze 
broken with recent live-build versions.

Because of all this my opinion is that #681261 [1] should be implemented (if 
that's the decision) only in jessie (wheezy+1). For now dealing with the 
presence of an empty fstab in the squashfs can/could be done in 
live-installer only.

I could upload nmu for squeeze and wheezy live-installer, and also 
wheezy partman-target, with my patches to make all work, at least for 
now, but I would need the assistance of a mentor, if a nmu is possible 
in this case.

Looking forward to resolve this issues and improve live-installer and 
Debian. Thank you.


[1](http://bugs.debian.org/681261) - #681261: update fstab even if 
non-existent (possibly fstab.d too)

[2](http://bugs.debian.org/655198) - #655198: live-installer does not remove live packages in the installed system

[3](http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=655198#25)

[4](http://bugs.debian.org/652946) - #652946: partman-target should not create /var/run

[5](http://bugs.debian.org/673328) - #673328: live-installer does not preserve /var/log; breaks freeradius

[6](http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=652946#83)

[7](http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=681261#10)

[8](http://anonscm.debian.org/gitweb/?p=d-i%2Fpartman-target.git&a=search&h=HEAD&st=grep&s=fstab)


Reply to: