# SliTaz package receipt. PACKED_SIZE="16.0K" UNPACKED_SIZE="72.0K" PACKAGE="base-tiny" VERSION="1.0" CATEGORY="configuration" SHORT_DESC="Tiny SliTaz base configuration files" MAINTAINER="pascal.bellard@slitaz.org" WEB_SITE="http://tiny.slitaz.org/" AUTO_SELECTION="always" CONFIG_FILES="/etc/network.conf /etc/passwd /etc/shadow \ /root/.profile /etc/fstab /etc/init.d/local.sh" # Rules to configure and make the package. compile_rules() { mkdir -p fs/var/lib fs/etc echo "none" > fs/var/lib/detected-modules echo "LANG=C" > fs/etc/locale.conf while read pkg file ; do if [ ! -s $pkg*/fs$file ]; then tazpkg get $pkg tazpkg extract $pkg*.tazpkg fi mkdir -p fs$(dirname $file) mv $pkg*/fs$file fs$(dirname $file) || return 1 done << EOT busybox /etc/udhcpd.conf busybox /etc/inetd.conf slitaz-base-files /etc/fstab slitaz-base-files /etc/group slitaz-base-files /etc/passwd slitaz-base-files /etc/shadow slitaz-boot-scripts /etc/inittab slitaz-boot-scripts /etc/network.conf slitaz-boot-scripts /etc/init.d/local.sh slitaz-boot-scripts /etc/rcS.conf EOT sed -i 's/:x:/:!:/' fs/etc/passwd sed -i 's/UDEV=.*/UDEV="no"/;s/hwconf.sh l/l/' fs/etc/rcS.conf } # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { cp -a fs/. $fs } config_form() { [ -n "$PASSWORD" ] || PASSWORD=root [ -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' [ -n "$FSTAB" ] || FSTAB='/dev/hda1 /mnt ext3 defaults 0 2' [ -n "$RC_LOCAL" ] || RC_LOCAL='[ -x /mnt/boot/init ] && /mnt/boot/init' cat < Root password (empty=disable) Interface Network configuration Internet address Netmask Gateway DNS server(s) Filesystems Additional boot commands EOT } post_install() { 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 if [ -n "$PASSWORD" ]; then mkdir $1/lib cp -a /lib/lib[cm][.-]* /lib/ld* $1/lib cp -a /bin/busybox $1/lib/chpasswd echo "root:$PASSWORD" | chroot $1/ /lib/chpasswd -m rm -rf $1/lib else sed -i 's/^root:[^:]*:/root::/' $1/etc/passwd mkdir $1/root 2> /dev/null cat > $1/root/.profile <> $1/etc/fstab <> $1/etc/init.d/local.sh <