diff options
author | Mike Frysinger <vapier@gentoo.org> | 2012-05-01 04:17:37 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2012-05-01 04:17:37 +0000 |
commit | 4b5fe574eaa1f6f6941b7d6bf331f4782902af9e (patch) | |
tree | fa3769c665e6e4318c54fc17242d1335251f5365 /sys-apps/busybox | |
parent | Version bump for stable channel release. (diff) | |
download | historical-4b5fe574eaa1f6f6941b7d6bf331f4782902af9e.tar.gz historical-4b5fe574eaa1f6f6941b7d6bf331f4782902af9e.tar.bz2 historical-4b5fe574eaa1f6f6941b7d6bf331f4782902af9e.zip |
Use mountpoint rather than reading /proc/mounts to avoid needing to mount /proc at all as pointed out by Maxim Kammerer.
Package-Manager: portage-2.2.0_alpha100/cvs/Linux x86_64
Diffstat (limited to 'sys-apps/busybox')
-rw-r--r-- | sys-apps/busybox/ChangeLog | 6 | ||||
-rw-r--r-- | sys-apps/busybox/Manifest | 30 | ||||
-rw-r--r-- | sys-apps/busybox/files/ginit.c | 52 |
3 files changed, 39 insertions, 49 deletions
diff --git a/sys-apps/busybox/ChangeLog b/sys-apps/busybox/ChangeLog index cfa4f10236a6..55fe03c0c961 100644 --- a/sys-apps/busybox/ChangeLog +++ b/sys-apps/busybox/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for sys-apps/busybox # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/ChangeLog,v 1.302 2012/04/30 01:59:09 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/ChangeLog,v 1.303 2012/05/01 04:17:37 vapier Exp $ + + 01 May 2012; Mike Frysinger <vapier@gentoo.org> files/ginit.c: + Use mountpoint rather than reading /proc/mounts to avoid needing to mount + /proc at all as pointed out by Maxim Kammerer. *busybox-1.20.0 (30 Apr 2012) *busybox-9999 (30 Apr 2012) diff --git a/sys-apps/busybox/Manifest b/sys-apps/busybox/Manifest index 2cfd5b76578c..5dcbeb2f1d3a 100644 --- a/sys-apps/busybox/Manifest +++ b/sys-apps/busybox/Manifest @@ -9,7 +9,7 @@ AUX busybox-1.20.0-buildsys.patch 695 RMD160 b90c1e356d11def9e42afcea4c1e859b0d0 AUX busybox-1.20.0-getty.patch 477 RMD160 3dfeb9b57acb342092ab1457e0aedc6d2bd26df5 SHA1 777639ae3e5d982378f740b5f8047fed57950d05 SHA256 9fad6e4652b61f387cf4595ef151667cdea3fb470a23b8f7771ed51550ee100e AUX busybox-1.20.0-lineedit.patch 768 RMD160 50f398265d1496df68d6afa89936b32b7fe065ba SHA1 77c2266ad808cfe6ba09f571dbf14875b9f3783a SHA256 f52874c75c2bf1ec5a101a1da111ec31fceee6e94ad895deadcbf9a4780503b2 AUX busybox-1.20.0-sed.patch 710 RMD160 c11de196a3cf33d0c8d66c1eff7674507562d25f SHA1 878f9800ea823a232273d57fe9da1ea1399857e1 SHA256 4d0a7670848967afee436d0692d4395c61677cbef67c2c0d1f44f1878d2ebadd -AUX ginit.c 3384 RMD160 d8edd12d416437c3c9160fd55b429f513f19cb7e SHA1 310fe189ced7843123519cf50bae770749846fd7 SHA256 ffb99c6dc0b53688636d58a696ceb70a3dd22a279a582a546abcc5ab2e235273 +AUX ginit.c 2865 RMD160 daff0393c1edcab02cc138df8d75844db3f070f2 SHA1 88e11eb0fef90af55a739f100ef873372884e511 SHA256 9f3330817a2ee3c650493a7ca5d6a2d4bc00571d76ac4a11af0d2d62dab04a26 AUX mdev-start.sh 2758 RMD160 c177aac4940b177bd857bc98ff2ac031e0489bbc SHA1 5a5b95da36c489cd12820513434a7a17ac3bffd1 SHA256 9904263c8dfe2b8c3e968a9b4245fa0c162a2413110c037cdd797ac3773587d7 AUX mdev.rc 282 RMD160 6a11e23fbed92acd24088a7885bdc52b9c845fac SHA1 46f1a0494e009332e83b62599842f8213b60ba60 SHA256 e52abbc3399fc85ce1f097e8f12b25a5ca7fe2e3d648bee60c061b547ba39dc5 AUX mdev.rc.1 2191 RMD160 e8cf408e576850868581d011614ca79a2be2dc9c SHA1 56c9b728403f06c821f90e2dd5ac76a28f7e7dce SHA256 1a22210a9d59d7c1f023141768b1d22e51f5102ec1d7e0a9ebd17d7618384c88 @@ -22,22 +22,22 @@ DIST busybox-1.20.0.tar.bz2 2190652 RMD160 b7d4d411b9903e709e71d0438d1aa2825d6a0 EBUILD busybox-1.19.3-r1.ebuild 8383 RMD160 7a2236072319bc46910dfb15d287759229e7a646 SHA1 4ecff8d511fbf29b7d7651890fb373aa3a11259c SHA256 686f630628f350ab27aac9080a38e6ef0fdf81d494e1ba23c8296946985a27da EBUILD busybox-1.20.0.ebuild 8696 RMD160 0151fb88a6e0a49008fa01111c2cb7d9c8311d90 SHA1 3b4f0d3117c1590830c061b6eb1e9a8e9ecb3bc4 SHA256 2effe69a2027baa5f2f45240889cdb52368ff52bbfe9f36d79995130a73cd36b EBUILD busybox-9999.ebuild 8693 RMD160 78af14e4f9132aea21f715064bac035c7ac4da47 SHA1 4eb43d0a0248dd7ea868b1dc529fd4d016856669 SHA256 9eed1a139a3187a1743d0cfb55d389bce2f3430ccfd0e39f552ae833091c69a3 -MISC ChangeLog 46833 RMD160 401c36797ed1c5af02a7785d44abba57147464f2 SHA1 bc7a480a9cef3fc18a6702595e8f8771a3c41bfc SHA256 fa23324db9226fb0e8b090d6c5d3843569ba0c38fade610df2b3d32088084f53 +MISC ChangeLog 47024 RMD160 7ce4c9e1e34378c2df4d3505daefcde38725e825 SHA1 39fae4eaed3953d6f72cb44239b26ade9d74d971 SHA256 00e4593a8240ab0393d65882bd8c61f11fbaf348ed5ac5883d9f76cba250c742 MISC metadata.xml 530 RMD160 8604f18142c1c5ce84242693f9cd9d2d09e62829 SHA1 a53e6b65712ebbaa5b22c66131c332b81e9bc9fe SHA256 5bfd661bd2547348d50f33d5c6e93dbadcf4d8acf3fd257ad9bc9c640b28451b -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) -iQIcBAEBAgAGBQJPnf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DpYnOQOQVG3g102ethOwk0wKuV0k2b2uwdhBlRK90een5v7dhfPruy+GoBjx +rYkFSpDevBtpBsyNXu9VFMbKQxm6q4WUyEtRtXi6RjDCAsju6YwLWZhF4K3byjRM +SfDM7goLVIX8vR/rz4kVA54U1UUyFpE1Km1eFTMtF21d8Eu657eTNeAu7TcGDMIU +vXhwe/z954jVu5pCqYKyI4fvN/tY/DtWXINFIcdCas2+0C+U+1MCIprizhqES99s +2ZfCHpARxmkO1lT33Z2RIeeRysei94ZXarbEgALYBI7vev8jeGJfsfEgyiTycDlo +JmoxfhzFgos4q7XCUqt5lQWPFPaLkd9JJdvdXnhB4sDDgl8/mKx9NJUY15Z+XpwV +MvFMLRyr6x7taWJY2kkv +=eVNQ -----END PGP SIGNATURE----- diff --git a/sys-apps/busybox/files/ginit.c b/sys-apps/busybox/files/ginit.c index b746b719edcb..f5246f403717 100644 --- a/sys-apps/busybox/files/ginit.c +++ b/sys-apps/busybox/files/ginit.c @@ -13,6 +13,10 @@ //config:config GINIT //config: bool "ginit" //config: default y +//config: select MKDIR +//config: select MDEV +//config: select MOUNT +//config: select MOUNTPOINT //config: help //config: sep-/usr bootstrapper @@ -60,7 +64,7 @@ int ginit_main(int argc UNUSED_PARAM, char **argv) return spawn_and_wait(argv+1); } -#define _spawn_and_wait(argv...) \ +#define saw(argv...) \ ({ \ static const char *args[] = { argv, NULL }; \ /* These casts are fine -- see process_args for mem setup */ \ @@ -68,53 +72,35 @@ int ginit_main(int argc UNUSED_PARAM, char **argv) spawn_and_wait((void *)args); \ }) - /* We need /proc in order to see what's already been mounted */ - if (access("/proc/mounts", F_OK) != 0) { - if (_spawn_and_wait("mount", "-n", "/proc")) - _spawn_and_wait("mount", "-n", "-t", "proc", "proc", "/proc"); - } - - /* Look up all the existing mount points */ - ismnted_dev = ismnted_sys = ismnted_usr = false; - mntlist = setmntent("/proc/mounts", "re"); - if (mntlist) { - while ((mntent = getmntent(mntlist))) { - if (!strcmp(mntent->mnt_dir, "/dev")) - ismnted_dev = true; - else if (!strcmp(mntent->mnt_dir, "/sys")) - ismnted_sys = true; - else if (!strcmp(mntent->mnt_dir, "/usr")) - ismnted_usr = true; - } - endmntent(mntlist); - } - /* First setup basic /dev */ - if (!ismnted_dev) { - if (_spawn_and_wait("mount", "-n", "/dev")) - if (_spawn_and_wait("mount", "-n", "-t", "devtmpfs", "devtmpfs", "/dev")) - _spawn_and_wait("mount", "-n", "-t", "tmpfs", "dev", "/dev"); + if (saw("mountpoint", "-q", "/dev") != 0) { + /* Try /etc/fstab */ + if (saw("mount", "-n", "/dev")) + /* Then devtmpfs */ + if (saw("mount", "-n", "-t", "devtmpfs", "devtmpfs", "/dev")) + /* Finally normal tmpfs */ + saw("mount", "-n", "-t", "tmpfs", "dev", "/dev"); } else { eprintf("%s appears to be mounted; skipping its setup\n", "/dev"); } /* If /dev is empty (e.g. tmpfs), run mdev to seed things */ if (access("/dev/console", F_OK) != 0) { - if (!ismnted_sys) { - if (_spawn_and_wait("mount", "-n", "/sys")) - _spawn_and_wait("mount", "-n", "-t", "sysfs", "sysfs", "/sys"); + if (saw("mountpoint", "-q", "/sys") != 0) { + if (saw("mount", "-n", "/sys")) + saw("mount", "-n", "-t", "sysfs", "sysfs", "/sys"); } else { eprintf("%s appears to be mounted; skipping its setup\n", "/sys"); } - _spawn_and_wait("mdev", "-s"); + saw("mdev", "-s"); } /* Then seed the stuff we care about */ - _spawn_and_wait("mkdir", "-p", "/dev/pts", "/dev/shm"); + saw("mkdir", "-p", "/dev/pts", "/dev/shm"); /* Then mount /usr */ - if (!ismnted_usr) { - _spawn_and_wait("mount", "-n", "/usr", "-o", "ro"); + if (saw("mountpoint", "-q", "/usr") != 0) { + saw("mount", "-n", "/usr", "-o", "ro"); } else { eprintf("%s appears to be mounted; skipping its setup\n", "/usr"); } |