added axe kernel modules, dropbear, rewrite inittab system, use /dev/mtdblock4 for config

This commit is contained in:
Jaroslav Kysela
2015-03-28 20:33:17 +01:00
parent 4acb001e0a
commit 86243d95c5
11 changed files with 161 additions and 9 deletions

19
fs-add/etc/config.default Normal file
View File

@@ -0,0 +1,19 @@
#
# IPV4 config
#
IPV4="dhcp"
# or
#IPV4="192.168.1.240"
#IPV4_NETMASK="255.255.255.0"
#IPV4_BROADCAST="192.168.1.255"
#IPV4_GATEWAY="192.168.1.1"
#
# telnetd
#
TELNETD="yes"
#
# dropbear
#
DROPBEAR="yes"

9
fs-add/etc/init.d/axe Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/sh
echo "Starting axe services:"
ln -s /lib/modules /root/modules
mknod -m 0777 /tmp/usbdevmon125788 p
source /lib/modules/load_modules.sh
cd /root
export AXE_API_TYPE=linuxdvb
exec ./main_axe.out

24
fs-add/etc/init.d/dropbear Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/sh
test -r /etc/sysconfig/config && . /etc/sysconfig/config
if test "$DROPBEAR" != "yes"; then
exit 0
fi
if ! test -r /etc/dropbear/dropbear_dss_host_key; then
mkdir -p /etc/dropbear
if test -r /etc/sysconfig/dropbear_dss_host_key; then
cp /etc/sysconfig/dropbear_dss_host_key /etc/dropbear/dropbear_dss_host_key
else
dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key
cp /etc/dropbear/dropbear_dss_host_key /etc/sysconfig/dropbear_dss_host_key
fi
fi
export HOME=/root
if test -r /etc/sysconfig/authorized_keys ; then
mkdir -p $HOME/.ssh
cp /etc/sysconfig/authorized_keys $HOME/.ssh/authorized_keys
chmod 0600 $HOME/.ssh/authorized_keys
fi
exec dropbear -F

14
fs-add/etc/init.d/network Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/sh
test -r /etc/sysconfig/config && . /etc/sysconfig/config
if test "$IPV4" = "dhcp"; then
exec /sbin/udhcpc -f -S -p /tmp/udhcpc.pid -s /etc/init.d/dhcpc-event
else
ifconfig eth0 $IPV4 netmask $IPV4_NETMASK broadcast $IPV4_BROADCAST
route add default gw $IPV4_GATEWAY
fi
if test -r /etc/sysconfig/resolv.conf; then
ln -s sysconfig/resolv.conf /etc/resolv.conf
fi

View File

@@ -25,6 +25,15 @@ mount -t tmpfs -o size=1M tmpfs /tmp
# start syslogd
syslogd -C256
# config/data storage
mkdir -p /mnt/data
mount -t jffs2 /dev/mtdblock4 /mnt/data/
mkdir -p /mnt/data/satip-axe/sysconfig
ln -s /mnt/data/satip-axe/sysconfig /etc/sysconfig
if ! test -r /etc/sysconfig/config ; then
cp /etc/config.default /etc/sysconfig/config
fi
# basic network
hostname satip-axe
ifconfig lo 127.0.0.1 netmask 255.255.255.0

9
fs-add/etc/init.d/telnetd Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/sh
test -r /etc/sysconfig/config && . /etc/sysconfig/config
if test "$DROPBEAR" != "yes"; then
exit 0
fi
exec /usr/sbin/telnetd -F -l /bin/login

View File

@@ -2,10 +2,14 @@
::sysinit:/etc/init.d/rcSBB
# Console
ttyAS0::askfirst:/bin/bash --init-file /etc/bashrc
# DHCP Client
::respawn:/sbin/udhcpc -f -S -p /tmp/udhcpc.pid -s /etc/init.d/dhcpc-event
# Network
::once:/etc/init.d/network
# telnetd
::respawn:/usr/sbin/telnetd -F -l /bin/login
::once:/etc/init.d/telnetd
# dropbear
::once:/etc/init.d/dropbear
# AXE kernel modules and environment
::once:/etc/init.d/axe
# Others
::ctrlaltdel:/sbin/reboot
::shutdown:/sbin/swapoff -a

13
fs-add/root/main_init.sh Executable file
View File

@@ -0,0 +1,13 @@
#
# this is script executed from /root/main_axe.out binary
# after the AXE initialization routine
# it is respawned immediately on exit
#
while [ 1 ]; do
if [ -x /etc/init.d/satip ]; then
. /etc/init.d/satip
else
sleep 33554432
fi
done