# HG changeset patch # User Pascal Bellard # Date 1281339479 -7200 # Node ID 7cc5d70d5d9bcf0edfdbfa52aae4233a6e76061b # Parent 6ef670b41c80971077bf1d95217ae5ff2ac74eee mirror-tools: fix FSH diff -r 6ef670b41c80 -r 7cc5d70d5d9b mirror-tools/stuff/host/boot/lguest-disk --- a/mirror-tools/stuff/host/boot/lguest-disk Sun Aug 08 19:48:39 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -#!/bin/sh - -usage() -{ - cat << EOT -resize2fs -usage: -$0 grow [MG] -$0 fixmbr -EOT - exit 1 -} - -grow() -{ - case "$2" in - *M) dd if=/dev/zero bs=1M count=${2%M} >> /boot/guests/$1 ;; - *G) dd if=/dev/zero bs=1G count=${2%G} >> /boot/guests/$1 ;; - esac -} - -# write a 32 bits data -# usage: storelong offset data32 file -storelong() -{ - printf "00000 %02X %02X %02X %02X \n" \ - $(( $2 & 255 )) $(( ($2>>8) & 255 )) \ - $(( ($2>>16) & 255 )) $(( ($2>>24) & 255 )) | \ - hexdump -R | dd bs=1 conv=notrunc of=$3 seek=$(( $1 )) 2> /dev/null -} - -# read a 32 bits data -# usage: getlong offset file -getlong() -{ - dd if=$2 bs=1 skip=$(( $1 )) count=4 2> /dev/null | \ - hexdump -e '"" 1/4 "%d" "\n"' -} - -fixmbr() -{ - if [ $(getlong 0x1ea $1) -ne 0 -a $(getlong 0x1fa $1) -ne 0 ]; then - echo "Parttion 3 & 4 non empty. Abort" - exit 1 - fi - if [ $(getlong 0x1da $1) -eq 0 ]; then - echo "Parttion 2 empty. Abort" - exit 1 - fi - size=$(stat -c %s $1) - new=$(( $size/512 - 32 - $(getlong 0x1ca $1) )) - storelong 0x1da $new $1 -} - -case "$1" in -grow) shift; grow $@ ; fixmbr $1 ;; -fixmbr) shift; fixmbr $1 ;; -*) usage ;; -esac diff -r 6ef670b41c80 -r 7cc5d70d5d9b mirror-tools/stuff/host/boot/lguest-slitaz --- a/mirror-tools/stuff/host/boot/lguest-slitaz Sun Aug 08 19:48:39 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -#!/bin/sh - -tty=tty; [ -n "$1" ] && tty=$1 -export TERM=$tty -shift - -rootfs="--initrd=/boot/rootfs-lguest.gz" -[ -n "$1" ] && rootfs="--block=$1 root=/dev/vda2" -shift - -net="--tunnet=192.168.0.1" -case "$1" in -192*) net="--tunnet=$1"; shift;; -esac - -args="screen=text lang=fr_FR kmap=fr-latin1 sound=noconf" -[ -n "$1" ] && args=$@ - -/sbin/modprobe lg -/usr/bin/lguest 512 /boot/vmlinuz-2.6.25.5-lguest \ - $net $rootfs $args > /dev/$tty < /dev/$tty 2>&1 diff -r 6ef670b41c80 -r 7cc5d70d5d9b mirror-tools/stuff/host/etc/apache/conf.d/slitaz --- a/mirror-tools/stuff/host/etc/apache/conf.d/slitaz Sun Aug 08 19:48:39 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ - - ServerName mirror.slitaz.org - ServerAlias *.slitaz.org - - ProxyPreserveHost On - ProxyRequests Off - ProxyTimeout 600 - - Order deny,allow - Allow from all - - ProxyPass / http://192.168.0.6/ - ProxyPassReverse / http://192.168.0.6/ - - - diff -r 6ef670b41c80 -r 7cc5d70d5d9b mirror-tools/stuff/host/etc/apache/conf.d/slitaz-ssl --- a/mirror-tools/stuff/host/etc/apache/conf.d/slitaz-ssl Sun Aug 08 19:48:39 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ - - SSLProxyEngine On - SSLEngine On - ServerName mirror.slitaz.org:443 - ServerAlias *.slitaz.org - SSLCertificateFile /etc/ssl/apache/slitaz.org.pem - SSLCertificateKeyFile /etc/ssl/apache/slitaz.org.pem - - ProxyPreserveHost On - ProxyRequests Off - ProxyTimeout 600 - - Order deny,allow - Allow from all - - ProxyPass / http://192.168.0.6/ - ProxyPassReverse / http://192.168.0.6/ - - - diff -r 6ef670b41c80 -r 7cc5d70d5d9b mirror-tools/stuff/host/install --- a/mirror-tools/stuff/host/install Sun Aug 08 19:48:39 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -#!/bin/sh - -grep -qs lguest-slitaz /etc/inittab || { -sed -i 's|^tty1::|tty16::respawn:/boot/lguest-slitaz tty16 /boot/guests/mirror.slitaz.org 192.168.0.1\n&|' /etc/inittab -cat >> /etc/init.d/local.sh < /proc/sys/net/ipv4/ip_forward -EOT -} diff -r 6ef670b41c80 -r 7cc5d70d5d9b mirror-tools/stuff/usr/share/mirror-host/boot/lguest-disk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mirror-tools/stuff/usr/share/mirror-host/boot/lguest-disk Mon Aug 09 09:37:59 2010 +0200 @@ -0,0 +1,59 @@ +#!/bin/sh + +usage() +{ + cat << EOT +resize2fs +usage: +$0 grow [MG] +$0 fixmbr +EOT + exit 1 +} + +grow() +{ + case "$2" in + *M) dd if=/dev/zero bs=1M count=${2%M} >> /boot/guests/$1 ;; + *G) dd if=/dev/zero bs=1G count=${2%G} >> /boot/guests/$1 ;; + esac +} + +# write a 32 bits data +# usage: storelong offset data32 file +storelong() +{ + printf "00000 %02X %02X %02X %02X \n" \ + $(( $2 & 255 )) $(( ($2>>8) & 255 )) \ + $(( ($2>>16) & 255 )) $(( ($2>>24) & 255 )) | \ + hexdump -R | dd bs=1 conv=notrunc of=$3 seek=$(( $1 )) 2> /dev/null +} + +# read a 32 bits data +# usage: getlong offset file +getlong() +{ + dd if=$2 bs=1 skip=$(( $1 )) count=4 2> /dev/null | \ + hexdump -e '"" 1/4 "%d" "\n"' +} + +fixmbr() +{ + if [ $(getlong 0x1ea $1) -ne 0 -a $(getlong 0x1fa $1) -ne 0 ]; then + echo "Parttion 3 & 4 non empty. Abort" + exit 1 + fi + if [ $(getlong 0x1da $1) -eq 0 ]; then + echo "Parttion 2 empty. Abort" + exit 1 + fi + size=$(stat -c %s $1) + new=$(( $size/512 - 32 - $(getlong 0x1ca $1) )) + storelong 0x1da $new $1 +} + +case "$1" in +grow) shift; grow $@ ; fixmbr $1 ;; +fixmbr) shift; fixmbr $1 ;; +*) usage ;; +esac diff -r 6ef670b41c80 -r 7cc5d70d5d9b mirror-tools/stuff/usr/share/mirror-host/boot/lguest-slitaz --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mirror-tools/stuff/usr/share/mirror-host/boot/lguest-slitaz Mon Aug 09 09:37:59 2010 +0200 @@ -0,0 +1,21 @@ +#!/bin/sh + +tty=tty; [ -n "$1" ] && tty=$1 +export TERM=$tty +shift + +rootfs="--initrd=/boot/rootfs-lguest.gz" +[ -n "$1" ] && rootfs="--block=$1 root=/dev/vda2" +shift + +net="--tunnet=192.168.0.1" +case "$1" in +192*) net="--tunnet=$1"; shift;; +esac + +args="screen=text lang=fr_FR kmap=fr-latin1 sound=noconf" +[ -n "$1" ] && args=$@ + +/sbin/modprobe lg +/usr/bin/lguest 512 /boot/vmlinuz-2.6.25.5-lguest \ + $net $rootfs $args > /dev/$tty < /dev/$tty 2>&1 diff -r 6ef670b41c80 -r 7cc5d70d5d9b mirror-tools/stuff/usr/share/mirror-host/etc/apache/conf.d/slitaz --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mirror-tools/stuff/usr/share/mirror-host/etc/apache/conf.d/slitaz Mon Aug 09 09:37:59 2010 +0200 @@ -0,0 +1,16 @@ + + ServerName mirror.slitaz.org + ServerAlias *.slitaz.org + + ProxyPreserveHost On + ProxyRequests Off + ProxyTimeout 600 + + Order deny,allow + Allow from all + + ProxyPass / http://192.168.0.6/ + ProxyPassReverse / http://192.168.0.6/ + + + diff -r 6ef670b41c80 -r 7cc5d70d5d9b mirror-tools/stuff/usr/share/mirror-host/etc/apache/conf.d/slitaz-ssl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mirror-tools/stuff/usr/share/mirror-host/etc/apache/conf.d/slitaz-ssl Mon Aug 09 09:37:59 2010 +0200 @@ -0,0 +1,20 @@ + + SSLProxyEngine On + SSLEngine On + ServerName mirror.slitaz.org:443 + ServerAlias *.slitaz.org + SSLCertificateFile /etc/ssl/apache/slitaz.org.pem + SSLCertificateKeyFile /etc/ssl/apache/slitaz.org.pem + + ProxyPreserveHost On + ProxyRequests Off + ProxyTimeout 600 + + Order deny,allow + Allow from all + + ProxyPass / http://192.168.0.6/ + ProxyPassReverse / http://192.168.0.6/ + + + diff -r 6ef670b41c80 -r 7cc5d70d5d9b mirror-tools/stuff/usr/share/mirror-host/install --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mirror-tools/stuff/usr/share/mirror-host/install Mon Aug 09 09:37:59 2010 +0200 @@ -0,0 +1,25 @@ +#!/bin/sh + +grep -qs lguest-slitaz /etc/inittab || { +sed -i 's|^tty1::|tty16::respawn:/boot/lguest-slitaz tty16 /boot/guests/mirror.slitaz.org 192.168.0.1\n&|' /etc/inittab +cat >> /etc/init.d/local.sh < /proc/sys/net/ipv4/ip_forward +EOT +}