diff options
author | Dmitry Eremin-Solenikov <dmitry_eremin@mentor.com> | 2015-04-02 18:23:01 +0300 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2015-04-13 12:55:51 +0200 |
commit | a94da017797e82d62484ffbced93108ce5830de1 (patch) | |
tree | cfe906dcbc3f81a553dbb16a0cf3c0ae1e89f990 /meta-initramfs/recipes-bsp | |
parent | 22990fdc1274165b439d32ca75839e1c44036b1c (diff) | |
download | meta-openembedded-a94da017797e82d62484ffbced93108ce5830de1.tar.gz |
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/recipes-bsp')
-rw-r--r-- | meta-initramfs/recipes-bsp/initrdscripts/files/init-debug.sh | 31 | ||||
-rw-r--r-- | meta-initramfs/recipes-bsp/initrdscripts/initramfs-debug_1.0.bb | 14 |
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 000000000..7edbd70cb --- /dev/null +++ b/meta-initramfs/recipes-bsp/initrdscripts/files/init-debug.sh | |||
@@ -0,0 +1,31 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | PATH=/sbin:/bin:/usr/sbin:/usr/bin | ||
4 | |||
5 | do_mount_fs() { | ||
6 | grep -q "$1" /proc/filesystems || return | ||
7 | test -d "$2" || mkdir -p "$2" | ||
8 | mount -t "$1" "$1" "$2" | ||
9 | } | ||
10 | |||
11 | do_mknod() { | ||
12 | test -e "$1" || mknod "$1" "$2" "$3" "$4" | ||
13 | } | ||
14 | |||
15 | mkdir -p /proc | ||
16 | mount -t proc proc /proc | ||
17 | |||
18 | do_mount_fs sysfs /sys | ||
19 | do_mount_fs debugfs /sys/kernel/debug | ||
20 | do_mount_fs devtmpfs /dev | ||
21 | do_mount_fs devpts /dev/pts | ||
22 | do_mount_fs tmpfs /dev/shm | ||
23 | |||
24 | mkdir -p /run | ||
25 | mkdir -p /var/run | ||
26 | |||
27 | do_mknod /dev/console c 5 1 | ||
28 | do_mknod /dev/null c 1 3 | ||
29 | do_mknod /dev/zero c 1 5 | ||
30 | |||
31 | 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 000000000..b7defff6f --- /dev/null +++ b/meta-initramfs/recipes-bsp/initrdscripts/initramfs-debug_1.0.bb | |||
@@ -0,0 +1,14 @@ | |||
1 | SUMMARY = "Extremely basic live image init script" | ||
2 | LICENSE = "MIT" | ||
3 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" | ||
4 | SRC_URI = "file://init-debug.sh" | ||
5 | |||
6 | S = "${WORKDIR}" | ||
7 | |||
8 | do_install() { | ||
9 | install -m 0755 ${WORKDIR}/init-debug.sh ${D}/init | ||
10 | } | ||
11 | |||
12 | inherit allarch | ||
13 | |||
14 | FILES_${PN} += " /init " | ||