So I was bored this evening and decided to open up tinycore.gz and try to figure out how TCL boots. I also found a few things you might want to fix (mostly cruft).
etc/init.d/tc-config (and rcS by symlink): The first fix uses grep -q in the actual if function without the intermediate test, this is also the same behavior as used in line 267 so I don't believe this was a coding style choice. The two methods should produce the same results unless I'm missing something.
The second part of the patch fixes an incorrect path to crond.
diff -pruN initrd.old/etc/init.d/tc-config initrd/etc/init.d/tc-config
--- initrd.old/etc/init.d/tc-config 2008-12-04 21:36:58.000000000 -0800
+++ initrd/etc/init.d/tc-config 2008-12-04 21:49:30.000000000 -0800
@@ -248,8 +248,7 @@ else
fi
fi
# Final test for /usr/local mount and call setup routines for libraries, modules, and menu.
- grep -q \/usr\/local /etc/mtab
- if [ "$?" == "0" ]; then
+ if grep -q \/usr\/local /etc/mtab; then
/sbin/ldconfig
/sbin/depmod -a
cp /opt/.tce_menu/jwm/menu_template /usr/local/tce.menu/menu
@@ -340,7 +339,7 @@ fi
[ -n "$SSH" ] && /etc/init.d/dropbear start >/dev/null && echo " ${GREEN}ssh started.${NORMAL}"
if [ -n "$CRON" ]; then
- /usr/sbin/bin/crond
+ /usr/sbin/crond
if [ "$?" == 0 ]; then echo " ${GREEN}cron started.${NORMAL}"; fi
fi
if [ -n "$LAPTOP" ]; then
etc/init.d/tc-functions: This function was probably written for a reason and isn't worth actually deleting, but (a) /etc/init.d/hwclockfirst.sh doesn't exist anymore and (b) the function isn't used when the time is set in /etc/init.d/tc-config anyway.
diff -pruN initrd.old/etc/init.d/tc-functions initrd/etc/init.d/tc-functions
--- initrd.old/etc/init.d/tc-functions 2008-12-04 21:36:58.000000000 -0800
+++ initrd/etc/init.d/tc-functions 2008-12-04 21:39:23.000000000 -0800
@@ -58,15 +58,6 @@ echo $INFO
return 0
}
-settime(){
-TZ="$(getbootparam 'tz')"
-if [ -n "$TZ" ]; then
- export TZ="$TZ"
- /etc/init.d/hwclockfirst.sh start
-fi
-return 0
-}
-
rotdash(){
p=$1
while [ -d /proc/$p ]
root/.ash_history: This is a relic I think...
diff -pruN initrd.old/root/.ash_history initrd/root/.ash_history
--- initrd.old/root/.ash_history 2008-12-04 21:36:58.000000000 -0800
+++ initrd/root/.ash_history 1969-12-31 16:00:00.000000000 -0800
@@ -1,39 +0,0 @@
-cd /dev/
-ls -l fd0*
-mknod /dev/fd0D360 b 2 12
-mknod /dev/fd0D720 b 2 16
-mknod /dev/fd0H1440 b 2 28
-mknod /dev/fd0H1722 b 2 60
-chmod g+w /dev/fd0*
-cat /etc/group
-cat /etc/passwd
-delgroup audio
-cat /etc/gshadow
-vi /etc/group
-cat /etc/group
-cat /etc/group /etc/gshadow
-delgroup www
-cat /etc/group /etc/gshadow
-cat /etc/group
-cat /etc/gshadow
-addgroup --help
-addgroup -g 25 dsl floppy
-addgroup -g 25 floppy
-cat /etc/group
-cat /etc/gshadow
-cat /etc/group
-adduser --help
-adduser -g floppy dsl
-addgroup --help
-addgroup dsl floppy
-cat /etc/group
-cat /etc/gshadow
-pwd
-ls -la fdo*
-ls -la fd0*
-chown root.floppy fd0*
-ls -la fd0*
-exit
-depmod -a
-uname -a
-exit
A couple more questions:
First, the cdrom is not mounted once the system has fully booted. However, I'm not sure when it is mounted/unmounted. If it is mounted during the boot process then:
./rcS:471:[ -n "$EJECT" ] && eject /dev/cdrom
might want to take advantage of getbootdevice in /etc/init.d/tc-functions.
Second, are there any plans to integrate ethernet device autodetection into the startup scripts? This certainly seems to be a common question in the IRC channel. You could probably use udev to do this but I'm not familiar with the method. Alternatively, you could use a shell script for it:
for i in `lspci -k | grep Ethernet -A 2 | awk -F : '/Kernel module/{print $2}'`; do
modprobe "$i" 2>&1 >/dev/null
done
Once again--this looks like a very well implemented boot system to my untrained eye. Excellent work.