2012-10-15

mk802 -- tinycore


Towards Microcore on Allwinner A10

a10Core-20120928.img.gz    6.2M

This brings the image up to 4.6.2 base and also changes provides from cgi to zsync'ed local database.


1.
tc@box:~$ cat /etc/init.d/rcS
#!/bin/sh
exec /etc/init.d/tc-config > /var/log/tc-config 2>&1

tc@box:~$ head /etc/init.d/tc-config
#!/bin/sh
# RC Script for Tiny Core Linux
# (c) Robert Shingledecker 2004-2012
# Several modifications for speed by Curaga
. /etc/init.d/tc-functions

USER="tc"
TCEDIR="/tmp/tce"
TCLOOP="/tmp/tcloop"
TCEINSTALLED="/usr/local/tce.installed"
tc@box:~$


2.
tc@box:~$ cat /etc/inittab
# /etc/inittab: init configuration for busybox init.
# Boot-time system configuration/initialization script.
#
::sysinit:/etc/init.d/rcS

# /sbin/getty respawn shell invocations for selected ttys.
tty1::respawn:/sbin/getty -nl /sbin/Autologin 38400 tty1
#tty2::respawn:/sbin/getty 38400 tty2
#tty3::respawn:/sbin/getty 38400 tty3
#tty4::askfirst:/sbin/getty 38400 tty4
#tty5::askfirst:/sbin/getty 38400 tty5
#tty6::askfirst:/sbin/getty 38400 tty6

# Stuff to do when restarting the init
# process, or before rebooting.
::restart:/etc/init.d/rc.shutdown
::restart:/sbin/init
::ctrlaltdel:/sbin/reboot
::shutdown:/etc/init.d/rc.shutdown


3.
tc@box:~$ cat /sbin/Autologin
#!/bin/sh
exec /bin/Bterm /sbin/autologin

tc@box:~$ cat /sbin/autologin
#!/bin/sh
cat /etc/issue
if [ -f /var/log/autologin ] ; then
    exec login
else
    touch /var/log/autologin
    exec login -f root
fi


4.
tc@box:~$ cat /init
#!/bin/sh
mount proc
grep -qw multivt /proc/cmdline && sed -i s/^#tty/tty/ /etc/inittab
if ! grep -qw noembed /proc/cmdline; then
  mount / -o remount,size=90%
  umount proc
  exec /sbin/init
fi
umount proc
if mount -t tmpfs -o size=90% tmpfs /mnt; then
  if tar -C / --exclude=mnt -cf - . | tar -C /mnt/ -xf - ; then
    mkdir /mnt/mnt
    exec /sbin/switch_root mnt /sbin/init
  fi
fi
exec /sbin/init


tc@box:~$ ls -l /sbin/init
lrwxrwxrwx    1 root     root            14 Oct  8 00:12 /sbin/init -> ../bin/busybox
.