Tiny Core Base > TCB Bugs

Minor clean-up in tinycore.gz


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.

--- Code: ---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
    # 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/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
 if [ -n "$LAPTOP" ]; then
--- End code ---

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.

--- Code: ---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
-TZ="$(getbootparam 'tz')"
-if [ -n "$TZ" ]; then
-   export TZ="$TZ"
-   /etc/init.d/hwclockfirst.sh start
-return 0
 while [ -d /proc/$p ]
--- End code ---

root/.ash_history: This is a relic I think...

--- Code: ---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
-ls -la fdo*
-ls -la fd0*
-chown root.floppy fd0*
-ls -la fd0*
-depmod -a
-uname -a

--- End code ---

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:

--- Code: ---./rcS:471:[ -n "$EJECT" ] && eject /dev/cdrom
--- End code ---

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:

--- Code: ---for i in `lspci -k | grep Ethernet -A 2 | awk -F : '/Kernel module/{print $2}'`; do
    modprobe "$i" 2>&1 >/dev/null
--- End code ---

Once again--this looks like a very well implemented boot system to my untrained eye.  Excellent work.

It always takes new eyes to see things. Nice fixes IMO.

The cdrom is not mounted at all specifically, temporarily during the tce and backup scan though. It should only be mounted at that time if there is a tce dir on it, and since it takes a boot argument to reach that, I doubt anyone who wants to use the cd makes it eject.

The ethernet scan should not be needed, as udev loads every module with a matching id automatically. It's however a known thing that not all device id's are yet put in the drivers, testified by the ongoing addition of them. It's being thought of, the best method to do a scan like that.

@dmoerner, Thanks for the input and the crond bug.
There are relics from over the years that I have been writing/updating the config and functions.
I began many years ago and it grew as I was supporting DSL., I retooled it for Tiny Core and curaga and jason also helped streamline and added to it.


[0] Message Index

Go to full version