summaryrefslogtreecommitdiff
path: root/packages/initrdscripts
diff options
context:
space:
mode:
authorMichael Lauer <mickey@vanille-media.de>2008-02-17 18:22:31 +0000
committerMichael Lauer <mickey@vanille-media.de>2008-02-17 18:22:31 +0000
commit2bd1b434ce09511ecc5ffe6b872162251ee1eab8 (patch)
treed90ba00133e0860e009660eca6c5d4bcda6868e0 /packages/initrdscripts
parent55f1bbed28e78a1f327b5ac198a0e54d02263890 (diff)
parent673d1bb689817bb46661662b5d1459d587f038ab (diff)
merge of 'cb01f2744d89a35b7112e49fc0d5862aba66733f'
and 'd0092933b0c82a6d8470e8da03507e0e5e71529c'
Diffstat (limited to 'packages/initrdscripts')
-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.sh10
-rw-r--r--packages/initrdscripts/files/85-blockboot.sh6
-rw-r--r--packages/initrdscripts/files/init.sh12
-rw-r--r--packages/initrdscripts/initramfs-image-ipk_1.0.bb15
-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-uniboot_1.0.bb3
-rw-r--r--packages/initrdscripts/kernel-initramfs_1.0.bb48
11 files changed, 33 insertions, 76 deletions
diff --git a/packages/initrdscripts/devimage_0.1.bb b/packages/initrdscripts/devimage_0.1.bb
index c671f38025..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 = "r3"
+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 d54a643807..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,8 +143,11 @@ 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 root=/dev/nfs nfsroot=192.168.2.200:/srv/nfs/oe/image"
elif [ -n "$path" ]; then
@@ -151,6 +155,10 @@ elif [ -n "$path" ]; then
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
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/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-image-ipk_1.0.bb b/packages/initrdscripts/initramfs-image-ipk_1.0.bb
deleted file mode 100644
index 8c79c24478..0000000000
--- a/packages/initrdscripts/initramfs-image-ipk_1.0.bb
+++ /dev/null
@@ -1,15 +0,0 @@
-DESCRIPTION = "Boot initramfs as a package"
-PR = "r1"
-
-do_compile() {
- cd ${TOPDIR}; DISTRO=${USERDISTRO} MACHINE=${MACHINE} ANGSTROM_MODE=uclibc IMAGE_FSTYPES=cpio.gz DEPLOY_TO=${D}/boot/initramfs.bin bitbake initramfs-image
-}
-
-do_install() {
- install -d ${D}/boot/
- cd ${TOPDIR}; DISTRO=${USERDISTRO} MACHINE=${MACHINE} ANGSTROM_MODE=uclibc IMAGE_FSTYPES=cpio.gz DEPLOY_TO=${D}/boot/initramfs.bin bitbake initramfs-image -c deploy_to
-}
-
-FILES_${PN} += "/boot/*"
-
-PACKAGE_ARCH = "${MACHINE_ARCH}"
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 8b9a49f40b..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 = "r9"
+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-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
diff --git a/packages/initrdscripts/kernel-initramfs_1.0.bb b/packages/initrdscripts/kernel-initramfs_1.0.bb
deleted file mode 100644
index be1c067ba2..0000000000
--- a/packages/initrdscripts/kernel-initramfs_1.0.bb
+++ /dev/null
@@ -1,48 +0,0 @@
-DESCRIPTION = "A kernel with internal initramfs"
-PR = "r1"
-
-#inherit kernel
-KERNEL_IMAGETYPE ?= "zImage"
-
-# Name of initramfs recipe to build and put result into kernel
-KERNEL_INITRAMFS ?= "initramfs-image"
-
-do_compile() {
- cd ${TOPDIR}; DISTRO=${USERDISTRO} MACHINE=${MACHINE} ANGSTROM_MODE=uclibc IMAGE_FSTYPES=cpio.gz DEPLOY_TO=${WORKDIR}/initramfs.bin bitbake ${KERNEL_INITRAMFS} -c deploy_to
- cd ${TOPDIR}; DISTRO=${USERDISTRO} MACHINE=${MACHINE} INITRAMFS_LOC=${WORKDIR}/initramfs.bin DEPLOY_TO=${WORKDIR}/\${KERNEL_IMAGE_BASE_NAME} bitbake virtual/kernel -c builtin_initramfs
-}
-
-do_install() {
- install -d ${D}/boot/
- install -m 644 ${WORKDIR}/${KERNEL_IMAGETYPE}* ${D}/boot/${KERNEL_IMAGETYPE}-${@get_pv(d)}
-}
-
-def get_version(d):
- import bb
- import os
- dest = bb.data.getVar("WORKDIR", d, 1)
- try:
- files = os.listdir(dest)
- files = filter(lambda f:f.startswith("zImage-"), files)
- ver = files[0][len("zImage-"):]
- return ver
- except:
- return "dum-m-y"
-
-def get_pv(d):
- ver = get_version(d)
- verc = ver.split("-")
- return verc[0] + "-" + verc[1]
-
-def get_pr(d):
- ver = get_version(d)
- verc = ver.split("-")
- return verc[2]
-
-PACKAGES = "kernel-image"
-FILES_kernel-image = "/boot/*"
-PKG_kernel-image = "kernel-image-${@get_pv(d)}"
-PKGPV_kernel-image = "${@get_pv(d)}"
-PKGPR_kernel-image = "${@get_pr(d)}"
-
-PACKAGE_ARCH = "${MACHINE_ARCH}"