wok-next annotate slitaz-loram/receipt @ rev 2287

*-pam: remove duplicate stuff/
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Feb 21 21:46:09 2009 +0000 (2009-02-21)
parents bc8f5b69f71c
children 6509db5aa948
rev   line source
pascal@229 1 # SliTaz package receipt.
pascal@229 2
pascal@229 3 PACKAGE="slitaz-loram"
pascal@1339 4 VERSION="1.4"
pascal@229 5 CATEGORY="misc"
pascal@229 6 SHORT_DESC="Rules to build low ram rootfs.gz."
pascal@229 7 MAINTAINER="pascal.bellard@slitaz.org"
pascal@1964 8 DEPENDS="slitaz-boot-scripts tazlito cromfs-or-squashfs"
pankso@422 9 WEB_SITE="http://www.slitaz.org/"
pascal@229 10
pascal@229 11 # Rules to gen a SliTaz package suitable for Tazpkg.
pascal@229 12 genpkg_rules()
pascal@229 13 {
pascal@229 14 mkdir -p $fs/etc/tazlito
pascal@370 15 cp stuff/loram.* $fs/etc/tazlito
pascal@229 16 }
pascal@229 17
pascal@377 18 set_patch()
pascal@229 19 {
pascal@370 20 local tag
pascal@370 21 local line
pascal@370 22 local i
pascal@1287 23 tag="/dev/cdrom if need"
pascal@375 24 i=$(grep -n "$tag" $1/etc/init.d/rcS | cut -d: -f1)
pascal@370 25 i=$(($i-1))
pascal@375 26 tag=$(grep "$tag" $1/etc/init.d/rcS)
pascal@375 27 if [ "$2" = "-R" ]; then
pascal@1884 28 line="-$(($i-25)),27 +$(($i-25)),2"
pascal@370 29 i="-"
pascal@370 30 else
pascal@389 31 grep -q 'from slitaz-loram package' $1/etc/init.d/rcS && return
pascal@1884 32 line="-$i,2 +$i,27"
pascal@370 33 i="+"
pascal@370 34 fi
pascal@377 35 patch -p0 <<EOF
pascal@375 36 --- $1/etc/init.d/rcS
pascal@375 37 +++ $1/etc/init.d/rcS
pascal@370 38 @@ $line @@
pascal@229 39
pascal@389 40 $i# Mount compressed /usr (from slitaz-loram package)
pascal@389 41 $i if [ -f /.usr.cromfs -o -f /.usr.sqfs ]; then
pascal@389 42 $i usr=usr
pascal@389 43 $i echo -n "Mounting /usr read-"
pascal@370 44 $i if [ -d /.usr.rw ]; then
pascal@389 45 $i usr=.usr.ro
pascal@389 46 $i echo -n "write... "
pascal@389 47 $i else
pascal@389 48 $i echo -n "only... "
pascal@389 49 $i fi
pascal@389 50 $i if [ -f /.usr.cromfs ]; then
pascal@1884 51 $i /bin/cromfs-driver /.usr.cromfs /\$usr -o ro,dev,suid,allow_other
pascal@389 52 $i else
pascal@389 53 $i /bin/mount -o loop,ro -t squashfs /.usr.sqfs /\$usr
pascal@389 54 $i fi
pascal@389 55 $i if [ -d /.usr.rw ]; then
pascal@1884 56 $i if [ -x bin/funionfs ]; then
pascal@1884 57 $i /bin/funionfs -o dirs=/.usr.ro=RO:/.usr.rw -o allow_other -o suid,dev NONE /usr
pascal@1884 58 $i else
pascal@1891 59 $i /bin/mount -t aufs -o br:/.usr.rw:/.usr.ro none /usr
pascal@1884 60 $i fi
pascal@370 61 $i fi
pascal@370 62 $i status
pascal@370 63 $i fi
pascal@370 64 $i
pascal@370 65 $tag
pascal@229 66 EOF
pascal@375 67 chmod 0755 $1/etc/init.d/rcS
pascal@229 68 }
pascal@229 69
pascal@229 70 # Pre and post install commands for Tazpkg.
pascal@251 71 pre_install()
pascal@251 72 {
pascal@380 73 local i
pascal@380 74 for i in $(cd /var/lib/tazpkg/installed ; ls -d slitaz-loram* 2> /dev/null); do
pascal@380 75 [ "$i" = "$PACKAGE" ] && continue
pascal@380 76 yes y | tazpkg remove $i
pascal@1285 77 . /etc/tazlito/tazlito.conf
pascal@389 78 rm -f $PACKAGES_REPOSITORY/slitaz-boot-scripts-*.tazpkg 2> /dev/null
pascal@380 79 done
pascal@251 80 }
pascal@251 81
pascal@229 82 post_install()
pascal@229 83 {
pascal@395 84 set_patch "$1"
pascal@1884 85 if [ ! -x $1/bin/funionfs -a ! -d $1/var/lib/tazpkg/installed/aufs ]; then
pascal@371 86 cat <<EOF
pascal@389 87 ----
pascal@371 88 You will build a live CD with /usr mounted read-only.
pascal@1884 89 You can install aufs or funionfs to have read-write access into /usr with:
pascal@389 90
pascal@1884 91 # tazpkg get-install aufs
pascal@1884 92 or
pascal@371 93 # tazpkg get-install funionfs
pascal@389 94
pascal@371 95 EOF
pascal@371 96 fi
pascal@229 97 }
pascal@229 98
pascal@229 99 # Pre remove commands for Tazpkg.
pascal@229 100 pre_remove()
pascal@229 101 {
pascal@377 102 set_patch '' -R
pascal@229 103 }