aboutsummaryrefslogtreecommitdiffstats
path: root/meta-initramfs
diff options
context:
space:
mode:
authorDmitry Eremin-Solenikov <dmitry_eremin@mentor.com>2015-04-02 18:23:01 +0300
committerMartin Jansa <Martin.Jansa@gmail.com>2015-04-13 12:55:51 +0200
commita94da017797e82d62484ffbced93108ce5830de1 (patch)
treecfe906dcbc3f81a553dbb16a0cf3c0ae1e89f990 /meta-initramfs
parent22990fdc1274165b439d32ca75839e1c44036b1c (diff)
downloadmeta-openembedded-contrib-a94da017797e82d62484ffbced93108ce5830de1.tar.gz
meta-openembedded-contrib-a94da017797e82d62484ffbced93108ce5830de1.tar.bz2
meta-openembedded-contrib-a94da017797e82d62484ffbced93108ce5830de1.zip
initramfs-debug: add simple init script for debugging
Add a tiny simple debug script that will mount all available virtual file systems and then execute a shell. Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin@mentor.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-initramfs')
-rw-r--r--meta-initramfs/recipes-bsp/initrdscripts/files/init-debug.sh31
-rw-r--r--meta-initramfs/recipes-bsp/initrdscripts/initramfs-debug_1.0.bb14
2 files changed, 45 insertions, 0 deletions
diff --git a/meta-initramfs/recipes-bsp/initrdscripts/files/init-debug.sh b/meta-initramfs/recipes-bsp/initrdscripts/files/init-debug.sh
new file mode 100644
index 0000000000..7edbd70cb0
--- /dev/null
+++ b/meta-initramfs/recipes-bsp/initrdscripts/files/init-debug.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+do_mount_fs() {
+ grep -q "$1" /proc/filesystems || return
+ test -d "$2" || mkdir -p "$2"
+ mount -t "$1" "$1" "$2"
+}
+
+do_mknod() {
+ test -e "$1" || mknod "$1" "$2" "$3" "$4"
+}
+
+mkdir -p /proc
+mount -t proc proc /proc
+
+do_mount_fs sysfs /sys
+do_mount_fs debugfs /sys/kernel/debug
+do_mount_fs devtmpfs /dev
+do_mount_fs devpts /dev/pts
+do_mount_fs tmpfs /dev/shm
+
+mkdir -p /run
+mkdir -p /var/run
+
+do_mknod /dev/console c 5 1
+do_mknod /dev/null c 1 3
+do_mknod /dev/zero c 1 5
+
+exec sh </dev/console >/dev/console 2>/dev/console
diff --git a/meta-initramfs/recipes-bsp/initrdscripts/initramfs-debug_1.0.bb b/meta-initramfs/recipes-bsp/initrdscripts/initramfs-debug_1.0.bb
new file mode 100644
index 0000000000..b7defff6fa
--- /dev/null
+++ b/meta-initramfs/recipes-bsp/initrdscripts/initramfs-debug_1.0.bb
@@ -0,0 +1,14 @@
+SUMMARY = "Extremely basic live image init script"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+SRC_URI = "file://init-debug.sh"
+
+S = "${WORKDIR}"
+
+do_install() {
+ install -m 0755 ${WORKDIR}/init-debug.sh ${D}/init
+}
+
+inherit allarch
+
+FILES_${PN} += " /init "