Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/releng:master commit in: sys-apps/busybox/, sys-apps/busybox/files/, sys-apps/busybox/files/mdev/
Date: Sat, 22 Feb 2014 14:19:55
Message-Id: 1393078501.78013c01ba4d46a498ea689e9bae3635f4e385bd.blueness@gentoo
1 commit: 78013c01ba4d46a498ea689e9bae3635f4e385bd
2 Author: Felix Janda <felix.janda <AT> posteo <DOT> de>
3 AuthorDate: Sat Feb 22 09:15:51 2014 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Sat Feb 22 14:15:01 2014 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/releng.git;a=commit;h=78013c01
7
8 sys-apps/busybox: move to tree
9
10 ---
11 sys-apps/busybox/Manifest | 25 ++
12 sys-apps/busybox/busybox-1.21.0-r99.ebuild | 304 +++++++++++++++++++++
13 sys-apps/busybox/files/busybox-1.19.0-bb.patch | 22 ++
14 .../busybox/files/busybox-1.21.0-ifconfig.patch | 11 +
15 sys-apps/busybox/files/busybox-1.21.0-iplink.patch | 12 +
16 sys-apps/busybox/files/busybox-1.21.0-mdev.patch | 35 +++
17 .../busybox/files/busybox-1.21.0-platform.patch | 24 ++
18 sys-apps/busybox/files/busybox-1.21.0-xz.patch | 84 ++++++
19 sys-apps/busybox/files/ginit.c | 124 +++++++++
20 sys-apps/busybox/files/klogd.confd | 9 +
21 sys-apps/busybox/files/klogd.initd | 12 +
22 sys-apps/busybox/files/mdev-start.sh | 125 +++++++++
23 sys-apps/busybox/files/mdev.rc | 9 +
24 sys-apps/busybox/files/mdev.rc.1 | 98 +++++++
25 sys-apps/busybox/files/mdev/dvbdev | 18 ++
26 sys-apps/busybox/files/mdev/ide_links | 23 ++
27 sys-apps/busybox/files/mdev/usbdev | 62 +++++
28 sys-apps/busybox/files/mdev/usbdisk_link | 34 +++
29 sys-apps/busybox/files/ntpd.confd | 6 +
30 sys-apps/busybox/files/ntpd.initd | 13 +
31 sys-apps/busybox/files/syslogd.confd | 9 +
32 sys-apps/busybox/files/syslogd.initd | 13 +
33 sys-apps/busybox/files/watchdog.confd | 9 +
34 sys-apps/busybox/files/watchdog.initd | 8 +
35 sys-apps/busybox/metadata.xml | 13 +
36 25 files changed, 1102 insertions(+)
37
38 diff --git a/sys-apps/busybox/Manifest b/sys-apps/busybox/Manifest
39 new file mode 100644
40 index 0000000..4b0e21c
41 --- /dev/null
42 +++ b/sys-apps/busybox/Manifest
43 @@ -0,0 +1,25 @@
44 +AUX busybox-1.19.0-bb.patch 908 SHA256 98f92c2edbcf61d1bacef783ea8b08cce07051b0a4489ed3f4579296846f89f1 SHA512 d4024e531ce7113cf554646608b1ef356e51691e3e21d165621b3690c82b56a319867b90d9daba548b635d9dbd41be5efea63181b7123d4505e529d863a8214c WHIRLPOOL b0d6d9b08ad0930e5243c7addc8a6db61505e95ed8e72c64fbfd734cb6ff9e303b3eb8ea6ec4790b2be567783664230cf278eb3e673fa0844c3881cf993f7cb8
45 +AUX busybox-1.21.0-ifconfig.patch 281 SHA256 81a8ea4471d2d0c6b925878b7276ad9837d2d3fda2db0669a4934c63f8d42c43 SHA512 5a1d6a20a349562cc217663aea91c494703725f80e46a4fcf81bff2ed6940a4080f2008b9216f73b75c80c7408f933743d6b783da5b780b5731475dace85832f WHIRLPOOL d1f0219f407acdf131a33db01c0fb74dfd42d56e180feb7c549fb2867b4483e6255ab0bb9651f35f4446bd9159167b33086e5599a2e4b88f52a79821c6401a48
46 +AUX busybox-1.21.0-iplink.patch 401 SHA256 f3ef2c9294c83860fd1dbd10cd40347118b96d42e60a4a8cb12d76a19215ceb0 SHA512 45a13ca6749771319414090a86fa15644e57062641cdaf7b908136125aad6cb25628c85830b150392debb87992f386ece9ea3a730eee72a5e5727655429f451b WHIRLPOOL 64cf91527c39f0dd3fb8d2bf35df6c82d0d470a00aa98c3d680d7fb63a986885f6f834785d27afda7131a8fa46381a285be57b5ef7d22a4691b459dcf330e994
47 +AUX busybox-1.21.0-mdev.patch 1173 SHA256 911371ceff8c6a899323cda8d63a20b5f98d503681e5617b2448b555c4fecc61 SHA512 490a9a85d6df17e0111ad86f420207fed1b699b3b4e9ebe8d6700d4ce33ab3de0e0137dba1326efb5011dbcd53c769448ddab855995c896135ed6adbe61d2e44 WHIRLPOOL 2a302d310a6e82f3aa1c878a14fc4d2b1644d4e724aae1e25c1390cbd3852d252a38c76fd38fc79ee4b08d8f83aa2a442963955fe49486a28c060d1d4b6edc47
48 +AUX busybox-1.21.0-platform.patch 1227 SHA256 ee7b96577330a68598d4ec48ce94f6eca3079c32a86cca32f3bb6cc28d467654 SHA512 595e1081dcc9f2dca714066c1f59659d7c7e3f702df937c138ff60cf9af42272b71ac354521c3abd26ac406eb07a710c14c4f94e62a293edcd6473ba1fd53675 WHIRLPOOL d18661bccd8f43bc4fcb492013a647480ff4e0e88a1ac8ea9a1a3f176193363bfbd7777589b2796ccdf92315cd80a5d6999a321dafc441f4939546d6272002eb
49 +AUX busybox-1.21.0-xz.patch 2647 SHA256 c807f73718e836a81ee74987306c72297ddba209038240f81fab96b4a28b73b4 SHA512 696dd31a73bbd919435a3ee1b8cd05769e6c3a45e853e3e052a22b7290bf332cd3b7e17e394911864b3c7ed7f9eea604dfbd7a5c43f0eb1e65b257d679fcccd3 WHIRLPOOL a3be95e60602374daff1629c38556f93b2342d81939afda86613f5fb0af0f7b600656118712ac33237cba230369f622a18502347e1dad0aa3570dc1d0a1725f1
50 +AUX ginit.c 3097 SHA256 fd6a4715d3dd10f6db479020433da3997d397658301335c847fb779129238b8c SHA512 8bf70f13db0fbeecedf9a9f862c5391c0d8b7aa3ddd2ec85cda9b360c3117a01e32b01017b8c30197f587e521ba360ff70d1caf8d0f69d5c3a27f37ecc252e7c WHIRLPOOL a1ec3ccc296033d88a9504b693c7d249d0bd11b1d75e3f59a62137c5e4b4c914fe2b8971c86dbca2cc8ccc0d86f3f8c2c45bb44cec85a3628c44f091476baa92
51 +AUX klogd.confd 218 SHA256 737b78745964e110da2fd3357c6d5fb80ccacf979039b8d40c03cf1cb969e5f3 SHA512 3348d5376b368b28d1431692a93868cd4550be12ad729340c5f78da35a5bd295e7613d70ce8ccde5029ad6d87a41c2f24155180f3570de8a9174dd63dece143f WHIRLPOOL ea28c1d926e36fba0ab69de8ddfd2503889b7cfa3a4ada347a9d22d9894fe30be068c0ed55f899b952e62b8de3cb69e1a4209f7864787988ded28ede10c7445a
52 +AUX klogd.initd 359 SHA256 ef607b72d270797e4be1fba425c23ba26078633c47c698063bd4b17e7b4ff8c3 SHA512 e9d6215e4b0dcc4fbb507ce2bb84c818ad18951282c47c98b0c98b3fa58e6b28218f608689a7786cb0447673ae1f5c3ba5767f9b29cffd73325d93bf2a928ac9 WHIRLPOOL d7e82a0d2a6a60b2444a3b212022250297ca163001045bf508442972fc6330c4eea55cb965920778e090c92a69441e864e6721f02ecc6d10279b6196b14f7e71
53 +AUX mdev-start.sh 2758 SHA256 9904263c8dfe2b8c3e968a9b4245fa0c162a2413110c037cdd797ac3773587d7 SHA512 532ececdf40769e8059172b95f600c92ddda9490dcf04dc76b11cd669b2b35740aeb02ef7c152a42c13d5adfefb391de01239ebbb4efd06faadc0d096fcde6f5 WHIRLPOOL aace77a07eedfea3ffab029ce25334ff58f512bf5c67512c1f4a40fd51278c2b8b764e55dbf975f74bb4423cfc3f35482a5d3ee8397032fcbf22ad1f91c7c4ea
54 +AUX mdev.rc 282 SHA256 e52abbc3399fc85ce1f097e8f12b25a5ca7fe2e3d648bee60c061b547ba39dc5 SHA512 b3e5f0810a5e33047ea73c6a4d846087100fb8c566cfa001e07fc0c1448d2024913ac06355122076ec6c79146867af77a02bbc6509b009afa97b5207588da1b9 WHIRLPOOL 2bd20507d115c82076653c6c78899751f8e3b8cde14c81c8f10ef7747ccba867360b463c90b9b3053cd6cb8599f297362153ebbff0dfad90c2fac8f445668320
55 +AUX mdev.rc.1 2202 SHA256 5235a2cd5e4ce92032a5e3e314c6e2980d98df8a6a387d2cf3e0d30d29f62cd5 SHA512 27435ac949ee351aa957f23a31b08f8689f284449928fba495f9432c893e30cd8ab8f883ee131626310f09e9edc615908484c7402009df3cba3a6eaf137f8afc WHIRLPOOL 54c23164ed320efe654d36656bd4be2be383199c003a57806a850692b38556d4f961b9608c1561f16fa108bac64643ab2270a8a1a5edf8e5d1e24a967f549b76
56 +AUX mdev/dvbdev 356 SHA256 ef091bb4c8943a99b9a97b556cdc15ddd20275f5afa8287e201419b08c4e71de SHA512 ebd82f935da2ca89097234dd8a8f47e179a423652c151123a1f3343f3e1e7bfaba2b8800380e988d4e8f4294545d3a9ab6708ae2e77c5b108b5f091bbce8f94a WHIRLPOOL ec24a4afe8333e2d4d856fe3853b844d113057daf3fe536a4c8ef481a5ec925254c7daeb09df378922fabb96400440f4bde40979417b7c35467934d7e2235739
57 +AUX mdev/ide_links 440 SHA256 3fccc9ee437e3dcc8ac73bfe3713334a7156a112fe442e052fff4f26ff0f6a88 SHA512 0142234d0bda86ad1e5f88f1da34669e5fda46a0fd52ce507bd49ce74d2b7c12c323e8db863bccb924e6d632b568db8b243361b217c5b2e1d92a25feb6e62dec WHIRLPOOL ce02358a65ad2beeab12485379e322736c7b6b58ff44a20b880d9bab8806e04890a385b94228f2db685150dfe0a3c716f842ce5c1c7f579c8208ab4e9a6ae852
58 +AUX mdev/usbdev 1624 SHA256 113ecaa722fa1f4e1c76489e2a7b24099778615a5bccd443aa9cbab28c6d05d0 SHA512 f2d98050eeeb2fbb299298e221f47182a74ed901d2c8c848aa297ebd461c62c30d2fb968bb3eb723a6d9c268fac4a3c40a18aa59ed934043d42c38a1f6b9f5a2 WHIRLPOOL 9b773cb41827bf5777061ec7ed432315bc5bf070768a44ceec7c893af2266d8c06ea4c061711b2696a8228d72c7222fbf52d26fb92b4112158716727b3bc1e38
59 +AUX mdev/usbdisk_link 984 SHA256 c72cdf4bfde9a8f8334a9d6bfce2a468c926a5530532b8a16a13a63d798abeb3 SHA512 05bc589f067cf988f97f10def3c05e139ac4f4ebe045bdb4c2f5453f5e672bf61d3dc1636974c5680c8c9cf22498bee9cfa28a8f4a264d9f5b10a72a9da0ca16 WHIRLPOOL 03f71c6ce87ea19d9b78615e06adbb5ad73e05b2e3dd69d28092df5e961aea2d06db6c97389d000d20b42b0df241a5e8a7f23056d0f40c5cde0557ce7fdf1fcc
60 +AUX ntpd.confd 186 SHA256 4bff7f5c66f4eece52e4381fd2706e591f10eb50f3c3a4132344d34150dc54de SHA512 b0ef111ea7dd6a096acf711d2d84a7c3d38e7e8c181f734053d38c565ab44ecf843ef32c0de0c4e7ecec990e97468a2545f83821beedb125cd6723ed74c67ad8 WHIRLPOOL a1b228ae22c61de6ecc7fa58edcd4c3941b3762a45fcc38d05bd1c9428bc553b1a158c101d65a99ba63d4bc19b269e834b3f0eba40a5a1c81e0ae876a2ecb42c
61 +AUX ntpd.initd 372 SHA256 66266f86f65a5095bdbcba4d8ec5893b086849e4dcf43dab81b2bcc5970f8e35 SHA512 4daec8c17e2d89abc386178ac172092b682b46d74dbb43c20bc9d0723bede720bc7dc5e90c24b33c6a7344d58f0ef43aab2fc331343ba12e69ff5446ac2a1345 WHIRLPOOL 4e92d44c95ae93622c838b4e0221e3d201983b649a50fe6ffceaab020aad7ec88024f66c9d9cbe044345af48bed81a1b985a8ed00df79bdf08045f9394add4b9
62 +AUX syslogd.confd 234 SHA256 65166088cb173582200b8c0d3bc6ea339b5929dbafa816780bfaf50e3514bc25 SHA512 01a2ecf89c49e3e06dd1b6f6673fca16d0f2dd01ff27c0d609c803bc2c81b5ced8245b6388e48ffa2f05ff4e8c1824af73df6364bbebebc722166447bd412f52 WHIRLPOOL b0a9e82225968d44446025242ac6c9429dc2e01a3720d94349756f71ec3a11c3ff2217bce7c4f1a1ea8a2a8baecd3265c3cce01675138674c05a9f2a96ade2ae
63 +AUX syslogd.initd 383 SHA256 b66e709317513b79139d5441c712839e271ff5177a3d743b86e39f70906fe2ee SHA512 b6bd8b7cb990c7c9c242baf4b3d20b3351e6ca0054b6d231787540b318ea9ac2332ac97ae4b56d07d2cf9ae52fb9c1644dede47bbfdd9f8bc7727bcfd0da8ed7 WHIRLPOOL 4b7a3e4ad7cc9e07853cc0e43b8f15aa0cb71642afeee89392190ba75d547e156ec4b790f8e35e56851bae01ff3965ef36e9160bf61aae95376c9fa2189f11a7
64 +AUX watchdog.confd 232 SHA256 786d9497ad55c29d6fff231709e71ecad94f2ee1de3b45b461deb29c3eba1c63 SHA512 8fd7121075535195f3e5d43ec773713c883fb7865cd5e5927b3b20c2605c50acb81d50461bd1a246c1282006ce74b11932ac1cec67ddc2be15da2f9aa8674232 WHIRLPOOL 8ea0f6b759198c978f10bf0b2b00cc73343e72401a05edf257b9c5e1032e8a619328aaa02936b5b5a717a021baa84b5653b8c9826e14e5c07c7b7af98f878767
65 +AUX watchdog.initd 334 SHA256 ae335a9540d282277d0a127673efff279177a1bb643e98afd772eef9423fe79f SHA512 e915a2b5567b1cfe5423b00ca984c37dea4afd72bc3b7a550858f7140dc18283831bb9cfeeb564ced2669706cf747f3934fd339f9e93d456b229b03781ac9303 WHIRLPOOL c57eaf47d0501394f2f08a6b6f09529f91fd34f3d5027f6e159573ea8c5321a88c2cb01511971d15f8b25c9a44693c88e340ee35949c4cdab49d7fbbbe064c22
66 +DIST busybox-1.21.0.tar.bz2 2200841 SHA256 eb9d268627783297f5f459cb9bd61a94e395dc7cb3647e10ec186e0159aa36ed SHA512 ddafded24881f03db550d9793585bb5442c70f2a60a5d9770126f50981dadfe95fc0b280f83d5b8a8ce21c86bb7ce64e9f1a606cea140fb2f2599a21de55ba31 WHIRLPOOL d50378bb823dd59e8a607ed6a72d4890f4e5ad3304f1ddba9f7f3d49b5ab820acc9daa2b3c4619f8b147dec085c53c3c6f4b4ebe4c60b431299031d2af00a4d3
67 +EBUILD busybox-1.21.0-r99.ebuild 8665 SHA256 be310b696d31f0a2cb85c2fb7717e1246404fe5394f5c41eb97004501fe6b075 SHA512 c17f6a3e12ed16cdb6989f15cf1311b8e98d151497f0f3cd227fc97abaad6fab5448fd7823dd224bd91fe844f599247544c7202670f9280e1e9230b22e380272 WHIRLPOOL 6603aaec25d73c6221c201e89693f28ee9916aead50a02849fab9ffc8a3f987bb4ac17b79ace51d9d33d9c53077c1609f198a5cfbbf1f54ac793e9d0991addfc
68 +MISC metadata.xml 708 SHA256 e17f2240f57d74f8847e7bbf4e3cf44fdcd3ab3f610e0a66eb186d2a598178be SHA512 0d26c0593b156cc5764ad03c64e9b2a724b3877e348787d57818aec6b32f995951a9c0976a92d6ba824a2a5983d0c88116b9d335e51ba0e3c7b8f89e579482ba WHIRLPOOL 2ab4758748cf6d83d1a3a1d2f5f9472825a01affe5c7fdf8cd78fb9c75a1abaf18d8895fce12c7c502453caf68dd40799f47cce502804c9ec60705af2bb4f388
69
70 diff --git a/sys-apps/busybox/busybox-1.21.0-r99.ebuild b/sys-apps/busybox/busybox-1.21.0-r99.ebuild
71 new file mode 100644
72 index 0000000..57c2bb4
73 --- /dev/null
74 +++ b/sys-apps/busybox/busybox-1.21.0-r99.ebuild
75 @@ -0,0 +1,304 @@
76 +# Copyright 1999-2013 Gentoo Foundation
77 +# Distributed under the terms of the GNU General Public License v2
78 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/busybox-1.21.0.ebuild,v 1.21 2013/09/14 10:38:45 ago Exp $
79 +
80 +# See `man savedconfig.eclass` for info on how to use USE=savedconfig.
81 +
82 +EAPI="4"
83 +inherit eutils flag-o-matic savedconfig toolchain-funcs multilib
84 +
85 +DESCRIPTION="Utilities for rescue and embedded systems"
86 +HOMEPAGE="http://www.busybox.net/"
87 +if [[ ${PV} == "9999" ]] ; then
88 + MY_P=${PN}
89 + EGIT_REPO_URI="git://busybox.net/busybox.git"
90 + inherit git-2
91 +else
92 + MY_P=${PN}-${PV/_/-}
93 + SRC_URI="http://www.busybox.net/downloads/${MY_P}.tar.bz2"
94 + KEYWORDS="amd64 arm x86"
95 +fi
96 +
97 +LICENSE="GPL-2"
98 +SLOT="0"
99 +
100 +IUSE="ipv6 livecd make-symlinks math mdev -pam selinux sep-usr +static syslog systemd"
101 +RESTRICT="test"
102 +
103 +RDEPEND="!static? ( selinux? ( sys-libs/libselinux ) )
104 + pam? ( sys-libs/pam )"
105 +DEPEND="${RDEPEND}
106 + static? ( selinux? ( sys-libs/libselinux[static-libs(+)] ) )
107 + >=sys-kernel/linux-headers-2.6.39"
108 +
109 +S=${WORKDIR}/${MY_P}
110 +
111 +busybox_config_option() {
112 + local flag=$1 ; shift
113 + if [[ ${flag} != [yn] ]] ; then
114 + busybox_config_option $(usex ${flag} y n) "$@"
115 + return
116 + fi
117 + while [[ $# -gt 0 ]] ; do
118 + if [[ ${flag} == "y" ]] ; then
119 + sed -i -e "s:.*\<CONFIG_$1\>.*set:CONFIG_$1=y:g" .config
120 + else
121 + sed -i -e "s:CONFIG_$1=y:# CONFIG_$1 is not set:g" .config
122 + fi
123 + einfo $(grep "CONFIG_$1[= ]" .config || echo Could not find CONFIG_$1 ...)
124 + shift
125 + done
126 +}
127 +
128 +busybox_config_enabled() {
129 + local val=$(sed -n "/^CONFIG_$1=/s:^[^=]*=::p" .config)
130 + case ${val} in
131 + "") return 1 ;;
132 + y) return 0 ;;
133 + *) echo "${val}" | sed -r 's:^"(.*)"$:\1:' ;;
134 + esac
135 +}
136 +
137 +src_prepare() {
138 + unset KBUILD_OUTPUT #88088
139 + append-flags -fno-strict-aliasing #310413
140 + use ppc64 && append-flags -mminimal-toc #130943
141 +
142 + # patches go here!
143 + epatch "${FILESDIR}"/${PN}-1.19.0-bb.patch
144 + epatch "${FILESDIR}"/${P}-*.patch
145 + cp "${FILESDIR}"/ginit.c init/ || die
146 +
147 + # flag cleanup
148 + sed -i -r \
149 + -e 's:[[:space:]]?-(Werror|Os|falign-(functions|jumps|loops|labels)=1|fomit-frame-pointer)\>::g' \
150 + Makefile.flags || die
151 + #sed -i '/bbsh/s:^//::' include/applets.h
152 + sed -i '/^#error Aborting compilation./d' applets/applets.c || die
153 + use elibc_glibc && sed -i 's:-Wl,--gc-sections::' Makefile
154 + sed -i \
155 + -e "/^CROSS_COMPILE/s:=.*:= ${CHOST}-:" \
156 + -e "/^AR\>/s:=.*:= $(tc-getAR):" \
157 + -e "/^CC\>/s:=.*:= $(tc-getCC):" \
158 + -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
159 + -e "/^PKG_CONFIG\>/s:=.*:= $(tc-getPKG_CONFIG):" \
160 + Makefile || die
161 + sed -i \
162 + -e 's:-static-libgcc::' \
163 + Makefile.flags || die
164 +}
165 +
166 +src_configure() {
167 + # check for a busybox config before making one of our own.
168 + # if one exist lets return and use it.
169 +
170 + restore_config .config
171 + if [ -f .config ]; then
172 + yes "" | emake -j1 oldconfig > /dev/null
173 + return 0
174 + else
175 + ewarn "Could not locate user configfile, so we will save a default one"
176 + fi
177 +
178 + # setup the config file
179 + emake -j1 allyesconfig > /dev/null
180 + # nommu forces a bunch of things off which we want on #387555
181 + busybox_config_option n NOMMU
182 + sed -i '/^#/d' .config
183 + yes "" | emake -j1 oldconfig >/dev/null
184 +
185 + # now turn off stuff we really don't want
186 + busybox_config_option n DMALLOC
187 + busybox_config_option n FEATURE_SUID_CONFIG
188 + busybox_config_option n BUILD_AT_ONCE
189 + busybox_config_option n BUILD_LIBBUSYBOX
190 + busybox_config_option n FEATURE_CLEAN_UP
191 + busybox_config_option n MONOTONIC_SYSCALL
192 + busybox_config_option n USE_PORTABLE_CODE
193 + busybox_config_option n WERROR
194 +
195 + # turn off some options causing trouble with musl
196 + busybox_config_option n EXTRA_COMPAT
197 + busybox_config_option n FEATURE_VI_REGEX_SEARCH
198 + busybox_config_option n IFPLUGD
199 +
200 + # If these are not set and we are using a uclibc/busybox setup
201 + # all calls to system() will fail.
202 + busybox_config_option y ASH
203 + busybox_config_option n HUSH
204 +
205 + # disable ipv6 applets
206 + if ! use ipv6; then
207 + busybox_config_option n FEATURE_IPV6
208 + busybox_config_option n TRACEROUTE6
209 + busybox_config_option n PING6
210 + fi
211 +
212 + if use static && use pam ; then
213 + ewarn "You cannot have USE='static pam'. Assuming static is more important."
214 + fi
215 + busybox_config_option $(usex static n pam) PAM
216 + busybox_config_option static STATIC
217 + busybox_config_option syslog {K,SYS}LOGD LOGGER
218 + busybox_config_option systemd FEATURE_SYSTEMD
219 + busybox_config_option math FEATURE_AWK_LIBM
220 +
221 + # all the debug options are compiler related, so punt them
222 + busybox_config_option n DEBUG
223 + busybox_config_option y NO_DEBUG_LIB
224 + busybox_config_option n DMALLOC
225 + busybox_config_option n EFENCE
226 +
227 + busybox_config_option selinux SELINUX
228 +
229 + # this opt only controls mounting with <linux-2.6.23
230 + busybox_config_option n FEATURE_MOUNT_NFS
231 +
232 + # default a bunch of uncommon options to off
233 + local opt
234 + for opt in \
235 + ADD_SHELL \
236 + BEEP BOOTCHARTD \
237 + CRONTAB \
238 + DC DEVFSD DNSD DPKG{,_DEB} \
239 + FAKEIDENTD FBSPLASH FOLD FSCK_MINIX FTP{GET,PUT} \
240 + FEATURE_DEVFS \
241 + HOSTID HUSH \
242 + INETD INOTIFYD IPCALC \
243 + LOCALE_SUPPORT LOGNAME LPD \
244 + MAKEMIME MKFS_MINIX MSH \
245 + OD \
246 + RDEV READPROFILE REFORMIME REMOVE_SHELL RFKILL RUN_PARTS RUNSV{,DIR} \
247 + SLATTACH SMEMCAP SULOGIN SV{,LOGD} \
248 + TASKSET TCPSVD \
249 + RPM RPM2CPIO \
250 + UDPSVD UUDECODE UUENCODE
251 + do
252 + busybox_config_option n ${opt}
253 + done
254 +
255 + emake -j1 oldconfig > /dev/null
256 +}
257 +
258 +src_compile() {
259 + unset KBUILD_OUTPUT #88088
260 + export SKIP_STRIP=y
261 +
262 + emake V=1 busybox
263 +}
264 +
265 +src_install() {
266 + unset KBUILD_OUTPUT #88088
267 + save_config .config
268 +
269 + into /
270 + dodir /bin
271 + if use sep-usr ; then
272 + # install /ginit to take care of mounting stuff
273 + exeinto /
274 + newexe busybox_unstripped ginit
275 + dosym /ginit /bin/bb
276 + dosym bb /bin/busybox
277 + else
278 + newbin busybox_unstripped busybox
279 + dosym busybox /bin/bb
280 + fi
281 + if use mdev ; then
282 + dodir /$(get_libdir)/mdev/
283 + use make-symlinks || dosym /bin/bb /sbin/mdev
284 + cp "${S}"/examples/mdev_fat.conf "${ED}"/etc/mdev.conf
285 +
286 + exeinto /$(get_libdir)/mdev/
287 + doexe "${FILESDIR}"/mdev/*
288 +
289 + newinitd "${FILESDIR}"/mdev.rc.1 mdev
290 + fi
291 + if use livecd ; then
292 + dosym busybox /bin/vi
293 + fi
294 +
295 + # add busybox daemon's, bug #444718
296 + if busybox_config_enabled FEATURE_NTPD_SERVER; then
297 + newconfd "${FILESDIR}/ntpd.confd" "busybox-ntpd"
298 + newinitd "${FILESDIR}/ntpd.initd" "busybox-ntpd"
299 + fi
300 + if busybox_config_enabled SYSLOGD; then
301 + newconfd "${FILESDIR}/syslogd.confd" "busybox-syslogd"
302 + newinitd "${FILESDIR}/syslogd.initd" "busybox-syslogd"
303 + fi
304 + if busybox_config_enabled KLOGD; then
305 + newconfd "${FILESDIR}/klogd.confd" "busybox-klogd"
306 + newinitd "${FILESDIR}/klogd.initd" "busybox-klogd"
307 + fi
308 + if busybox_config_enabled WATCHDOG; then
309 + newconfd "${FILESDIR}/watchdog.confd" "busybox-watchdog"
310 + newinitd "${FILESDIR}/watchdog.initd" "busybox-watchdog"
311 + fi
312 + if busybox_config_enabled UDHCPC; then
313 + local path=$(busybox_config_enabled UDHCPC_DEFAULT_SCRIPT)
314 + exeinto "${path%/*}"
315 + newexe examples/udhcp/simple.script "${path##*/}"
316 + fi
317 + if busybox_config_enabled UDHCPD; then
318 + insinto /etc
319 + doins examples/udhcp/udhcpd.conf
320 + fi
321 +
322 + # bundle up the symlink files for use later
323 + emake DESTDIR="${ED}" install
324 + rm _install/bin/busybox
325 + # for compatibility, provide /usr/bin/env
326 + mkdir -p _install/usr/bin
327 + ln -s /bin/env _install/usr/bin/env
328 + tar cf busybox-links.tar -C _install . || : #;die
329 + insinto /usr/share/${PN}
330 + use make-symlinks && doins busybox-links.tar
331 +
332 + dodoc AUTHORS README TODO
333 +
334 + cd docs
335 + docinto txt
336 + dodoc *.txt
337 + docinto pod
338 + dodoc *.pod
339 + dohtml *.html
340 +
341 + cd ../examples
342 + docinto examples
343 + dodoc inittab depmod.pl *.conf *.script undeb unrpm
344 +}
345 +
346 +pkg_preinst() {
347 + if use make-symlinks && [[ ! ${VERY_BRAVE_OR_VERY_DUMB} == "yes" ]] && [[ ${ROOT} == "/" ]] ; then
348 + ewarn "setting USE=make-symlinks and emerging to / is very dangerous."
349 + ewarn "it WILL overwrite lots of system programs like: ls bash awk grep (bug 60805 for full list)."
350 + ewarn "If you are creating a binary only and not merging this is probably ok."
351 + ewarn "set env VERY_BRAVE_OR_VERY_DUMB=yes if this is really what you want."
352 + die "silly options will destroy your system"
353 + fi
354 +
355 + if use make-symlinks ; then
356 + mv "${ED}"/usr/share/${PN}/busybox-links.tar "${T}"/ || die
357 + fi
358 +}
359 +
360 +pkg_postinst() {
361 + savedconfig_pkg_postinst
362 +
363 + if use make-symlinks ; then
364 + cd "${T}" || die
365 + mkdir _install
366 + tar xf busybox-links.tar -C _install || die
367 + cp -vpPR _install/* "${ROOT}"/ || die "copying links for ${x} failed"
368 + fi
369 +
370 + if use sep-usr ; then
371 + elog "In order to use the sep-usr support, you have to update your"
372 + elog "kernel command line. Add the option:"
373 + elog " init=/ginit"
374 + elog "To launch a different init than /sbin/init, use:"
375 + elog " init=/ginit /sbin/yourinit"
376 + elog "To get a rescue shell, you may boot with:"
377 + elog " init=/ginit bb"
378 + fi
379 +}
380
381 diff --git a/sys-apps/busybox/files/busybox-1.19.0-bb.patch b/sys-apps/busybox/files/busybox-1.19.0-bb.patch
382 new file mode 100644
383 index 0000000..a66b45a
384 --- /dev/null
385 +++ b/sys-apps/busybox/files/busybox-1.19.0-bb.patch
386 @@ -0,0 +1,22 @@
387 +--- a/shell/ash.c
388 ++++ b/shell/ash.c
389 +@@ -75,6 +75,8 @@
390 + //applet:IF_ASH(APPLET(ash, BB_DIR_BIN, BB_SUID_DROP))
391 + //applet:IF_FEATURE_SH_IS_ASH(APPLET_ODDNAME(sh, ash, BB_DIR_BIN, BB_SUID_DROP, sh))
392 + //applet:IF_FEATURE_BASH_IS_ASH(APPLET_ODDNAME(bash, ash, BB_DIR_BIN, BB_SUID_DROP, bash))
393 ++//applet:IF_ASH(APPLET_ODDNAME(bb, ash, BB_DIR_BIN, BB_SUID_DROP, ash))
394 ++//applet:IF_ASH(APPLET_ODDNAME(bbsh, ash, BB_DIR_BIN, BB_SUID_DROP, ash))
395 +
396 + //kbuild:lib-$(CONFIG_ASH) += ash.o ash_ptr_hack.o shell_common.o
397 + //kbuild:lib-$(CONFIG_ASH_RANDOM_SUPPORT) += random.o
398 +--- a/shell/ash.c
399 ++++ b/shell/ash.c
400 +@@ -7255,6 +7255,8 @@
401 + }
402 + /* re-exec ourselves with the new arguments */
403 + execve(bb_busybox_exec_path, argv, envp);
404 ++ execve("/bin/busybox.static", argv, envp);
405 ++ execve("/bin/busybox", argv, envp);
406 + /* If they called chroot or otherwise made the binary no longer
407 + * executable, fall through */
408 + }
409
410 diff --git a/sys-apps/busybox/files/busybox-1.21.0-ifconfig.patch b/sys-apps/busybox/files/busybox-1.21.0-ifconfig.patch
411 new file mode 100644
412 index 0000000..bc74904
413 --- /dev/null
414 +++ b/sys-apps/busybox/files/busybox-1.21.0-ifconfig.patch
415 @@ -0,0 +1,11 @@
416 +--- a/busybox-1.21.0/networking/ifconfig.c
417 ++++ b/busybox-1.21.0/networking/ifconfig.c
418 +@@ -56,7 +56,7 @@
419 + #endif
420 +
421 + #if ENABLE_FEATURE_IFCONFIG_SLIP
422 +-# include <net/if_slip.h>
423 ++# include <linux/if_slip.h>
424 + #endif
425 +
426 + /* I don't know if this is needed for busybox or not. Anyone? */
427
428 diff --git a/sys-apps/busybox/files/busybox-1.21.0-iplink.patch b/sys-apps/busybox/files/busybox-1.21.0-iplink.patch
429 new file mode 100644
430 index 0000000..80d8e5d
431 --- /dev/null
432 +++ b/sys-apps/busybox/files/busybox-1.21.0-iplink.patch
433 @@ -0,0 +1,12 @@
434 +--- a/busybox-1.21.0/networking/libiproute/iplink.c
435 ++++ b/busybox-1.21.0/networking/libiproute/iplink.c
436 +@@ -5,8 +5,7 @@
437 + * Licensed under GPLv2 or later, see file LICENSE in this source tree.
438 + */
439 + #include <net/if.h>
440 +-#include <net/if_packet.h>
441 +-#include <netpacket/packet.h>
442 ++#include <linux/if_packet.h>
443 + #include <netinet/if_ether.h>
444 +
445 + #include "ip_common.h" /* #include "libbb.h" is inside */
446
447 diff --git a/sys-apps/busybox/files/busybox-1.21.0-mdev.patch b/sys-apps/busybox/files/busybox-1.21.0-mdev.patch
448 new file mode 100644
449 index 0000000..cb873fa
450 --- /dev/null
451 +++ b/sys-apps/busybox/files/busybox-1.21.0-mdev.patch
452 @@ -0,0 +1,35 @@
453 +--- busybox-1.21.0/util-linux/mdev.c
454 ++++ busybox-1.21.0-mdev/util-linux/mdev.c
455 +@@ -661,6 +661,8 @@ static void make_device(char *device_nam
456 + if (mknod(node_name, rule->mode | type, makedev(major, minor)) && errno != EEXIST)
457 + bb_perror_msg("can't create '%s'", node_name);
458 + if (ENABLE_FEATURE_MDEV_CONF) {
459 ++ if (G.verbose)
460 ++ bb_error_msg("chmod: %o chown: %u:%u", rule->mode, rule->ugid.uid, rule->ugid.gid);
461 + chmod(node_name, rule->mode);
462 + chown(node_name, rule->ugid.uid, rule->ugid.gid);
463 + }
464 +@@ -813,6 +815,7 @@ static void load_firmware(const char *fi
465 + full_write(loading_fd, "-1", 2);
466 +
467 + out:
468 ++ xchdir("/dev");
469 + if (ENABLE_FEATURE_CLEAN_UP) {
470 + close(firmware_fd);
471 + close(loading_fd);
472 +@@ -919,11 +922,13 @@ int mdev_main(int argc UNUSED_PARAM, cha
473 + }
474 +
475 + {
476 +- int logfd = open("/dev/mdev.log", O_WRONLY | O_APPEND);
477 ++ int logfd = open("mdev.log", O_WRONLY | O_APPEND);
478 + if (logfd >= 0) {
479 + xmove_fd(logfd, STDERR_FILENO);
480 + G.verbose = 1;
481 +- bb_error_msg("seq: %s action: %s", seq, action);
482 ++ if (seq)
483 ++ applet_name = xasprintf("%s[%s]", applet_name, seq);
484 ++ bb_error_msg("action: %s", action);
485 + }
486 + }
487 +
488
489 diff --git a/sys-apps/busybox/files/busybox-1.21.0-platform.patch b/sys-apps/busybox/files/busybox-1.21.0-platform.patch
490 new file mode 100644
491 index 0000000..9be6cb8
492 --- /dev/null
493 +++ b/sys-apps/busybox/files/busybox-1.21.0-platform.patch
494 @@ -0,0 +1,24 @@
495 +--- busybox-1.21.0/archival/libarchive/decompress_unxz.c
496 ++++ busybox-1.21.0-platform/archival/libarchive/decompress_unxz.c
497 +@@ -30,8 +30,8 @@ static uint32_t xz_crc32(const uint8_t *
498 + /* We use arch-optimized unaligned accessors */
499 + #define get_unaligned_le32(buf) ({ uint32_t v; move_from_unaligned32(v, buf); SWAP_LE32(v); })
500 + #define get_unaligned_be32(buf) ({ uint32_t v; move_from_unaligned32(v, buf); SWAP_BE32(v); })
501 +-#define put_unaligned_le32(val, buf) move_to_unaligned16(buf, SWAP_LE32(val))
502 +-#define put_unaligned_be32(val, buf) move_to_unaligned16(buf, SWAP_BE32(val))
503 ++#define put_unaligned_le32(val, buf) move_to_unaligned32(buf, SWAP_LE32(val))
504 ++#define put_unaligned_be32(val, buf) move_to_unaligned32(buf, SWAP_BE32(val))
505 +
506 + #include "unxz/xz_dec_bcj.c"
507 + #include "unxz/xz_dec_lzma2.c"
508 +--- busybox-1.21.0/include/platform.h
509 ++++ busybox-1.21.0-platform/include/platform.h
510 +@@ -228,7 +228,7 @@ typedef uint32_t bb__aliased_uint32_t FI
511 + # define move_from_unaligned32(v, u32p) (memcpy(&(v), (u32p), 4))
512 + # define move_to_unaligned16(u16p, v) do { \
513 + uint16_t __t = (v); \
514 +- memcpy((u16p), &__t, 4); \
515 ++ memcpy((u16p), &__t, 2); \
516 + } while (0)
517 + # define move_to_unaligned32(u32p, v) do { \
518 + uint32_t __t = (v); \
519
520 diff --git a/sys-apps/busybox/files/busybox-1.21.0-xz.patch b/sys-apps/busybox/files/busybox-1.21.0-xz.patch
521 new file mode 100644
522 index 0000000..56ba1a2
523 --- /dev/null
524 +++ b/sys-apps/busybox/files/busybox-1.21.0-xz.patch
525 @@ -0,0 +1,84 @@
526 +--- busybox-1.21.0/archival/libarchive/decompress_unxz.c
527 ++++ busybox-1.21.0-xz/archival/libarchive/decompress_unxz.c
528 +@@ -40,6 +40,7 @@ static uint32_t xz_crc32(const uint8_t *
529 + IF_DESKTOP(long long) int FAST_FUNC
530 + unpack_xz_stream(transformer_aux_data_t *aux, int src_fd, int dst_fd)
531 + {
532 ++ enum xz_ret xz_result;
533 + struct xz_buf iobuf;
534 + struct xz_dec *state;
535 + unsigned char *membuf;
536 +@@ -63,9 +64,8 @@ unpack_xz_stream(transformer_aux_data_t
537 + /* Limit memory usage to about 64 MiB. */
538 + state = xz_dec_init(XZ_DYNALLOC, 64*1024*1024);
539 +
540 ++ xz_result = X_OK;
541 + while (1) {
542 +- enum xz_ret r;
543 +-
544 + if (iobuf.in_pos == iobuf.in_size) {
545 + int rd = safe_read(src_fd, membuf, BUFSIZ);
546 + if (rd < 0) {
547 +@@ -73,28 +73,57 @@ unpack_xz_stream(transformer_aux_data_t
548 + total = -1;
549 + break;
550 + }
551 ++ if (rd == 0 && xz_result == XZ_STREAM_END)
552 ++ break;
553 + iobuf.in_size = rd;
554 + iobuf.in_pos = 0;
555 + }
556 ++ if (xz_result == XZ_STREAM_END) {
557 ++ /*
558 ++ * Try to start decoding next concatenated stream.
559 ++ * Stream padding must always be a multiple of four
560 ++ * bytes to preserve four-byte alignment. To keep the
561 ++ * code slightly smaller, we aren't as strict here as
562 ++ * the .xz spec requires. We just skip all zero-bytes
563 ++ * without checking the alignment and thus can accept
564 ++ * files that aren't valid, e.g. the XZ utils test
565 ++ * files bad-0pad-empty.xz and bad-0catpad-empty.xz.
566 ++ */
567 ++ do {
568 ++ if (membuf[iobuf.in_pos] != 0) {
569 ++ xz_dec_reset(state);
570 ++ goto do_run;
571 ++ }
572 ++ iobuf.in_pos++;
573 ++ } while (iobuf.in_pos < iobuf.in_size);
574 ++ }
575 ++ do_run:
576 + // bb_error_msg(">in pos:%d size:%d out pos:%d size:%d",
577 + // iobuf.in_pos, iobuf.in_size, iobuf.out_pos, iobuf.out_size);
578 +- r = xz_dec_run(state, &iobuf);
579 ++ xz_result = xz_dec_run(state, &iobuf);
580 + // bb_error_msg("<in pos:%d size:%d out pos:%d size:%d r:%d",
581 +-// iobuf.in_pos, iobuf.in_size, iobuf.out_pos, iobuf.out_size, r);
582 ++// iobuf.in_pos, iobuf.in_size, iobuf.out_pos, iobuf.out_size, xz_result);
583 + if (iobuf.out_pos) {
584 + xwrite(dst_fd, iobuf.out, iobuf.out_pos);
585 + IF_DESKTOP(total += iobuf.out_pos;)
586 + iobuf.out_pos = 0;
587 + }
588 +- if (r == XZ_STREAM_END) {
589 +- break;
590 ++ if (xz_result == XZ_STREAM_END) {
591 ++ /*
592 ++ * Can just "break;" here, if not for concatenated
593 ++ * .xz streams.
594 ++ * Checking for padding may require buffer
595 ++ * replenishment. Can't do it here.
596 ++ */
597 ++ continue;
598 + }
599 +- if (r != XZ_OK && r != XZ_UNSUPPORTED_CHECK) {
600 ++ if (xz_result != XZ_OK && xz_result != XZ_UNSUPPORTED_CHECK) {
601 + bb_error_msg("corrupted data");
602 + total = -1;
603 + break;
604 + }
605 + }
606 ++
607 + xz_dec_end(state);
608 + free(membuf);
609 +
610
611 diff --git a/sys-apps/busybox/files/ginit.c b/sys-apps/busybox/files/ginit.c
612 new file mode 100644
613 index 0000000..de98e4a
614 --- /dev/null
615 +++ b/sys-apps/busybox/files/ginit.c
616 @@ -0,0 +1,124 @@
617 +/*
618 + * simple init to bootstrap sep-/usr
619 + *
620 + * Copyright (C) 2012-2013 Mike Frysinger <vapier@g.o>
621 + *
622 + * Licensed under GPLv2 or later
623 + */
624 +
625 +//applet:IF_GINIT(APPLET(ginit, BB_DIR_SBIN, BB_SUID_DROP))
626 +
627 +//kbuild:lib-$(CONFIG_GINIT) += ginit.o
628 +
629 +//config:config GINIT
630 +//config: bool "ginit"
631 +//config: default y
632 +//config: select MKDIR
633 +//config: select MDEV
634 +//config: select MOUNT
635 +//config: select MOUNTPOINT
636 +//config: help
637 +//config: sep-/usr bootstrapper
638 +
639 +//usage:#define ginit_trivial_usage NOUSAGE_STR
640 +//usage:#define ginit_full_usage ""
641 +
642 +#include "libbb.h"
643 +
644 +#define eprintf(fmt, args...) printf("%s" fmt, "sep-usr init: ", ## args)
645 +
646 +static void process_args(char **args)
647 +{
648 + size_t i;
649 +
650 + eprintf("running: ");
651 + for (i = 0; args[i]; ++i) {
652 + /* String needs to be writable, so dupe it */
653 + args[i] = xstrdup(args[i]);
654 + printf("'%s' ", args[i]);
655 + }
656 + printf("\n");
657 +}
658 +
659 +int ginit_main(int argc UNUSED_PARAM, char **argv) MAIN_EXTERNALLY_VISIBLE;
660 +int ginit_main(int argc UNUSED_PARAM, char **argv)
661 +{
662 + FILE *mntlist;
663 + bool ismnted_dev, ismnted_sys, ismnted_usr;
664 + struct mntent *mntent;
665 +
666 + /*
667 + int fd = open("/dev/console", O_RDWR);
668 + if (fd >= 0) {
669 + dup2(fd, 0);
670 + dup2(fd, 1);
671 + dup2(fd, 2);
672 + }
673 + */
674 +
675 + /* If given an argv[] with an applet name, run it instead.
676 + * Makes recovering simple by doing: init=/ginit bb
677 + */
678 + if (argv[1] && argv[1][0] != '/') {
679 + eprintf("running user requested applet %s\n", argv[1]);
680 + return spawn_and_wait(argv+1);
681 + }
682 +
683 +#define saw(argv...) \
684 + ({ \
685 + static const char *args[] = { argv, NULL }; \
686 + /* These casts are fine -- see process_args for mem setup */ \
687 + process_args((void *)args); \
688 + spawn_and_wait((void *)args); \
689 + })
690 +
691 + /* First setup basic /dev */
692 + if (saw("mountpoint", "-q", "/dev") != 0) {
693 + /* Try /etc/fstab */
694 + if (saw("mount", "-n", "/dev"))
695 + /* Then devtmpfs */
696 + if (saw("mount", "-n", "-t", "devtmpfs", "devtmpfs", "/dev"))
697 + /* Finally normal tmpfs */
698 + saw("mount", "-n", "-t", "tmpfs", "dev", "/dev");
699 + } else {
700 + eprintf("%s appears to be mounted; skipping its setup\n", "/dev");
701 + }
702 +
703 + /* If /dev is empty (e.g. tmpfs), run mdev to seed things */
704 + if (access("/dev/console", F_OK) != 0) {
705 + if (saw("mountpoint", "-q", "/sys") != 0) {
706 + if (saw("mount", "-n", "/sys"))
707 + saw("mount", "-n", "-t", "sysfs", "sysfs", "/sys");
708 + } else {
709 + eprintf("%s appears to be mounted; skipping its setup\n", "/sys");
710 + }
711 +
712 + /* Mount /proc as mdev will fork+exec /proc/self/exe */
713 + if (saw("mountpoint", "-q", "/proc") != 0) {
714 + /* Try /etc/fstab */
715 + if (saw("mount", "-n", "/proc"))
716 + saw("mount", "-n", "-t", "proc", "proc", "/proc");
717 + }
718 +
719 + saw("mdev", "-s");
720 + }
721 +
722 + /* Then seed the stuff we care about */
723 + saw("mkdir", "-p", "/dev/pts", "/dev/shm");
724 +
725 + /* Then mount /usr */
726 + if (saw("mountpoint", "-q", "/usr") != 0) {
727 + saw("mount", "-n", "/usr", "-o", "ro");
728 + } else {
729 + eprintf("%s appears to be mounted; skipping its setup\n", "/usr");
730 + }
731 +
732 + /* Now that we're all done, exec the real init */
733 + if (!argv[1]) {
734 + argv[0] = (void *)"/sbin/init";
735 + argv[1] = NULL;
736 + } else
737 + ++argv;
738 + process_args(argv);
739 + return execv(argv[0], argv);
740 +}
741
742 diff --git a/sys-apps/busybox/files/klogd.confd b/sys-apps/busybox/files/klogd.confd
743 new file mode 100644
744 index 0000000..4c16096
745 --- /dev/null
746 +++ b/sys-apps/busybox/files/klogd.confd
747 @@ -0,0 +1,9 @@
748 +# Config file for /etc/init.d/busybox-sysklogd
749 +
750 +# run "/sbin/klogd --help" to see all possible options.
751 +
752 +# activate if you need remote logging
753 +#rc_need="net"
754 +
755 +# send warnings and above to the console
756 +KLOGD_OPTS="-c 3"
757
758 diff --git a/sys-apps/busybox/files/klogd.initd b/sys-apps/busybox/files/klogd.initd
759 new file mode 100644
760 index 0000000..4c6dbbc
761 --- /dev/null
762 +++ b/sys-apps/busybox/files/klogd.initd
763 @@ -0,0 +1,12 @@
764 +#!/sbin/runscript
765 +# Copyright 1999-2012 Gentoo Foundation
766 +# Distributed under the terms of the GNU General Public License v2
767 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/files/klogd.initd,v 1.2 2012/12/21 03:15:28 blueness Exp $
768 +
769 +command="/bin/busybox klogd"
770 +command_args="${KLOGD_OPTS}"
771 +pidfile="/var/run/klogd.pid"
772 +
773 +depend() {
774 + need clock hostname
775 +}
776
777 diff --git a/sys-apps/busybox/files/mdev-start.sh b/sys-apps/busybox/files/mdev-start.sh
778 new file mode 100755
779 index 0000000..8784cd5
780 --- /dev/null
781 +++ b/sys-apps/busybox/files/mdev-start.sh
782 @@ -0,0 +1,125 @@
783 +# Copyright 1999-2008 Gentoo Foundation
784 +# Distributed under the terms of the GNU General Public License v2
785 +
786 +find_mdev()
787 +{
788 + if [ -x /sbin/mdev ] ; then
789 + echo "/sbin/mdev"
790 + else
791 + echo "/bin/busybox mdev"
792 + fi
793 +}
794 +
795 +populate_mdev()
796 +{
797 + # populate /dev with devices already found by the kernel
798 +
799 + if get_bootparam "nocoldplug" ; then
800 + RC_COLDPLUG="no"
801 + ewarn "Skipping mdev coldplug as requested in kernel cmdline"
802 + fi
803 +
804 + ebegin "Populating /dev with existing devices with mdev -s"
805 + $(find_mdev) -s
806 + eend $?
807 +
808 + return 0
809 +}
810 +
811 +seed_dev()
812 +{
813 + # Seed /dev with some things that we know we need
814 +
815 + # creating /dev/console and /dev/tty1 to be able to write
816 + # to $CONSOLE with/without bootsplash before mdev creates it
817 + [ -c /dev/console ] || mknod /dev/console c 5 1
818 + [ -c /dev/tty1 ] || mknod /dev/tty1 c 4 1
819 +
820 + # udevd will dup its stdin/stdout/stderr to /dev/null
821 + # and we do not want a file which gets buffered in ram
822 + [ -c /dev/null ] || mknod /dev/null c 1 3
823 +
824 + # copy over any persistant things
825 + if [ -d /lib/mdev/devices ] ; then
826 + cp -RPp /lib/mdev/devices/* /dev 2>/dev/null
827 + fi
828 +
829 + # Not provided by sysfs but needed
830 + ln -snf /proc/self/fd /dev/fd
831 + ln -snf fd/0 /dev/stdin
832 + ln -snf fd/1 /dev/stdout
833 + ln -snf fd/2 /dev/stderr
834 + [ -e /proc/kcore ] && ln -snf /proc/kcore /dev/core
835 +
836 + # Create problematic directories
837 + mkdir -p /dev/pts /dev/shm
838 +}
839 +
840 +mount_it_b1()
841 +{
842 + if [ "${RC_USE_FSTAB}" = "yes" ] ; then
843 + mntcmd=$(get_mount_fstab /dev)
844 + else
845 + unset mntcmd
846 + fi
847 + if [ -n "${mntcmd}" ] ; then
848 + try mount -n ${mntcmd}
849 + else
850 + if grep -Eq "[[:space:]]+tmpfs$" /proc/filesystems ; then
851 + mntcmd="tmpfs"
852 + else
853 + mntcmd="ramfs"
854 + fi
855 + # many video drivers require exec access in /dev #92921
856 + try mount -n -t "${mntcmd}" -o exec,nosuid,mode=0755 mdev /dev
857 + fi
858 +}
859 +mount_it_b2()
860 +{
861 + if fstabinfo --quiet /dev ; then
862 + mount -n /dev
863 + else
864 + # Some devices require exec, Bug #92921
865 + mount -n -t tmpfs -o "exec,nosuid,mode=0755,size=10M" mdev /dev
866 + fi
867 +}
868 +mount_it()
869 +{
870 + type fstabinfo && mount_it_b2 || mount_it_b1
871 +}
872 +
873 +main()
874 +{
875 + # Setup temporary storage for /dev
876 + ebegin "Mounting /dev for mdev"
877 + mount_it
878 + eend $?
879 +
880 + # Create a file so that our rc system knows it's still in sysinit.
881 + # Existance means init scripts will not directly run.
882 + # rc will remove the file when done with sysinit.
883 + touch /dev/.rcsysinit
884 +
885 + # Selinux lovin; /selinux should be mounted by selinux-patched init
886 + if [ -x /sbin/restorecon ] && [ -c /selinux/null ] ; then
887 + restorecon /dev > /selinux/null
888 + fi
889 +
890 + seed_dev
891 +
892 + # Setup hotplugging (if possible)
893 + if [ -e /proc/sys/kernel/hotplug ] ; then
894 + ebegin "Setting up proper hotplug agent"
895 + eindent
896 + einfo "Setting /sbin/mdev as hotplug agent ..."
897 + echo $(find_mdev) > /proc/sys/kernel/hotplug
898 + eoutdent
899 + eend 0
900 + fi
901 +
902 + populate_mdev
903 +}
904 +
905 +main
906 +
907 +# vim:ts=4
908
909 diff --git a/sys-apps/busybox/files/mdev.rc b/sys-apps/busybox/files/mdev.rc
910 new file mode 100755
911 index 0000000..5470404
912 --- /dev/null
913 +++ b/sys-apps/busybox/files/mdev.rc
914 @@ -0,0 +1,9 @@
915 +#!/sbin/runscript
916 +# Copyright 1999-2010 Gentoo Foundation
917 +# Distributed under the terms of the GNU General Public License v2
918 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/files/mdev.rc,v 1.1 2010/08/15 03:55:29 vapier Exp $
919 +
920 +start()
921 +{
922 + . /lib/rcscripts/addons/mdev-start.sh
923 +}
924
925 diff --git a/sys-apps/busybox/files/mdev.rc.1 b/sys-apps/busybox/files/mdev.rc.1
926 new file mode 100755
927 index 0000000..569d540
928 --- /dev/null
929 +++ b/sys-apps/busybox/files/mdev.rc.1
930 @@ -0,0 +1,98 @@
931 +#!/sbin/runscript
932 +# Copyright 1999-2012 Gentoo Foundation
933 +# Distributed under the terms of the GNU General Public License v2
934 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/files/mdev.rc.1,v 1.2 2012/09/26 21:25:23 robbat2 Exp $
935 +
936 +depend()
937 +{
938 + provide dev dev-mount
939 + need sysfs
940 +}
941 +
942 +find_mdev()
943 +{
944 + if [ -x /sbin/mdev ] ; then
945 + echo "/sbin/mdev"
946 + else
947 + echo "/bin/busybox mdev"
948 + fi
949 +}
950 +
951 +populate_mdev()
952 +{
953 + # populate /dev with devices already found by the kernel
954 +
955 + if get_bootparam "nocoldplug" ; then
956 + RC_COLDPLUG="no"
957 + ewarn "Skipping mdev coldplug as requested in kernel cmdline"
958 + fi
959 +
960 + ebegin "Populating /dev with existing devices with mdev -s"
961 + $(find_mdev) -s
962 + eend $?
963 +
964 + return 0
965 +}
966 +
967 +seed_dev()
968 +{
969 + # Seed /dev with some things that we know we need
970 +
971 + # creating /dev/console and /dev/tty1 to be able to write
972 + # to $CONSOLE with/without bootsplash before mdev creates it
973 + [ -c /dev/console ] || mknod /dev/console c 5 1
974 + [ -c /dev/tty1 ] || mknod /dev/tty1 c 4 1
975 +
976 + # udevd will dup its stdin/stdout/stderr to /dev/null
977 + # and we do not want a file which gets buffered in ram
978 + [ -c /dev/null ] || mknod /dev/null c 1 3
979 +
980 + # copy over any persistant things
981 + if [ -d /lib/mdev/devices ] ; then
982 + cp -RPp /lib/mdev/devices/* /dev 2>/dev/null
983 + fi
984 +
985 + # Not provided by sysfs but needed
986 + ln -snf /proc/self/fd /dev/fd
987 + ln -snf fd/0 /dev/stdin
988 + ln -snf fd/1 /dev/stdout
989 + ln -snf fd/2 /dev/stderr
990 + [ -e /proc/kcore ] && ln -snf /proc/kcore /dev/core
991 +
992 + # Create problematic directories
993 + mkdir -p /dev/pts /dev/shm
994 +}
995 +
996 +mount_it()
997 +{
998 + if fstabinfo --quiet /dev ; then
999 + mount -n /dev
1000 + else
1001 + # Some devices require exec, Bug #92921
1002 + mount -n -t tmpfs -o "exec,nosuid,mode=0755,size=10M" mdev /dev
1003 + fi
1004 +}
1005 +
1006 +start()
1007 +{
1008 + # Setup temporary storage for /dev
1009 + ebegin "Mounting /dev for mdev"
1010 + mount_it
1011 + eend $?
1012 +
1013 + # Create a file so that our rc system knows it's still in sysinit.
1014 + # Existance means init scripts will not directly run.
1015 + # rc will remove the file when done with sysinit.
1016 + touch /dev/.rcsysinit
1017 +
1018 + seed_dev
1019 +
1020 + # Setup hotplugging (if possible)
1021 + if [ -e /proc/sys/kernel/hotplug ] ; then
1022 + ebegin "Setting up mdev as hotplug agent"
1023 + echo $(find_mdev) > /proc/sys/kernel/hotplug
1024 + eend 0
1025 + fi
1026 +
1027 + populate_mdev
1028 +}
1029
1030 diff --git a/sys-apps/busybox/files/mdev/dvbdev b/sys-apps/busybox/files/mdev/dvbdev
1031 new file mode 100644
1032 index 0000000..f0186c1
1033 --- /dev/null
1034 +++ b/sys-apps/busybox/files/mdev/dvbdev
1035 @@ -0,0 +1,18 @@
1036 +#!/bin/sh
1037 +
1038 +# MDEV=dvb0.demux1 -> ADAPTER=dvb0 -> N=0
1039 +ADAPTER=${MDEV%.*}
1040 +N=${ADAPTER#dvb}
1041 +# MDEV=dvb0.demux1 -> DEVB_DEV=demux1
1042 +DVB_DEV=${MDEV#*.}
1043 +
1044 +case "$ACTION" in
1045 + add|"")
1046 + mkdir -p dvb/adapter${N}
1047 + mv ${MDEV} dvb/adapter${N}/${DVB_DEV}
1048 + ;;
1049 + remove)
1050 + rm -f dvb/adapter${N}/${DVB_DEV}
1051 + rmdir dvb/adapter${N} 2>/dev/null
1052 + rmdir dvb/ 2>/dev/null
1053 +esac
1054
1055 diff --git a/sys-apps/busybox/files/mdev/ide_links b/sys-apps/busybox/files/mdev/ide_links
1056 new file mode 100644
1057 index 0000000..be0c95a
1058 --- /dev/null
1059 +++ b/sys-apps/busybox/files/mdev/ide_links
1060 @@ -0,0 +1,23 @@
1061 +#!/bin/sh
1062 +
1063 +[ -f /proc/ide/$MDEV/media ] || exit
1064 +
1065 +media=`cat /proc/ide/$MDEV/media`
1066 +for i in $media $media[0-9]* ; do
1067 + if [ "`readlink $i 2>/dev/null`" = $MDEV ] ; then
1068 + LINK=$i
1069 + break
1070 + fi
1071 +done
1072 +
1073 +# link exist, remove if necessary and exit
1074 +if [ "$LINK" ] ; then
1075 + [ "$ACTION" = remove ] && rm $LINK
1076 + exit
1077 +fi
1078 +
1079 +# create a link
1080 +num=`ls $media[0-9]* 2>/dev/null | wc -l`
1081 +ln -sf $MDEV "$media`echo $num`"
1082 +[ -e "$media" ] || ln -sf $MDEV "$media"
1083 +
1084
1085 diff --git a/sys-apps/busybox/files/mdev/usbdev b/sys-apps/busybox/files/mdev/usbdev
1086 new file mode 100644
1087 index 0000000..ea5b915
1088 --- /dev/null
1089 +++ b/sys-apps/busybox/files/mdev/usbdev
1090 @@ -0,0 +1,62 @@
1091 +#!/bin/sh
1092 +
1093 +# script is buggy; until patched just do exit 0
1094 +#exit 0
1095 +
1096 +# add zeros to device or bus
1097 +add_zeros () {
1098 + case "$(echo $1 | wc -L)" in
1099 + 1) echo "00$1" ;;
1100 + 2) echo "0$1" ;;
1101 + *) echo "$1"
1102 + esac
1103 + exit 0
1104 +}
1105 +
1106 +
1107 +# bus and device dirs in /sys
1108 +USB_PATH=$(echo $MDEV | sed -e 's/usbdev\([0-9]\).[0-9]/usb\1/')
1109 +USB_PATH=$(find /sys/devices -type d -name "$USB_PATH")
1110 +USB_DEV_DIR=$(echo $MDEV | sed -e 's/usbdev\([0-9]\).\([0-9]\)/\1-\2/')
1111 +
1112 +# dir names in /dev
1113 +BUS=$(add_zeros $(echo $MDEV | sed -e 's/^usbdev\([0-9]\).[0-9]/\1/'))
1114 +USB_DEV=$(add_zeros $(echo $MDEV | sed -e 's/^usbdev[0-9].\([0-9]\)/\1/'))
1115 +
1116 +
1117 +# try to load the proper driver for usb devices
1118 +case "$ACTION" in
1119 + add|"")
1120 + # load usb bus driver
1121 + for i in $USB_PATH/*/modalias ; do
1122 + modprobe `cat $i` 2>/dev/null
1123 + done
1124 + # load usb device driver if existent
1125 + if [ -d $USB_PATH/$USB_DEV_DIR ]; then
1126 + for i in $USB_PATH/$USB_DEV_DIR/*/modalias ; do
1127 + modprobe `cat $i` 2>/dev/null
1128 + done
1129 + fi
1130 + # move usb device file
1131 + mkdir -p bus/usb/$BUS
1132 + mv $MDEV bus/usb/$BUS/$USB_DEV
1133 + ;;
1134 + remove)
1135 + # unload device driver, if device dir is existent
1136 + if [ -d $USB_PATH/$USB_DEV_DIR ]; then
1137 + for i in $USB_PATH/$USB_DEV_DIR/*/modalias ; do
1138 + modprobe -r `cat $i` 2>/dev/null
1139 + done
1140 + fi
1141 + # unload usb bus driver. Does this make sense?
1142 + # what happens, if two usb devices are plugged in
1143 + # and one is removed?
1144 + for i in $USB_PATH/*/modalias ; do
1145 + modprobe -r `cat $i` 2>/dev/null
1146 + done
1147 + # remove device file and possible empty dirs
1148 + rm -f bus/usb/$BUS/$USB_DEV
1149 + rmdir bus/usb/$BUS/ 2>/dev/null
1150 + rmdir bus/usb/ 2>/dev/null
1151 + rmdir bus/ 2>/dev/null
1152 +esac
1153
1154 diff --git a/sys-apps/busybox/files/mdev/usbdisk_link b/sys-apps/busybox/files/mdev/usbdisk_link
1155 new file mode 100644
1156 index 0000000..6bb0692
1157 --- /dev/null
1158 +++ b/sys-apps/busybox/files/mdev/usbdisk_link
1159 @@ -0,0 +1,34 @@
1160 +#!/bin/sh
1161 +
1162 +# NOTE: since mdev -s only provide $MDEV, don't depend on any hotplug vars.
1163 +
1164 +current=$(readlink usbdisk)
1165 +
1166 +if [ "$current" = "$MDEV" ] && [ "$ACTION" = "remove" ]; then
1167 + rm -f usbdisk usba1
1168 +fi
1169 +[ -n "$current" ] && exit
1170 +
1171 +if [ -e /sys/block/$MDEV ]; then
1172 + SYSDEV=$(readlink -f /sys/block/$MDEV/device)
1173 + # if /sys device path contains '/usb[0-9]' then we assume its usb
1174 + # also, if it's a usb without partitions we require FAT
1175 + if [ "${SYSDEV##*/usb[0-9]}" != "$SYSDEV" ]; then
1176 + # do not create link if there is not FAT
1177 + dd if=/dev/$MDEV bs=512 count=1 2>/dev/null | strings | grep FAT >/dev/null || exit 0
1178 +
1179 + ln -sf $MDEV usbdisk
1180 + # keep this for compat. people have it in fstab
1181 + ln -sf $MDEV usba1
1182 + fi
1183 +
1184 +elif [ -e /sys/block/*/$MDEV ] ; then
1185 + PARENT=$(dirname /sys/block/*/$MDEV)
1186 + SYSDEV=$(readlink -f $PARENT/device)
1187 + if [ "${SYSDEV##*/usb[0-9]}" != "$SYSDEV" ]; then
1188 + ln -sf $MDEV usbdisk
1189 + # keep this for compat. people have it in fstab
1190 + ln -sf $MDEV usba1
1191 + fi
1192 +fi
1193 +
1194
1195 diff --git a/sys-apps/busybox/files/ntpd.confd b/sys-apps/busybox/files/ntpd.confd
1196 new file mode 100644
1197 index 0000000..f50d4c2
1198 --- /dev/null
1199 +++ b/sys-apps/busybox/files/ntpd.confd
1200 @@ -0,0 +1,6 @@
1201 +# Config file for /etc/init.d/busybox-ntpd
1202 +
1203 +# run "/sbin/ntpd --help" to see all possible options.
1204 +
1205 +# Get time from specified server and run in background
1206 +NTPD_OPTS="-N -p pool.ntp.org"
1207
1208 diff --git a/sys-apps/busybox/files/ntpd.initd b/sys-apps/busybox/files/ntpd.initd
1209 new file mode 100644
1210 index 0000000..5a05c31
1211 --- /dev/null
1212 +++ b/sys-apps/busybox/files/ntpd.initd
1213 @@ -0,0 +1,13 @@
1214 +#!/sbin/runscript
1215 +# Copyright 1999-2012 Gentoo Foundation
1216 +# Distributed under the terms of the GNU General Public License v2
1217 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/files/ntpd.initd,v 1.2 2012/12/21 03:15:28 blueness Exp $
1218 +
1219 +command="/bin/busybox ntpd"
1220 +command_args="${NTPD_OPTS}"
1221 +pidfile="/var/run/ntpd.pid"
1222 +
1223 +depend() {
1224 + use net dns logger
1225 + after ntp-client
1226 +}
1227
1228 diff --git a/sys-apps/busybox/files/syslogd.confd b/sys-apps/busybox/files/syslogd.confd
1229 new file mode 100644
1230 index 0000000..7df6885
1231 --- /dev/null
1232 +++ b/sys-apps/busybox/files/syslogd.confd
1233 @@ -0,0 +1,9 @@
1234 +# Config file for /etc/init.d/busybox-sysklogd
1235 +
1236 +# run "/sbin/syslogd --help" to see all possible options.
1237 +
1238 +# activate if you need remote logging
1239 +#rc_need="net"
1240 +
1241 +# Log to shared mem buffer (use logread to read it)
1242 +SYSLOGD_OPTS="-C128"
1243
1244 diff --git a/sys-apps/busybox/files/syslogd.initd b/sys-apps/busybox/files/syslogd.initd
1245 new file mode 100644
1246 index 0000000..f14224a
1247 --- /dev/null
1248 +++ b/sys-apps/busybox/files/syslogd.initd
1249 @@ -0,0 +1,13 @@
1250 +#!/sbin/runscript
1251 +# Copyright 1999-2012 Gentoo Foundation
1252 +# Distributed under the terms of the GNU General Public License v2
1253 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/files/syslogd.initd,v 1.2 2012/12/21 03:15:28 blueness Exp $
1254 +
1255 +command="/bin/busybox syslogd"
1256 +command_args="${SYSLOGD_OPTS}"
1257 +pidfile="/var/run/syslogd.pid"
1258 +
1259 +depend() {
1260 + need clock hostname
1261 + provide logger
1262 +}
1263
1264 diff --git a/sys-apps/busybox/files/watchdog.confd b/sys-apps/busybox/files/watchdog.confd
1265 new file mode 100644
1266 index 0000000..bd6aec0
1267 --- /dev/null
1268 +++ b/sys-apps/busybox/files/watchdog.confd
1269 @@ -0,0 +1,9 @@
1270 +# Config file for /etc/init.d/busybox-watchdog
1271 +
1272 +# run "/sbin/watchdog --help" to see all possible options.
1273 +
1274 +# Periodically write to watchdog device
1275 +WATCHDOG_OPTS="/dev/watchdog"
1276 +
1277 +# optionally set the nice-level
1278 +#SSD_NICELEVEL="-20"
1279
1280 diff --git a/sys-apps/busybox/files/watchdog.initd b/sys-apps/busybox/files/watchdog.initd
1281 new file mode 100644
1282 index 0000000..214468a
1283 --- /dev/null
1284 +++ b/sys-apps/busybox/files/watchdog.initd
1285 @@ -0,0 +1,8 @@
1286 +#!/sbin/runscript
1287 +# Copyright 1999-2013 Gentoo Foundation
1288 +# Distributed under the terms of the GNU General Public License v2
1289 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/busybox/files/watchdog.initd,v 1.3 2013/04/27 07:47:23 vapier Exp $
1290 +
1291 +command="/bin/busybox watchdog"
1292 +command_args="${WATCHDOG_OPTS}"
1293 +pidfile="/var/run/watchdog.pid"
1294
1295 diff --git a/sys-apps/busybox/metadata.xml b/sys-apps/busybox/metadata.xml
1296 new file mode 100644
1297 index 0000000..72850fb
1298 --- /dev/null
1299 +++ b/sys-apps/busybox/metadata.xml
1300 @@ -0,0 +1,13 @@
1301 +<?xml version="1.0" encoding="UTF-8"?>
1302 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
1303 +<pkgmetadata>
1304 +<herd>embedded</herd>
1305 +<use>
1306 +<flag name="make-symlinks">Create all the appropriate symlinks in /bin and /sbin.</flag>
1307 +<flag name="math">Enable math support in gawk (requires libm)</flag>
1308 +<flag name="mdev">Create the appropriate symlink in /sbin and install mdev.conf and support files</flag>
1309 +<flag name="sep-usr">Support a separate /usr without needing an initramfs by booting with init=/ginit</flag>
1310 +<flag name="static">Make the system rescue shell (/bin/bb) static so you can recover even when glibc is broken</flag>
1311 +<flag name="systemd">Support systemd</flag>
1312 +</use>
1313 +</pkgmetadata>