Magellan Linux

Annotation of /smage/trunk/core/busybox-initscripts/busybox-initscripts-0.1.12-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1594 - (hide annotations) (download)
Fri Mar 4 12:09:43 2011 UTC (13 years, 2 months ago) by niro
File size: 3331 byte(s)
auto added: ver bump to 0.1.12-r1
1 niro 1594 # $Id$
2    
3     PNAME="busybox-initscripts"
4     PVER="0.1.12"
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/coreutils-5
17     >= sys-apps/findutils-4
18     >= net-misc/rsync-2"
19    
20     SRCFILE="${PNAME}-${PVER}.tar.bz2"
21     SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
22    
23     # fixes mageversion;
24     # the makefile uses the date as version number
25     # but for release we want to use the release version
26     RELEASE_MAGEVERSION=
27    
28     SRC_URI=( mirror://${PNAME}/${SRCFILE} )
29    
30     src_prepare()
31     {
32     munpack ${SRCFILE} || die
33     }
34    
35     src_install()
36     {
37     cd ${SRCDIR}
38     make DESTDIR=${BINDIR} install || die
39    
40     # CONFIG_PROTECT_MASK for /etc/rc.d/init.d
41     install -d ${BINDIR}/etc/env.d || die
42     echo "CONFIG_PROTECT_MASK=\"/etc/rc.d/init.d\"" > ${BINDIR}/etc/env.d/01initscripts || die
43     # always overwrite /etc/mageversion
44     echo 'CONFIG_PROTECT_MASK="/etc/mageversion"' >> ${BINDIR}/etc/env.d/01initscripts || die
45     # always keep this files even if the user 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/conf.d/net.eth0"
54     config_protect_ignore+=" /etc/modules.autoload.d/kernel-2.4"
55     config_protect_ignore+=" /etc/modules.autoload.d/kernel-2.6"
56     config_protect_ignore+=" /etc/modules.autoload"
57     echo "CONFIG_PROTECT_IGNORE=\"${config_protect_ignore}\"" >> ${BINDIR}/etc/env.d/01initscripts || die
58    
59     # fix mageversion if any release version is given
60     if [[ ! -z ${RELEASE_MAGEVERSION} ]]
61     then
62     echo "${RELEASE_MAGEVERSION}" > ${BINDIR}/etc/mageversion || die
63     fi
64     }
65    
66     postinstall()
67     {
68     # emulate seq; its needed to run rc-config
69     # this fixes some annyoing warning when building
70     # livecd or bootstrapping a system.
71     # this hack will be removed when the toolchain is fixed
72     if [ ! -f /usr/bin/seq ]
73     then
74     echo "Using fake 'seq' command ..."
75     seq() {
76     start=$1
77     end=$2
78     for ((i=start; i < end+1; i++))
79     do
80     echo $i
81     done
82     }
83     export -f seq
84     fi
85    
86     # create service state dir mountpoint
87     # needed by >=initscripts-0.3.2-r1
88     [ ! -d ${MROOT}/var/lib/init.d ] && install -d ${MROOT}/var/lib/init.d
89    
90     # mark this dir as undeletable
91     touch ${MROOT}/var/lib/init.d/.keep
92    
93     echo "Creating Runlevels ..."
94     local i
95     for i in cleanfs \
96     loadkeys \
97     localnet \
98     modules \
99     mountfs \
100     network \
101     setclock \
102     swap
103     do
104     echo -e "\tAdded ${i} ..."
105     ${MROOT}/sbin/rc-config del ${i} > /dev/null
106     ${MROOT}/sbin/rc-config add ${i} > /dev/null
107     done
108    
109     #
110     # do not ask the user about following files
111     #
112     # if they exist let config_protect process them
113     # but then remove the protected files, to keep only the original file
114     #
115     # file-root is ${MROOT}/etc
116     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"
117     local i file path
118     for i in ${CONFIG_IGNORE}
119     do
120     file="$(basename ${i})"
121     path="$(dirname ${i})/"
122     [[ ${path} == ./ ]] && path=""
123    
124     rm -f ${MROOT}/etc/${path}._cfg????_${file}
125     done
126     }