Tiny Core Linux

Tiny Core Base => TCB Bugs => Topic started by: danielibarnes on July 20, 2009, 01:11:29 PM

Title: Race condition in tc-config (2.1)
Post by: danielibarnes on July 20, 2009, 01:11:29 PM
The parts of the script which handle the tce= and restore= boot parameters do not "wait $fstab_pid" so if the user specifies noswap nolocal and does not specify any other boot option which will wait, then it is possible that tce= and restore= will fail.

This is present in 2.1; I did not check 2.2.

The patch below fixes the problem:

@@ -475,6 +482,7 @@
    echo "${GREEN}Skipping TCE Application Extensions as requested on the command line.${NORMAL}"
    MOUNTPOINT="/tmp"; TCE_DIR="tce"
 else
+   wait $fstab_pid
    # First check cdrom for extra apps
    if [ -d /cdrom/tce ]; then
       MOUNTPOINT="/cdrom"
@@ -545,6 +553,7 @@
 if [ -n "$NORESTORE" ]; then
   echo "${GREEN}Skipping restore as requested from the command line.${NORMAL}"
 else
+   wait $fstab_pid
   /etc/init.d/tc-restore.sh "$TCEDIR"
 fi
Title: Re: Race condition in tc-config (2.1)
Post by: roberts on July 20, 2009, 03:44:35 PM
Many thanks! Applied.