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