From: Hugo Villeneuve Date: Tue, 17 Sep 2013 00:36:03 +0000 (-0400) Subject: Upgrade from udev to eudev X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=085c7444d60ccd8512e49df7dfa6410934b86510;p=hvlinux.git Upgrade from udev to eudev Remove null and console static devices creation, they are provided by the kernel devtmpfs. Move other static devices creation to eudev post-install script. --- diff --git a/config/packages-list b/config/packages-list index 480b466..f7f1c00 100644 --- a/config/packages-list +++ b/config/packages-list @@ -403,7 +403,7 @@ TK="tk8.5.9-src" TRANSMISSION="transmission-2.60" TUNCTL="tunctl-1.5" -UDEV="udev-182" +EUDEV="eudev-1.2" UNRAR="unrar-4.2.4" UNZIP="unzip-6.0" UPSTART="upstart-0.6.3" diff --git a/stage1/bootscripts/udev b/stage1/bootscripts/udev index 34e1ce1..12527a5 100644 --- a/stage1/bootscripts/udev +++ b/stage1/bootscripts/udev @@ -3,7 +3,7 @@ # udev # Udev cold-plugging script -DAEMON=/lib/udev/udevd +DAEMON=/sbin/udevd DAEMON_DESC=UDEV DAEMON_OPTS="--daemon" @@ -18,11 +18,11 @@ udev_coldplug() mkdir -p /dev/udev/queue && # Configure all devices - /bin/udevadm trigger --action=add --type=subsystems && - /bin/udevadm trigger --action=add --type=devices && + /sbin/udevadm trigger --action=add --type=subsystems && + /sbin/udevadm trigger --action=add --type=devices && # Now wait for udevd to process the uevents we triggered - /bin/udevadm settle + /sbin/udevadm settle } udev_start() diff --git a/stage1/hv-install-2 b/stage1/hv-install-2 index 8a4da91..79be861 100755 --- a/stage1/hv-install-2 +++ b/stage1/hv-install-2 @@ -70,7 +70,9 @@ ipkg ${SHADOW} "\ ipkg ${E2FSPROGS} ipkg -m noac ${SYSVINIT} ipkg ${KMOD} -ipkg ${UDEV} + +LDFLAGS="-Wl,-rpath,/tools/lib:/lib" \ + ipkg ${EUDEV} ipkg -c -m noac ${KERNEL} rscr once "Creating default users" create-users diff --git a/stage1/packages-update b/stage1/packages-update index 7ac3ba4..1401ed5 100755 --- a/stage1/packages-update +++ b/stage1/packages-update @@ -56,6 +56,6 @@ fpkg -m sf ${E2FSPROGS} fpkg ${SYSVINIT} "http://download.savannah.gnu.org/releases/sysvinit" fpkg -e "tar.xz" -s "linux/utils/kernel/kmod" ${KMOD} ${KERNEL_URL} -fpkg -s "linux/utils/kernel/hotplug" ${UDEV} ${KERNEL_URL} +fpkg ${EUDEV} "ftp://mirror.ovh.net/gentoo-distfiles/distfiles" exit $? diff --git a/stage1/pkg/eudev b/stage1/pkg/eudev new file mode 100644 index 0000000..b36838f --- /dev/null +++ b/stage1/pkg/eudev @@ -0,0 +1,66 @@ +#!/bin/bash + +hvconfig_pre() +{ + export BLKID_CFLAGS="-I/tools/include" + export BLKID_LIBS="-L/tools/lib -lblkid" + export KMOD_CFLAGS="-I/tools/include/" + export KMOD_LIBS="-L/tools/lib -lkmod" + + CONFIGURE_OPTS="\ + --prefix=/usr \ + --build=${CLFS_HOST} \ + --host=${CLFS_TARGET} \ + --with-rootprefix= \ + --enable-split-usr \ + --sysconfdir=/etc \ + --libexecdir=/lib \ + --bindir=/sbin \ + --sbindir=/sbin \ + --libdir=/lib \ + --disable-introspection \ + --disable-gtk-doc-html \ + --disable-gudev \ + --disable-keymap \ + --with-firmware-path=/lib/firmware \ + --enable-libkmod" + + cd ${LFS_TMP}/${PACKAGE} + +} + +hvbuild() +{ + make + make DESTDIR=${LFS} install +} + +hvbuild_post() +{ + install -dv ${LFS}/lib/{firmware,udev/devices} + + # Static UDEV devices + if [ ! -c ${LFS}/lib/udev/devices/kmsg ]; then + mknod -m0666 ${LFS}/lib/udev/devices/kmsg c 1 11 + fi + + if [ ! -h ${LFS}/lib/udev/devices/fd ]; then + ln -sfv /proc/self/fd ${LFS}/lib/udev/devices/fd + fi + + if [ ! -h ${LFS}/lib/udev/devices/stdin ]; then + ln -sfv /proc/self/fd/0 ${LFS}/lib/udev/devices/stdin + fi + + if [ ! -h ${LFS}/lib/udev/devices/stdout ]; then + ln -sfv /proc/self/fd/1 ${LFS}/lib/udev/devices/stdout + fi + + if [ ! -h ${LFS}/lib/udev/devices/stderr ]; then + ln -sfv /proc/self/fd/2 ${LFS}/lib/udev/devices/stderr + fi + + if [ ! -h ${LFS}/lib/udev/devices/core ]; then + ln -sfv /proc/kcore ${LFS}/lib/udev/devices/core + fi +} diff --git a/stage1/pkg/udev b/stage1/pkg/udev deleted file mode 100644 index 4333579..0000000 --- a/stage1/pkg/udev +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -hvconfig_pre() -{ - export LIBS="-lpthread" - export BLKID_CFLAGS="-I/tools/include/blkid" - export BLKID_LIBS="-L/tools/lib64 -lblkid" - export KMOD_CFLAGS="-I/tools/include" - export KMOD_LIBS="-L${CLFS}/lib64 -lkmod" - - CONFIGURE_OPTS="\ - --prefix=/usr \ - --build=${CLFS_HOST} \ - --host=${CLFS_TARGET} \ - --exec-prefix="" \ - --with-rootprefix=${LFS} - --sysconfdir=/etc \ - --libexecdir=/lib \ - --disable-introspection \ - --with-usb-ids-path=no \ - --with-pci-ids-path=no \ - --disable-gtk-doc-html \ - --disable-gudev \ - --disable-keymap \ - --disable-logging" - - cd ${LFS_TMP}/${PACKAGE} - install -dv ${LFS}/lib/{firmware,udev/devices/{pts,shm}} -} - -hvbuild() -{ - make - make DESTDIR=${LFS} install -} diff --git a/stage1/post-install b/stage1/post-install index e9c8eaa..22624cb 100755 --- a/stage1/post-install +++ b/stage1/post-install @@ -2,46 +2,6 @@ source ../functions/main -# We need /dev/null and /dev/console before udev is started. -mkdir -pv ${LFS}/dev - -if [ ! -c ${LFS}/dev/console ]; then - mknod -m 0600 ${LFS}/dev/console c 5 1 -fi - -if [ ! -c ${LFS}/dev/null ]; then - mknod -m 0666 ${LFS}/dev/null c 1 3 -fi - -# Static UDEV devices -if [ ! -c ${LFS}/lib/udev/devices/null ]; then - mknod -m0666 ${LFS}/lib/udev/devices/null c 1 3 -fi - -if [ ! -c ${LFS}/lib/udev/devices/kmsg ]; then - mknod -m0666 ${LFS}/lib/udev/devices/kmsg c 1 11 -fi - -if [ ! -h ${LFS}/lib/udev/devices/fd ]; then - ln -sfv /proc/self/fd ${LFS}/lib/udev/devices/fd -fi - -if [ ! -h ${LFS}/lib/udev/devices/stdin ]; then - ln -sfv /proc/self/fd/0 ${LFS}/lib/udev/devices/stdin -fi - -if [ ! -h ${LFS}/lib/udev/devices/stdout ]; then - ln -sfv /proc/self/fd/1 ${LFS}/lib/udev/devices/stdout -fi - -if [ ! -h ${LFS}/lib/udev/devices/stderr ]; then - ln -sfv /proc/self/fd/2 ${LFS}/lib/udev/devices/stderr -fi - -if [ ! -h ${LFS}/lib/udev/devices/core ]; then - ln -sfv /proc/kcore ${LFS}/lib/udev/devices/core -fi - # Change the ownership for ${LFS} and its subdirectories chown -Rv root:root ${LFS}