sys-kernel/genkernel: add wrapper arround the creation of chroot dev entries onyl when required

git-svn-id: https://svn.disconnected-by-peer.at/svn/linamh/trunk/genlink@2624 6952d904-891a-0410-993b-d76249ca496b
This commit is contained in:
geos_one
2010-10-30 07:36:58 +00:00
parent 3f0071324a
commit 8227bdda72
3 changed files with 18 additions and 10 deletions

View File

@@ -3,7 +3,7 @@ Date: 2010-10-30
Initial Package Version: 3.4.10.907
Origin: gentoo busybox mdev-start.sh and me
Upstream Status: unknown
Description: create a new nashack boot option to work around real root is missing some dev entries
Description: add a new boot command 'nashack' that creates the missing dev entries
diff -Naur genkernel-3.4.10.907.orig/defaults/initrd.scripts genkernel-3.4.10.907/defaults/initrd.scripts
--- genkernel-3.4.10.907.orig/defaults/initrd.scripts 2010-10-29 16:11:03.765695917 +0000
@@ -77,28 +77,31 @@ diff -Naur genkernel-3.4.10.907.orig/defaults/initrd.scripts genkernel-3.4.10.90
+
diff -Naur genkernel-3.4.10.907.orig/defaults/linuxrc genkernel-3.4.10.907/defaults/linuxrc
--- genkernel-3.4.10.907.orig/defaults/linuxrc 2010-10-29 16:11:03.762695924 +0000
+++ genkernel-3.4.10.907/defaults/linuxrc 2010-10-30 05:20:08.366956721 +0000
+++ genkernel-3.4.10.907/defaults/linuxrc 2010-10-30 07:31:00.700222780 +0000
@@ -62,6 +62,10 @@
init_opts\=*)
INIT_OPTS=`parse_opt "${x}"`
;;
+ # remount chroot rw and create missing dev entries in real_root
+ # remount chroot rw and create missing files
+ nashack)
+ NASHACK=1
+ ;;
# Livecd options
cdroot)
CDROOT=1
@@ -731,6 +735,14 @@
@@ -731,6 +735,17 @@
verbose_kmsg
+# create the missing dev entrys for the nas boxes
+# create the missing dev entrys for the nas boxes if the don't exist
+if [ "${NASHACK}" = '1' ]
+then
+ mount -o remount,rw ${CHROOT} >/dev/null 2>&1
+ seed_chroot_dev
+ mount -o remount,ro ${CHROOT} >/dev/null 2>&1
+ if [ ! -e "${CHROOT}/dev/console" ] || [ ! -e "${CHROOT}/dev/null" ]
+ then
+ mount -o remount,rw ${CHROOT} >/dev/null 2>&1
+ seed_chroot_dev
+ mount -o remount,ro ${CHROOT} >/dev/null 2>&1
+ fi
+fi
+
echo -ne "${GOOD}>>${NORMAL}${BOLD} Booting (initramfs)${NORMAL}"