wok-current annotate slitaz-base-files/receipt @ rev 52

Modified slitaz-base-files + slitaz-boot-scripts to avoid errosr msg
author Christophe Lincoln <pankso@slitaz.org>
date Thu Dec 20 22:17:41 2007 +0100 (2007-12-20)
parents 5b9b4307925d
children e510cfe46815
rev   line source
pankso@1 1 # SliTaz package receipt.
pankso@1 2
pankso@1 3 PACKAGE="slitaz-base-files"
pankso@1 4 VERSION="1.0"
pankso@1 5 CATEGORY="base-system"
pankso@1 6 SHORT_DESC="Linux tree and the necessary files for the base system."
pankso@1 7 MAINTAINER="pankso@slitaz.org"
pankso@1 8 TARBALL="$PACKAGE-$VERSION.tar.gz"
pankso@1 9 WEB_SITE="http://www.slitaz.org/"
pankso@1 10 WGET_URL="http://download.tuxfamily.org/slitaz/sources/base-files/$TARBALL"
pankso@1 11
pankso@1 12 # Rules to gen a SliTaz package suitable for Tazpkg.
pankso@1 13 genpkg_rules()
pankso@1 14 {
pankso@1 15 # Copy all rootfs from the stuff and set permissions.
pankso@1 16 cp -a $src/rootfs/* $fs
pankso@1 17
pankso@1 18 chown -R root.root $fs/*
pankso@1 19 chmod 1777 $fs/tmp
pankso@1 20 chmod 640 $fs/etc/shadow
pankso@1 21 chmod 640 $fs/etc/gshadow
pankso@1 22
pankso@1 23 # Populate /dev with /$fs/sbin/mktazdevs.sh.
pankso@1 24 ./$fs/sbin/mktazdevs.sh $fs/dev
pankso@1 25
pankso@1 26 # Creat /etc/mtab symlink.
pankso@1 27 cd $fs/etc
pankso@1 28 ln -s /proc/mounts mtab
pankso@1 29 }
pankso@1 30
pankso@1 31 # Pre and post install to backup all /etc/settings
pankso@1 32 #
pankso@1 33 pre_install()
pankso@1 34 {
pankso@1 35 local root
pankso@1 36 root=$1
pankso@52 37 echo "Creating backup of all files in /etc..."
pankso@52 38 cp -a $root/etc $root/tmp/etc.bak 2>/dev/null
pankso@1 39 }
pankso@1 40
pankso@1 41 post_install()
pankso@1 42 {
pankso@1 43 local root
pankso@1 44 root=$1
pankso@52 45 echo "Restoring files from /etc/etc.bak..."
pankso@52 46 cp -a $root/tmp/etc.bak/* $root/etc 2>/dev/null
pankso@1 47 rm -rf $root/tmp/etc.bak
pankso@1 48
pankso@1 49 # Remove old base-file pkg info
pankso@1 50 rm -rf $root/var/lib/tazpkg/installed/base-files
pankso@1 51
pankso@1 52 # Reset permission.
pankso@1 53 chmod 640 $root/etc/shadow
pankso@1 54 chmod 640 $root/etc/gshadow
pankso@1 55
pankso@1 56 if ! grep -q audio $root/etc/group; then
pankso@1 57 if [ -n "$root" ]; then
pankso@1 58 cp /etc/group $root/etc/group
pankso@1 59 else
pankso@1 60 addgroup -g 20 audio
pankso@1 61 fi
pankso@1 62 fi
pankso@1 63
pankso@1 64 # Add crond to daemons confi file
pankso@1 65 if ! grep -q CROND_OPTIONS $root/etc/daemons.conf; then
pankso@1 66 echo '# Cron daemon options.' >> $root/etc/daemons.conf
pankso@1 67 echo 'CROND_OPTIONS="-b"' >> $root/etc/daemons.conf
pankso@1 68 echo '' >> $root/etc/daemons.conf
pankso@1 69 fi
pankso@1 70 }
pankso@1 71 SELF_INSTALL=1