wok view slitaz-loram/receipt @ rev 395

Slitaz-loram: typo
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Mar 10 10:41:39 2008 +0000 (2008-03-10)
parents c4e6b92f665f
children e0ad9f116fca
line source
1 # SliTaz package receipt.
3 PACKAGE="slitaz-loram"
4 VERSION="1.2"
5 CATEGORY="misc"
6 SHORT_DESC="Rules to build low ram rootfs.gz."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 DEPENDS="cromfs"
10 # Rules to gen a SliTaz package suitable for Tazpkg.
11 genpkg_rules()
12 {
13 mkdir -p $fs/etc/tazlito
14 cp stuff/loram.* $fs/etc/tazlito
15 }
17 set_patch()
18 {
19 local tag
20 local line
21 local i
22 tag="Creat /dev/cdrom if needed"
23 i=$(grep -n "$tag" $1/etc/init.d/rcS | cut -d: -f1)
24 i=$(($i-1))
25 tag=$(grep "$tag" $1/etc/init.d/rcS)
26 if [ "$2" = "-R" ]; then
27 line="-$(($i-21)),23 +$(($i-21)),2"
28 i="-"
29 else
30 grep -q 'from slitaz-loram package' $1/etc/init.d/rcS && return
31 line="-$i,2 +$i,23"
32 i="+"
33 fi
34 patch -p0 <<EOF
35 --- $1/etc/init.d/rcS
36 +++ $1/etc/init.d/rcS
37 @@ $line @@
39 $i# Mount compressed /usr (from slitaz-loram package)
40 $i if [ -f /.usr.cromfs -o -f /.usr.sqfs ]; then
41 $i usr=usr
42 $i echo -n "Mounting /usr read-"
43 $i if [ -d /.usr.rw ]; then
44 $i usr=.usr.ro
45 $i echo -n "write... "
46 $i else
47 $i echo -n "only... "
48 $i fi
49 $i if [ -f /.usr.cromfs ]; then
50 $i /bin/cromfs-driver /.usr.cromfs /\$usr
51 $i else
52 $i /bin/mount -o loop,ro -t squashfs /.usr.sqfs /\$usr
53 $i fi
54 $i if [ -d /.usr.rw ]; then
55 $i /bin/funionfs -o dirs=/.usr.ro=RO:/.usr.rw -o allow_other NONE /usr
56 $i fi
57 $i status
58 $i fi
59 $i
60 $tag
61 EOF
62 chmod 0755 $1/etc/init.d/rcS
63 }
65 # Pre and post install commands for Tazpkg.
66 pre_install()
67 {
68 local i
69 . /etc/tazlito/tazlito.conf
70 for i in $(cd /var/lib/tazpkg/installed ; ls -d slitaz-loram* 2> /dev/null); do
71 [ "$i" = "$PACKAGE" ] && continue
72 yes y | tazpkg remove $i
73 rm -f $PACKAGES_REPOSITORY/slitaz-boot-scripts-*.tazpkg 2> /dev/null
74 done
75 }
77 post_install()
78 {
79 set_patch "$1"
80 if [ ! -x /bin/funionfs ]; then
81 cat <<EOF
82 ----
83 You will build a live CD with /usr mounted read-only.
84 You can install funionfs to have read-write access into /usr with:
86 # tazpkg get-install funionfs
88 EOF
89 fi
90 }
92 # Pre remove commands for Tazpkg.
93 pre_remove()
94 {
95 set_patch '' -R
96 }