wok-current view slitaz-boot-scripts/receipt @ rev 1574
Up slitaz-boot-scripts (2.5.2)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Oct 15 15:06:01 2008 +0000 (2008-10-15) |
parents | c3027d83478d |
children | e0bdc4e2d7ec |
line source
1 # SliTaz package receipt.
3 PACKAGE="slitaz-boot-scripts"
4 VERSION="2.5.2"
5 CATEGORY="base-system"
6 SHORT_DESC="Provide all the initialisation scripts used at boot time."
7 MAINTAINER="pankso@slitaz.org"
8 TARBALL="$PACKAGE-$VERSION.tar.gz"
9 WEB_SITE="http://www.slitaz.org/"
10 WGET_URL="http://mirror.slitaz.org/sources/boot-scripts/$TARBALL"
11 CONFIG_FILES="/etc/inittab /etc/init.d/local.sh /etc/rcS.conf /etc/network.conf"
13 # Rules to gen a SliTaz package suitable for Tazpkg.
14 #
15 # This package is all build by genpkg, it provide the boot scripts found
16 # in /etc/init.d with the main config file : /etc/rcS.conf. It provide also
17 # the default inittab and the network config file used with network.sh
18 #
19 genpkg_rules()
20 {
21 mkdir -p $fs/usr/share
22 cp -a $src/etc $fs
23 cp -a $src/applications $fs/usr/share
25 # Perms
26 chown -R root.root $fs/etc/init.d
27 chmod 755 $fs/etc/init.d/*.sh
28 chmod 755 $fs/etc/init.d/rc*
29 }
31 # Pre install commands.
32 #
33 pre_install()
34 {
35 local root
36 root=$1
38 # Backup file to restore with post install
39 echo "Creating backups of configs..."
40 cp $root/etc/rcS.conf $root/etc/rcS.conf.bak 2>/dev/null
41 cp $root/etc/network.conf $root/etc/network.conf.bak 2>/dev/null
42 cp $root/etc/inittab $root/etc/inittab.bak 2>/dev/null
43 cp $root/etc/init.d/local.sh $root/etc/init.d/local.sh.bak 2>/dev/null
44 }
46 post_install()
47 {
48 local root
49 root=$1
50 ( cd $1/ ; cpio -o -H newc | gzip -9 ) > \
51 $1/$INSTALLED/$PACKAGE/volatile.cpio.gz <<EOT
52 etc/rcS.conf
53 etc/network.conf
54 EOT
55 echo "Restoring configs backups..."
56 mv -f $root/etc/rcS.conf.bak $root/etc/rcS.conf 2>/dev/null
57 mv -f $root/etc/network.conf.bak $root/etc/network.conf 2>/dev/null
58 mv -f $root/etc/inittab.bak $root/etc/inittab 2>/dev/null
59 mv -f $root/etc/init.d/local.sh.bak $root/etc/init.d/local.sh 2>/dev/null
61 # wifi config
62 if ! grep -q ^WIFI $root/etc/network.conf; then
63 cat >> $root/etc/network.conf << "EOT"
64 # Wifi connection.
65 # Enable/disable wireless connection at boot time.
66 WIFI="no"
68 # Wifi interface (iwconfig) and ESSID.
69 WIFI_INTERFACE="wlan0"
70 WIFI_ESSID="any"
71 WIFI_MODE="managed"
72 WIFI_KEY=""
73 WIFI_KEY_TYPE="none"
74 WPA_DRIVER=""
75 WIFI_CHANNEL=""
76 WIFI_IWCONFIG_ARGS=""
77 NDISWRAPPER_DRIVERS=""
79 EOT
80 fi
81 # From 2.3 default user have uid=1000 (standard), so change hacker
82 # id/group and chown.
83 if grep -q "500:500" $root/etc/passwd; then
84 sed -i s/'500:500'/'1000:1000'/ $root/etc/passwd
85 sed -i s/'500'/'1000'/ $root/etc/group
86 chown -R 1000.1000 $root/home/hacker
87 fi
88 }
90 repack_cleanup()
91 {
92 zcat $INSTALLED/$PACKAGE/volatile.cpio.gz | ( cd $1 ; cpio -id )
93 }