Contents of /smage/trunk/core/busybox-initscripts/busybox-initscripts-0.7.6-r1.smage2
Parent Directory | Revision Log
Revision 3923 -
(show annotations)
(download)
Tue Jul 24 09:22:12 2012 UTC (11 years, 9 months ago) by niro
File size: 4436 byte(s)
Tue Jul 24 09:22:12 2012 UTC (11 years, 9 months ago) by niro
File size: 4436 byte(s)
-respect usr-move
1 | # $Id$ |
2 | |
3 | PNAME="busybox-initscripts" |
4 | PVER="0.7.6" |
5 | PBUILD="r1" |
6 | |
7 | PCAT="sys-apps" |
8 | |
9 | DESCRIPTION="Port of the Magellan Initscripts for busybox." |
10 | HOMEPAGE="http://magellan-linux.net/" |
11 | |
12 | # the pkgs "coreutils, findutils, sed, gawk, bzip2, tar, rsync, wget" |
13 | # are needed to fix the /etc/profile issue |
14 | DEPEND=">= sys-apps/busybox-1.20 |
15 | >= sys-apps/coreutils-8.17 |
16 | >= sys-apps/findutils-4.4 |
17 | >= virtual/grep |
18 | >= virtual/sed |
19 | >= sys-apps/gawk-3 |
20 | >= virtual/bzip2 |
21 | >= virtual/tar |
22 | >= net-misc/rsync-3 |
23 | >= virtual/wget |
24 | >= virtual/which |
25 | >= sys-apps/mage-release-0" |
26 | |
27 | SRCFILE="initscripts-${PVER}.tar.bz2" |
28 | SRCDIR="${BUILDDIR}/initscripts-${PVER}" |
29 | |
30 | sminclude mtools alx |
31 | |
32 | SRC_URI=( mirror://initscripts/${SRCFILE} ) |
33 | |
34 | src_prepare() |
35 | { |
36 | munpack ${SRCFILE} || die |
37 | } |
38 | |
39 | src_install() |
40 | { |
41 | cd ${SRCDIR} |
42 | make DESTDIR=${BINDIR} LIBDIR=/usr/lib SBINDIR=/usr/sbin install_busybox || die |
43 | |
44 | # CONFIG_PROTECT_MASK for /etc/rc.d/init.d |
45 | minstalldir /etc/env.d || die |
46 | MCONFIG="/etc/env.d/01initscripts" |
47 | mclearconfig || die |
48 | maddconfig 'CONFIG_PROTECT_MASK="/etc/rc.d/init.d"' || die |
49 | # always keep this files even if the user did not edited them |
50 | local config_protect_ignore |
51 | config_protect_ignore="/etc/fstab" |
52 | config_protect_ignore+=" /etc/group" |
53 | config_protect_ignore+=" /etc/hostname" |
54 | config_protect_ignore+=" /etc/hosts" |
55 | config_protect_ignore+=" /etc/inittab" |
56 | config_protect_ignore+=" /etc/passwd" |
57 | config_protect_ignore+=" /etc/shadow" |
58 | config_protect_ignore+=" /etc/conf.d/net.eth0" |
59 | config_protect_ignore+=" /etc/conf.d/net.routes" |
60 | config_protect_ignore+=" /etc/modules.autoload.d/kernel-2.4" |
61 | config_protect_ignore+=" /etc/modules.autoload.d/kernel-2.6" |
62 | config_protect_ignore+=" /etc/modules.autoload" |
63 | # add conf.d/kernel to protect current udev|mdev configuration |
64 | config_protect_ignore+=" /etc/conf.d/kernel" |
65 | maddconfig "CONFIG_PROTECT_IGNORE=\"${config_protect_ignore}\"" || die |
66 | |
67 | # always use udev on alx |
68 | sed -i 's:^\(RC_DEVICEMANAGER=\).*:\1udev:' ${BINDIR}/etc/conf.d/kernel || die |
69 | } |
70 | |
71 | preinstall() |
72 | { |
73 | add_conf_prot_mask /etc/env.d /etc/modprobe.d /etc/rc.d/init.d /etc/profile /etc/inputrc \ |
74 | /etc/shells /etc/issue /etc/DIR_COLORS /etc/inittab \ |
75 | /etc/conf.d/net.sample /etc/conf.d/kernel /etc/conf.d/rc /etc/conf.d/network |
76 | |
77 | add_conf_prot_ignore /etc/fstab /etc/group /etc/hostname /etc/hosts /etc/modules.autoload \ |
78 | /etc/passwd /etc/shadow /etc/conf.d/clock /etc/conf.d/editor /etc/conf.d/keymap \ |
79 | /etc/conf.d/net.routes |
80 | } |
81 | |
82 | postinstall() |
83 | { |
84 | # emulate seq; its needed to run rc-config |
85 | # this fixes some annyoing warning when building |
86 | # livecd or bootstrapping a system. |
87 | # this hack will be removed when the toolchain is fixed |
88 | if [ ! -f /usr/bin/seq ] |
89 | then |
90 | echo "Using fake 'seq' command ..." |
91 | seq() { |
92 | start=$1 |
93 | end=$2 |
94 | for ((i=start; i < end+1; i++)) |
95 | do |
96 | echo $i |
97 | done |
98 | } |
99 | export -f seq |
100 | fi |
101 | |
102 | # create service state dir mountpoint |
103 | # needed by >=initscripts-0.3.2-r1 |
104 | [ ! -d ${MROOT}/var/lib/init.d ] && install -d ${MROOT}/var/lib/init.d |
105 | |
106 | # mark this dir as undeletable |
107 | touch ${MROOT}/var/lib/init.d/.keep |
108 | |
109 | echo "Creating Runlevels ..." |
110 | local i |
111 | for i in cleanfs \ |
112 | loadkeys \ |
113 | localnet \ |
114 | modules \ |
115 | mountfs \ |
116 | network \ |
117 | setclock \ |
118 | swap |
119 | do |
120 | echo -e "\tAdded ${i} ..." |
121 | ${MROOT}/usr/sbin/rc-config del ${i} > /dev/null |
122 | ${MROOT}/usr/sbin/rc-config add ${i} > /dev/null |
123 | done |
124 | # delete these |
125 | for i in checkfs |
126 | do |
127 | echo -e "\rDeleted ${i} ..." |
128 | ${MROOT}/usr/sbin/rc-config del ${i} > /dev/null |
129 | done |
130 | |
131 | # |
132 | # do not ask the user about following files |
133 | # |
134 | # if they exist let config_protect process them |
135 | # but then remove the protected files, to keep only the original file |
136 | # |
137 | # don't do this if MAGE_BOOTSTRAP=true is set! |
138 | if [[ ${MAGE_BOOTSTRAP} = true ]] |
139 | then |
140 | echo "bootstrap phase - ignoring autocleanup" |
141 | else |
142 | # file-root is ${MROOT}/etc |
143 | local CONFIG_IGNORE="fstab group hostname hosts inittab passwd conf.d/net.eth0 modules.autoload.d/kernel-2.4 modules.autoload.d/kernel-2.6" |
144 | local i file path |
145 | for i in ${CONFIG_IGNORE} |
146 | do |
147 | file="$(basename ${i})" |
148 | path="$(dirname ${i})/" |
149 | [[ ${path} == ./ ]] && path="" |
150 | |
151 | rm -f ${MROOT}/etc/${path}._cfg????_${file} |
152 | done |
153 | fi |
154 | |
155 | # fix mtab |
156 | if [[ ! -L ${MROOT}/etc/mtab ]] || [[ $(readlink ${MROOT}/etc/mtab) != /proc/mounts ]] |
157 | then |
158 | ln -snf /proc/mounts ${MROOT}/etc/mtab |
159 | fi |
160 | |
161 | # remove /etc/modprobe.conf |
162 | if [[ -f ${MROOT}/etc/modprobe.conf ]] && [[ -d ${MROOT}/etc/modprobe.d ]] |
163 | then |
164 | rm ${MROOT}/etc/modprobe.conf |
165 | fi |
166 | } |