Patchwork [4/4] busybox: add support to mdev

login
register
mail settings
Submitter Otavio Salvador
Date May 2, 2011, 7:09 p.m.
Message ID <1304363356-27535-4-git-send-email-otavio@ossystems.com.br>
Download mbox | patch
Permalink /patch/3083/
State New, archived
Headers show

Comments

Otavio Salvador - May 2, 2011, 7:09 p.m.
This changes the packaging only if the configuration used has mdev
support enabled.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 meta/recipes-core/busybox/busybox.inc       |   15 ++++++++++-
 meta/recipes-core/busybox/busybox_1.17.3.bb |    4 ++-
 meta/recipes-core/busybox/files/mdev        |    7 +++++
 meta/recipes-core/busybox/files/mdev.conf   |   35 +++++++++++++++++++++++++++
 4 files changed, 58 insertions(+), 3 deletions(-)
 create mode 100755 meta/recipes-core/busybox/files/mdev
 create mode 100644 meta/recipes-core/busybox/files/mdev.conf
Khem Raj - May 2, 2011, 10:21 p.m.
On Mon, May 2, 2011 at 12:09 PM, Otavio Salvador
<otavio@ossystems.com.br> wrote:
> This changes the packaging only if the configuration used has mdev
> support enabled.


Did you test this patch on a config where mdev support is disabled ?
that will be interesting to know

>
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
>  meta/recipes-core/busybox/busybox.inc       |   15 ++++++++++-
>  meta/recipes-core/busybox/busybox_1.17.3.bb |    4 ++-
>  meta/recipes-core/busybox/files/mdev        |    7 +++++
>  meta/recipes-core/busybox/files/mdev.conf   |   35 +++++++++++++++++++++++++++
>  4 files changed, 58 insertions(+), 3 deletions(-)
>  create mode 100755 meta/recipes-core/busybox/files/mdev
>  create mode 100644 meta/recipes-core/busybox/files/mdev.conf
>
> diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
> index 9f2d64c..164d089 100644
> --- a/meta/recipes-core/busybox/busybox.inc
> +++ b/meta/recipes-core/busybox/busybox.inc
> @@ -12,23 +12,28 @@ SECTION = "base"
>  PRIORITY = "required"
>
>  export EXTRA_CFLAGS = "${CFLAGS}"
> -PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog"
> +PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog ${PN}-mdev"
>
>  FILES_${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www"
>  FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog* ${sysconfdir}/syslog.conf*"
> +FILES_${PN}-mdev = "${sysconfdir}/init.d/mdev ${sysconfdir}/mdev.conf"
>  FILES_${PN}-udhcpd = "${sysconfdir}/init.d/busybox-udhcpd"
>  FILES_${PN}-udhcpc = "${sysconfdir}/udhcpc.d ${datadir}/udhcpc ${sysconfdir}/init.d/busybox-udhcpc"
>
> -INITSCRIPT_PACKAGES = "${PN}-httpd ${PN}-syslog ${PN}-udhcpd ${PN}-udhcpc"
> +INITSCRIPT_PACKAGES = "${PN}-httpd ${PN}-syslog ${PN}-udhcpd ${PN}-udhcpc ${PN}-mdev"
>
>  INITSCRIPT_NAME_${PN}-httpd = "busybox-httpd"
>  INITSCRIPT_NAME_${PN}-syslog = "syslog"
> +INITSCRIPT_NAME_${PN}-mdev = "mdev"
>  INITSCRIPT_NAME_${PN}-udhcpd = "busybox-udhcpd"
>  INITSCRIPT_NAME_${PN}-udhcpc = "busybox-udhcpc"
>  CONFFILES_${PN}-syslog = "${sysconfdir}/syslog.conf.${PN}"
> +CONFFILES_${PN}-mdev = "${sysconfdir}/mdev.conf"
>
>  RRECOMMENDS_${PN} = "${PN}-syslog ${PN}-udhcpc"
>
> +INITSCRIPT_PARAMS_${PN}-mdev = "start 06 S ."
> +
>  # This disables the syslog startup links in slugos (see slugos-init)
>  INITSCRIPT_PARAMS_${PN}-syslog_slugos = "start 20 ."
>
> @@ -103,6 +108,12 @@ do_install () {
>                install -m 0755 ${WORKDIR}/default.script ${D}${datadir}/udhcpc/default.script
>                install -m 0755 ${WORKDIR}/busybox-udhcpc ${D}${sysconfdir}/init.d/
>        fi
> +       if grep "CONFIG_MDEV=y" ${WORKDIR}/defconfig; then
> +               install -m 0755 ${WORKDIR}/mdev ${D}${sysconfdir}/init.d/mdev
> +               if grep "CONFIG_FEATURE_MDEV_CONF=y" ${WORKDIR}/defconfig; then
> +                       install -m 644 ${WORKDIR}/mdev.conf ${D}${sysconfdir}/mdev.conf
> +               fi
> +       fi
>
>        install -m 0644 ${S}/busybox.links ${D}${sysconfdir}
>
> diff --git a/meta/recipes-core/busybox/busybox_1.17.3.bb b/meta/recipes-core/busybox/busybox_1.17.3.bb
> index 28342fe..2d98ad3 100644
> --- a/meta/recipes-core/busybox/busybox_1.17.3.bb
> +++ b/meta/recipes-core/busybox/busybox_1.17.3.bb
> @@ -1,5 +1,5 @@
>  require busybox.inc
> -PR = "r2"
> +PR = "r3"
>
>  SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
>            file://udhcpscript.patch \
> @@ -21,6 +21,8 @@ SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
>            file://mount.busybox \
>            file://syslog \
>            file://syslog.conf \
> +           file://mdev \
> +           file://mdev.conf \
>            file://umount.busybox \
>            file://defconfig"
>
> diff --git a/meta/recipes-core/busybox/files/mdev b/meta/recipes-core/busybox/files/mdev
> new file mode 100755
> index 0000000..4eba619
> --- /dev/null
> +++ b/meta/recipes-core/busybox/files/mdev
> @@ -0,0 +1,7 @@
> +#!/bin/sh
> +
> +mount -t tmpfs tmpfs /dev  -o size=64k,mode=0755
> +mkdir /dev/pts /dev/shm
> +mount -t devpts devpts /dev/pts
> +echo "/sbin/mdev" > /proc/sys/kernel/hotplug
> +mdev -s
> diff --git a/meta/recipes-core/busybox/files/mdev.conf b/meta/recipes-core/busybox/files/mdev.conf
> new file mode 100644
> index 0000000..0e1d6bc
> --- /dev/null
> +++ b/meta/recipes-core/busybox/files/mdev.conf
> @@ -0,0 +1,35 @@
> +console 0:0 0600
> +cpu_dma_latency 0:0 0660
> +fb0:0 44 0660
> +full 0:0 0666
> +initctl 0:0 0600
> +ircomm[0-9].* 0:20 0660
> +kmem 0:15 0640
> +kmsg 0:0 0660
> +log 0:0 0666
> +loop[0-9].* 0:6 0640
> +mem 0:15 0640
> +network_latency 0:0 0660
> +network_throughput 0:0 0660
> +null 0:0 0666
> +port 0:15 0640
> +ptmx 0:5 0666
> +ram[0-9].* 0:6 0640
> +random 0:0 0666
> +sda 0:6 0640
> +tty 0:5 0666
> +tty.* 0:0 0620
> +urandom 0:0 0666
> +usbdev.* 0:0 0660 */etc/mdev/usb.sh
> +vcs.* 0:5 0660
> +zero 0:0 0666
> +
> +pcm.* 0:0 0660 =snd/
> +control.* 0:0 0660 =snd/
> +timer 0:0 0660 =snd/
> +
> +event.* 0:0 0660 =input/ @/etc/mdev/find-touchscreen.sh
> +mice 0:0 0660 =input/
> +mouse.* 0:0 0660 =input/
> +
> +tun[0-9]* 0:0 0660 =net/
> --
> 1.7.2.5
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
Otavio Salvador - May 2, 2011, 10:26 p.m.
On Mon, May 2, 2011 at 19:21, Khem Raj <raj.khem@gmail.com> wrote:
> Did you test this patch on a config where mdev support is disabled ?
> that will be interesting to know

Yes I did. It seems to work fine for me. Do you see any problem with that?

Patch

diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
index 9f2d64c..164d089 100644
--- a/meta/recipes-core/busybox/busybox.inc
+++ b/meta/recipes-core/busybox/busybox.inc
@@ -12,23 +12,28 @@  SECTION = "base"
 PRIORITY = "required"
 
 export EXTRA_CFLAGS = "${CFLAGS}"
-PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog"
+PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog ${PN}-mdev"
 
 FILES_${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www"
 FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog* ${sysconfdir}/syslog.conf*"
+FILES_${PN}-mdev = "${sysconfdir}/init.d/mdev ${sysconfdir}/mdev.conf"
 FILES_${PN}-udhcpd = "${sysconfdir}/init.d/busybox-udhcpd"
 FILES_${PN}-udhcpc = "${sysconfdir}/udhcpc.d ${datadir}/udhcpc ${sysconfdir}/init.d/busybox-udhcpc"
 
-INITSCRIPT_PACKAGES = "${PN}-httpd ${PN}-syslog ${PN}-udhcpd ${PN}-udhcpc"
+INITSCRIPT_PACKAGES = "${PN}-httpd ${PN}-syslog ${PN}-udhcpd ${PN}-udhcpc ${PN}-mdev"
 
 INITSCRIPT_NAME_${PN}-httpd = "busybox-httpd"
 INITSCRIPT_NAME_${PN}-syslog = "syslog"
+INITSCRIPT_NAME_${PN}-mdev = "mdev"
 INITSCRIPT_NAME_${PN}-udhcpd = "busybox-udhcpd" 
 INITSCRIPT_NAME_${PN}-udhcpc = "busybox-udhcpc" 
 CONFFILES_${PN}-syslog = "${sysconfdir}/syslog.conf.${PN}"
+CONFFILES_${PN}-mdev = "${sysconfdir}/mdev.conf"
 
 RRECOMMENDS_${PN} = "${PN}-syslog ${PN}-udhcpc"
 
+INITSCRIPT_PARAMS_${PN}-mdev = "start 06 S ."
+
 # This disables the syslog startup links in slugos (see slugos-init)
 INITSCRIPT_PARAMS_${PN}-syslog_slugos = "start 20 ."
 
@@ -103,6 +108,12 @@  do_install () {
 		install -m 0755 ${WORKDIR}/default.script ${D}${datadir}/udhcpc/default.script
 		install -m 0755 ${WORKDIR}/busybox-udhcpc ${D}${sysconfdir}/init.d/
 	fi
+	if grep "CONFIG_MDEV=y" ${WORKDIR}/defconfig; then
+		install -m 0755 ${WORKDIR}/mdev ${D}${sysconfdir}/init.d/mdev
+		if grep "CONFIG_FEATURE_MDEV_CONF=y" ${WORKDIR}/defconfig; then
+			install -m 644 ${WORKDIR}/mdev.conf ${D}${sysconfdir}/mdev.conf
+		fi
+	fi
 
 	install -m 0644 ${S}/busybox.links ${D}${sysconfdir}
 
diff --git a/meta/recipes-core/busybox/busybox_1.17.3.bb b/meta/recipes-core/busybox/busybox_1.17.3.bb
index 28342fe..2d98ad3 100644
--- a/meta/recipes-core/busybox/busybox_1.17.3.bb
+++ b/meta/recipes-core/busybox/busybox_1.17.3.bb
@@ -1,5 +1,5 @@ 
 require busybox.inc
-PR = "r2"
+PR = "r3"
 
 SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
            file://udhcpscript.patch \
@@ -21,6 +21,8 @@  SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
            file://mount.busybox \
            file://syslog \
            file://syslog.conf \
+           file://mdev \
+           file://mdev.conf \
            file://umount.busybox \
            file://defconfig"
 
diff --git a/meta/recipes-core/busybox/files/mdev b/meta/recipes-core/busybox/files/mdev
new file mode 100755
index 0000000..4eba619
--- /dev/null
+++ b/meta/recipes-core/busybox/files/mdev
@@ -0,0 +1,7 @@ 
+#!/bin/sh
+
+mount -t tmpfs tmpfs /dev  -o size=64k,mode=0755
+mkdir /dev/pts /dev/shm
+mount -t devpts devpts /dev/pts
+echo "/sbin/mdev" > /proc/sys/kernel/hotplug
+mdev -s
diff --git a/meta/recipes-core/busybox/files/mdev.conf b/meta/recipes-core/busybox/files/mdev.conf
new file mode 100644
index 0000000..0e1d6bc
--- /dev/null
+++ b/meta/recipes-core/busybox/files/mdev.conf
@@ -0,0 +1,35 @@ 
+console 0:0 0600 
+cpu_dma_latency 0:0 0660 
+fb0:0 44 0660 
+full 0:0 0666 
+initctl 0:0 0600 
+ircomm[0-9].* 0:20 0660 
+kmem 0:15 0640 
+kmsg 0:0 0660 
+log 0:0 0666 
+loop[0-9].* 0:6 0640 
+mem 0:15 0640 
+network_latency 0:0 0660 
+network_throughput 0:0 0660 
+null 0:0 0666 
+port 0:15 0640 
+ptmx 0:5 0666 
+ram[0-9].* 0:6 0640 
+random 0:0 0666 
+sda 0:6 0640 
+tty 0:5 0666 
+tty.* 0:0 0620 
+urandom 0:0 0666 
+usbdev.* 0:0 0660 */etc/mdev/usb.sh
+vcs.* 0:5 0660 
+zero 0:0 0666 
+ 
+pcm.* 0:0 0660 =snd/ 
+control.* 0:0 0660 =snd/ 
+timer 0:0 0660 =snd/ 
+
+event.* 0:0 0660 =input/ @/etc/mdev/find-touchscreen.sh
+mice 0:0 0660 =input/ 
+mouse.* 0:0 0660 =input/
+
+tun[0-9]* 0:0 0660 =net/