# SliTaz package receipt. PACKED_SIZE="220.0K" UNPACKED_SIZE="472.0K" PACKAGE="busybox-net" VERSION="1.28-20170822" GIT_TAG="753c4045e4f287fc4b4788afd94f58738a7f04b4" CATEGORY="base-system" SHORT_DESC="Busybox UNIX utilities with many network commands." MAINTAINER="pascal.bellard@slitaz.org" LICENSE="GPL2" [ -n "$TARGET" ] || TARGET="i486" DEPENDS="busybox" BUILD_DEPENDS="bzip2 uclibc-cross-compiler-$TARGET wget" TARBALL="busybox-$VERSION.tar.bz2" WEB_SITE="http://www.busybox.net/" WGET_URL="https://git.busybox.net/busybox/snapshot/busybox-$GIT_TAG.tar.bz2" CONFIG_FILES="/etc/dnsd.conf /etc/inetd.conf /etc/udhcpd.conf /etc/resolv.conf \ /etc/network.conf /etc/inetd.conf" apply_bb_patchs() { cd $src while read file; do [ -f done.$file ] && continue echo "Apply $file..." patch -p1 < $stuff/busybox-git-$file || return 1 touch done.$file done < /dev/null | \ awk '/=>/ { print $3 }' | while read file ; do cp -a $file _install/lib while [ -L "$file" ]; do dir="$(dirname $file)/" file="$(readlink $file)" case "$file" in /*) ;; *) file="$dir$file";; esac cp -a "$file" _install/lib done done chown 0.0 _install/lib/* } # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { mkdir -p $fs/boot $fs/bin $fs/sbin $fs/etc/init.d sed -e 's| *#.*$||' -e '/^$/d' < $stuff/services > $fs/etc/services cp -a $src/_install/bin/busybox $fs/bin for i in /bin/sh /bin/login /bin/false /sbin/mdev /init ; do ln -f $fs/bin/busybox $fs$i done # Busybox config files. touch $fs/etc/resolv.conf cp $stuff/inetd.conf $fs/etc cp $stuff/network.conf $fs/etc cp $stuff/daemon $fs/etc/init.d cp $stuff/network.sh $fs/etc/init.d for i in crond dnsd ftpd httpd inetd klogd ntpd syslogd telnetd tftpd \ udhcpd zcip ; do grep -qi config_$i=y $src/.config && ln -s daemon $fs/etc/init.d/$i done # Udhcpc stuff. mkdir -p $fs/usr/share/udhcpc cp $stuff/udhcp.script $fs/usr/share/udhcpc/default.script chmod +x $fs/usr/share/udhcpc/default.script sed -i '2,$s/^#.*//;/^$/d' $fs/etc/init.d/daemon $fs/etc/init.d/*.sh sed -i 's/^#.*//;/^$/d' $fs/etc/*.conf find $fs -exec touch -r $fs {} \; cp $stuff/busybox-net-git.config $fs/boot/config-busybox } config_form() { if [ -z "$MODE" ]; then [ -n "$INTERFACE" ] || INTERFACE=eth0 [ -n "$IP" ] || IP=192.168.0.6 [ -n "$NETMASK" ] || NETMASK=255.255.255.0 [ -n "$GATEWAY" ] || GATEWAY=192.168.0.1 [ -n "$DNS_SERVER" ] || DNS_SERVER='192.168.0.1 192.168.0.2' fi cat < Interface Network configuration Internet address Netmask Gateway DNS server(s) EOT } config_note() { cat < function update_form() { var hide = true for (var i = 0; i < document.forms.length; i++) { for (var j = 0; j < document.forms[i].elements.length; j++) { var obj = document.forms[i].elements[j] if (obj.name == "MODE" && obj.value == "STATIC") hide = false } } for (var i = 0; i < document.forms.length; i++) { for (var j = 0; j < document.forms[i].elements.length; j++) { var obj = document.forms[i].elements[j] switch (obj.name) { case "IP" : case "NETMASK" : case "GATEWAY" : case "DNS_SERVER" : obj.disabled = hide; break; } } } } update_form() window.onchange = update_form //--> EOT } post_install() { sed -i 's|local.sh|network.sh &|' $1/etc/rcS.conf chmod 4755 $1/bin/busybox ln -fs /proc/mounts $1/etc/mtab DHCP="no" STATIC="yes" case "$MODE" in "") return 1;; DISABLE) STATIC="no" ;; DHCP) DHCP="yes" STATIC="no" esac sed -i -e "s/^DNS_SERVER=.*/DNS_SERVER=\"$DNS_SERVER\"/" \ -e "s/^INTERFACE=.*/INTERFACE=\"$INTERFACE\"/" \ -e "s/^NETMASK=.*/NETMASK=\"$NETMASK\"/" \ -e "s/^GATEWAY=.*/GATEWAY=\"$GATEWAY\"/" \ -e "s/^STATIC=.*/STATIC=\"$STATIC\"/" \ -e "s/^DHCP=.*/DHCP=\"$DHCP\"/" \ -e "s/^IP=.*/IP=\"$IP\"/" $1/etc/network.conf }