# HG changeset patch # User Pascal Bellard # Date 1368722526 -7200 # Node ID a40a0eb643ba7dd81a64fd97a575533ec8d7c3ac # Parent dc87133e6b532e73da190b7f4117e1f43cb687f0 Up slitaz-loram-http (2.0) diff -r dc87133e6b53 -r a40a0eb643ba slitaz-loram-http/receipt --- a/slitaz-loram-http/receipt Thu May 16 11:25:56 2013 +0000 +++ b/slitaz-loram-http/receipt Thu May 16 18:42:06 2013 +0200 @@ -1,12 +1,12 @@ # SliTaz package receipt. PACKAGE="slitaz-loram-http" -VERSION="1.6" +VERSION="2.0" CATEGORY="misc" SHORT_DESC="Rules to build low ram system using http." MAINTAINER="pascal.bellard@slitaz.org" WEB_SITE="http://www.slitaz.org/" -DEPENDS="slitaz-boot-scripts tazlito httpfs-fuse funionfs" +DEPENDS="" # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() @@ -14,165 +14,3 @@ mkdir -p $fs/etc/tazlito cp stuff/loram.* $fs/etc/tazlito } - -set_patch() -{ - local tag - local line - local len - local i - tag="Handle kernel cmdline parameter config" - i=$(grep -n "$tag" $1/etc/init.d/rcS | cut -d: -f1) - i=$(($i-1)) - len=89 - tag=$(grep "$tag" $1/etc/init.d/rcS) - if [ "$2" = "-R" ]; then - line="-$(($i-$len+2)),$len +$(($i-$len+2)),2" - i="-" - else - grep -q 'from slitaz-loram-http package' $1/etc/init.d/rcS && return - line="-$i,2 +$i,$len" - i="+" - fi - busybox patch -p0 < /dev/null -$i return 0 -$i fi -$i fi -$i echo -n "Loading /usr in memory..." -$i cp -a \$FS /.usr.fs -$i status -$i echo -n "Releasing HTTP link..." -$i umount /cdrom && umount /cdrom -$i FS=/.usr.fs -$i if [ -d \$FS ]; then -$i rm -f /\$usr -$i mv \$FS /usr -$i fi -$i fi -$i return 1 -$i } -$i -$i# Mount /usr (from slitaz-loram-http package) -$i while [ -d /cdrom ]; do -$i /etc/init.d/network.sh -$i RUN_SCRIPTS="\$(echo \$RUN_SCRIPTS | sed 's/network.sh//')" -$i release=\$(cat /etc/slitaz-release) -$i iso1=iso/\$release/flavors/slitaz-\$release-loram-cdrom.iso -$i iso2=iso/\$release/flavors/slitaz-loram-cdrom.iso -$i URLISO=http://mirror.slitaz.org/\$iso1,http://mirror.slitaz.org/\$iso2,http://download.tuxfamily.org/slitaz/\$iso1,http://download.tuxfamily.org/slitaz/\$iso2,http://slitaz.c3sl.ufpr.br/\$iso1,http://slitaz.c3sl.ufpr.br/\$iso2 -$i grep -q " urliso=" /proc/cmdline && URLISO=\$(cat /proc/cmdline | sed 's/.* urliso=\([^ ]*\).*/\1/'),\$URLISO -$i for i in \$(echo \$URLISO | sed 's/,/ /g'); do -$i /bin/httpfs \$i /cdrom && break -$i done -$i mount -o loop,ro /cdrom/*.iso /cdrom -$i if [ -d /.usr.rw -a -x /bin/funionfs ]; then -$i echo -n "Mounting /usr read-write... " -$i usr=.usr.ro -$i else -$i echo -n "Mounting /usr read-only... " -$i usr=usr -$i fi -$i FS=/cdrom/usr.cromfs -$i if [ -f \$FS ]; then -$i mkdir /\$usr -$i ln -s /usr/.moved /.moved -$i release_http && break -$i /bin/cromfs-driver \$FS /\$usr -o ro,dev,suid,allow_other -$i elif grep -q squashfs /etc/filesystems && [ -f /cdrom/usr.sqfs ]; then -$i FS=/cdrom/usr.sqfs -$i ln -s /usr/.moved /.moved -$i mkdir /\$usr -$i release_http && break -$i mount -o loop,ro -t squashfs \$FS /\$usr -$i elif grep -q squashfs /etc/filesystems && [ -f /cdrom/rootfs.gz ]; then -$i FS=/cdrom/rootfs.gz -$i ln -s /.rootfs /.moved -$i mkdir /.rootfs -$i release_http && break -$i mount -o loop,ro -t squashfs \$FS /.rootfs -$i ln -s /.rootfs/usr /\$usr -$i elif [ -d /cdrom/usr ]; then -$i FS=/cdrom/usr -$i ln -s /usr/.moved /.moved -$i rm -rf /\$usr && ln -s \$FS /\$usr -$i else -$i FS=/cdrom/fs/usr -$i ln -s /cdrom/fs /.moved -$i rm -rf /\$usr && ln -s \$FS /\$usr -$i fi -$i status -$i if [ -d /.usr.rw -a -x /bin/funionfs ]; then -$i /bin/funionfs -o dirs=/.usr.ro=RO:/.usr.rw -o allow_other,nonempty -o suid,dev NONE /usr -$i fi -$i break -$i done -$i - $tag -EOF - chmod 0755 $1/etc/init.d/rcS -} - -# Pre and post install commands for Tazpkg. -pre_install() -{ - local i - for i in $(cd /var/lib/tazpkg/installed ; ls -d slitaz-loram* 2> /dev/null); do - [ "$i" = "$PACKAGE" ] && continue - yes y | tazpkg remove $i - . /etc/tazlito/tazlito.conf - rm -f $PACKAGES_REPOSITORY/slitaz-boot-scripts-*.tazpkg 2> /dev/null - done -} - -post_install() -{ - set_patch "$1" - - # Don't support FAST_BOOT_X yet - sed -i 's/FAST_BOOT_X=.*/FAST_BOOT_X="no"/' $1/etc/rcS.conf - - cat < /dev/null -rmdir .usr* 2> /dev/null -if [ -L usr ]; then - rm usr - cp -a $1/usr . -fi -packedfs="$1/usr.cromfs" -if [ -f $packedfs ]; then - rmdir usr - rm -f bin/unmkcromfs - cp -a $1/unmkcromfs bin/unmkcromfs - bin/unmkcromfs $packedfs usr > /dev/null - [ "${packedfs%%/*}" = ".." ] && rm -f $packedfs - rm -f bin/cromfs-driver - cp -a $1/cromfs-driver bin/cromfs-driver -fi -packedfs="$1/usr.sqfs" -if [ -f $packedfs ]; then - rmdir usr - sbin/unsquashfs -d usr $packedfs > /dev/null - [ "${packedfs%%/*}" = ".." ] && rm -f $packedfs -fi -if [ -d .moved ]; then - ( cd .moved ; find * -print ) | \ - while read file; do - [ -L "$file" ] || continue - rm -f "$file" - mv ".moved/$file" "$file" - done - rm -rf usr/.moved 2> /dev/null - rm -f .moved -fi -for ii in lib/libz.so lib/libstdc++.so lib/libgcc_s.so; do - [ -e $ii ] && mv $ii* usr/lib/ -done -if [ -L root ]; then - rm -f etc/keymap.conf etc/locale.conf etc/resolv.conf etc/TZ etc/motd - [ -d var/log.ORG ] && mv -f var/log.ORG var/log - [ -d var/run.ORG ] && mv -f var/run.ORG var/run - [ -d var/lock.ORG ] && mv -f var/lock.ORG var/lock - [ -d root.ORG ] && mv -f root.ORG root - rm -f media/cdrom - rmdir mnt/target - sed -i 's/CLEAN_UP_SYSTEM="no"/CLEAN_UP_SYSTEM="yes"/' etc/rcS.conf - sed -i 's/RUN_DAEMONS="/RUN_DAEMONS="slim /' etc/rcS.conf -fi -for ii in bin/vcsa2txt bin/awk bin/script bin/cut bin/readlink bin/du bin/free \ - bin/killall5 bin/seq bin/find bin/xargs bin/patch; do - [ -e usr/$ii ] && rm -f $ii -done -[ -e usr/bin/vcsa2txt ] || rm -f bin/conspy diff -r dc87133e6b53 -r a40a0eb643ba slitaz-loram-http/stuff/loram.final --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/slitaz-loram-http/stuff/loram.final Thu May 16 18:42:06 2013 +0200 @@ -0,0 +1,11 @@ +cd $1/.. +iso=$(ls *.iso) +if [ -s "$iso" ]; then + echo "Converting $iso to low ram/http iso..." + yes y | tazlito build-loram $iso $iso.$$ http + mv -f $iso.$$ $iso + md5sum $iso > ${iso%.iso}.md5 + echo "================================================================================" +fi +cd - > /dev/null + diff -r dc87133e6b53 -r a40a0eb643ba slitaz-loram-http/stuff/loram.rootfs --- a/slitaz-loram-http/stuff/loram.rootfs Thu May 16 11:25:56 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -echo "$(du -hs /usr | cut -f1) were used by /usr" -for j in insmod unmkcromfs unsquashfs ; do - lib/ld-*.so --list *bin/$j 2> /dev/null | grep /usr/lib | cut -d\ -f3 | \ - while read ii; do - mv .${ii%%.so.*}.so* ./lib - done -done -for ii in /sbin /lib /bin; do - mkdir -p ./usr/.moved$ii - for j in e2fsprogs pcmciautils cpio syslinux-extra isapnptools ncurses \ - libcap; do - for k in $(grep -s ^$ii /var/lib/tazpkg/installed/$j/files.list) ; do - [ -f .$k ] || continue - mv .$k ./usr/.moved$k - ln -s /.moved$k .$k - done - done -done -for ii in /var/lib/tazpkg/installed /lib/modules/*/kernel/drivers/net \ - /lib/modules/*/kernel/sound /sbin/depmod /sbin/modinfo /sbin/lsmod \ - /lib/libnss_c* ; do - [ -L .$ii ] && continue - j=$(dirname /usr/.moved$ii) - mkdir -p .$j - mv .$ii .$j - ln -s /.moved$ii .$ii -done -echo "$(du -hs ./usr/.moved | cut -f1) have been moved into /usr" -mv usr/bin/httpfs bin -cp usr/lib/libfuse.so.2.* lib/libfuse.so.2 -mv usr/share/udhcpc/default.script . -rm -rf usr -mkdir -p usr/share/udhcpc -mv default.script usr/share/udhcpc -ln -s /cdrom/boot boot -for ii in bin/vcsa2txt bin/awk bin/script bin/cut bin/readlink bin/du bin/free \ - bin/killall5 bin/seq bin/find bin/xargs bin/patch; do - [ -e $ii ] || ln -s busybox $ii -done -[ -e bin/vcsa2txt ] || ln -s busybox bin/conspy -mkdir cdrom .usr.rw -COMPRESSION="gzip"