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