From 07bee5903dff0e465321cd9440aff46ce87e19c9 Mon Sep 17 00:00:00 2001 From: Markham Date: Thu, 19 Nov 2015 19:31:01 +0100 Subject: [PATCH] make rootfs bootable from stick --- skel-root-apollo/etc/TZ | 1 + skel-root-kronos/etc/TZ | 1 + skel-root-nevis/bin/reboot.sh | 3 - skel-root-nevis/etc/TZ | 1 + skel-root-nevis/etc/filesystems | 0 skel-root-nevis/etc/fstab | 4 +- skel-root-nevis/etc/hosts | 0 skel-root-nevis/etc/ifplugd/ifplugd.action | 10 ++ skel-root-nevis/etc/inetd.conf | 2 + skel-root-nevis/etc/init.d/rcS | 101 +++++++++++++ .../etc/init.d/rcS-kernel-2.6.26.8-cnxt | 73 ---------- .../etc/init.d/rcS-kernel-2.6.34.13-cnxt | 76 ---------- .../etc/init.d/rcS-kernel-2.6.35.14-cnxt | 76 ---------- .../etc/init.d/rcS-kernel-2.6.39.4-cnxt | 78 ---------- skel-root-nevis/etc/inittab | 0 skel-root-nevis/etc/localtime | Bin skel-root-nevis/etc/mdev.conf | 14 ++ skel-root-nevis/etc/mdev/mdev-mount.sh | 135 ++++++++++++++++++ skel-root-nevis/etc/mdev/usbdev.sh | 35 +++++ skel-root-nevis/etc/mdev/wlan.sh | 19 +++ skel-root-nevis/etc/modprobe.conf | 0 skel-root-nevis/etc/network/interfaces | 32 ++--- skel-root-nevis/etc/network/pre-wlan0.sh | 6 +- skel-root-nevis/etc/nsswitch.conf | 0 skel-root-nevis/etc/passwd | 0 skel-root-nevis/etc/profile | 26 ++-- skel-root-nevis/etc/protocols | 43 ++++-- skel-root-nevis/etc/resolv.conf | 0 skel-root-nevis/etc/rpc | 0 skel-root-nevis/etc/services | 0 skel-root-nevis/etc/timezone.xml | 0 skel-root-nevis/etc/vsftpd.conf | 14 ++ skel-root-nevis/etc/wpa_supplicant.conf | 10 ++ skel-root-nevis/sbin/mknodes | 30 ++-- skel-root-nevis/var/etc/.telnetd | 0 skel-root-nevis/var/etc/.vsftpd | 0 skel-root-nevis/var/etc/profile | 3 - 37 files changed, 430 insertions(+), 363 deletions(-) create mode 100644 skel-root-apollo/etc/TZ create mode 100644 skel-root-kronos/etc/TZ delete mode 100755 skel-root-nevis/bin/reboot.sh create mode 100644 skel-root-nevis/etc/TZ mode change 100755 => 100644 skel-root-nevis/etc/filesystems mode change 100755 => 100644 skel-root-nevis/etc/fstab mode change 100755 => 100644 skel-root-nevis/etc/hosts create mode 100755 skel-root-nevis/etc/ifplugd/ifplugd.action create mode 100644 skel-root-nevis/etc/inetd.conf create mode 100755 skel-root-nevis/etc/init.d/rcS delete mode 100755 skel-root-nevis/etc/init.d/rcS-kernel-2.6.26.8-cnxt delete mode 100755 skel-root-nevis/etc/init.d/rcS-kernel-2.6.34.13-cnxt delete mode 100755 skel-root-nevis/etc/init.d/rcS-kernel-2.6.35.14-cnxt delete mode 100755 skel-root-nevis/etc/init.d/rcS-kernel-2.6.39.4-cnxt mode change 100755 => 100644 skel-root-nevis/etc/inittab mode change 100755 => 100644 skel-root-nevis/etc/localtime create mode 100644 skel-root-nevis/etc/mdev.conf create mode 100755 skel-root-nevis/etc/mdev/mdev-mount.sh create mode 100755 skel-root-nevis/etc/mdev/usbdev.sh create mode 100755 skel-root-nevis/etc/mdev/wlan.sh mode change 100755 => 100644 skel-root-nevis/etc/modprobe.conf mode change 100755 => 100644 skel-root-nevis/etc/nsswitch.conf mode change 100755 => 100644 skel-root-nevis/etc/passwd mode change 100755 => 100644 skel-root-nevis/etc/profile mode change 100755 => 100644 skel-root-nevis/etc/protocols mode change 100755 => 100644 skel-root-nevis/etc/resolv.conf mode change 100755 => 100644 skel-root-nevis/etc/rpc mode change 100755 => 100644 skel-root-nevis/etc/services mode change 100755 => 100644 skel-root-nevis/etc/timezone.xml create mode 100644 skel-root-nevis/etc/vsftpd.conf create mode 100644 skel-root-nevis/etc/wpa_supplicant.conf delete mode 100644 skel-root-nevis/var/etc/.telnetd delete mode 100644 skel-root-nevis/var/etc/.vsftpd delete mode 100755 skel-root-nevis/var/etc/profile diff --git a/skel-root-apollo/etc/TZ b/skel-root-apollo/etc/TZ new file mode 100644 index 0000000..9ce1c5b --- /dev/null +++ b/skel-root-apollo/etc/TZ @@ -0,0 +1 @@ +CET-1CEST,M3.5.0/2,M10.5.0/3 diff --git a/skel-root-kronos/etc/TZ b/skel-root-kronos/etc/TZ new file mode 100644 index 0000000..9ce1c5b --- /dev/null +++ b/skel-root-kronos/etc/TZ @@ -0,0 +1 @@ +CET-1CEST,M3.5.0/2,M10.5.0/3 diff --git a/skel-root-nevis/bin/reboot.sh b/skel-root-nevis/bin/reboot.sh deleted file mode 100755 index 16a7da0..0000000 --- a/skel-root-nevis/bin/reboot.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -echo 1 > /proc/sys/kernel/sysrq -echo b > /proc/sysrq-trigger diff --git a/skel-root-nevis/etc/TZ b/skel-root-nevis/etc/TZ new file mode 100644 index 0000000..9ce1c5b --- /dev/null +++ b/skel-root-nevis/etc/TZ @@ -0,0 +1 @@ +CET-1CEST,M3.5.0/2,M10.5.0/3 diff --git a/skel-root-nevis/etc/filesystems b/skel-root-nevis/etc/filesystems old mode 100755 new mode 100644 diff --git a/skel-root-nevis/etc/fstab b/skel-root-nevis/etc/fstab old mode 100755 new mode 100644 index 971fd92..2967beb --- a/skel-root-nevis/etc/fstab +++ b/skel-root-nevis/etc/fstab @@ -4,6 +4,4 @@ proc /proc proc defaults 0 0 devpts /dev/pts devpts defaults,gid=5,mode=620 0 0 tmpfs /tmp tmpfs defaults 0 0 -sysfs /sys sysfs defaults 0 0 -/dev/sda1 /media/sda1 auto defaults 0 0 -/dev/sdb1 /media/sdb1 auto defaults 0 0 + diff --git a/skel-root-nevis/etc/hosts b/skel-root-nevis/etc/hosts old mode 100755 new mode 100644 diff --git a/skel-root-nevis/etc/ifplugd/ifplugd.action b/skel-root-nevis/etc/ifplugd/ifplugd.action new file mode 100755 index 0000000..dc54531 --- /dev/null +++ b/skel-root-nevis/etc/ifplugd/ifplugd.action @@ -0,0 +1,10 @@ +#!/bin/sh +# +# simplest possible ifplugd script ;-) +# +LOG="logger -t ${0##*/}" +case $2 in + up) ifup $1 | $LOG ;; + down) ifdown $1 | $LOG ;; +esac +true diff --git a/skel-root-nevis/etc/inetd.conf b/skel-root-nevis/etc/inetd.conf new file mode 100644 index 0000000..4648891 --- /dev/null +++ b/skel-root-nevis/etc/inetd.conf @@ -0,0 +1,2 @@ +ftp stream tcp nowait root /sbin/vsftpd /etc/vsftpd.conf +telnet stream tcp nowait root /sbin/telnetd /sbin/telnetd diff --git a/skel-root-nevis/etc/init.d/rcS b/skel-root-nevis/etc/init.d/rcS new file mode 100755 index 0000000..816424b --- /dev/null +++ b/skel-root-nevis/etc/init.d/rcS @@ -0,0 +1,101 @@ +#!/bin/sh +export PATH=/var/bin:/var/sbin:/var/plugins:/sbin:/bin:/usr/sbin:/usr/bin +export TERM=linux +export TZ=`cat /etc/TZ` + +# for next boot ;) +[ -e /dev/console ] || mknod -m 644 /dev/console c 5 1 +mount -t proc proc /proc +mount -t tmpfs dev /dev +# make sure that important devices are there before mdev startup +# otherwise a redirection in a mdev script might create them... +mknod -m 644 /dev/console c 5 1 +mknod -m 666 /dev/null c 1 3 +mount -t sysfs sys /sys +mount -t tmpfs tmp /tmp +mkdir /dev/pts +mount -t devpts devpts /dev/pts +mkdir -p /dev/shm/usb +# directory for mounting disks +mkdir /tmp/media +[ -e /media ] || ln -sf /tmp/media /media + +# manually create nodes for crappy drivers +sync +/sbin/mknodes +sync + +# make mdev try to process the events in sequential order +echo >/dev/mdev.seq +# register mdev as hotplug handler +echo $(which mdev) > /proc/sys/kernel/hotplug +sync + +dmesg -n1 + +insmod cs_frontpanel +if [ -e /etc/init.d/update.sh ]; then + /etc/init.d/update.sh +fi +/bin/dt -ls01 +/bin/dt -ls02 +/bin/dt -c +/bin/dt -t"Loading drivers" + +insmod 8712u +insmod 8192cu +insmod rt2870sta +#insmod rt3070sta + +insmod cifs +insmod fuse +insmod usbserial +insmod ftdi_sio +insmod cnxt_i2c +insmod cnxt_kal +insmod cnxt_base init=0 + +insmod cnxt_fb cnxtfb_standalone=1 cnxtfb_width=1280 cnxtfb_height=720 + +insmod cnxt_lnx +insmod cnxt_alsa +insmod cs_control hdd_power=1 + +insmod stv6110 verbose=0 +insmod stv090x verbose=0 +insmod tda10023 +insmod avl2108 +insmod max2112 +insmod cs_frontend_prop +insmod dvb-core +insmod cs_frontend +insmod cnxt_sata_drv + +/sbin/inetd + +if [ -e /etc/init.d/rcB.local ]; then + /etc/init.d/rcB.local +fi + +# start up mdev with coldplugging +mdev -s +sync + +. /etc/profile + +if [ -e /var/etc/.telnetd ]; then + /sbin/telnetd -l /bin/login +fi +if [ -e /var/etc/.vsftpd ]; then + /sbin/vsftpd +fi +#mount -t cifs //NAS_IP/movies /mnt/movies -o user=root,passwd=coolstream // some example for smb NAS +if [ -e /etc/init.d/rcB ]; then + /etc/init.d/rcB +fi +if [ -e /etc/init.d/rcS.local ]; then + /etc/init.d/rcS.local +fi + +/etc/init.d/upnp.sh & +/etc/init.d/start_neutrino & diff --git a/skel-root-nevis/etc/init.d/rcS-kernel-2.6.26.8-cnxt b/skel-root-nevis/etc/init.d/rcS-kernel-2.6.26.8-cnxt deleted file mode 100755 index 43bc736..0000000 --- a/skel-root-nevis/etc/init.d/rcS-kernel-2.6.26.8-cnxt +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh -export PATH=/var/bin:/var/sbin:/var/plugins:/sbin:/bin:/usr/sbin:/usr/bin - -/sbin/mknodes 2> /dev/null - -/bin/mount /proc -/bin/mount -a -hostname -F /etc/hostname -dmesg -n1 - -/sbin/insmod cs_frontpanel -if [ -e /etc/init.d/update.sh ]; then - /etc/init.d/update.sh -fi -/bin/dt -t"Init hardware" -/sbin/insmod cnxt_kal -/sbin/insmod cnxt_base init=0 -/sbin/insmod cnxt_fb cnxtfb_standalone=1 cnxtfb_width=1280 cnxtfb_height=720 -/sbin/insmod cnxt_lnx -/sbin/insmod cnxt_alsa -/sbin/insmod cs_control hdd_power=1 -/sbin/insmod cnxt_i2c -/sbin/insmod cnxt_sata_drv - -/sbin/insmod usb-storage - -/sbin/insmod 8712u -/sbin/insmod 8192cu -#/sbin/insmod rt3070sta - -/sbin/ifup -a - -/bin/dt -ls01 -/bin/dt -ls02 -/bin/dt -c -/bin/dt -t"Loading drivers" - -/sbin/insmod cifs -/sbin/insmod fuse -/sbin/insmod usbserial -/sbin/insmod ftdi_sio - -if [ -e /etc/init.d/rcB.local ]; then - /etc/init.d/rcB.local -fi - -/sbin/insmod stv6110 verbose=0 -/sbin/insmod stv090x verbose=0 -/sbin/insmod tda10023 -/sbin/insmod avl2108 -/sbin/insmod max2112 -/sbin/insmod cs_frontend_prop -/sbin/insmod dvb-core -/sbin/insmod cs_frontend - -. /etc/profile - -if [ -e /var/etc/.telnetd ]; then - /sbin/telnetd -l /bin/login -fi -if [ -e /var/etc/.vsftpd ]; then - /sbin/vsftpd -fi -#mount -t cifs //NAS_IP/movies /mnt/movies -o user=root,passwd=coolstream // some example for smb NAS -if [ -e /etc/init.d/rcB ]; then - /etc/init.d/rcB -fi -if [ -e /etc/init.d/rcS.local ]; then - /etc/init.d/rcS.local -fi - -/etc/init.d/upnp.sh & -/etc/init.d/start_neutrino & diff --git a/skel-root-nevis/etc/init.d/rcS-kernel-2.6.34.13-cnxt b/skel-root-nevis/etc/init.d/rcS-kernel-2.6.34.13-cnxt deleted file mode 100755 index a0b4505..0000000 --- a/skel-root-nevis/etc/init.d/rcS-kernel-2.6.34.13-cnxt +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/sh -export PATH=/var/bin:/var/sbin:/var/plugins:/sbin:/bin:/usr/sbin:/usr/bin - -/sbin/mknodes 2> /dev/null - -/bin/mount /proc -/bin/mount -a -hostname -F /etc/hostname -dmesg -n1 - -/sbin/insmod cs_frontpanel -if [ -e /etc/init.d/update.sh ]; then - /etc/init.d/update.sh -fi -/bin/dt -t"Init hardware" -/sbin/insmod cnxt_kal -/sbin/insmod cnxt_base init=0 -/sbin/insmod cnxt_fb cnxtfb_standalone=1 cnxtfb_width=1280 cnxtfb_height=720 -/sbin/insmod cnxt_lnx -/sbin/insmod cnxt_alsa -/sbin/insmod cs_control hdd_power=1 -/sbin/insmod cnxt_i2c -/sbin/insmod cnxt_sata_drv - -/sbin/insmod usb-storage - -/sbin/insmod 8712u -/sbin/insmod 8192cu -/sbin/insmod r8192u_usb -/sbin/insmod rt2870sta -#/sbin/insmod rt3070sta - -/sbin/ifup -a - -/bin/dt -ls01 -/bin/dt -ls02 -/bin/dt -c -/bin/dt -t"Loading drivers" - -/sbin/insmod md4 -/sbin/insmod cifs -/sbin/insmod fuse -/sbin/insmod usbserial -/sbin/insmod ftdi_sio - -if [ -e /etc/init.d/rcB.local ]; then - /etc/init.d/rcB.local -fi - -/sbin/insmod stv6110 verbose=0 -/sbin/insmod stv090x verbose=0 -/sbin/insmod tda10023 -/sbin/insmod avl2108 -/sbin/insmod max2112 -/sbin/insmod cs_frontend_prop -/sbin/insmod dvb-core -/sbin/insmod cs_frontend - -. /etc/profile - -if [ -e /var/etc/.telnetd ]; then - /sbin/telnetd -l /bin/login -fi -if [ -e /var/etc/.vsftpd ]; then - /sbin/vsftpd -fi -#mount -t cifs //NAS_IP/movies /mnt/movies -o user=root,passwd=coolstream // some example for smb NAS -if [ -e /etc/init.d/rcB ]; then - /etc/init.d/rcB -fi -if [ -e /etc/init.d/rcS.local ]; then - /etc/init.d/rcS.local -fi - -/etc/init.d/upnp.sh & -/etc/init.d/start_neutrino & diff --git a/skel-root-nevis/etc/init.d/rcS-kernel-2.6.35.14-cnxt b/skel-root-nevis/etc/init.d/rcS-kernel-2.6.35.14-cnxt deleted file mode 100755 index a0b4505..0000000 --- a/skel-root-nevis/etc/init.d/rcS-kernel-2.6.35.14-cnxt +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/sh -export PATH=/var/bin:/var/sbin:/var/plugins:/sbin:/bin:/usr/sbin:/usr/bin - -/sbin/mknodes 2> /dev/null - -/bin/mount /proc -/bin/mount -a -hostname -F /etc/hostname -dmesg -n1 - -/sbin/insmod cs_frontpanel -if [ -e /etc/init.d/update.sh ]; then - /etc/init.d/update.sh -fi -/bin/dt -t"Init hardware" -/sbin/insmod cnxt_kal -/sbin/insmod cnxt_base init=0 -/sbin/insmod cnxt_fb cnxtfb_standalone=1 cnxtfb_width=1280 cnxtfb_height=720 -/sbin/insmod cnxt_lnx -/sbin/insmod cnxt_alsa -/sbin/insmod cs_control hdd_power=1 -/sbin/insmod cnxt_i2c -/sbin/insmod cnxt_sata_drv - -/sbin/insmod usb-storage - -/sbin/insmod 8712u -/sbin/insmod 8192cu -/sbin/insmod r8192u_usb -/sbin/insmod rt2870sta -#/sbin/insmod rt3070sta - -/sbin/ifup -a - -/bin/dt -ls01 -/bin/dt -ls02 -/bin/dt -c -/bin/dt -t"Loading drivers" - -/sbin/insmod md4 -/sbin/insmod cifs -/sbin/insmod fuse -/sbin/insmod usbserial -/sbin/insmod ftdi_sio - -if [ -e /etc/init.d/rcB.local ]; then - /etc/init.d/rcB.local -fi - -/sbin/insmod stv6110 verbose=0 -/sbin/insmod stv090x verbose=0 -/sbin/insmod tda10023 -/sbin/insmod avl2108 -/sbin/insmod max2112 -/sbin/insmod cs_frontend_prop -/sbin/insmod dvb-core -/sbin/insmod cs_frontend - -. /etc/profile - -if [ -e /var/etc/.telnetd ]; then - /sbin/telnetd -l /bin/login -fi -if [ -e /var/etc/.vsftpd ]; then - /sbin/vsftpd -fi -#mount -t cifs //NAS_IP/movies /mnt/movies -o user=root,passwd=coolstream // some example for smb NAS -if [ -e /etc/init.d/rcB ]; then - /etc/init.d/rcB -fi -if [ -e /etc/init.d/rcS.local ]; then - /etc/init.d/rcS.local -fi - -/etc/init.d/upnp.sh & -/etc/init.d/start_neutrino & diff --git a/skel-root-nevis/etc/init.d/rcS-kernel-2.6.39.4-cnxt b/skel-root-nevis/etc/init.d/rcS-kernel-2.6.39.4-cnxt deleted file mode 100755 index 525cbed..0000000 --- a/skel-root-nevis/etc/init.d/rcS-kernel-2.6.39.4-cnxt +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/sh -export PATH=/var/bin:/var/sbin:/var/plugins:/sbin:/bin:/usr/sbin:/usr/bin - -/sbin/mknodes 2> /dev/null - -/bin/mount /proc -/bin/mount -a -hostname -F /etc/hostname -dmesg -n1 - -/sbin/insmod cs_frontpanel -if [ -e /etc/init.d/update.sh ]; then - /etc/init.d/update.sh -fi -/bin/dt -t"Init hardware" -/sbin/insmod cnxt_kal -/sbin/insmod cnxt_base init=0 -/sbin/insmod cnxt_fb cnxtfb_standalone=1 cnxtfb_width=1280 cnxtfb_height=720 -/sbin/insmod cnxt_lnx -/sbin/insmod cnxt_alsa -/sbin/insmod cs_control hdd_power=1 -/sbin/insmod cnxt_i2c -/sbin/insmod cnxt_sata_drv - -/sbin/insmod usb-storage - -/sbin/insmod rtlwifi -/sbin/insmod rtl8192c-common -/sbin/insmod rtl8192cu -/sbin/insmod r8712u -/sbin/insmod r8192u_usb -/sbin/insmod rt2870sta -#/sbin/insmod rt3070sta - -/sbin/ifup -a - -/bin/dt -ls01 -/bin/dt -ls02 -/bin/dt -c -/bin/dt -t"Loading drivers" - -/sbin/insmod md4 -/sbin/insmod cifs -/sbin/insmod fuse -/sbin/insmod usbserial -/sbin/insmod ftdi_sio - -if [ -e /etc/init.d/rcB.local ]; then - /etc/init.d/rcB.local -fi - -/sbin/insmod stv6110 verbose=0 -/sbin/insmod stv090x verbose=0 -/sbin/insmod tda10023 -/sbin/insmod avl2108 -/sbin/insmod max2112 -/sbin/insmod cs_frontend_prop -/sbin/insmod dvb-core -/sbin/insmod cs_frontend - -. /etc/profile - -if [ -e /var/etc/.telnetd ]; then - /sbin/telnetd -l /bin/login -fi -if [ -e /var/etc/.vsftpd ]; then - /sbin/vsftpd -fi -#mount -t cifs //NAS_IP/movies /mnt/movies -o user=root,passwd=coolstream // some example for smb NAS -if [ -e /etc/init.d/rcB ]; then - /etc/init.d/rcB -fi -if [ -e /etc/init.d/rcS.local ]; then - /etc/init.d/rcS.local -fi - -/etc/init.d/upnp.sh & -/etc/init.d/start_neutrino & diff --git a/skel-root-nevis/etc/inittab b/skel-root-nevis/etc/inittab old mode 100755 new mode 100644 diff --git a/skel-root-nevis/etc/localtime b/skel-root-nevis/etc/localtime old mode 100755 new mode 100644 diff --git a/skel-root-nevis/etc/mdev.conf b/skel-root-nevis/etc/mdev.conf new file mode 100644 index 0000000..f8e2dd6 --- /dev/null +++ b/skel-root-nevis/etc/mdev.conf @@ -0,0 +1,14 @@ +dvb([0-9]).([a-z]*)([0-9]) 0:0 0644 =dvb/adapter%1/%2%3 +fb([0-2]) 0:0 0660 >fb/%1 +sd[a-z][0-9]* 0:0 0664 */etc/mdev/mdev-mount.sh +sd[a-z]* 0:0 0664 */etc/mdev/mdev-mount.sh +wlan[0-9]* 0:0 0660 */etc/mdev/wlan.sh +ra[0-9]* 0:0 0660 */etc/mdev/wlan.sh +rausb[0-9]* 0:0 0660 */etc/mdev/wlan.sh +usbdev.* 0:0 0660 */etc/mdev/usbdev.sh +ram1 0:0 0660 >ram +null 0:0 0666 +full 0:0 0666 +zero 0:0 0666 +random 0:0 0666 +urandom 0:0 0666 diff --git a/skel-root-nevis/etc/mdev/mdev-mount.sh b/skel-root-nevis/etc/mdev/mdev-mount.sh new file mode 100755 index 0000000..4b77a6e --- /dev/null +++ b/skel-root-nevis/etc/mdev/mdev-mount.sh @@ -0,0 +1,135 @@ +#!/bin/sh +LOG="logger -p user.info -t mdev-mount" +WARN="logger -p user.warn -t mdev-mount" + +MOUNTBASE=/media +MOUNTPOINT="$MOUNTBASE/$MDEV" +ROOTDEV=$(readlink /dev/root) + +# do not add or remove root device again... +[ "$ROOTDEV" = "$MDEV" ] && exit 0 + +create_symlinks() { + DEVBASE=${MDEV:0:3} # first 3 characters + PARTNUM=${MDEV:3} # characters 4- + read MODEL < /sys/block/$DEVBASE/device/model + MODEL=${MODEL// /_} # replace ' ' with '_' + OLDPWD=$PWD + cd $MOUNTBASE + if which blkid > /dev/null; then + BLKID=$(blkid /dev/$MDEV) + eval ${BLKID#*:} + fi + if [ -n "$LABEL" ]; then + rm -f "$LABEL" + ln -s $MDEV "$LABEL" + elif [ -n "$MODEL" ]; then + LINK="${MODEL}${PARTNUM:+-}${PARTNUM}" + rm -f "${LINK}" + ln -s $MDEV "${LINK}" + elif [ -n "$UUID" ]; then + LINK="${TYPE}${TYPE:+-}${UUID}" + rm -f "${LINK}" + ln -s $MDEV "${LINK}" + else + BUS="" + PORT="" + P=$PHYSDEVPATH + case "$P" in + /devices/platform/cx2450x-ehci.?/usb?/?-?/?-?.?/?-?.?:?.?/host*) # hub + PORT=${P#*.*.} # strip off /devices/platform/cx2450x-ehci.?/usb?/?-?/?-? + PORT=${PORT%%/*} # strip off /?-?.?:?.?/host*, leaving the port + BUS="usb-${P:31:1}-hub-${PORT}" + ;; + /devices/platform/cx2450x-ehci.?/usb?/?-?/?-?:?.?/host*) # no hub + BUS="usb-${P:31:1}" + ;; + /devices/platform/cnxt_sata?-?.?/host*) + BUS="sata-${P:27:1}" + ;; + *) + # BUS="unknown" # ignored for now + ;; + esac + if [ -n "$BUS" ]; then + LINK="${BUS}${PARTNUM:+-}${PARTNUM}" + rm -f "${LINK}" + ln -s $MDEV "${LINK}" + fi + fi + + cd $OLDPWD +} + +remove_symlinks() { + OLDPWD=$PWD + cd $MOUNTBASE + for i in *; do + [ -L "$i" ] || continue + TARGET=$(readlink "$i") + if [ "$TARGET" = "$MDEV" ]; then + rm "$i" + fi + done + cd $OLDPWD +} + +case "$ACTION" in + add|"") + if [ ${#MDEV} = 3 ]; then # sda, sdb, sdc => whole drive + PARTS=$(sed -n "/ ${MDEV}[0-9]$/{s/ *[0-9]* *[0-9]* * [0-9]* //;p}" /proc/partitions) + if [ -n "$PARTS" ]; then + $LOG "drive has partitions $PARTS, not trying to mount $MDEV" + exit 0 + fi + fi + if grep -q "/dev/$MDEV " /proc/mounts; then + $LOG "/dev/$MDEV already mounted - not mounting again" + exit 0 + fi + $LOG "mounting /dev/$MDEV to $MOUNTPOINT" + NTFSMOUNT=$(which ntfs-3g) + RET2=$? + # remove old mountpoint symlinks we might have for this device + rm -f $MOUNTPOINT + mkdir -p $MOUNTPOINT + for i in 1 2; do # retry, my freeagent drive sometimes needs more time + # $LOG "mounting /dev/$MDEV to $MOUNTPOINT try $i" + OUT1=$(mount -t auto /dev/$MDEV $MOUNTPOINT 2>&1 >/dev/null) + RET1=$? + [ $RET1 = 0 ] && break + sleep 1 + done + if [ $RET1 != 0 -a -n "$NTFSMOUNT" ]; then + # failed,retry with ntfs-3g + for i in 1 2; do # retry only twice, waited already 5 seconds + $NTFSMOUNT /dev/$MDEV $MOUNTPOINT + RET2=$? + [ $RET2 = 0 ] && break + sleep 1 + done + fi + if [ $RET1 = 0 -o $RET2 = 0 ]; then + create_symlinks + else + $WARN "mount /dev/$MDEV $MOUNTPOINT failed with $RET1" + $WARN " $OUT1" + if [ -n "$NTFSMOUNT" ]; then + $WARN "ntfs-3g /dev/$MDEV $MOUNTPOINT failed with $RET2" + fi + rmdir $MOUNTPOINT + fi + ;; + remove) + $LOG "unmounting /dev/$MDEV" + grep -q "^/dev/$MDEV " /proc/mounts || exit 0 # not mounted... + umount -lf /dev/$MDEV + RET=$? + if [ $RET = 0 ]; then + rmdir $MOUNTPOINT + remove_symlinks + else + $WARN "umount /dev/$MDEV failed with $RET" + fi + ;; +esac diff --git a/skel-root-nevis/etc/mdev/usbdev.sh b/skel-root-nevis/etc/mdev/usbdev.sh new file mode 100755 index 0000000..3c76945 --- /dev/null +++ b/skel-root-nevis/etc/mdev/usbdev.sh @@ -0,0 +1,35 @@ +#!/bin/sh +LOG="logger -p user.info -t mdev-usb" +WARN="logger -p user.warn -t mdev-usb" + +# supported devices +LCD=1908:0102 + +# lcd-support +idV_LCD=$(echo ${LCD:0:4} | sed 's/^[0]*//') # vendor w/o leading zeros +idP_LCD=$(echo ${LCD:5:4} | sed 's/^[0]*//') # product w/o leading zeros +flagLCD=/tmp/.lcd-${MDEV} + +case "$ACTION" in + add|"") + # lcd-support + if [ -e /sys/class/usb_device/${MDEV}/device/uevent ]; then + if grep "^PRODUCT=${idV_LCD}/${idP_LCD}/*" /sys/class/usb_device/${MDEV}/device/uevent > /dev/null; then + $LOG "supported lcd (ID $LCD) on ${MDEV} found" + echo "$LCD" > $flagLCD + /var/lcd/lcdrun.sh & + fi + fi + ;; + remove) + # lcd-support + if [ -e $flagLCD ]; then + if grep "^$LCD" $flagLCD > /dev/null; then + $LOG "supported lcd (ID $LCD) removed from ${MDEV}" + /bin/killall lcd4linux & + sleep 2 + rm -f $flagLCD + fi + fi + ;; +esac diff --git a/skel-root-nevis/etc/mdev/wlan.sh b/skel-root-nevis/etc/mdev/wlan.sh new file mode 100755 index 0000000..9dd05e2 --- /dev/null +++ b/skel-root-nevis/etc/mdev/wlan.sh @@ -0,0 +1,19 @@ +#!/bin/sh +LOG="logger -p user.info -t mdev-wlan" +WARN="logger -p user.warn -t mdev-wlan" + +case "$ACTION" in + add|"") + if [ -s /etc/wpa_supplicant.conf ]; then + $LOG "trying to bring $MDEV up" + ifup $MDEV + else + $WARN "/etc/wpa_supplicant.conf missing or empty, not trying to bring $MDEV up" + fi + ;; + remove) + $LOG "trying to bring $MDEV down" + ifdown $MDEV + ;; +esac + diff --git a/skel-root-nevis/etc/modprobe.conf b/skel-root-nevis/etc/modprobe.conf old mode 100755 new mode 100644 diff --git a/skel-root-nevis/etc/network/interfaces b/skel-root-nevis/etc/network/interfaces index 95ffce1..d106411 100755 --- a/skel-root-nevis/etc/network/interfaces +++ b/skel-root-nevis/etc/network/interfaces @@ -1,28 +1,12 @@ -# -# Interfaces to start with ifup -a -# - -# -# Loopback interface -# auto lo iface lo inet loopback -# -# Ethernet interface (dhcp) -# auto eth0 -iface eth0 inet static - address 192.168.220.242 - broadcast 192.168.220.255 - gateway 192.168.220.3 - netmask 255.255.255.0 - - -# last line - - - - - - +iface eth0 inet dhcp + hostname coolstream + +auto wlan0 +iface wlan0 inet dhcp + hostname wificool + post-down /etc/network/post-wlan0.sh + pre-up /etc/network/pre-wlan0.sh diff --git a/skel-root-nevis/etc/network/pre-wlan0.sh b/skel-root-nevis/etc/network/pre-wlan0.sh index 629da07..87daa58 100755 --- a/skel-root-nevis/etc/network/pre-wlan0.sh +++ b/skel-root-nevis/etc/network/pre-wlan0.sh @@ -2,10 +2,10 @@ echo Starting wlan0 -mkdir /var/run/wpa_supplicant +mkdir -p /var/run/wpa_supplicant /sbin/wpa_cli terminate sleep 1 -#/sbin/wpa_supplicant -B -D wext -i ra0 -c /etc/wpa_supplicant.conf//ralink -/sbin/wpa_supplicant -D ipw -c /etc/wpa_supplicant.conf -i wlan0 -B +#/sbin/wpa_supplicant -B -D wext -i ra0 -c /etc/wpa_supplicant.conf //ralink +/sbin/wpa_supplicant -D wext -c /etc/wpa_supplicant.conf -i wlan0 -B sleep 8 diff --git a/skel-root-nevis/etc/nsswitch.conf b/skel-root-nevis/etc/nsswitch.conf old mode 100755 new mode 100644 diff --git a/skel-root-nevis/etc/passwd b/skel-root-nevis/etc/passwd old mode 100755 new mode 100644 diff --git a/skel-root-nevis/etc/profile b/skel-root-nevis/etc/profile old mode 100755 new mode 100644 index 7b73b74..ae5b7b5 --- a/skel-root-nevis/etc/profile +++ b/skel-root-nevis/etc/profile @@ -1,8 +1,18 @@ -#!/bin/sh -alias ll='ls -al' -alias c='cat' -alias d='date' -alias g='grep' -alias m='more' -alias h='history' -alias f='file' +# make sure TZ is exported... +PATH=/var/bin:/var/sbin:/var/plugins:/sbin:/bin:/usr/sbin:/usr/bin +read TZ < /etc/TZ +export TZ + +alias l='ls -al' +alias ll='ls -l' +alias dir='ls -lA' +alias ..='cd ..' +alias etherwake='ether-wake' + +# for top etc. +TERM=linux + +# Proxyeinstellungen +#export http_proxy="http://username:passwort@proxy-ip:proxy-port" +#export ftp_proxy="ftp://username:passwort@proxy-ip:proxy-port" +#export no_proxy="127.0.0.1, localhost, Lan-Netz/24" diff --git a/skel-root-nevis/etc/protocols b/skel-root-nevis/etc/protocols old mode 100755 new mode 100644 index e637564..d2782da --- a/skel-root-nevis/etc/protocols +++ b/skel-root-nevis/etc/protocols @@ -1,8 +1,35 @@ -# /etc/protocols -ip 0 IP -icmp 1 ICMP -igmp 2 IGMP -ggp 3 GGP -tcp 6 TCP -udp 17 UDP -rdp 27 RDP +# protocols This file describes the various protocols that are +# available from the TCP/IP subsystem. It should be +# consulted instead of using the numbers in the ARPA +# include files, or, worse, just guessing them. + +ip 0 IP # internet protocol v4 +icmp 1 ICMP # internet control message protocol +igmp 2 IGMP # internet group multicast protocol +ggp 3 GGP # gateway-gateway protocol +tcp 6 TCP # transmission control protocol +egp 8 EGP # exterior gateway protocol +pup 12 PUP # PARC universal packet protocol +udp 17 UDP # user datagram protocol +hmp 20 HMP # host monitoring protocol +idp 22 IDP # WhatsThis? +rdp 27 RDP # "reliable datagram" protocol +iso-tp4 29 ISO-TP4 # ISO Transport Protocol Class 4 +# +# Internet (IPv6) extension headers +# +hopopt 0 HOPOPT # Hop-by-hop optons for IPv6 +ipv6 41 IPv6 # IPv6 +ipv6-route 43 IPv6-Route # Routing Header for IPv6 +ipv6-frag 44 IPv6-Frag # Fragment Header for IPv6 +ipv6-crypt 50 IPv6-Crypt # Encryption Header for IPv6 +ipv6-auth 51 IPv6-Auth # Authentication Header for IPv6 +icmpv6 58 IPv6-ICMP ICMPV6 ipv6-icmp icmp6 # ICMP for IPv6 +ipv6-nonxt 59 IPv6-NoNxt # No Next Header for IPv6 +ipv6-opts 60 IPv6-Opts # Destination Options for IPv6 +iso-ip 80 ISO-IP # ISO Internet Protocol +encap 98 ENCAP # RFC1241 encapsulation +raw 255 RAW # RAW IP interface + +# End. + diff --git a/skel-root-nevis/etc/resolv.conf b/skel-root-nevis/etc/resolv.conf old mode 100755 new mode 100644 diff --git a/skel-root-nevis/etc/rpc b/skel-root-nevis/etc/rpc old mode 100755 new mode 100644 diff --git a/skel-root-nevis/etc/services b/skel-root-nevis/etc/services old mode 100755 new mode 100644 diff --git a/skel-root-nevis/etc/timezone.xml b/skel-root-nevis/etc/timezone.xml old mode 100755 new mode 100644 diff --git a/skel-root-nevis/etc/vsftpd.conf b/skel-root-nevis/etc/vsftpd.conf new file mode 100644 index 0000000..b7e9079 --- /dev/null +++ b/skel-root-nevis/etc/vsftpd.conf @@ -0,0 +1,14 @@ +# config file /etc/vsftpd.conf +listen=NO +hide_ids=YES +anonymous_enable=NO +local_enable=YES +write_enable=YES +chroot_local_user=NO +local_umask=022 +dirmessage_enable=YES +xferlog_enable=NO +connect_from_port_20=YES +secure_chroot_dir=/share/empty +use_localtime=YES +ftpd_banner=Willkommen auf Deiner Coolstream diff --git a/skel-root-nevis/etc/wpa_supplicant.conf b/skel-root-nevis/etc/wpa_supplicant.conf new file mode 100644 index 0000000..af46b21 --- /dev/null +++ b/skel-root-nevis/etc/wpa_supplicant.conf @@ -0,0 +1,10 @@ +ctrl_interface=/var/run/wpa_supplicant +network={ + ssid="deinNetzwerkname" + proto=WPA WPA2 + key_mgmt=WPA-PSK + pairwise=CCMP TKIP + group= CCMP TKIP + psk="deinNetzwerkschlüssel" + } + diff --git a/skel-root-nevis/sbin/mknodes b/skel-root-nevis/sbin/mknodes index 730de2c..a11a98b 100755 --- a/skel-root-nevis/sbin/mknodes +++ b/skel-root-nevis/sbin/mknodes @@ -1,15 +1,29 @@ #!/bin/sh /bin/echo "running $0" +# +makedevs /dev << EOF +# is this needed at all? +watchdog c 644 0 0 10 130 + +cnxt d 755 0 0 +cnxt/cnxt_gen_drv c 644 0 0 102 0 + +notifyq c 644 0 0 102 1 +user_kal c 644 0 0 102 2 +display c 644 0 0 238 0 +cs_control c 644 0 0 249 0 +iolib c 644 0 0 253 0 + +input d 755 0 0 +input/nevis_ir c 644 0 0 240 0 +input/event0_uinput c 644 0 0 10 223 +input/mouse c 644 0 0 13 32 0 1 4 +input/mice c 644 0 0 13 63 +input/event2 c 644 0 0 13 66 +input/event3 c 644 0 0 13 67 +EOF ln -sf nevis_ir /dev/input/event0 ln -sf nevis_ir /dev/input/input0 -ln -sf ../fb0 /dev/fb/0 -ln -sf adsp0 /dev/adsp -ln -sf amidi0 /dev/amidi -ln -sf audio0 /dev/audio -ln -sf dsp0 /dev/dsp -ln -sf midi00 /dev/midi -ln -sf mixer0 /dev/mixer -ln -sf music /dev/sequencer2 /bin/echo "done $0" diff --git a/skel-root-nevis/var/etc/.telnetd b/skel-root-nevis/var/etc/.telnetd deleted file mode 100644 index e69de29..0000000 diff --git a/skel-root-nevis/var/etc/.vsftpd b/skel-root-nevis/var/etc/.vsftpd deleted file mode 100644 index e69de29..0000000 diff --git a/skel-root-nevis/var/etc/profile b/skel-root-nevis/var/etc/profile deleted file mode 100755 index 5d272ca..0000000 --- a/skel-root-nevis/var/etc/profile +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -alias ll='ls -al' -export TZ=CET-3CEST,M3.5.0/2,M10.5.0/3 -- 2.39.5