All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-initramfs][PATCH 1/2] initramfs-debug: add simple init script for debugging
@ 2015-04-02 15:23 Dmitry Eremin-Solenikov
  2015-04-02 15:23 ` [meta-initramfs][PATCH 2/2] initramfs-debug-image: tiny debugging initramfs image Dmitry Eremin-Solenikov
  2015-04-03 18:59 ` [meta-initramfs][PATCH 1/2] initramfs-debug: add simple init script for debugging Otavio Salvador
  0 siblings, 2 replies; 4+ messages in thread
From: Dmitry Eremin-Solenikov @ 2015-04-02 15:23 UTC (permalink / raw)
  To: openembedded-devel

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>
---
 .../recipes-bsp/initrdscripts/files/init-debug.sh  | 31 ++++++++++++++++++++++
 .../initrdscripts/initramfs-debug_1.0.bb           | 14 ++++++++++
 2 files changed, 45 insertions(+)
 create mode 100644 meta-initramfs/recipes-bsp/initrdscripts/files/init-debug.sh
 create mode 100644 meta-initramfs/recipes-bsp/initrdscripts/initramfs-debug_1.0.bb

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 0000000..7edbd70
--- /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 0000000..b7defff
--- /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 "
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [meta-initramfs][PATCH 2/2] initramfs-debug-image: tiny debugging initramfs image
  2015-04-02 15:23 [meta-initramfs][PATCH 1/2] initramfs-debug: add simple init script for debugging Dmitry Eremin-Solenikov
@ 2015-04-02 15:23 ` Dmitry Eremin-Solenikov
  2015-04-03 19:01   ` Otavio Salvador
  2015-04-03 18:59 ` [meta-initramfs][PATCH 1/2] initramfs-debug: add simple init script for debugging Otavio Salvador
  1 sibling, 1 reply; 4+ messages in thread
From: Dmitry Eremin-Solenikov @ 2015-04-02 15:23 UTC (permalink / raw)
  To: openembedded-devel

A tiny initramfs image suitable for initial bringup of the hardware.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin@mentor.com>
---
 .../recipes-bsp/images/initramfs-debug-image.bb     | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 meta-initramfs/recipes-bsp/images/initramfs-debug-image.bb

diff --git a/meta-initramfs/recipes-bsp/images/initramfs-debug-image.bb b/meta-initramfs/recipes-bsp/images/initramfs-debug-image.bb
new file mode 100644
index 0000000..8e87c19
--- /dev/null
+++ b/meta-initramfs/recipes-bsp/images/initramfs-debug-image.bb
@@ -0,0 +1,21 @@
+# Simple initramfs image. Mostly used for live images.
+DESCRIPTION = "Small image capable of booting a device. The kernel includes \
+the Minimal RAM-based Initial Root Filesystem (initramfs), which one can use \
+to check the hardware efficiently."
+
+PACKAGE_INSTALL = "initramfs-debug busybox base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}"
+
+# Do not pollute the initrd image with rootfs features
+IMAGE_FEATURES = ""
+
+export IMAGE_BASENAME = "initramfs-debug-image"
+IMAGE_LINGUAS = ""
+
+LICENSE = "MIT"
+
+IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
+inherit core-image
+
+IMAGE_ROOTFS_SIZE = "8192"
+
+BAD_RECOMMENDATIONS += "busybox-syslog"
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [meta-initramfs][PATCH 1/2] initramfs-debug: add simple init script for debugging
  2015-04-02 15:23 [meta-initramfs][PATCH 1/2] initramfs-debug: add simple init script for debugging Dmitry Eremin-Solenikov
  2015-04-02 15:23 ` [meta-initramfs][PATCH 2/2] initramfs-debug-image: tiny debugging initramfs image Dmitry Eremin-Solenikov
@ 2015-04-03 18:59 ` Otavio Salvador
  1 sibling, 0 replies; 4+ messages in thread
From: Otavio Salvador @ 2015-04-03 18:59 UTC (permalink / raw)
  To: OpenEmbedded Devel List

Hello,

On Thu, Apr 2, 2015 at 12:23 PM, Dmitry Eremin-Solenikov
<dmitry_eremin@mentor.com> wrote:
> 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>

I think this is easy to be accomplished with a module for
initramfs-framework[1].

1. http://git.openembedded.org/openembedded-core/tree/meta/recipes-core/initrdscripts

When we designed it at O.S. Systems we tried to make it very easy to
extend and we use it with some products with good success. It also
includes a debug module which allow for fancy stuff like to support to
dynamic debugging of initramfs using bootparam in following format:

  shell                 : starts a shell before and after each module
  shell=before:<module> : starts a shell before <module> is loaded and run
  shell=after:<module>  : starts a shell after <module> is loaded and run

  shell-debug                 : run set -x as soon as possible
  shell-debug=before:<module> : run set -x before <module> is loaded and run
  shell-debug=after:<module>  : run set -x after <module> is loaded and run

The missing aspect is the debugfs which is not mounted but could be
added as a module.

Please take a look on it as avoid work duplication is a health effort :)

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [meta-initramfs][PATCH 2/2] initramfs-debug-image: tiny debugging initramfs image
  2015-04-02 15:23 ` [meta-initramfs][PATCH 2/2] initramfs-debug-image: tiny debugging initramfs image Dmitry Eremin-Solenikov
@ 2015-04-03 19:01   ` Otavio Salvador
  0 siblings, 0 replies; 4+ messages in thread
From: Otavio Salvador @ 2015-04-03 19:01 UTC (permalink / raw)
  To: OpenEmbedded Devel List

On Thu, Apr 2, 2015 at 12:23 PM, Dmitry Eremin-Solenikov
<dmitry_eremin@mentor.com> wrote:
> A tiny initramfs image suitable for initial bringup of the hardware.
>
> Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin@mentor.com>

I've been using core-image-minimal for this purpose. What you think is
missing there?

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-04-03 19:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-02 15:23 [meta-initramfs][PATCH 1/2] initramfs-debug: add simple init script for debugging Dmitry Eremin-Solenikov
2015-04-02 15:23 ` [meta-initramfs][PATCH 2/2] initramfs-debug-image: tiny debugging initramfs image Dmitry Eremin-Solenikov
2015-04-03 19:01   ` Otavio Salvador
2015-04-03 18:59 ` [meta-initramfs][PATCH 1/2] initramfs-debug: add simple init script for debugging Otavio Salvador

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.