summaryrefslogtreecommitdiff
path: root/packages/initrdscripts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/initrdscripts')
-rw-r--r--packages/initrdscripts/devimage/devimage.sh5
-rw-r--r--packages/initrdscripts/devimage_0.1.bb8
-rw-r--r--packages/initrdscripts/files/10-initfs.sh1
-rw-r--r--packages/initrdscripts/files/30-bootmenu.sh15
-rw-r--r--packages/initrdscripts/files/85-blockboot.sh6
-rw-r--r--packages/initrdscripts/files/87-kexecboot.sh19
-rw-r--r--packages/initrdscripts/files/init.sh12
-rw-r--r--packages/initrdscripts/initramfs-module-block_1.0.bb2
-rw-r--r--packages/initrdscripts/initramfs-module-bootmenu_1.0.bb2
-rw-r--r--packages/initrdscripts/initramfs-module-initfs_1.0.bb2
-rw-r--r--packages/initrdscripts/initramfs-module-kexecboot_1.0.bb12
-rw-r--r--packages/initrdscripts/initramfs-uniboot_1.0.bb3
12 files changed, 72 insertions, 15 deletions
diff --git a/packages/initrdscripts/devimage/devimage.sh b/packages/initrdscripts/devimage/devimage.sh
index e85debf245..8a264ed33d 100644
--- a/packages/initrdscripts/devimage/devimage.sh
+++ b/packages/initrdscripts/devimage/devimage.sh
@@ -7,6 +7,11 @@ mount -t sysfs sysfs /sys
mkdir -p /dev/pts
mount -t devpts devpts /dev/pts
+modprobe g_ether
+ifconfig usb0 192.168.2.202
+
+export PATH=$PATH:/usr/sbin
+
/usr/sbin/dropbear -E
/bin/sh
diff --git a/packages/initrdscripts/devimage_0.1.bb b/packages/initrdscripts/devimage_0.1.bb
index 08949b9515..0622dd0330 100644
--- a/packages/initrdscripts/devimage_0.1.bb
+++ b/packages/initrdscripts/devimage_0.1.bb
@@ -1,12 +1,14 @@
DESCRIPTION = "Set of files to initialize bare system suitable for kernel, etc. testing."
SRC_URI = "file://devimage.sh file://passwd file://dropbear_rsa_host_key"
-PR = "r2"
+PR = "r4"
do_install() {
- install -m 0755 ${WORKDIR}/devimage.sh ${D}/init
install -d ${D}/etc/dropbear
+ install -d ${D}/sbin
+ install -m 0755 ${WORKDIR}/devimage.sh ${D}/init
install -m 0600 ${WORKDIR}/dropbear_rsa_host_key ${D}/etc/dropbear/
install -m 0644 ${WORKDIR}/passwd ${D}/etc/
+ ln -s /init ${D}/sbin/init
}
-FILES_${PN} += " /init /etc/*"
+FILES_${PN} += " /init /etc/* /sbin/*"
diff --git a/packages/initrdscripts/files/10-initfs.sh b/packages/initrdscripts/files/10-initfs.sh
index bad649e5c2..c2a843eb12 100644
--- a/packages/initrdscripts/files/10-initfs.sh
+++ b/packages/initrdscripts/files/10-initfs.sh
@@ -3,3 +3,4 @@
modprobe -q vfat >/dev/null 2>&1
modprobe -q ext2 >/dev/null 2>&1
modprobe -q ext3 >/dev/null 2>&1
+modprobe -q jffs2 >/dev/null 2>&1
diff --git a/packages/initrdscripts/files/30-bootmenu.sh b/packages/initrdscripts/files/30-bootmenu.sh
index 7bc1429b1b..3f3b8c7079 100644
--- a/packages/initrdscripts/files/30-bootmenu.sh
+++ b/packages/initrdscripts/files/30-bootmenu.sh
@@ -95,6 +95,7 @@ while read maj min nblk dev; do
done < /proc/partitions
add_menu_item "NFS (nfsroot=192.168.2.200:/srv/nfs/oe/image)"
+add_menu_item "Shell"
total=`echo -e $list | wc -l`
num=0
@@ -142,15 +143,23 @@ echo Selected: $sel
dev=`expr "$sel" : '\([^ /]*\)'`
path=`expr "$sel" : '[^/]*\([^ ]*\).*'`
+fstype=`expr "$sel" : '[^ ]* *\(.*\)'`
-if [ "$dev" == "NFS" ]; then
+if [ "$dev" == "Shell" ]; then
+ exec /bin/sh
+elif [ "$dev" == "NFS" ]; then
ROOT_DEVICE="/dev/nfs"
- CMDLINE="$CMDLINE nfsroot=192.168.2.200:/srv/nfs/oe/image"
+ CMDLINE="$CMDLINE root=/dev/nfs nfsroot=192.168.2.200:/srv/nfs/oe/image"
elif [ -n "$path" ]; then
ROOT_DEVICE="/dev/loop"
- CMDLINE="looproot=/dev/$dev:$path"
+ CMDLINE="$CMDLINE root=/dev/loop looproot=/dev/$dev:$path"
else
ROOT_DEVICE="/dev/$dev"
+ # jffs2 is not recognized by mount automagically
+ if [ "$fstype" == "(jffs2)" ]; then
+ ROOT_FSTYPE="jffs2"
+ fi
+ CMDLINE="$CMDLINE root=$ROOT_DEVICE"
fi
echo ROOT_DEVICE=$ROOT_DEVICE
diff --git a/packages/initrdscripts/files/85-blockboot.sh b/packages/initrdscripts/files/85-blockboot.sh
index 567f7e29b3..e1c3ed893e 100644
--- a/packages/initrdscripts/files/85-blockboot.sh
+++ b/packages/initrdscripts/files/85-blockboot.sh
@@ -3,6 +3,10 @@
if [ -e "$ROOT_DEVICE" ]; then
echo "booting from: $ROOT_DEVICE"
- mount "$ROOT_DEVICE" /mnt
+ type=""
+ if [ -n "$ROOT_FSTYPE" ]; then
+ type="-t $ROOT_FSTYPE"
+ fi
+ mount $type "$ROOT_DEVICE" /mnt || fatal "Unable to mount rootfs device"
BOOT_ROOT=/mnt
fi
diff --git a/packages/initrdscripts/files/87-kexecboot.sh b/packages/initrdscripts/files/87-kexecboot.sh
new file mode 100644
index 0000000000..9232934f98
--- /dev/null
+++ b/packages/initrdscripts/files/87-kexecboot.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+# Allow kexecing to kernel in rootfs
+
+if [ -n "$BOOT_ROOT" -a -f "$BOOT_ROOT/boot/zImage" ]; then
+ if ! expr "$CMDLINE" : '.*nokexec'; then
+ echo "Kernel found in rootfs:"
+ ls -l "$BOOT_ROOT/boot/zImage"
+ initramfs=""
+ if [ -f "$BOOT_ROOT/boot/initramfs.bin" ]; then
+ echo "Initramfs found in rootfs:"
+ ls -l "$BOOT_ROOT/boot/initramfs.bin"
+ initramfs="--initrd=$BOOT_ROOT/boot/initramfs.bin"
+ fi
+ echo /usr/sbin/kexec -f "$BOOT_ROOT/boot/zImage" $initramfs --command-line="$CMDLINE nokexec"
+ sleep 10
+ /usr/sbin/kexec -f "$BOOT_ROOT/boot/zImage" $initramfs --command-line="$CMDLINE nokexec"
+ sleep 10000
+ fi
+fi
diff --git a/packages/initrdscripts/files/init.sh b/packages/initrdscripts/files/init.sh
index f8d5de9173..8b9fe12429 100644
--- a/packages/initrdscripts/files/init.sh
+++ b/packages/initrdscripts/files/init.sh
@@ -8,6 +8,7 @@ early_setup() {
mkdir /proc
mount -t proc proc /proc
mkdir /mnt
+ modprobe -q mtdblock
}
dev_setup()
@@ -30,6 +31,8 @@ read_args() {
case $arg in
root=*)
ROOT_DEVICE=$optarg ;;
+ rootfstype=*)
+ ROOT_FSTYPE=$optarg ;;
rootdelay=*)
rootdelay=$optarg ;;
esac
@@ -48,13 +51,13 @@ boot_root() {
exec switch_root -c /dev/console $BOOT_ROOT /sbin/init
}
-boot_failed() {
- echo "No valid root device was specified. Please add root=/dev/something to"
- echo "the kernel command-line and try again."
+fatal() {
+ echo $1
echo
exec sh
}
+
echo "Starting initramfs boot..."
early_setup
read_args
@@ -68,4 +71,5 @@ dev_setup
load_modules
[ -n "$BOOT_ROOT" ] && boot_root
-boot_failed
+
+fatal "No valid root device was specified. Please add root=/dev/something to the kernel command-line and try again."
diff --git a/packages/initrdscripts/initramfs-module-block_1.0.bb b/packages/initrdscripts/initramfs-module-block_1.0.bb
index 72812a2490..b4b2d43150 100644
--- a/packages/initrdscripts/initramfs-module-block_1.0.bb
+++ b/packages/initrdscripts/initramfs-module-block_1.0.bb
@@ -1,5 +1,5 @@
SRC_URI = "file://85-blockboot.sh"
-PR = "r1"
+PR = "r3"
RDEPENDS = "initramfs-uniboot"
DESCRIPTION = "An initramfs module for booting off normal block devices."
diff --git a/packages/initrdscripts/initramfs-module-bootmenu_1.0.bb b/packages/initrdscripts/initramfs-module-bootmenu_1.0.bb
index e87ba69776..8c66521f30 100644
--- a/packages/initrdscripts/initramfs-module-bootmenu_1.0.bb
+++ b/packages/initrdscripts/initramfs-module-bootmenu_1.0.bb
@@ -1,5 +1,5 @@
SRC_URI = "file://30-bootmenu.sh"
-PR = "r8"
+PR = "r11"
DESCRIPTION = "An initramfs module with UI for selection of boot device."
RDEPENDS = "klibc-utils-fstype initramfs-uniboot initramfs-module-block initramfs-module-loop initramfs-module-nfs"
# For VFAT mounting.
diff --git a/packages/initrdscripts/initramfs-module-initfs_1.0.bb b/packages/initrdscripts/initramfs-module-initfs_1.0.bb
index 64bba4a304..2c2ec07bf5 100644
--- a/packages/initrdscripts/initramfs-module-initfs_1.0.bb
+++ b/packages/initrdscripts/initramfs-module-initfs_1.0.bb
@@ -1,5 +1,5 @@
SRC_URI = "file://10-initfs.sh"
-PR = "r2"
+PR = "r4"
DESCRIPTION = "An initramfs module for initializing filesystems."
RDEPENDS = "initramfs-uniboot"
RRECOMMENDS = "kernel-module-vfat kernel-module-ext2"
diff --git a/packages/initrdscripts/initramfs-module-kexecboot_1.0.bb b/packages/initrdscripts/initramfs-module-kexecboot_1.0.bb
new file mode 100644
index 0000000000..35100a94e6
--- /dev/null
+++ b/packages/initrdscripts/initramfs-module-kexecboot_1.0.bb
@@ -0,0 +1,12 @@
+SRC_URI = "file://87-kexecboot.sh"
+PR = "r0.4"
+DESCRIPTION = "An initramfs module for kexecing kernel from rootfs."
+RDEPENDS = "initramfs-uniboot kexec-static"
+
+do_install() {
+ install -d ${D}/initrd.d
+ install -m 0755 ${WORKDIR}/87-kexecboot.sh ${D}/initrd.d/
+}
+
+PACKAGE_ARCH = "all"
+FILES_${PN} += " /initrd.d/* "
diff --git a/packages/initrdscripts/initramfs-uniboot_1.0.bb b/packages/initrdscripts/initramfs-uniboot_1.0.bb
index 167ce71ffe..e0f726582e 100644
--- a/packages/initrdscripts/initramfs-uniboot_1.0.bb
+++ b/packages/initrdscripts/initramfs-uniboot_1.0.bb
@@ -1,6 +1,7 @@
SRC_URI = "file://init.sh"
-PR = "r2"
+PR = "r4"
DESCRIPTON = "A modular initramfs init script system."
+RRECOMMENDS = "kernel-module-mtdblock"
do_install() {
install -m 0755 ${WORKDIR}/init.sh ${D}/init