wok view slitaz-loram/receipt @ rev 282

Busybox: add df -i & hexdump -R
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Feb 26 12:00:01 2008 +0000 (2008-02-26)
parents c956bc99b845
children 3a5e92c048e0
line source
1 # SliTaz package receipt.
3 PACKAGE="slitaz-loram"
4 VERSION="1.1"
5 CATEGORY="misc"
6 SHORT_DESC="Rules to build low ram rootfs.gz."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 DEPENDS="squashfs"
10 # Rules to gen a SliTaz package suitable for Tazpkg.
11 genpkg_rules()
12 {
13 mkdir -p $fs/etc/tazlito
14 cat > $fs/etc/tazlito/loram.rootfs << EOF
15 echo "\$(du -hs ./usr | cut -f1) were used by /usr"
16 for ii in /sbin /lib /bin; do
17 mkdir -p ./usr/.moved\$ii
18 for j in e2fsprogs pcmciautils cpio syslinux-extra isapnptools ncurses; do
19 for k in \$(grep ^\$ii ./var/lib/tazpkg/installed/\$j/files.list) ; do
20 [ -f .\$k ] || continue
21 mv .\$k ./usr/.moved\$k
22 ln -s /usr/.moved\$k .\$k
23 done
24 done
25 done
26 for ii in /var/lib/tazpkg/installed ; do
27 j=\$(dirname /usr/.moved\$ii)
28 mkdir -p .\$j
29 mv .\$ii .\$j
30 ln -s /usr/.moved\$ii .\$ii
31 done
32 echo "\$(du -hs ./usr/.moved | cut -f1) have been moved into /usr"
33 echo "\$(du -hs ./usr | cut -f1) were used by /usr before compression"
34 usr/sbin/mksquashfs usr .usr.sqfs
35 rm -rf usr
36 mkdir usr
37 COMPRESSION="none"
38 echo "\$(du -hs ./.usr.sqfs | cut -f1) are used by /usr after compression"
39 EOF
40 }
42 get_patch()
43 {
44 cat <<EOF
45 --- /etc/init.d/rcS
46 +++ /etc/init.d/rcS
47 @@ -68,2 +68,9 @@
49 +# Mount compressed /usr
50 +if [ -f /.usr.sqfs ]; then
51 + echo -n "Mounting compressed /usr read-only... "
52 + /bin/mount -o loop,ro -t squashfs /.usr.sqfs /usr
53 + status
54 +fi
55 +
56 # Creat /dev/cdrom if needed (symlink does not exist on LiveCD). Chmod
57 EOF
58 }
60 # Pre and post install commands for Tazpkg.
61 pre_install()
62 {
63 local $loram
64 loram=$(cd /var/lib/tazpkg/installed ; ls -d slitaz-loram* 2> /dev/null)
65 [ -n "$loram" ] && yes y | tazpkg remove $loram
66 }
68 post_install()
69 {
70 get_patch | patch -p0
71 }
73 # Pre remove commands for Tazpkg.
74 pre_remove()
75 {
76 get_patch | patch -R -p0
77 }