2010-10-29 19:45:20 +02:00
|
|
|
Submitted By: Mario Fetka (mario dot fetka at gmail dot com)
|
2010-10-30 07:38:21 +02:00
|
|
|
Date: 2010-10-30
|
2010-10-29 19:45:20 +02:00
|
|
|
Initial Package Version: 3.4.10.907
|
2010-10-29 22:19:58 +02:00
|
|
|
Origin: gentoo busybox mdev-start.sh and me
|
2010-10-29 19:45:20 +02:00
|
|
|
Upstream Status: unknown
|
2010-10-30 09:36:58 +02:00
|
|
|
Description: add a new boot command 'nashack' that creates the missing dev entries
|
2010-10-29 19:45:20 +02:00
|
|
|
|
|
|
|
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
|
2010-10-29 23:17:31 +02:00
|
|
|
+++ genkernel-3.4.10.907/defaults/initrd.scripts 2010-10-29 21:14:39.022515391 +0000
|
|
|
|
@@ -284,9 +284,60 @@
|
2010-10-29 19:45:20 +02:00
|
|
|
/bin/ash
|
|
|
|
}
|
|
|
|
|
2010-10-29 22:19:58 +02:00
|
|
|
+seed_chroot_dev()
|
|
|
|
+{
|
|
|
|
+ # Seed /dev with some things that we know we need
|
|
|
|
+
|
2010-10-29 23:17:31 +02:00
|
|
|
+ # Create problematic directories
|
2010-10-30 11:14:47 +02:00
|
|
|
+ mkdir -p ${CHROOT}/dev/pts ${CHROOT}/dev/shm
|
2010-10-29 23:17:31 +02:00
|
|
|
+
|
2010-10-29 22:19:58 +02:00
|
|
|
+ # creating /dev/console and /dev/tty1 to be able to write
|
|
|
|
+ # to $CONSOLE with/without bootsplash before mdev creates it
|
2010-10-30 11:14:47 +02:00
|
|
|
+ [ -c ${CHROOT}/dev/console ] || mknod ${CHROOT}/dev/console c 5 1
|
|
|
|
+ [ -c ${CHROOT}/dev/tty1 ] || mknod ${CHROOT}/dev/tty1 c 4 1
|
2010-10-29 22:19:58 +02:00
|
|
|
+
|
|
|
|
+ # udevd will dup its stdin/stdout/stderr to /dev/null
|
|
|
|
+ # and we do not want a file which gets buffered in ram
|
2010-10-30 11:14:47 +02:00
|
|
|
+ [ -c ${CHROOT}/dev/null ] || mknod ${CHROOT}/dev/null c 1 3
|
2010-10-29 23:07:55 +02:00
|
|
|
+
|
2010-10-29 23:17:31 +02:00
|
|
|
+ # creating /dev/initctl to be able to switch init
|
2010-10-30 11:14:47 +02:00
|
|
|
+ [ -c ${CHROOT}/dev/initctl ] || mknod ${CHROOT}/dev/initctl p
|
2010-10-29 22:19:58 +02:00
|
|
|
+}
|
|
|
|
+
|
2010-10-29 19:45:20 +02:00
|
|
|
+seed_dev()
|
|
|
|
+{
|
|
|
|
+ # Seed /dev with some things that we know we need
|
|
|
|
+
|
|
|
|
+ # creating /dev/console and /dev/tty1 to be able to write
|
|
|
|
+ # to $CONSOLE with/without bootsplash before mdev creates it
|
|
|
|
+ [ -c /dev/console ] || mknod /dev/console c 5 1
|
|
|
|
+ [ -c /dev/tty1 ] || mknod /dev/tty1 c 4 1
|
|
|
|
+
|
|
|
|
+ # udevd will dup its stdin/stdout/stderr to /dev/null
|
|
|
|
+ # and we do not want a file which gets buffered in ram
|
|
|
|
+ [ -c /dev/null ] || mknod /dev/null c 1 3
|
|
|
|
+
|
|
|
|
+ # copy over any persistant things
|
|
|
|
+ if [ -d /lib/mdev/devices ] ; then
|
|
|
|
+ cp -RPp /lib/mdev/devices/* /dev 2>/dev/null
|
|
|
|
+ fi
|
|
|
|
+
|
|
|
|
+ # Not provided by sysfs but needed
|
|
|
|
+ ln -snf /proc/self/fd /dev/fd
|
|
|
|
+ ln -snf fd/0 /dev/stdin
|
|
|
|
+ ln -snf fd/1 /dev/stdout
|
|
|
|
+ ln -snf fd/2 /dev/stderr
|
|
|
|
+ [ -e /proc/kcore ] && ln -snf /proc/kcore /dev/core
|
|
|
|
+
|
|
|
|
+ # Create problematic directories
|
|
|
|
+ mkdir -p /dev/pts /dev/shm
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
runmdev() {
|
|
|
|
# busybox udev replacement
|
|
|
|
mdev -s
|
|
|
|
+ # add missing dev entrys for nas devices without console
|
|
|
|
+ seed_dev
|
|
|
|
}
|
|
|
|
|
|
|
|
test_success() {
|
2010-10-29 23:17:31 +02:00
|
|
|
@@ -1093,3 +1144,5 @@
|
2010-10-29 22:19:58 +02:00
|
|
|
USE_UNIONFS_NORMAL=0
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
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
|
2010-10-30 09:36:58 +02:00
|
|
|
+++ genkernel-3.4.10.907/defaults/linuxrc 2010-10-30 07:31:00.700222780 +0000
|
2010-10-30 07:38:21 +02:00
|
|
|
@@ -62,6 +62,10 @@
|
|
|
|
init_opts\=*)
|
|
|
|
INIT_OPTS=`parse_opt "${x}"`
|
|
|
|
;;
|
2010-10-30 09:36:58 +02:00
|
|
|
+ # remount chroot rw and create missing files
|
2010-10-30 07:38:21 +02:00
|
|
|
+ nashack)
|
|
|
|
+ NASHACK=1
|
|
|
|
+ ;;
|
|
|
|
# Livecd options
|
|
|
|
cdroot)
|
|
|
|
CDROOT=1
|
2010-10-30 09:36:58 +02:00
|
|
|
@@ -731,6 +735,17 @@
|
2010-10-29 22:19:58 +02:00
|
|
|
|
|
|
|
verbose_kmsg
|
|
|
|
|
2010-10-30 09:36:58 +02:00
|
|
|
+# create the missing dev entrys for the nas boxes if the don't exist
|
2010-10-30 07:38:21 +02:00
|
|
|
+if [ "${NASHACK}" = '1' ]
|
|
|
|
+then
|
2010-10-30 09:36:58 +02:00
|
|
|
+ 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
|
2010-10-30 07:38:21 +02:00
|
|
|
+fi
|
2010-10-29 22:19:58 +02:00
|
|
|
+
|
|
|
|
echo -ne "${GOOD}>>${NORMAL}${BOLD} Booting (initramfs)${NORMAL}"
|
|
|
|
if [ ! -e "${CHROOT}/dev/console" ] || [ ! -e "${CHROOT}/dev/null" ]
|
|
|
|
then
|