public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/genkernel:xake commit in: defaults/
@ 2011-03-24 11:49 Peter Hjalmarsson
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Hjalmarsson @ 2011-03-24 11:49 UTC (permalink / raw
  To: gentoo-commits

commit:     55a9eda4766e1dd60ff948e99b388a633435b678
Author:     Peter Hjalmarsson <xake <AT> rymdraket <DOT> net>
AuthorDate: Thu Mar 24 11:48:24 2011 +0000
Commit:     Peter Hjalmarsson <xake <AT> rymdraket <DOT> net>
CommitDate: Thu Mar 24 11:48:24 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=55a9eda4

When "root=" specifies the real root we should also use "init=" as real init.

---
 defaults/linuxrc |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/defaults/linuxrc b/defaults/linuxrc
index 61efc95..64bb150 100755
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -50,6 +50,9 @@ do
 		subdir\=*)
 			SUBDIR=`parse_opt "${x}"`
 		;;
+		init\=*)
+			FAKE_INIT=`parse_opt "${x}"`
+		;;
 		real_init\=*)
 			REAL_INIT=`parse_opt "${x}"`
 		;;
@@ -250,7 +253,8 @@ done
 
 if [ -z "${REAL_ROOT}" -a \( "${CDROOT}" = '0' \)  -a \( "${FAKE_ROOT}" != "/dev/ram0" \) ]
 then
-	REAL_ROOT="${FAKE_ROOT}"	
+	REAL_ROOT="${FAKE_ROOT}"
+	REAL_INIT="${FAKE_INIT}"
 fi
 
 splash 'init'



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

* [gentoo-commits] proj/genkernel:xake commit in: defaults/
@ 2011-03-25  9:28 Peter Hjalmarsson
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Hjalmarsson @ 2011-03-25  9:28 UTC (permalink / raw
  To: gentoo-commits

commit:     84fa86d53867dc30b90f83b4cebc2e89bfac153c
Author:     Peter Hjalmarsson <xake <AT> rymdraket <DOT> net>
AuthorDate: Fri Mar 25 09:25:15 2011 +0000
Commit:     Peter Hjalmarsson <xake <AT> rymdraket <DOT> net>
CommitDate: Fri Mar 25 09:25:15 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=84fa86d5

If "real_init=" is already already specified, do not overwite it with "init=".

---
 defaults/linuxrc |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/defaults/linuxrc b/defaults/linuxrc
index 8d20a20..012c556 100755
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -254,7 +254,7 @@ done
 if [ -z "${REAL_ROOT}" -a \( "${CDROOT}" = '0' \)  -a \( "${FAKE_ROOT}" != "/dev/ram0" \) ]
 then
 	REAL_ROOT="${FAKE_ROOT}"
-	REAL_INIT="${FAKE_INIT}"
+	[ -z "REAL_INIT" ] && REAL_INIT="${FAKE_INIT}"
 fi
 
 splash 'init'



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

* [gentoo-commits] proj/genkernel:xake commit in: defaults/
@ 2011-03-25  9:28 Peter Hjalmarsson
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Hjalmarsson @ 2011-03-25  9:28 UTC (permalink / raw
  To: gentoo-commits

commit:     4f3fb890795bce02be5a8f27f87e66c4796a3541
Author:     Peter Hjalmarsson <xake <AT> rymdraket <DOT> net>
AuthorDate: Thu Mar 24 12:33:03 2011 +0000
Commit:     Peter Hjalmarsson <xake <AT> rymdraket <DOT> net>
CommitDate: Thu Mar 24 12:33:03 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=4f3fb890

Use the same options for proc and sysfs as Gentoo/OpenRC uses

---
 defaults/initrd.scripts |    2 +-
 defaults/linuxrc        |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index 4a12b73..b228a77 100755
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -210,7 +210,7 @@ cache_cd_contents() {
 }
 
 mount_sysfs() {
-	mount -t sysfs /sys /sys >/dev/null 2>&1
+	mount -t sysfs sysfs /sys -o noexec,nosuid,nodev >/dev/null 2>&1
 	ret=$?
 	[ ${ret} -eq 0 ] || bad_msg "Failed to mount /sys!"
 }

diff --git a/defaults/linuxrc b/defaults/linuxrc
index 64bb150..f5802d7 100755
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -20,7 +20,7 @@ then
 	exit 1
 fi
 
-mount -t proc proc /proc >/dev/null 2>&1
+mount -t proc -o noexec,nosuid,nodev proc /proc >/dev/null 2>&1
 mount -o remount,rw / >/dev/null 2>&1
 
 # Set up symlinks



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

* [gentoo-commits] proj/genkernel:xake commit in: defaults/
@ 2011-03-25  9:28 Peter Hjalmarsson
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Hjalmarsson @ 2011-03-25  9:28 UTC (permalink / raw
  To: gentoo-commits

commit:     3b21c8aae7a02e6f72facb2660980a751cd3867f
Author:     Peter Hjalmarsson <xake <AT> rymdraket <DOT> net>
AuthorDate: Thu Mar 24 12:36:56 2011 +0000
Commit:     Peter Hjalmarsson <xake <AT> rymdraket <DOT> net>
CommitDate: Thu Mar 24 12:36:56 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=3b21c8aa

Try to move /sys and /proc to the newroot first instead of just unmounting.

---
 defaults/linuxrc |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/defaults/linuxrc b/defaults/linuxrc
index f5802d7..8d20a20 100755
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -737,16 +737,17 @@ echo -ne "${BOLD}.${NORMAL}"
 
 # If devtmpfs is mounted, try move it to the new root
 # If that fails, try to unmount all possible mounts of devtmpfs as stuff breaks otherwise
-if grep -qs "/dev " /proc/mounts
-then
-	if ! mount --move /dev "${CHROOT}"/dev
+for fs in /dev /sys /proc
+do
+	if grep -qs "$fs" /proc/mounts
 	then
-		umount /dev || echo '*: Failed to move and unmount the ramdisk /dev!'
+		if ! mount --move $fs "${CHROOT}"$fs
+		then
+			umount $fs || echo '*: Failed to move and unmount the ramdisk $fs!'
+		fi
 	fi
-fi
+done
 
-umount /sys || echo '*: Failed to unmount the ramdisk /sys!'
-umount /proc || echo '*: Failed to unmount the ramdisk /proc!'
 echo -e "${BOLD}.${NORMAL}"
 
 exec /sbin/switch_root -c "/dev/console" "${CHROOT}" "${REAL_INIT:-/sbin/init}" "${INIT_OPTS}"



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

end of thread, other threads:[~2011-03-25  9:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-25  9:28 [gentoo-commits] proj/genkernel:xake commit in: defaults/ Peter Hjalmarsson
  -- strict thread matches above, loose matches on Subject: below --
2011-03-25  9:28 Peter Hjalmarsson
2011-03-25  9:28 Peter Hjalmarsson
2011-03-24 11:49 Peter Hjalmarsson

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