meta-digi-dey: add bootscript to create static device nodes

Some test applications (e.g. gpio_test) use static device nodes. This
commit adds a bootscript that creates such device nodes reading from a
config file.

https://jira.digi.com/browse/DEL-458

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
This commit is contained in:
Javier Viguera 2013-10-21 17:12:14 +02:00
parent 1603b71fe1
commit 0c6eb85b0c
4 changed files with 37 additions and 5 deletions

View File

@ -0,0 +1,25 @@
#!/bin/sh
#===============================================================================
#
# busybox-static-nodes
#
# Copyright (C) 2013 by Digi International Inc.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 as published by
# the Free Software Foundation.
#
# !Description: make static device nodes from device table
#
#===============================================================================
set -e
MAKEDEVS="/sbin/makedevs"
DEVICE_TABLE_CFG="/etc/device_table"
# Create static device nodes via configuration file.
if [ -f "${DEVICE_TABLE_CFG}" ]; then
${MAKEDEVS} -d "${DEVICE_TABLE_CFG}" / >/dev/null 2>&1
fi

View File

@ -21,8 +21,6 @@ if [ "${1}" != "start" ]; then
fi
MDEV="/sbin/mdev"
MAKEDEVS="/sbin/makedevs"
CONFIG="/etc/device_table"
# Create shared memory mount point
mkdir -p /dev/shm
@ -36,9 +34,6 @@ fi
# Create all device nodes scanning /sys.
${MDEV} -s
# Create rest device nodes via configuration file.
[ -f "${CONFIG}" ] && ${MAKEDEVS} -d "${CONFIG}" / >/dev/null 2>&1
# mount storage devices
usbmount
mmc-mount

View File

@ -23,6 +23,7 @@ SRC_URI += "file://0001-del-baudrates.patch \
file://acpid.map \
file://pswitch-press \
file://pswitch-release \
file://busybox-static-nodes \
"
# Add device handlers to 'mdev' package
@ -56,6 +57,13 @@ FILES_${PN}-acpid = " ${sysconfdir}/init.d/busybox-acpid \
INITSCRIPT_PACKAGES =+ "${PN}-acpid"
INITSCRIPT_NAME_${PN}-acpid = "busybox-acpid"
# static-nodes package (create static nodes from /etc/device_table)
PACKAGES =+ "${PN}-static-nodes"
FILES_${PN}-static-nodes = "${sysconfdir}/init.d/busybox-static-nodes"
INITSCRIPT_PACKAGES =+ "${PN}-static-nodes"
INITSCRIPT_NAME_${PN}-static-nodes = "busybox-static-nodes"
INITSCRIPT_PARAMS_${PN}-static-nodes = "start 07 S ."
do_install_append() {
if grep "CONFIG_MDEV=y" ${WORKDIR}/defconfig; then
if grep "CONFIG_FEATURE_MDEV_CONF=y" ${WORKDIR}/defconfig; then
@ -86,4 +94,7 @@ do_install_append() {
install -m 0755 ${WORKDIR}/pswitch-press ${D}${sysconfdir}/acpi/
install -m 0755 ${WORKDIR}/pswitch-release ${D}${sysconfdir}/acpi/
fi
if grep "CONFIG_MAKEDEVS=y" ${WORKDIR}/defconfig; then
install -m 0755 ${WORKDIR}/busybox-static-nodes ${D}${sysconfdir}/init.d/
fi
}

View File

@ -32,6 +32,7 @@ RDEPENDS_${PN} = "\
base-files \
base-passwd \
busybox \
busybox-static-nodes \
${@base_contains("MACHINE_FEATURES", "rtc", "busybox-hwclock", "", d)} \
${@base_contains("MACHINE_FEATURES", "keyboard", "${VIRTUAL-RUNTIME_keymaps}", "", d)} \
${@base_contains("MACHINE_FEATURES", "touchscreen", "${VIRTUAL-RUNTIME_touchscreen}", "",d)} \