Magellan Linux

Annotation of /smage/trunk/core/busybox-initscripts/busybox-initscripts-0.1.14-r2.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1659 - (hide annotations) (download)
Thu Mar 10 21:54:47 2011 UTC (13 years, 2 months ago) by niro
File size: 3691 byte(s)
added /etc/shadow, /etc/conf.d/net.routes, /etc/conf.d/kernel on config ignore list
1 niro 1659 # $Id$
2    
3     PNAME="busybox-initscripts"
4     PVER="0.1.14"
5     PBUILD="r2"
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 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     # fix mageversion if any release version is given
64     if [[ ! -z ${RELEASE_MAGEVERSION} ]]
65     then
66     echo "${RELEASE_MAGEVERSION}" > ${BINDIR}/etc/mageversion || die
67     fi
68     }
69    
70     postinstall()
71     {
72     # emulate seq; its needed to run rc-config
73     # this fixes some annyoing warning when building
74     # livecd or bootstrapping a system.
75     # this hack will be removed when the toolchain is fixed
76     if [ ! -f /usr/bin/seq ]
77     then
78     echo "Using fake 'seq' command ..."
79     seq() {
80     start=$1
81     end=$2
82     for ((i=start; i < end+1; i++))
83     do
84     echo $i
85     done
86     }
87     export -f seq
88     fi
89    
90     # create service state dir mountpoint
91     # needed by >=initscripts-0.3.2-r1
92     [ ! -d ${MROOT}/var/lib/init.d ] && install -d ${MROOT}/var/lib/init.d
93    
94     # mark this dir as undeletable
95     touch ${MROOT}/var/lib/init.d/.keep
96    
97     echo "Creating Runlevels ..."
98     local i
99     for i in cleanfs \
100     loadkeys \
101     localnet \
102     modules \
103     mountfs \
104     network \
105     setclock \
106     swap
107     do
108     echo -e "\tAdded ${i} ..."
109     ${MROOT}/sbin/rc-config del ${i} > /dev/null
110     ${MROOT}/sbin/rc-config add ${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     }