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