Receipt for package "slitaz-loram-http"
# SliTaz package receipt. PACKAGE="slitaz-loram-http" VERSION="1.6" 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" # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { 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 <<EOF --- $1/etc/init.d/rcS +++ $1/etc/init.d/rcS @@ $line @@ $i# Try to release http link (from slitaz-loram-http package) $i release_http() $i { $i FREEMEM=\$(free | awk '{ n = \$NF } END { print n }') $i if [ \$FREEMEM -gt \$(du -s \$FS | awk '{ print \$1+40000 }') ]; then $i status $i if ! grep -q " keep-loram" /proc/cmdline && $i [ -d \$FS -o \$FREEMEM -gt \$(du -s \$FS | \\ $i awk '{ print (\$1*4)+40000 }') ]; then $i echo -n "Extracting loram..." $i . /etc/tazlito/loram.extract /cdrom $i if status; then $i umount /cdrom && umount /cdrom $i rmdir /cdrom $i yes y | tazpkg remove slitaz-loram-http > /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 <<EOF ---- 'tazlito gen-distro' will create a loram-http flavor while this package is installed. EOF if [ ! -x $1/bin/funionfs ]; then cat <<EOF ---- You will build a live CD with /usr mounted read-only. You can install funionfs to have read-write access into /usr with: # tazpkg get-install funionfs EOF fi } # Pre remove commands for Tazpkg. pre_remove() { set_patch '' -R cat <<EOF ---- 'tazlito gen-distro' will work as expected now. EOF }
3382 packages and 430813 files in stable database (Mon Mar 4 17:53:49 2019)