Annotation of /smage/trunk/core/busybox-initscripts/busybox-initscripts-0.7.1.3-r1.smage2
Parent Directory | Revision Log
Revision 1782 -
(hide annotations)
(download)
Fri Sep 23 16:00:58 2011 UTC (12 years, 8 months ago) by niro
File size: 3530 byte(s)
Fri Sep 23 16:00:58 2011 UTC (12 years, 8 months ago) by niro
File size: 3530 byte(s)
auto added: ver bump to 0.7.1.3-r1
1 | niro | 1782 | # $Id$ |
2 | |||
3 | PNAME="busybox-initscripts" | ||
4 | PVER="0.7.1.3" | ||
5 | PBUILD="r1" | ||
6 | |||
7 | PCATEGORIE="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.19 | ||
15 | >= sys-apps/coreutils-8.12 | ||
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}/initrscripts-${PVER}" | ||
29 | |||
30 | SRC_URI=( mirror://initscripts/${SRCFILE} ) | ||
31 | |||
32 | src_prepare() | ||
33 | { | ||
34 | munpack ${SRCFILE} || die | ||
35 | } | ||
36 | |||
37 | src_install() | ||
38 | { | ||
39 | cd ${SRCDIR} | ||
40 | make DESTDIR=${BINDIR} install_busybox || die | ||
41 | |||
42 | # CONFIG_PROTECT_MASK for /etc/rc.d/init.d | ||
43 | install -d ${BINDIR}/etc/env.d || die | ||
44 | echo "CONFIG_PROTECT_MASK=\"/etc/rc.d/init.d\"" > ${BINDIR}/etc/env.d/01initscripts || die | ||
45 | # always keep this files even if the user did not edited them | ||
46 | local config_protect_ignore | ||
47 | config_protect_ignore="/etc/fstab" | ||
48 | config_protect_ignore+=" /etc/group" | ||
49 | config_protect_ignore+=" /etc/hostname" | ||
50 | config_protect_ignore+=" /etc/hosts" | ||
51 | config_protect_ignore+=" /etc/inittab" | ||
52 | config_protect_ignore+=" /etc/passwd" | ||
53 | config_protect_ignore+=" /etc/shadow" | ||
54 | config_protect_ignore+=" /etc/conf.d/net.eth0" | ||
55 | config_protect_ignore+=" /etc/conf.d/net.routes" | ||
56 | config_protect_ignore+=" /etc/modules.autoload.d/kernel-2.4" | ||
57 | config_protect_ignore+=" /etc/modules.autoload.d/kernel-2.6" | ||
58 | config_protect_ignore+=" /etc/modules.autoload" | ||
59 | # add conf.d/kernel to protect current udev|mdev configuration | ||
60 | config_protect_ignore+=" /etc/conf.d/kernel" | ||
61 | echo "CONFIG_PROTECT_IGNORE=\"${config_protect_ignore}\"" >> ${BINDIR}/etc/env.d/01initscripts || die | ||
62 | } | ||
63 | |||
64 | postinstall() | ||
65 | { | ||
66 | # emulate seq; its needed to run rc-config | ||
67 | # this fixes some annyoing warning when building | ||
68 | # livecd or bootstrapping a system. | ||
69 | # this hack will be removed when the toolchain is fixed | ||
70 | if [ ! -f /usr/bin/seq ] | ||
71 | then | ||
72 | echo "Using fake 'seq' command ..." | ||
73 | seq() { | ||
74 | start=$1 | ||
75 | end=$2 | ||
76 | for ((i=start; i < end+1; i++)) | ||
77 | do | ||
78 | echo $i | ||
79 | done | ||
80 | } | ||
81 | export -f seq | ||
82 | fi | ||
83 | |||
84 | # create service state dir mountpoint | ||
85 | # needed by >=initscripts-0.3.2-r1 | ||
86 | [ ! -d ${MROOT}/var/lib/init.d ] && install -d ${MROOT}/var/lib/init.d | ||
87 | |||
88 | # mark this dir as undeletable | ||
89 | touch ${MROOT}/var/lib/init.d/.keep | ||
90 | |||
91 | echo "Creating Runlevels ..." | ||
92 | local i | ||
93 | for i in cleanfs \ | ||
94 | loadkeys \ | ||
95 | localnet \ | ||
96 | modules \ | ||
97 | mountfs \ | ||
98 | network \ | ||
99 | setclock \ | ||
100 | swap | ||
101 | do | ||
102 | echo -e "\tAdded ${i} ..." | ||
103 | ${MROOT}/sbin/rc-config del ${i} > /dev/null | ||
104 | ${MROOT}/sbin/rc-config add ${i} > /dev/null | ||
105 | done | ||
106 | # delete these | ||
107 | for i in checkfs | ||
108 | do | ||
109 | echo -e "\tDeleted ${i} ..." | ||
110 | ${MROOT}/sbin/rc-config del ${i} > /dev/null | ||
111 | done | ||
112 | |||
113 | # | ||
114 | # do not ask the user about following files | ||
115 | # | ||
116 | # if they exist let config_protect process them | ||
117 | # but then remove the protected files, to keep only the original file | ||
118 | # | ||
119 | # file-root is ${MROOT}/etc | ||
120 | 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" | ||
121 | local i file path | ||
122 | for i in ${CONFIG_IGNORE} | ||
123 | do | ||
124 | file="$(basename ${i})" | ||
125 | path="$(dirname ${i})/" | ||
126 | [[ ${path} == ./ ]] && path="" | ||
127 | |||
128 | rm -f ${MROOT}/etc/${path}._cfg????_${file} | ||
129 | done | ||
130 | |||
131 | # fix mtab | ||
132 | if [[ ! -L ${MROOT}/etc/mtab ]] || [[ $(readlink ${MROOT}/etc/mtab) != /proc/mounts ]] | ||
133 | then | ||
134 | ln -snf /proc/mounts ${MROOT}/etc/mtab | ||
135 | fi | ||
136 | } |