2015-03-27 21:55:18 +01:00
|
|
|
#!/bin/busybox sh
|
|
|
|
|
|
|
|
busybox echo "Welcome to SATIP-AXE Linux!"
|
|
|
|
|
|
|
|
busybox mount -t proc proc /proc
|
|
|
|
# remount root filesystem in rw mode
|
|
|
|
busybox mount -o remount,rw /
|
|
|
|
# Create all symbolic links.
|
2015-04-08 13:54:26 +02:00
|
|
|
/bin/busybox --install -s
|
|
|
|
|
|
|
|
# Date
|
|
|
|
date 010112002015 >/dev/null
|
2015-03-27 21:55:18 +01:00
|
|
|
|
|
|
|
# mount /dev and devpts to allow logging in
|
|
|
|
mount -t tmpfs -o size=64k,mode=0755 tmpfs /dev
|
|
|
|
mkdir /dev/pts /dev/input
|
|
|
|
mount -t devpts none /dev/pts -ogid=5,mode=620
|
|
|
|
|
|
|
|
# use mdev/sysfs
|
2015-04-10 15:08:02 +02:00
|
|
|
mkdir -p /lib/modules/$(uname -r)
|
2015-03-27 21:55:18 +01:00
|
|
|
mount -t sysfs sysfs /sys
|
2015-04-08 13:54:26 +02:00
|
|
|
touch /dev/mdev.seq
|
|
|
|
mkdir -p /media
|
2015-03-27 21:55:18 +01:00
|
|
|
echo /sbin/mdev > /proc/sys/kernel/hotplug
|
|
|
|
mdev -s
|
|
|
|
|
|
|
|
# make /tmp as tmpfs
|
2015-04-08 17:30:03 +02:00
|
|
|
mount -t tmpfs -o size=4M tmpfs /tmp
|
2015-04-08 13:54:26 +02:00
|
|
|
mv /var /var.2
|
|
|
|
mkdir /tmp/var
|
|
|
|
ln -s /tmp/var /var
|
|
|
|
rm -rf /var.2
|
|
|
|
mkdir -p /tmp/var/run /tmp/var/log /tmp/var/spool
|
2015-03-27 21:55:18 +01:00
|
|
|
|
2015-04-09 10:47:49 +02:00
|
|
|
# sysctl.conf
|
|
|
|
sysctl -q -p
|
|
|
|
|
2015-03-27 21:55:18 +01:00
|
|
|
# start syslogd
|
|
|
|
syslogd -C256
|
|
|
|
|
2015-03-28 20:33:17 +01:00
|
|
|
# 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
|
2015-03-31 16:39:17 +02:00
|
|
|
if test -r /etc/sysconfig/passwd ; then
|
|
|
|
cp /etc/sysconfig/passwd /etc/passwd
|
|
|
|
fi
|
2015-03-28 20:33:17 +01:00
|
|
|
|
2015-04-10 15:08:02 +02:00
|
|
|
# loopback
|
|
|
|
ifconfig lo 127.0.0.1 netmask 255.255.255.0
|
|
|
|
|
|
|
|
# AXE modules and AXE hw initialization
|
|
|
|
sync
|
|
|
|
/lib/modules/axe/load_modules.sh
|
|
|
|
/etc/init.d/axe &
|
|
|
|
axehelper wait 5000 -10 /tmp/axe-done
|
|
|
|
#nc -l 127.0.0.1:1001 -e /bin/true
|
|
|
|
rm -f /root/main_init.sh /tmp/axe-done
|
|
|
|
|
2015-04-08 13:54:26 +02:00
|
|
|
# hostname
|
|
|
|
test -r /etc/sysconfig/config && . /etc/sysconfig/config
|
|
|
|
test -n "$HOSTNAME" && hostname "$HOSTNAME"
|
|
|
|
test -z "$HOSTNAME" && hostname satip-axe
|
|
|
|
|
2015-04-08 17:30:03 +02:00
|
|
|
# modules
|
|
|
|
if test -n "$KMODULES"; then
|
|
|
|
for m in $KMODULES; do
|
|
|
|
insmod "/lib/modules/$m"
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
2015-03-27 21:55:18 +01:00
|
|
|
# basic network
|
|
|
|
ifconfig eth0 up
|
|
|
|
route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
|
2015-03-31 16:39:17 +02:00
|
|
|
|
|
|
|
# local boot
|
|
|
|
if test -x /etc/sysconfig/localboot ; then
|
|
|
|
/etc/sysconfig/localboot
|
|
|
|
fi
|