slitaz-modular rev 42
Started to add dnsmasq support into local-mirror. Will allow local lan version of tank to be possible. Add lfs.slitaz.org support also. Fixed hg repos pull.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Sun Mar 27 01:40:22 2011 +0000 (2011-03-27) |
parents | 636e958e0560 |
children | 2b10f14d9a17 |
files | initramfs/etc/dnsmasq.conf initramfs/usr/bin/local-mirror |
line diff
1.1 --- a/initramfs/etc/dnsmasq.conf Sun Mar 27 00:35:50 2011 +0000 1.2 +++ b/initramfs/etc/dnsmasq.conf Sun Mar 27 01:40:22 2011 +0000 1.3 @@ -4,7 +4,6 @@ 1.4 domain=slitaz.lan 1.5 local=/slitaz.lan/ 1.6 dhcp-range=192.168.1.100,192.168.1.149,255.255.255.0,72h 1.7 -dhcp-option=option:router,192.168.1.1 1.8 dhcp-option=option:domain-search,slitaz.lan 1.9 dhcp-leasefile=/tmp/dnsmasq.leases 1.10 dhcp-authoritative
2.1 --- a/initramfs/usr/bin/local-mirror Sun Mar 27 00:35:50 2011 +0000 2.2 +++ b/initramfs/usr/bin/local-mirror Sun Mar 27 01:40:22 2011 +0000 2.3 @@ -56,8 +56,10 @@ 2.4 ;; 2.5 bb) 2.6 [ -d /usr/share/slitaz/web-bb ] && cp -a /usr/share/slitaz/web-bb $WWW_DIR/bb 2.7 - [ -d /usr/share/slitaz/web ] && cp -a /usr/share/slitaz/web $WWW_DIR/bb/web 2.8 + #[ -d /usr/share/slitaz/web ] && cp -a /usr/share/slitaz/web $WWW_DIR/bb/web 2.9 [ -d $REPOS_DIR/website/pics ] && ln -sf $REPOS_DIR/website/pics $WWW_DIR/bb/pics 2.10 + [ -d $COOKING/wok ] || ln -sf $REPOS_DIR/wok $COOKING/clean-wok 2.11 + [ -d $STABLE/wok ] || ln -sf $REPOS_DIR/wok-stable $STABLE/clean-wok 2.12 echo -e "$WWW_DIR/bb" | tazwok webserver on 2.13 ;; 2.14 pkgs) 2.15 @@ -109,6 +111,9 @@ 2.16 [ -f $REPOS_DIR/slitaz-forge/tank/files/etc/mercurial/hgweb.config ] && cp -a $REPOS_DIR/slitaz-forge/tank/files/etc/mercurial/hgweb.config /etc/mercurial/hgweb.config 2.17 #[ -f /etc/mercurial/hgweb.conf ] && sed -i 's|style = slitaz|style = gitweb|g' /etc/mercurial/hgweb.config 2.18 ;; 2.19 + lfs) 2.20 + [ -d $WWW_DIR/lfs ] || ln -sf /usr/share/doc/lfs-book $WWW_DIR/lfs 2.21 + ;; 2.22 esac 2.23 } 2.24 2.25 @@ -125,7 +130,7 @@ 2.26 if [ ! -f $REPOS_DIR/$repo/.hg/hgrc-web ]; then 2.27 touch $REPOS_DIR/$repo/.hg/hgrc-web 2.28 echo "[paths]" >> $REPOS_DIR/$repo/.hg/hgrc-web 2.29 - echo "path = http://hg.slitaz.org/$repo/" >> $REPOS_DIR/$repo/.hg/hgrc-web 2.30 + echo "default = http://hg.slitaz.org/$repo/" >> $REPOS_DIR/$repo/.hg/hgrc-web 2.31 echo "[web]" >> $REPOS_DIR/$repo/.hg/hgrc-web 2.32 #[ -d $REPOS_DIR/$repo/.hg ] && echo "style = slitaz" >> $REPOS_DIR/$repo/.hg/hgrc-web 2.33 echo "staticurl = http://hg.slitaz.org/static/" >> $REPOS_DIR/$repo/.hg/hgrc-web 2.34 @@ -200,18 +205,20 @@ 2.35 done 2.36 echo "127.0.0.1 localhost $(cat /etc/hostname)" > /etc/hosts 2.37 for hostname in $ADDRESS; do 2.38 - END_IP=$(($END_IP+1)) 2.39 - for i in $END_IP; do 2.40 #if [ ! $(grep -l "${BASE_IP}.$i $hostname" /etc/hosts) ]; then 2.41 - echo "${BASE_IP}.$i $hostname" >> /etc/hosts 2.42 + echo "$IP_ADDR $hostname" >> /etc/hosts 2.43 #fi 2.44 - done 2.45 done 2.46 + if [ "$IP_ADDR" != "127.0.0.1" ]; then 2.47 + if [ ! $(grep -l 'dhcp-option=option:router' /etc/dnsmasq.conf) ]; then 2.48 + echo "dhcp-option=option:router,$ROUTER_IP" >> /etc/dnsmasq.conf 2.49 + fi 2.50 + fi 2.51 + echo "$PKGDIR" > $LOCALSTATE/mirror 2.52 if [ "$COMMAND" = "tank-only" ]; then 2.53 [ -f $VHOST_TANK_FILE ] && ln -sf $VHOST_TANK_FILE /etc/lighttpd/vhosts.conf 2.54 elif [ "$COMMAND" = "mirror-only" ]; then 2.55 [ -f $VHOST_MIRROR_FILE ] && ln -sf $VHOST_MIRROR_FILE /etc/lighttpd/vhosts.conf 2.56 - 2.57 else 2.58 [ -f $VHOST_FILE ] && ln -sf $VHOST_FILE /etc/lighttpd/vhosts.conf 2.59 fi