diff options
| -rw-r--r-- | meta-yocto/conf/distro/poky-tiny.conf | 2 | ||||
| -rw-r--r-- | meta-yocto/recipes-core/tiny-init/files/init | 21 | ||||
| -rw-r--r-- | meta-yocto/recipes-core/tiny-init/files/rc.local.sample | 23 | ||||
| -rw-r--r-- | meta-yocto/recipes-core/tiny-init/tiny-init.bb | 28 |
4 files changed, 73 insertions, 1 deletions
diff --git a/meta-yocto/conf/distro/poky-tiny.conf b/meta-yocto/conf/distro/poky-tiny.conf index a34c7dc6ca..8ae1d85e8a 100644 --- a/meta-yocto/conf/distro/poky-tiny.conf +++ b/meta-yocto/conf/distro/poky-tiny.conf | |||
| @@ -95,7 +95,7 @@ DISTRO_FEATURES = "${DISTRO_FEATURES_TINY} \ | |||
| 95 | # Use tmpdevfs and the busybox runtime services | 95 | # Use tmpdevfs and the busybox runtime services |
| 96 | VIRTUAL-RUNTIME_dev_manager = "" | 96 | VIRTUAL-RUNTIME_dev_manager = "" |
| 97 | VIRTUAL-RUNTIME_login_manager = "" | 97 | VIRTUAL-RUNTIME_login_manager = "" |
| 98 | VIRTUAL-RUNTIME_init_manager = "" | 98 | VIRTUAL-RUNTIME_init_manager = "tiny-init" |
| 99 | VIRTUAL-RUNTIME_keymaps = "" | 99 | VIRTUAL-RUNTIME_keymaps = "" |
| 100 | 100 | ||
| 101 | # FIXME: Consider adding "modules" to MACHINE_FEATURES and using that in | 101 | # FIXME: Consider adding "modules" to MACHINE_FEATURES and using that in |
diff --git a/meta-yocto/recipes-core/tiny-init/files/init b/meta-yocto/recipes-core/tiny-init/files/init new file mode 100644 index 0000000000..bf2817d099 --- /dev/null +++ b/meta-yocto/recipes-core/tiny-init/files/init | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | # Mount the Linux kernel virtual filesystems | ||
| 4 | mount none -t proc /proc | ||
| 5 | mount none -t sysfs /sys | ||
| 6 | mkdir /dev/pts | ||
| 7 | mount none -t devpts /dev/pts | ||
| 8 | |||
| 9 | ifup lo | ||
| 10 | |||
| 11 | # Allow for distro or local customizations | ||
| 12 | if [ -f /etc/rc.local ] ; then | ||
| 13 | source /etc/rc.local | ||
| 14 | fi | ||
| 15 | |||
| 16 | # Become session leader and try to find a real tty (e.g. ttyS0) | ||
| 17 | while true; do | ||
| 18 | setsid cttyhack sh | ||
| 19 | echo "Console sh exited with $?, respawning..." | ||
| 20 | sleep 1 | ||
| 21 | done | ||
diff --git a/meta-yocto/recipes-core/tiny-init/files/rc.local.sample b/meta-yocto/recipes-core/tiny-init/files/rc.local.sample new file mode 100644 index 0000000000..d9e198a200 --- /dev/null +++ b/meta-yocto/recipes-core/tiny-init/files/rc.local.sample | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | # Start services and customize the boot process here. | ||
| 4 | echo "Running /etc/rc.local..." | ||
| 5 | |||
| 6 | # Use init scripts included with packages such as dropbear | ||
| 7 | #/etc/init.d/dropbear start | ||
| 8 | |||
| 9 | # Spawn a getty manually | ||
| 10 | #setsid /sbin/getty 115200 ttyS2 | ||
| 11 | |||
| 12 | # Print a banner | ||
| 13 | #echo "You are running a poky-tiny image brought to you by the Yocto Project." | ||
| 14 | |||
| 15 | # Setup a debugging environment | ||
| 16 | #mkdir /debugfs | ||
| 17 | #mount none -t debugfs /debugfs | ||
| 18 | |||
| 19 | # Load modules (note: linux-yocto-tiny does not have module support by default) | ||
| 20 | #modprobe yourdriver | ||
| 21 | |||
| 22 | # DO NOT run any long running tasks or loops as these will delay | ||
| 23 | # the /init script and the console shell. | ||
diff --git a/meta-yocto/recipes-core/tiny-init/tiny-init.bb b/meta-yocto/recipes-core/tiny-init/tiny-init.bb new file mode 100644 index 0000000000..f5892ed472 --- /dev/null +++ b/meta-yocto/recipes-core/tiny-init/tiny-init.bb | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | SUMMARY = "Poky-tiny init" | ||
| 2 | DESCRIPTION = "Basic init system for poky-tiny" | ||
| 3 | LICENSE = "MIT" | ||
| 4 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" | ||
| 5 | |||
| 6 | PR = "r0" | ||
| 7 | |||
| 8 | RDEPENDS_${PN} = "busybox" | ||
| 9 | |||
| 10 | SRC_URI = "file://init \ | ||
| 11 | file://rc.local.sample \ | ||
| 12 | " | ||
| 13 | |||
| 14 | do_configure() { | ||
| 15 | : | ||
| 16 | } | ||
| 17 | |||
| 18 | do_compile() { | ||
| 19 | : | ||
| 20 | } | ||
| 21 | |||
| 22 | do_install() { | ||
| 23 | install -d ${D}${sysconfdir} | ||
| 24 | install -m 0755 ${WORKDIR}/init ${D} | ||
| 25 | install -m 0755 ${WORKDIR}/rc.local.sample ${D}${sysconfdir} | ||
| 26 | } | ||
| 27 | |||
| 28 | FILES_${PN} = "/init ${sysconfdir}/rc.local.sample" | ||
