From: Mike Frysinger Date: Tue, 17 Apr 2007 00:14:33 +0000 (+0000) Subject: Make an addon for mdev startup. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0552003f6402c68d23fb52451c69b0ca1d55847c;p=gentoo.git Make an addon for mdev startup. Package-Manager: portage-2.1.2.3 --- diff --git a/sys-apps/busybox/ChangeLog b/sys-apps/busybox/ChangeLog index 1f0ea75605fa..54ff03eced73 100644 --- a/sys-apps/busybox/ChangeLog +++ b/sys-apps/busybox/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for sys-apps/busybox # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/ChangeLog,v 1.136 2007/04/07 08:49:36 opfer Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/ChangeLog,v 1.137 2007/04/17 00:14:33 vapier Exp $ + + 17 Apr 2007; Mike Frysinger +files/mdev-start.sh, + busybox-1.5.0.ebuild: + Make an addon for mdev startup. 07 Apr 2007; Christian Faulhammer busybox-1.4.1-r2.ebuild: diff --git a/sys-apps/busybox/Manifest b/sys-apps/busybox/Manifest index c15d416c2c1d..5e4f85128d24 100644 --- a/sys-apps/busybox/Manifest +++ b/sys-apps/busybox/Manifest @@ -33,6 +33,10 @@ AUX config-netboot 9853 RMD160 3d62cf31765adbc88c7a39f0f21223d7e73ef627 SHA1 0dc MD5 d9841a0171170d16bb121c696591e7ef files/config-netboot 9853 RMD160 3d62cf31765adbc88c7a39f0f21223d7e73ef627 files/config-netboot 9853 SHA256 75cae861b7bae144ca86998cb90dae9bcb0f54e09ed0c36d1ed81ad79a401e3d files/config-netboot 9853 +AUX mdev-start.sh 2300 RMD160 ebe467f2abd281edff11c9a4173233c699c99cdc SHA1 26e6875b029256c35a39127c65701621e18bdc6b SHA256 9250084747b261fd535065f97d2453c658d035004c563f81905b18eebcfdc9b3 +MD5 9def7dac5b9dd69b00cd48b49bdaa63f files/mdev-start.sh 2300 +RMD160 ebe467f2abd281edff11c9a4173233c699c99cdc files/mdev-start.sh 2300 +SHA256 9250084747b261fd535065f97d2453c658d035004c563f81905b18eebcfdc9b3 files/mdev-start.sh 2300 DIST busybox-1.2.2.1.tar.bz2 1413458 RMD160 f61662f1ee12a7c65b9e65864c23242b6176a242 SHA1 41683c6a31f365ac884b84a376533d9ff372c05e SHA256 e31de8f3fc6639660af08446cc8b49f5831d5e5ecab0a56d9482c1d4eb89a701 DIST busybox-1.4.1.tar.bz2 1510432 RMD160 6ea5461718fae52b9ee3b966e49a226a0685fd28 SHA1 e349e3585448ba0f7c28504326301ea130eb2e35 SHA256 2936318008322392716a9d3566bcff071cf5c97cb1df1f5953ec5b5a8a1701bb DIST busybox-1.4.2.tar.bz2 1509690 RMD160 222c2f2bcabeba45b8233981c8071fe4f4d62bf3 SHA1 d654727c62f324ab13295095c219451b969beb87 SHA256 da1a9b1c9e210e3e129ab8a3b4e6af2fe093673e3f60722931e2c722d4c29b0f @@ -49,14 +53,14 @@ EBUILD busybox-1.4.2.ebuild 7830 RMD160 30cc0f145cd8f72e41a76bcd0818bee61a80f971 MD5 3a68b99ad936601a1ad280966612894f busybox-1.4.2.ebuild 7830 RMD160 30cc0f145cd8f72e41a76bcd0818bee61a80f971 busybox-1.4.2.ebuild 7830 SHA256 08927c976ab170dfb0e2264f3ae7551b2e1f5c17d065b3f6d5fa45297867116a busybox-1.4.2.ebuild 7830 -EBUILD busybox-1.5.0.ebuild 7784 RMD160 bd66d2eff7accce9d072ec923a22bb4019800a11 SHA1 440b5d79c982732ed5f463d8ead8fbd7f49be38d SHA256 67420ccb2cd25b62f7dbad359a744edeec15119f982011ab75ec85cdacdb2cba -MD5 31f1f566a3de184cd5eeaf4cd30e4a72 busybox-1.5.0.ebuild 7784 -RMD160 bd66d2eff7accce9d072ec923a22bb4019800a11 busybox-1.5.0.ebuild 7784 -SHA256 67420ccb2cd25b62f7dbad359a744edeec15119f982011ab75ec85cdacdb2cba busybox-1.5.0.ebuild 7784 -MISC ChangeLog 21506 RMD160 144be6ae01ce05c4b4a701bde764121078162856 SHA1 7d0d85c722635100955891506a1781fb03fb74ed SHA256 f8368e8f4ce8c27e976ea0addd9f43b257796759da9c55a456c1498a7e2b92f8 -MD5 42797a812ca0d775e172bcda21805c70 ChangeLog 21506 -RMD160 144be6ae01ce05c4b4a701bde764121078162856 ChangeLog 21506 -SHA256 f8368e8f4ce8c27e976ea0addd9f43b257796759da9c55a456c1498a7e2b92f8 ChangeLog 21506 +EBUILD busybox-1.5.0.ebuild 7868 RMD160 3cae2d1336e045658eea320dab5777cf0e333571 SHA1 7ef50b84de74fd6838e2dca2eb1305bc03d9dc9e SHA256 91678e27dff0afd8281a6f622a8247a4cfc2d87bbdd31849b5669f1c50ca7927 +MD5 8e42e449d422f30808727498dd1d6452 busybox-1.5.0.ebuild 7868 +RMD160 3cae2d1336e045658eea320dab5777cf0e333571 busybox-1.5.0.ebuild 7868 +SHA256 91678e27dff0afd8281a6f622a8247a4cfc2d87bbdd31849b5669f1c50ca7927 busybox-1.5.0.ebuild 7868 +MISC ChangeLog 21638 RMD160 9f64e3e586f6a70ba9474402d5232b77c8cae7f3 SHA1 88c6fd07abfa5755f945325edab65b584e5b10df SHA256 029e058e46949b247672f27ef948a9e383ba5157c376bea2266ab120af243ed4 +MD5 cbee77f0cf77c4f3e36d61ada790f657 ChangeLog 21638 +RMD160 9f64e3e586f6a70ba9474402d5232b77c8cae7f3 ChangeLog 21638 +SHA256 029e058e46949b247672f27ef948a9e383ba5157c376bea2266ab120af243ed4 ChangeLog 21638 MISC metadata.xml 161 RMD160 77385273ea1d12ed4093a4167307486b74d1cf82 SHA1 aa4b2873e32de89c0b0aeb26b5782f77cb00948e SHA256 a11fdd02015a232398fdf22a20d26a95fc34d44c54513e6b26b6128d0b76122e MD5 8ef75eba39772bdd1a8facc7815dbebb metadata.xml 161 RMD160 77385273ea1d12ed4093a4167307486b74d1cf82 metadata.xml 161 @@ -74,9 +78,9 @@ MD5 5ca64c848ab0c5589b071839147ba040 files/digest-busybox-1.5.0 247 RMD160 3e96eb155b5d982b705c87761a09b378590b87d5 files/digest-busybox-1.5.0 247 SHA256 07a1d99470a24ffb961a0d1bdd253fc04e90a28f3e76e10b18c0c844ce54f8cd files/digest-busybox-1.5.0 247 -----BEGIN PGP SIGNATURE----- -Version: GnuPG v1.4.6 (GNU/Linux) +Version: GnuPG v2.0.3 (GNU/Linux) -iD8DBQFGF1syNQqtfCuFneMRAp8zAJ0XxYnkG6D1ljVtRfXwL0F3Dlny6ACfRIAN -Rnkmnt81Jl5WFZZiJZwWMOs= -=Gt+g +iD8DBQFGJBF38bi6rjpTunYRAl1EAKCXblWHLgTqV8/+o3M0HZft4Y9dWwCgkbtU +UJ2KftpkQPAe8fnpwIiWexo= +=UjR1 -----END PGP SIGNATURE----- diff --git a/sys-apps/busybox/busybox-1.5.0.ebuild b/sys-apps/busybox/busybox-1.5.0.ebuild index 85d98b5a14f6..03d8e0d3b6d8 100644 --- a/sys-apps/busybox/busybox-1.5.0.ebuild +++ b/sys-apps/busybox/busybox-1.5.0.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/busybox-1.5.0.ebuild,v 1.5 2007/04/06 00:21:59 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/busybox-1.5.0.ebuild,v 1.6 2007/04/17 00:14:33 vapier Exp $ inherit eutils flag-o-matic @@ -183,6 +183,9 @@ src_install() { || dobin bb dosym bb /bin/busybox.static + insinto /$(get_libdir)/rcscripts/addons + doins "${FILESDIR}"/mdev-start.sh || die + # bundle up the symlink files for use later emake install || die rm _install/bin/busybox diff --git a/sys-apps/busybox/files/mdev-start.sh b/sys-apps/busybox/files/mdev-start.sh new file mode 100755 index 000000000000..bd2c60f137c2 --- /dev/null +++ b/sys-apps/busybox/files/mdev-start.sh @@ -0,0 +1,93 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +populate_mdev() { + # populate /dev with devices already found by the kernel + + if get_bootparam "nocoldplug" ; then + RC_COLDPLUG="no" + ewarn "Skipping mdev coldplug as requested in kernel cmdline" + fi + + ebegin "Populating /dev with existing devices with mdev -s" + mdev -s + eend $? + + return 0 +} + +seed_dev() { + # Seed /dev with some things that we know we need + ebegin "Seeding /dev with needed nodes" + + # creating /dev/console and /dev/tty1 to be able to write + # to $CONSOLE with/without bootsplash before mdev creates it + [ ! -c /dev/console ] && mknod /dev/console c 5 1 + [ ! -c /dev/tty1 ] && mknod /dev/tty1 c 4 1 + + # copy over any persistant things + if [ -d /lib/mdev/devices ] ; then + cp --preserve=all --recursive --update /lib/mdev/devices/* /dev 2>/dev/null + fi + + # Not provided by sysfs but needed + ln -snf /proc/self/fd /dev/fd + ln -snf fd/0 /dev/stdin + ln -snf fd/1 /dev/stdout + ln -snf fd/2 /dev/stderr + [ -e /proc/kcore ] && ln -snf /proc/kcore /dev/core + + # Create problematic directories + mkdir -p /dev/pts /dev/shm + eend 0 +} + +main() { + # Setup temporary storage for /dev + ebegin "Mounting /dev for mdev" + if [ "${RC_USE_FSTAB}" = "yes" ] ; then + mntcmd=$(get_mount_fstab /dev) + else + unset mntcmd + fi + if [ -n "${mntcmd}" ] ; then + try mount -n ${mntcmd} + else + if grep -Eq "[[:space:]]+tmpfs$" /proc/filesystems ; then + mntcmd="tmpfs" + else + mntcmd="ramfs" + fi + # many video drivers require exec access in /dev #92921 + try mount -n -t "${mntcmd}" -o exec,nosuid,mode=0755 mdev /dev + fi + eend $? + + # Create a file so that our rc system knows it's still in sysinit. + # Existance means init scripts will not directly run. + # rc will remove the file when done with sysinit. + touch /dev/.rcsysinit + + # Selinux lovin; /selinux should be mounted by selinux-patched init + if [ -x /sbin/restorecon ] && [ -c /selinux/null ] ; then + restorecon /dev > /selinux/null + fi + + seed_dev + + # Setup hotplugging (if possible) + if [ -e /proc/sys/kernel/hotplug ] ; then + ebegin "Setting up proper hotplug agent" + eindent + einfo "Setting /sbin/mdev as hotplug agent ..." + echo "/sbin/mdev" > /proc/sys/kernel/hotplug + eoutdent + eend 0 + fi + + populate_mdev +} + +main + +# vim:ts=4