Magellan Linux

Contents of /smage/branches/alx-0_6_0/core/busybox-initscripts/busybox-initscripts-0.1.14-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1949 - (show annotations) (download)
Fri May 6 20:12:14 2011 UTC (13 years, 1 month ago) by niro
File size: 3990 byte(s)
-fixed dependencies
1 # $Id$
2
3 PNAME="busybox-initscripts"
4 PVER="0.1.14"
5 PBUILD="r1"
6
7 PCATEGORIE="sys-apps"
8 STATE="unstable"
9
10 DESCRIPTION="Port of the Magellan Initscripts for busybox."
11 HOMEPAGE="http://magellan-linux.net/"
12
13 # the pkgs "coreutils, findutils, sed, gawk, bzip2, tar, rsync, wget"
14 # are needed to fix the /etc/profile issue
15 DEPEND=">= sys-apps/busybox-1.17.4
16 >= sys-apps/sysvinit-2.88
17 >= sys-apps/coreutils-5
18 >= sys-apps/findutils-4
19 >= net-misc/rsync-2"
20
21 SRCFILE="${PNAME}-${PVER}.tar.bz2"
22 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
23
24 # fixes mageversion;
25 # the makefile uses the date as version number
26 # but for release we want to use the release version
27 RELEASE_MAGEVERSION=
28
29 SRC_URI=( mirror://${PNAME}/${SRCFILE} )
30
31 src_prepare()
32 {
33 munpack ${SRCFILE} || die
34 }
35
36 src_install()
37 {
38 cd ${SRCDIR}
39 make DESTDIR=${BINDIR} install || die
40
41 # CONFIG_PROTECT_MASK for /etc/rc.d/init.d
42 install -d ${BINDIR}/etc/env.d || die
43 echo "CONFIG_PROTECT_MASK=\"/etc/rc.d/init.d\"" > ${BINDIR}/etc/env.d/01initscripts || die
44 # always overwrite /etc/mageversion
45 echo 'CONFIG_PROTECT_MASK="/etc/mageversion"' >> ${BINDIR}/etc/env.d/01initscripts || die
46 # always keep this files even if the user did not edited them
47 local config_protect_ignore
48 config_protect_ignore="/etc/fstab"
49 config_protect_ignore+=" /etc/group"
50 config_protect_ignore+=" /etc/hostname"
51 config_protect_ignore+=" /etc/hosts"
52 config_protect_ignore+=" /etc/inittab"
53 config_protect_ignore+=" /etc/passwd"
54 config_protect_ignore+=" /etc/shadow"
55 config_protect_ignore+=" /etc/conf.d/net.eth0"
56 config_protect_ignore+=" /etc/conf.d/net.routes"
57 config_protect_ignore+=" /etc/modules.autoload.d/kernel-2.4"
58 config_protect_ignore+=" /etc/modules.autoload.d/kernel-2.6"
59 config_protect_ignore+=" /etc/modules.autoload"
60 # add conf.d/kernel to protect current udev|mdev configuration
61 config_protect_ignore+=" /etc/conf.d/kernel"
62 echo "CONFIG_PROTECT_IGNORE=\"${config_protect_ignore}\"" >> ${BINDIR}/etc/env.d/01initscripts || die
63
64 # fix mageversion if any release version is given
65 if [[ ! -z ${RELEASE_MAGEVERSION} ]]
66 then
67 echo "${RELEASE_MAGEVERSION}" > ${BINDIR}/etc/mageversion || die
68 fi
69 }
70
71 postinstall()
72 {
73 # emulate seq; its needed to run rc-config
74 # this fixes some annyoing warning when building
75 # livecd or bootstrapping a system.
76 # this hack will be removed when the toolchain is fixed
77 if [ ! -f /usr/bin/seq ]
78 then
79 echo "Using fake 'seq' command ..."
80 seq() {
81 start=$1
82 end=$2
83 for ((i=start; i < end+1; i++))
84 do
85 echo $i
86 done
87 }
88 export -f seq
89 fi
90
91 # create service state dir mountpoint
92 # needed by >=initscripts-0.3.2-r1
93 [ ! -d ${MROOT}/var/lib/init.d ] && install -d ${MROOT}/var/lib/init.d
94
95 # mark this dir as undeletable
96 touch ${MROOT}/var/lib/init.d/.keep
97
98 echo "Creating Runlevels ..."
99 local i
100 for i in cleanfs \
101 loadkeys \
102 localnet \
103 modules \
104 mountfs \
105 network \
106 setclock \
107 swap
108 do
109 echo -e "\tAdded ${i} ..."
110 ${MROOT}/sbin/rc-config del ${i} > /dev/null
111 ${MROOT}/sbin/rc-config add ${i} > /dev/null
112 done
113
114 #
115 # do not ask the user about following files
116 #
117 # if they exist let config_protect process them
118 # but then remove the protected files, to keep only the original file
119 #
120 # file-root is ${MROOT}/etc
121 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"
122 local i file path
123 for i in ${CONFIG_IGNORE}
124 do
125 file="$(basename ${i})"
126 path="$(dirname ${i})/"
127 [[ ${path} == ./ ]] && path=""
128
129 rm -f ${MROOT}/etc/${path}._cfg????_${file}
130 done
131
132 # fix mtab
133 if [[ ! -L ${MROOT}/etc/mtab ]] || [[ $(readlink ${MROOT}/etc/mtab) != /proc/mounts ]]
134 then
135 ln -snf /proc/mounts ${MROOT}/etc/mtab
136 fi
137
138 # remove old alx initscripts
139 local target
140 for target in alx_dev alx_livecd alx
141 do
142 if [[ ! -z $(magequery -n initscripts-${target}) ]]
143 then
144 echo "removing deprecated mage-target 'initscripts-${target}'"
145 mage uninstall initscripts-${target} || die
146 fi
147 done
148 }