diff --git a/target/router/build.sh b/target/router/build.sh index b796a399a..fa829dd8d 100644 --- a/target/router/build.sh +++ b/target/router/build.sh @@ -20,8 +20,10 @@ chmod 700 $outdir cd $outdir echo_status "Copying program binaries." -for x in bash modprobe modprobe.old lsmod lsmod.old uname awk lspci find \ - sysctl mount umount sshd ssh-keygen agetty sleep cat ls ps ln strace +for x in bash modprobe lsmod uname gawk lspci find openvpn killall sync dhclient \ + sysctl mount umount sshd ssh-keygen agetty sleep cat ls ps ln strace \ + swapon swapoff mkdir killall5 reboot sed sort dhclient-script ifconfig \ + expr hostname route nvi ez-ipupdate pptp rm scp do for y in bin sbin usr/bin usr/sbin; do [ -f $build_root/$y/$x ] && cp $build_root/$y/$x initrd/bin/ @@ -30,7 +32,7 @@ do echo_error "Did not find program binary for '$x'." done -for x in iproute2 iptables +for x in iproute2 iptables grub pppd do echo_status "Copy entire $x package." while read dummy fn @@ -51,15 +53,33 @@ do "cd /; ldd \`type -p $x\`"; ) done +echo_status "Copying shutdown script." +cp $base/target/$target/shutdown initrd/bin/ +chmod +x initrd/bin/shutdown +echo_status "Copying rocknet scripts." +cp -r $build_root/etc/network initrd/etc/ +cp -r $build_root/etc/services initrd/etc/ +cp $build_root/sbin/if{up,down} initrd/bin/ +echo_status "Copying some terminfo database entries." +mkdir -p initrd/share/terminfo/{v,x,l} +cp -r $build_root/usr/share/terminfo/v/vt100 initrd/share/terminfo/v/ +cp -r $build_root/usr/share/terminfo/l/linux initrd/share/terminfo/l/ +cp -r $build_root/usr/share/terminfo/x/xterm initrd/share/terminfo/x/ +echo_status "deleting manpages and other stuff." +rm -rf initrd/share/man +rm -rf initrd/var/adm + echo_status "Copying kernel modules." cp -a $build_root/lib/modules initrd/lib/ cd initrd/lib/modules/*/ -rm -rf pcmcia kernel/fs kernel/drivers/{bluetooth,cdrom,pcmcia,scsi,sound,usb} +rm -rf pcmcia kernel/fs kernel/drivers/{bluetooth,cdrom,pcmcia,scsi,sound,usb} +rm -rf kernel/sound rm -rf kernel/net/{8021q,appletalk,bluetooth,irda,khttpd,decnet,econet,ipx} -rm -rf kernel/drivers/{video,telephony,mtd,message,media,md,input,ide,i2c} +rm -rf kernel/drivers/{video,telephony,mtd,message,media,md,input,ide,i2c,ieee1394} rm -rf kernel/drivers/{hotplug,char,block} cd $outdir + echo_status "Create init script." echo -e '#!/bin/bash\ncd; exec /bin/bash --login' > initrd/bin/login-shell cp $base/target/$target/init.sh initrd/bin/init @@ -82,8 +102,8 @@ cp $build_root/boot/vmlinuz . echo_status "Create isolinux setup." tar --use-compress-program=bzip2 \ - -xf $base/download/router/syslinux-2.11.tar.bz2 \ - syslinux-2.11/isolinux.bin -O > isolinux.bin + -xOf $base/download/mirror/s/syslinux-3.07.tar.bz2 \ + syslinux-3.07/isolinux.bin > isolinux.bin cp $base/target/$target/isolinux.cfg . echo_status "Create iso description." diff --git a/target/router/init.sh b/target/router/init.sh index 823b665fc..a4f35e739 100644 --- a/target/router/init.sh +++ b/target/router/init.sh @@ -2,6 +2,7 @@ mount -n -t proc none /proc mount -n -t tmpfs none /tmp +mount -n -t devpts none /dev/pts cat /proc/mounts > /etc/fstab cat /proc/mounts > /etc/mtab @@ -21,10 +22,12 @@ echo " ** http://www.rocklinux.org/ **" echo " *************************************" echo -for x in vc/{1,2,3,4,5,6} ; do +for x in vc/{1,2,3,4,5,6} tts/0 ; do ( ( while : ; do agetty -i 38400 $x -n -l /bin/login-shell ; done ) & ) done - + +[ -x /etc/network/rocknet ] && /etc/network/rocknet default auto up + exec < /dev/null > /dev/null 2>&1 while : ; do sleep 1 ; done diff --git a/target/router/kernel.conf b/target/router/kernel.conf new file mode 100644 index 000000000..6985b8f3f --- /dev/null +++ b/target/router/kernel.conf @@ -0,0 +1,105 @@ + +# --- ROCK-COPYRIGHT-NOTE-BEGIN --- +# +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# Please add additional copyright information _after_ the line containing +# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by +# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! +# +# ROCK Linux: rock-src/target/livecd/kernel.conf +# ROCK Linux is Copyright (C) 1998 - 2005 Clifford Wolf +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. A copy of the GNU General Public +# License can be found at Documentation/COPYING. +# +# Many people helped and are helping developing ROCK Linux. Please +# have a look at http://www.rocklinux.org/ and the Documentation/TEAM +# file for details. +# +# --- ROCK-COPYRIGHT-NOTE-END --- + +# boot, damn it! +CONFIG_X86_GENERIC=y + +#serial console +CONFIG_SERIAL_8250_CONSOLE=y + +# nfs server as module (smaller kernel image) +CONFIG_NFSD=m + +# no FireWire support +CONFIG_IEEE1394=n +CONFIG_IEEE1394_VIDEO1394=n +CONFIG_IEEE1394_SBP2=n +CONFIG_IEEE1394_DV1394=n +CONFIG_IEEE1394_RAWIO=n +CONFIG_IEEE1394_CMP=n +CONFIG_IEEE1394_ETH1394=n + +# no framebuffer stuff +CONFIG_VGA_CONSOLE=n +CONFIG_VIDEO_SELECT=n +CONFIG_FB=n +CONFIG_FRAMEBUFFER_CONSOLE=n +CONFIG_LOGO=n + +# no agp +CONFIG_AGP=n + +# no drm +CONFIG_DRM=n + +# no MD +CONFIG_MD=n + +# no oss! +CONFIG_SOUND_PRIME=n +CONFIG_DMASOUND_PMAC=n + +# no usb +CONFIG_USB=n +CONFIG_USB_GADGET=n + +# no weird filesystems +CONFIG_XFS_FS=n +CONFIG_JFS_FS=n +CONFIG_REISERFS_FS=n +CONFIG_QUOTA=n +CONFIG_UDF_FS=n +CONFIG_MSDOS_FS=n +CONFIG_VFAT_FS=n +CONFIG_NTFS_FS=n +CONFIG_CIFS=n +CONFIG_NCP_FS=n +CONFIG_AFS_FS=n +CONFIG_ADFS_FS=n +CONFIG_AFFS_FS=n +CONFIG_HFS_FS=n +CONFIG_HFSPLUS_FS=n +CONFIG_BEFS_FS=n +CONFIG_BFS_FS=n +CONFIG_EFS_FS=n +CONFIG_VXFS_FS=n +CONFIG_HPFS_FS=n +CONFIG_QNX4FS_FS=n +CONFIG_SYSV_FS=n +CONFIG_UFS_FS=n + +# no profiling +CONFIG_PROFILING=n + +# no acpi +CONFIG_ACPI=n + +# rarely needed for a router... +CONFIG_IBM_ASM=n +CONFIG_MMC=n +CONFIG_PARPORT=n +CONFIG_SMP=n +CONFIG_PREEMPT=n +CONFIG_FUSION=n +CONFIG_I2O=n +CONFIG_W1=n diff --git a/target/router/kernel.conf.sh b/target/router/kernel.conf.sh new file mode 100644 index 000000000..04b5f1771 --- /dev/null +++ b/target/router/kernel.conf.sh @@ -0,0 +1,17 @@ + +echo "router target -> disabling some settings ..." + +sed -e "s/CONFIG_VIDEO\(.*\)=./# CONFIG_VIDEO\1 is not set/" \ + -e "s/CONFIG_PHONE\(.*\)=./# CONFIG_PHONE\1 is not set/" \ + -e "s/CONFIG_RADIO\(.*\)=./# CONFIG_RADIO\1 is not set/" \ + -e "s/CONFIG_HAMRADIO\(.*\)=./# CONFIG_HAMRADIO\1 is not set/" \ + -e "s/CONFIG_SMP\(.*\)=./# CONFIG_SMP\1 is not set/" \ + -e "s/CONFIG_SOUND_\(.*\)=./# CONFIG_SOUND_\1 is not set/" \ + -e "s/CONFIG_PCI_NAMES\(.*\)=./# CONFIG_PCI_NAMES\1 is not set/" \ + -e "s/CONFIG_INPUT\(.*\)=./# CONFIG_INPUT\1 is not set/" \ + -e "s/CONFIG_GAMEPORT\(.*\)=./# CONFIG_GAMEPORT\1 is not set/" \ + -e "s/CONFIG_SCSI\(.*\)=./# CONFIG_SCSI\1 is not set/" \ + $1 > .config.router + +mv .config.router $1 + diff --git a/target/router/pkgsel.sed b/target/router/pkgsel.sed index c9b9e8406..c41315b58 100644 --- a/target/router/pkgsel.sed +++ b/target/router/pkgsel.sed @@ -1,61 +1,53 @@ -# This file is auto-generated from pkgsel.sh / 00-dirtree / { p; d; } -/ acl / { p; d; } -/ attr / { p; d; } / autoconf / { p; d; } -/ automake=automake18 / { p; d; } +/ automake=automake17 / { p; d; } / bash=bash2 / { p; d; } -/ bdb=bdb33 / { p; d; } -/ bdb=bdb41 / { p; d; } / binutils / { p; d; } / bison / { p; d; } / bzip2 / { p; d; } / coreutils / { p; d; } -/ dietlibc / { p; d; } +/ dhcp / { p; d; } / diffutils / { p; d; } -/ e2fsprogs / { p; d; } +/ ezipupdate / { p; d; } / findutils / { p; d; } / flex / { p; d; } / gawk / { p; d; } -/ gcc3 / { p; d; } -/ gcc33 / { p; d; } -/ gccx / { p; d; } -/ gdbm / { p; d; } +/ gcc / { p; d; } / gettext / { p; d; } -/ glibc22 / { p; d; } -/ glibc23 / { p; d; } +/ glibc / { p; d; } / grep / { p; d; } / groff / { p; d; } +/ grub / { p; d; } / gzip / { p; d; } / iproute2 / { p; d; } / iptables / { p; d; } / liblockfile / { p; d; } -/ libtool / { p; d; } -/ linux24 / { p; d; } -/ linux24-header / { p; d; } -/ linux24-src / { p; d; } +/ linux / { p; d; } +/ lzo / { p; d; } / m4 / { p; d; } / make / { p; d; } -/ man / { p; d; } / mktemp / { p; d; } / module-init-tools / { p; d; } -/ modutils / { p; d; } / ncurses / { p; d; } / net-tools / { p; d; } +/ nvi / { p; d; } / openssh / { p; d; } / openssl / { p; d; } +/ openvpn / { p; d; } / patch / { p; d; } / pciutils / { p; d; } -/ pcmcia-cs / { p; d; } / perl5 / { p; d; } +/ ppp / { p; d; } +/ pptp-linux / { p; d; } / procps / { p; d; } -/ psutils / { p; d; } +/ psmisc / { p; d; } +/ rocknet / { p; d; } / sed / { p; d; } / strace / { p; d; } / sysfiles / { p; d; } +/ sysvinit / { p; d; } / tar / { p; d; } / tcp_wrappers / { p; d; } -/ tcsh / { p; d; } / texinfo / { p; d; } / time / { p; d; } / util-linux / { p; d; } diff --git a/target/router/pkgsel.sh b/target/router/pkgsel.sh deleted file mode 100644 index ebb4fbd9d..000000000 --- a/target/router/pkgsel.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# -# We only need iptables, ip+tc, ssh and a kernel. But since we would -# make a native build we need a lot of other stuff for building those -# packages. This is autodetected here. -# -# Various small other packages (like bash and fileutils) which are -# also needed for the router are selected automatically because of the -# dependencies ... - -perl -e ' - my @x=qw/iptables iproute2 openssh linux24 util-linux time - coreutils procps strace pciutils 00-dirtree/; - $b{$_}=1 foreach @x; - print "\n"; - print "ALL: ".join(" ", @x)."\n"; - print "\n"; - while (<>) { - next unless /(.*): [0-9]* [0-9]* (.*)/; - my ($pkg, $deps) = ($1, ''); - foreach (split /\s+/, $2) { - next if /^(linux26|alsa|rpm|pam|gcc2)([^a-z]|$)/; - next unless -d "../../package/base/$_"; - $deps .= " $_"; $b{$_} = 1; - } - print "$pkg: $deps\n\t\@echo \"\/ $pkg \/ { p; d; }\"\n"; - $a{$pkg} = 1; - } - foreach (keys %b) { print "$_:\n\t\@echo \"/ $_ / { p; d; }\"\n\n" if not defined $a{$_}; } -' < ../../scripts/dep_db.txt > pkgsel.mk - -echo '# This file is auto-generated from pkgsel.sh' > pkgsel.sed -make -f pkgsel.mk ALL 2> /dev/null | sort -u >> pkgsel.sed -echo 'd;' >> pkgsel.sed; rm -f pkgsel.mk - diff --git a/target/router/shutdown b/target/router/shutdown new file mode 100644 index 000000000..ae045ae38 --- /dev/null +++ b/target/router/shutdown @@ -0,0 +1,21 @@ +#!/bin/sh + +echo "Sending all processes a SIGTERM (15)." +killall5 -15 || error=$? ; sleep 5 + +echo "Sending all processes a 2nd SIGTERM (15)." +killall5 -15 || error=$? ; sleep 5 + +echo "Sending all processes a SIGKILL (9)." +killall5 -9 || error=$? ; sleep 5 + +echo "Turning off swap devices." +swapoff -a || error=$? +sync ; sleep 1 + +echo "Unmounting filesystems." +umount -advf || error=$? + +echo "Reboot ..." +reboot -f +