public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/genkernel:zfs commit in: defaults/
@ 2015-09-20 19:30 Richard Yao
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Yao @ 2015-09-20 19:30 UTC (permalink / raw
  To: gentoo-commits

commit:     7b805055ce3b1f211ae64905d2ee7d8898e880fd
Author:     Richard Yao <ryao <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 20 19:29:35 2015 +0000
Commit:     Richard Yao <ryao <AT> gentoo <DOT> org>
CommitDate: Sun Sep 20 19:29:35 2015 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=7b805055

Further ZFS boot improvements

Signed-off-by: Richard Yao <ryao <AT> gentoo.org>

 defaults/initrd.scripts | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index 9c0c290..d1bb0bc 100644
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -1034,10 +1034,22 @@ startVolumes() {
 		elif [ -z "${ZFS_POOL}" ]
 		then
 			bad_msg "Please boot with root=ZFS=\$DATASET"
+		# startVolumes is called twice for LUKS assembly.
+		# Devices are not accessed until mount, so become a no-op.
+		# We fall through from the waitForZFS call rather than stopping
+		# sooner so that initramfs archives where the zpool.cache file
+		# has been included are protected against races.
+		elif [ -f /etc/zfs/zpool.cache ]
+		then
+			:
 		elif /sbin/zpool import -f -N -o readonly=on "${ZFS_POOL}" 2>&1 >/dev/null
 		then
 			mkdir -p /tmp/zfs
-			mount -o ro,zfsutil -t zfs "${REAL_ROOT#*=}" /tmp/zfs
+			/sbin/mount.zfs -o ro,zfsutil "${REAL_ROOT#*=}" /tmp/zfs 2>&1 >/dev/null
+			if [ $? -ne 0 ]
+				bad_msg "Failed to mount ${REAL_ROOT#*=}"
+				return 1
+			fi
 
 			# Copy important files to /etc/zfs
 			for i in zpool.cache zdev.conf


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] proj/genkernel:zfs commit in: defaults/
@ 2015-09-21 13:13 Richard Yao
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Yao @ 2015-09-21 13:13 UTC (permalink / raw
  To: gentoo-commits

commit:     3ff0e784021281b01e7a005e81fef4506d0192cb
Author:     Richard Yao <ryao <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 21 01:22:36 2015 +0000
Commit:     Richard Yao <ryao <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 13:13:30 2015 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=3ff0e784

Reimplement dozfs=force support

Signed-off-by: Richard Yao <ryao <AT> gentoo.org>

 defaults/initrd.scripts | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index d1c3873..b7c8cc3 100644
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -1042,6 +1042,14 @@ startVolumes() {
 		elif [ -f /etc/zfs/zpool.cache ]
 		then
 			:
+		# Depreciated support for dozfs=force
+		elif [ -n "${ZPOOL_FORCE}" ]
+		then
+			/sbin/zpool import -f -N "${ZFS_POOL}" 2>&1 >/dev/null
+			if [ $? -ne 0 ]
+			then
+				bad_msg "Failed to force import ${ZFS_POOL}"
+			fi
 		elif /sbin/zpool import -f -N -o readonly=on "${ZFS_POOL}" 2>&1 >/dev/null
 		then
 			mkdir -p /tmp/zfs


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] proj/genkernel:zfs commit in: defaults/
@ 2015-09-21 13:13 Richard Yao
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Yao @ 2015-09-21 13:13 UTC (permalink / raw
  To: gentoo-commits

commit:     6b3e3dfbc265ef47c2c2e008ad31ae79041225b6
Author:     Richard Yao <ryao <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 21 01:44:36 2015 +0000
Commit:     Richard Yao <ryao <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 13:13:30 2015 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=6b3e3dfb

Cleanup logic to find rootfs on ZFS

We no longer support root=ZFS. Only root=ZFS=$dataset is supported.
GRUB2 never used that syntax and users never liked it, so that should be
okay.

We also handle the case where the root pool is missing from the
cachefile or the cachefile itself is missing by informing users of how
to repair the system. We inform them rather than do it ourselves because
a step is required after the pool is imported and while we can do it for
them, the heuristics are unlikely to be right 100% of the time and we
really should not be making changes to the rootfs from the initramfs.

Signed-off-by: Richard Yao <ryao <AT> gentoo.org>

 defaults/linuxrc | 48 +++++++++++++++++++++++-------------------------
 1 file changed, 23 insertions(+), 25 deletions(-)

diff --git a/defaults/linuxrc b/defaults/linuxrc
index 877d845..dc129ce 100644
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -523,11 +523,27 @@ do
 				fi
 				;;
 			ZFS*)
-				if [ "${USE_ZFS}" = '0' ]; then
+				zpool list -H -o name | grep -q "${ZFS_POOL}"
+				if [ $? -ne 0 ]
+				then
+					if [ ! -e /etc/zfs/zpool.cache ]
+					then
+						bad_msg "${ZFS_POOL} not imported due to missing zpool.cache file."
+
+					else
+						bad_msg "${ZFS_POOL} absent from zpool.cache file."
+					fi
+					bad_msg "Provided that ${ZFS_POOL} exists, you can correct this by:"
+					bad_msg
+					bad_msg "1. Dropping to a shell."
+					bad_msg "2. Running \`zpool import -d /dev/disk/by-id -N ${ZFS_POOL}\`"
+					bad_msg "3. Pressing Cntl+D to exit."
+					bad_msg "4. Running \`zpool set cachefile= ${ZFS_POOL}\` (space after equal sign)"
+					bad_msg "	as root after system has booted."
 					prompt_user "REAL_ROOT" "root block device"
+					got_good_root=0
 					continue
 				fi
-					
 				ROOT_DEV="${REAL_ROOT#*=}"
 				if [ "${ROOT_DEV}" != 'ZFS' ] 
 				then
@@ -543,29 +559,11 @@ do
 						continue
 					fi
 				else
-					BOOTFS=$(/sbin/zpool list -H -o bootfs)
-					if [ "${BOOTFS}" != '-' ]
-					then
-
-						for i in ${BOOTFS}
-						do
-
-							zfs get type ${i} > /dev/null
-							retval=$?
-
-							if [ ${retval} -eq 0 ];	then
-								got_good_root=1
-								REAL_ROOT=${i}
-								ROOTFSTYPE=zfs
-								break
-							fi	
-						
-						done;
-
-					else
-						got_good_root=0
-					fi
-
+					bad_msg "root=ZFS is no longer supported."
+					bad_msg "Please specify root=ZFS=\$DATASET:"
+					prompt_user "REAL_ROOT" "root block device"
+					got_good_root=0
+					continue
 				fi
 
 				if [ ${got_good_root} -ne 1 ]; then


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] proj/genkernel:zfs commit in: defaults/
@ 2015-09-21 13:13 Richard Yao
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Yao @ 2015-09-21 13:13 UTC (permalink / raw
  To: gentoo-commits

commit:     d6663b5493579e33f311340b80da5a1fb0d7f6ed
Author:     Richard Yao <ryao <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 21 13:13:08 2015 +0000
Commit:     Richard Yao <ryao <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 13:13:30 2015 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=d6663b54

Fix missing `then` keyword

Signed-off-by: Richard Yao <ryao <AT> gentoo.org>

 defaults/initrd.scripts | 1 +
 1 file changed, 1 insertion(+)

diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index d1bb0bc..d1c3873 100644
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -1047,6 +1047,7 @@ startVolumes() {
 			mkdir -p /tmp/zfs
 			/sbin/mount.zfs -o ro,zfsutil "${REAL_ROOT#*=}" /tmp/zfs 2>&1 >/dev/null
 			if [ $? -ne 0 ]
+			then
 				bad_msg "Failed to mount ${REAL_ROOT#*=}"
 				return 1
 			fi


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] proj/genkernel:zfs commit in: defaults/
@ 2016-01-20 18:58 Richard Yao
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Yao @ 2016-01-20 18:58 UTC (permalink / raw
  To: gentoo-commits

commit:     255d1f34ef55ee9c83983fec1057c1dde156ea26
Author:     Richard Yao <ryao <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 20 18:54:33 2016 +0000
Commit:     Richard Yao <ryao <AT> gentoo <DOT> org>
CommitDate: Wed Jan 20 18:54:33 2016 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=255d1f34

busybox mount takes -o move instead of --move

Our attempt to move /dev into /newroot/dev fails because busybox's mount
does not understand --move. Instead it requires `-o move`. ZFS /dev/zd*
devices to be lost during the boot process.

At present, there is no nothing in userland that knows how to recreate
them from `/sys/devices/virtual/block`.

Signed-off-by: Richard Yao <ryao <AT> gentoo.org>

 defaults/linuxrc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/defaults/linuxrc b/defaults/linuxrc
index dc129ce..66efda8 100644
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -998,7 +998,7 @@ for fs in /dev /sys /proc
 do
 	if grep -qs "$fs" /proc/mounts
 	then
-		if ! mount --move $fs "${CHROOT}"$fs
+		if ! mount -o move $fs "${CHROOT}"$fs
 		then
 			umount $fs || \
 			bad_msg "Failed to move and unmount the ramdisk $fs!"


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-01-20 18:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-21 13:13 [gentoo-commits] proj/genkernel:zfs commit in: defaults/ Richard Yao
  -- strict thread matches above, loose matches on Subject: below --
2016-01-20 18:58 Richard Yao
2015-09-21 13:13 Richard Yao
2015-09-21 13:13 Richard Yao
2015-09-20 19:30 Richard Yao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox