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

Bug#688782: marked as done (Moving of mount points in initramfs from /live to /root/live does not work in important cases)



Your message dated Wed, 26 Sep 2012 12:47:38 +0000
with message-id <E1TGr1e-0007IM-DN@franck.debian.org>
and subject line Bug#688782: fixed in live-boot 3.0~b3-1
has caused the Debian Bug report #688782,
regarding Moving of mount points in initramfs from /live to /root/live does not work in important cases
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
688782: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=688782
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: live-boot
Version: 3.0~b2-1
Severity: grave
Tags: patch

Hi

The attached patch fixes the move of persistence and other mounts from
/live to /root/live inside the initramfs. It also removes some
leftover mount points that are not used because the device did not
contain a persistence layer.

I'm setting the severity to grave as without these changes the
persistence filesystems can not be seen from the live system and
therefore cannot be remounted readonly on shutdown. This leaves these
filesystem in an inconsistent state which may lead to data corruption.
IMO this needs to be fixed for wheezy.

The patch consists of three individual commits that all can be applied
separately.

The readonly remounting of persistence filesystems does not work with
the latest live-config for unrelated reasons. I'll submit a separate bug
report (with patch ;-) ) to fix this issue.

Gaudenz

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (800, 'testing'), (700, 'unstable'), (50, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.5-trunk-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_CH.UTF-8, LC_CTYPE=de_CH.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
>From 9339bf268e1d8b58db75228e30cedccffb47caeb Mon Sep 17 00:00:00 2001
From: Gaudenz Steinlin <gaudenz@debian.org>
Date: Tue, 25 Sep 2012 17:54:45 +0200
Subject: [PATCH 1/3] Move filesystems even if mountpoint exists

If /live has a persistence layer the mountpoint may already exist. Move
the filesystems anyway.
---
 scripts/boot/9990-main.sh |   11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/scripts/boot/9990-main.sh b/scripts/boot/9990-main.sh
index 5732b2a..a95033e 100755
--- a/scripts/boot/9990-main.sh
+++ b/scripts/boot/9990-main.sh
@@ -146,11 +146,8 @@ Main ()
 	esac
 
 	# Move to the new root filesystem so that programs there can get at it.
-	if [ ! -d /root/live/image ]
-	then
-		mkdir -p /root/live/image
-		mount --move /live/image /root/live/image
-	fi
+	[ ! -d /root/live/image ] && mkdir -p /root/live/image
+	mount --move /live/image /root/live/image
 
 	# aufs2 in kernel versions around 2.6.33 has a regression:
 	# directories can't be accessed when read for the first the time,
@@ -159,9 +156,9 @@ Main ()
 	ls /root/* >/dev/null 2>&1
 
 	# Move findiso directory to the new root filesystem so that programs there can get at it.
-	if [ -d /live/findiso ] && [ ! -d /root/live/findiso ]
+	if [ -d /live/findiso ]
 	then
-		mkdir -p /root/live/findiso
+		[ ! -d /root/live/findiso ] && mkdir -p /root/live/findiso
 		mount -n --move /live/findiso /root/live/findiso
 	fi
 
-- 
1.7.10.4

>From 79cf89b66bace9b980e7c175c0612a68c90d4507 Mon Sep 17 00:00:00 2001
From: Gaudenz Steinlin <gaudenz@debian.org>
Date: Tue, 25 Sep 2012 17:56:51 +0200
Subject: [PATCH 2/3] Remove mountpoints if there is no persistence

Remove mountpoint if no persistence layer is found on a device.
---
 scripts/boot/9990-misc-helpers.sh |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/boot/9990-misc-helpers.sh b/scripts/boot/9990-misc-helpers.sh
index 117876f..4429c33 100755
--- a/scripts/boot/9990-misc-helpers.sh
+++ b/scripts/boot/9990-misc-helpers.sh
@@ -911,7 +911,9 @@ probe_for_file_name ()
 	then
 		echo ${ret}
 	else
+		# unmount and remove mountpoint
 		umount ${backing} > /dev/null 2>&1 || true
+		rmdir ${backing} > /dev/null 2>&1 || true
 	fi
 }
 
-- 
1.7.10.4

>From 31a6da42164d1abc7285506738a9a796b9a80afc Mon Sep 17 00:00:00 2001
From: Gaudenz Steinlin <gaudenz@debian.org>
Date: Tue, 25 Sep 2012 17:58:50 +0200
Subject: [PATCH 3/3] Move mountpoints below /live/{persistence,rofs}

When moving a mountpoint all mounts below are not automatically moved.
This moves all these mountpoints individually.
---
 scripts/boot/9990-overlay.sh |   19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/scripts/boot/9990-overlay.sh b/scripts/boot/9990-overlay.sh
index 597ff50..5405781 100755
--- a/scripts/boot/9990-overlay.sh
+++ b/scripts/boot/9990-overlay.sh
@@ -405,8 +405,23 @@ setup_unionfs ()
 		done
 	fi
 
-	mkdir -p "${rootmnt}/live"
-	mount -o move /live "${rootmnt}/live" >/dev/null 2>&1 || mount -o bind /live "${rootmnt}/live" || log_warning_msg "Unable to move or bind /live to ${rootmnt}/live"
+	# prepare /root/live with tmpfs for moving of filesystems
+	[ ! -d	"${rootmnt}/live" ] && mkdir "${rootmnt}/live"
+	mount -t tmpfs tmpfs "${rootmnt}/live"
+
+	# move all mount points to root filesystem
+	for dir in rofs persistence
+	do
+		if [ -d /live/${dir} ]
+		then
+			mkdir "${rootmnt}/live/${dir}"
+			for mp in $(ls /live/$dir)
+			do
+				mkdir "${rootmnt}/live/${dir}/${mp}"
+				mount -o move "/live/${dir}/${mp}" "${rootmnt}/live/${dir}/${mp}" >/dev/null 2>&1 || mount -o bind "/live/${dir}/${mp}" "${rootmnt}/live/${dir}/${mp}" || log_warning_msg "Unable to move or bind /live/${dir}/${mp} to ${rootmnt}/live/${dir}/${mp}"
+			done
+		fi
+	done
 
 	# shows cow fs on /overlay (FIXME: do we still need/want this? probably yes)
 	mkdir -p "${rootmnt}/live/overlay"
-- 
1.7.10.4


--- End Message ---
--- Begin Message ---
Source: live-boot
Source-Version: 3.0~b3-1

We believe that the bug you reported is fixed in the latest version of
live-boot, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 688782@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Daniel Baumann <daniel@debian.org> (supplier of updated live-boot package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Wed, 26 Sep 2012 14:40:32 +0200
Source: live-boot
Binary: live-boot live-boot-doc live-boot-initramfs-tools
Architecture: source all
Version: 3.0~b3-1
Distribution: unstable
Urgency: low
Maintainer: Debian Live Project <debian-live@lists.debian.org>
Changed-By: Daniel Baumann <daniel@debian.org>
Description: 
 live-boot  - Debian Live - System Boot Scripts
 live-boot-doc - Debian Live - System Boot Scripts (documentation)
 live-boot-initramfs-tools - Debian Live - System Boot Scripts (initramfs-tools backend)
Closes: 687099 688782
Changes: 
 live-boot (3.0~b3-1) unstable; urgency=low
 .
   [ Daniel Baumann ]
   * Always move live filesystem mounts to /root within initramfs,
     regardless if mountpoint already exists or not (Closes: #688782).
 .
   [ Gaudenz Steinlin ]
   * Removing mountpoint if no persistence layer is found on a device.
 .
   [ Daniel Baumann ]
   * Exposing rofs and persistence mounts under /live in the live
     systems, not just initramfs only (Closes: #687099).
   * Updating code for exposing of overlay mounts under /live too.
Checksums-Sha1: 
 daa932c693842c0a65f12d536ea66bc4029c1746 1376 live-boot_3.0~b3-1.dsc
 33a9ad54e74d46ac0df06c3d2d2a546982ca799d 58892 live-boot_3.0~b3.orig.tar.xz
 651b2a5fe4be3e748954eadb358371ce8aeb23d9 21196 live-boot_3.0~b3-1.debian.tar.xz
 8cd412b81c236614e9e1dd06f686541c4ab1832b 46992 live-boot_3.0~b3-1_all.deb
 d96b1aa770c9576836579def628102b38db5a8a8 50580 live-boot-doc_3.0~b3-1_all.deb
 c61efa700fe913b4f3dbc4c89d678bd8485e8c14 24926 live-boot-initramfs-tools_3.0~b3-1_all.deb
Checksums-Sha256: 
 8d589f16d636b0ff7a9c5bab2e838363f4ebebf9ea2e2d9589650341691e937b 1376 live-boot_3.0~b3-1.dsc
 87304318f45d2983175830a598d3dc9e479ce015ccb8eb84e3b8203af93f97c4 58892 live-boot_3.0~b3.orig.tar.xz
 1dfc001a04f464b8f17cd1b6793815165d50e88ce49a8f0486af7678b55baf6b 21196 live-boot_3.0~b3-1.debian.tar.xz
 c92419abd74abb499dbee4011637a2478476b9262951a67edddea3a02479ba0c 46992 live-boot_3.0~b3-1_all.deb
 3b3299a407a8c1d22cf5dabf6bafabbccfcbc8ae52b4d05dc9619d9dd0ad5edc 50580 live-boot-doc_3.0~b3-1_all.deb
 c9053e965324406c95f99f4ca4793030a5603c312e09bf1c6499671d6d929965 24926 live-boot-initramfs-tools_3.0~b3-1_all.deb
Files: 
 e69dcda8264f1f35471a36a80aabbc1c 1376 misc optional live-boot_3.0~b3-1.dsc
 94cdeccd4a44c84586aef4433c61ae1d 58892 misc optional live-boot_3.0~b3.orig.tar.xz
 42b97db1e209f0398d682580249bc1fe 21196 misc optional live-boot_3.0~b3-1.debian.tar.xz
 8ea5ad5d3e79a8a6061d7c78a032819b 46992 misc optional live-boot_3.0~b3-1_all.deb
 fb2d9526e698ea380607eb5b9f8e95d1 50580 doc optional live-boot-doc_3.0~b3-1_all.deb
 e96b052e502299fe29e76c0288d86b69 24926 misc optional live-boot-initramfs-tools_3.0~b3-1_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAlBi+G8ACgkQ+C5cwEsrK56dLgCgqhrl7/5cKjEvxtA5t7nc7FuP
YTAAoL+FjhGsD0WkX/O7y9oWhgzUbPf+
=A3ze
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: