wok-6.x view slitaz-loram/stuff/loram.rootfs @ rev 5770
Up: tazwok 3.2.1
author | Antoine Bodin <gokhlayeh@mailoo.org> |
---|---|
date | Mon Jul 05 19:22:21 2010 +0200 (2010-07-05) |
parents | fa0257184d3c |
children | 0a217ca53bab |
line source
1 echo "$(du -hs ./usr | cut -f1) were used by /usr"
2 for j in insmod unmkcromfs unsquashfs ; do
3 lib/ld-*.so --list *bin/$j 2> /dev/null | grep /usr/lib | cut -d\ -f3 | \
4 while read ii; do
5 mv .${ii%%.so.*}.so* ./lib
6 done
7 done
8 for ii in /sbin /lib /bin; do
9 mkdir -p ./usr/.moved$ii
10 for j in e2fsprogs pcmciautils cpio syslinux-extra isapnptools ncurses \
11 libcap; do
12 for k in $(grep -s ^$ii ./var/lib/tazpkg/installed/$j/files.list) ; do
13 [ -f .$k ] || continue
14 mv .$k ./usr/.moved$k
15 ln -s /usr/.moved$k .$k
16 done
17 done
18 done
19 for ii in /var/lib/tazpkg/installed ; do
20 j=$(dirname /usr/.moved$ii)
21 mkdir -p .$j
22 mv .$ii .$j
23 ln -s /usr/.moved$ii .$ii
24 done
25 echo "$(du -hs ./usr/.moved | cut -f1) have been moved into /usr"
26 echo "$(du -hs ./usr | cut -f1) were used by /usr before compression"
27 usr=usr
28 if [ -x usr/bin/mkcromfs ]; then
29 usr/bin/mkcromfs -qq -f 262144 -b 16384 usr .usr.cromfs
30 else
31 usr/sbin/mksquashfs usr .usr.sqfs -comp lzma
32 fi
33 if [ -x bin/funionfs -o -d /var/lib/tazpkg/installed/aufs-utils ]; then
34 mkdir .usr.rw .usr.ro
35 usr=.usr.ro
36 fi
37 if [ -x bin/funionfs -o -x usr/bin/mkcromfs ]; then
38 ln -s /$usr/lib/$(cd usr/lib ; ls libfuse.so.2.*) lib/libfuse.so.2
39 fi
40 rm -rf usr
41 mkdir usr
42 echo "$(du -hs ./.usr.*fs | cut -f1) are used by /usr after compression"
43 for ii in bin/vcsa2txt bin/awk bin/script bin/cut bin/readlink bin/du bin/free \
44 bin/killall5 bin/seq bin/find bin/xargs bin/patch; do
45 [ -e $ii ] || ln -s busybox $ii
46 done
47 [ -e bin/vcsa2txt ] || ln -s busybox bin/conspy
48 echo .usr.*fs | cpio -o -H newc > $1/rootfs.gz2
49 rm -f .usr.*fs