Tiny Core Linux

Tiny Core Base => Micro Core => Topic started by: whitelines2 on July 02, 2011, 11:39:44 AM

Title: Skip waitusb?
Post by: whitelines2 on July 02, 2011, 11:39:44 AM
hey,

it seems its not possible to skip the waitusb=5 boot option. If i create a usb without mention of waitusb=5, i have to wait 5 seconds. If i change it to waitusb=1, i still have to wait 5 seconds.

Is there not a way to just skip the wait? Booting would be almost instant without it... Thanks.
Title: Re: Skip waitusb?
Post by: Guy on July 02, 2011, 11:50:32 AM
It depends on the computer and usb drive.

You can leave out waitusb and see what happens.

With many computers and usb drives, it will not work.

I have a computer which pauses longer when booting from a usb drive than when booting from a hard drive.
Title: Re: Skip waitusb?
Post by: maro on July 02, 2011, 04:09:09 PM
@whitelines2: If you have a set of extensions on your USB device (e.g. in a '/tce' directory structure) you need to ensure that the device has been recognised by the time TC (or MC) gets around to scanning all devices for such a directory. Even though you can provide some guidance with the 'tce=...' boot code to where the systems should expect to find the 'tce' directory, if the device is not yet ready the 'tce' directory won't be identified (and therefore not used). This should explain why one needs the 'waitusb=...' boot code.

To minimize the time spent with waiting the TC / MC installation script creates a boot code like waitusb=N:UUID="xxx-yyy" The "xxx-yyy" stands for the UUID of the device which uniquely identifies it (unlike a fixed name like 'sda' which would depend on the system configuration etc.). AFAIK the default is N=5, but I'm using a higher value (e.g. 15) to be sure that even my slowest hardware will be able to be recognised. Using a higher value is no disadvantage as the wait time will last only as long as what will be required to find the uniquely specified device.

If you OTOH would boot from a USB stick, but have the 'tce' directory on a (non-USB) hard disk the 'waitusb=...' boot code won't be needed (but the 'tce=...' boot code would still be a really good idea). I for one can not imagine why one would use such a "split setup", as putting the boot loader, kernel and initrd also on the hard disk would be the more obvious solution.
Title: Re: Skip waitusb?
Post by: whitelines2 on July 02, 2011, 10:28:26 PM
Thanks for informative post. I don't need any extensions i just want to run a dd command in a startup script automatically (so need some kind of persistence in /etc/init.d...
Title: Re: Skip waitusb?
Post by: Rich on July 02, 2011, 11:20:02 PM
Hi whitelines2

Sounds like if you add your commands to  /opt/bootlocal.sh  you'll get what you are looking for.

Title: Re: Skip waitusb?
Post by: maro on July 02, 2011, 11:58:06 PM
I don't need any extensions i just want to run a dd command in a startup script automatically (so need some kind of persistence in /etc/init.d...
Whether you put the 'dd' command in '/etc/init.d...' or in '/opt/bootlocal.sh' the "normal" case would be to use backup (via 'mydata.tgz') to gain persistence (which would need to be somewhere on the USB stick and again requiring the 'waitusb=...' boot code to work properly).

To avoid this dependency on the recogition of the USB stick in a timely manner during the TC / MC boot process you'll have to use remastering (http://wiki.tinycorelinux.net/wiki:remastering) of the initrd. This way your 'dd' command is part of what the boot loader reads into memory and the fact that the running system learn too late about the existance of the USB stick is not a problem anymore.
Title: Re: Skip waitusb?
Post by: whitelines2 on July 04, 2011, 06:18:58 AM
Hi,

I decided to just manually install it on the usb stick. I used FlashBoot to install syslinux on it, then i just made my own syslinux.cfg. Please have a look:

http://pastebin.com/6rYXZj7n

Now there is no wait time at all. Is there anything else i need to add to the config file or to the usb stick to get the persistence in etc/init or /opt/bootlocal.sh? I just realized i also need to install bash...

At the moment my usb stick has no tce directory, i guess that is a problem!
Title: Re: Skip waitusb?
Post by: Juanito on July 04, 2011, 06:38:29 AM
I used FlashBoot to install syslinux on it, then i just made my own syslinux.cfg. Please have a look:
..not sure you need "noicons"

Quote
Is there anything else i need to add to the config file or to the usb stick to get the persistence in etc/init or /opt/bootlocal.sh?
you need to add etc/init to /opt/.filetool.lst and then "filetool.sh -b" will make a backup.

Quote
At the moment my usb stick has no tce directory, i guess that is a problem!
I don't recall if "ab" makes one automatically, but otherwise you can create your own in the root directory and it will be found automatically
Title: Re: Skip waitusb?
Post by: whitelines2 on July 04, 2011, 06:56:04 AM
Thanks,

very fast replies in this forum :) So i don't actually need to append any other boot options in the config file?

I see some such as restore=, opt= and safebackup.

I just checked and inside dir opt/ there is no file called filetool.lst. Something i'm missing here... i also tried making a file in the home dir and it wasn't there after restart.
Title: Re: Skip waitusb?
Post by: Juanito on July 04, 2011, 07:19:38 AM
I just checked and inside dir opt/ there is no file called filetool.lst. Something i'm missing here... i also tried making a file in the home dir and it wasn't there after restart.

the file is hidden by putting a "." in front of it - /opt/.filetool.lst - "ls -a" or similar should show it.

you need to initiate a backup/restore - as mentioned "filetool.sh -b" should do it.
Title: Re: Skip waitusb?
Post by: whitelines2 on July 04, 2011, 08:26:02 AM
Tried filetool.sh -b, it said invalid device. So i formatted the usb and just used the gui in tinycorelinux to make it. Frugal mode, ext2, the only boot options i chose were tce=sda superuser safebackup.

Then rebooted, was able to backup filetool.sh, restarted and the changes i made were there :) However i tried editing another file, bootlocal.sh, and running bootlocal.sh -b         i get sh not found, so it seems like i can't backup that file in the same way as filetool.sh.

I feel like i am missing part of the picture here.
Title: Re: Skip waitusb?
Post by: Rich on July 04, 2011, 08:39:45 AM
Hi whitelines2
filetool.sh is used to backup and restore your mydata.tgz file. /opt/.filetool.lst contains a list of files
and/or directories you wish to back up. If you have a line that says   opt/bootlocal.sh   in your
/opt/.filetool.lst  then it will be included when you run a back up.
Title: Re: Skip waitusb?
Post by: whitelines2 on July 04, 2011, 08:58:35 AM
Ok i read the persistence for dummies part of the wiki and i think i get it now.

I redid the usb creation tool and this time chose 'opt=sdb1 home=sdb1 tce=sdb1 superuser'. So now i have a permanent home for opt and home, and other changes will automatically get saved into the file in tce if i specify it in filetool.lst.

Booted it up for first time and edited bootlocal.sh with the line

hexdump -C /dev/sda

restarted the computer and viola, it works!!!!

Now last thing i need to work out is how to install bash and have it the default shell on startup. The scrips i need to run will be saved in /.bachrc. Thanks for the help!
Title: Re: Skip waitusb?
Post by: gerald_clark on July 04, 2011, 09:09:11 AM
Having opt and home on a flash drive is not recommended.

If you are going to do this, you need to remove all opt and home entries from .filetool.lst.
Title: Re: Skip waitusb?
Post by: whitelines2 on July 04, 2011, 09:17:15 AM
Ok.

i'll just add opt and home to filetool.lst instead. I've browsed through the entire wiki, can't find any mention of how to download and install extensions from the cli.
Title: Re: Skip waitusb?
Post by: Juanito on July 04, 2011, 10:07:47 AM
I've browsed through the entire wiki, can't find any mention of how to download and install extensions from the cli.

If you know what you're looking for "tce-load -wil extension_name"

Otherwise "ab"
Title: Re: Skip waitusb?
Post by: gerald_clark on July 04, 2011, 11:47:13 AM
You have opt= and home= boot codes.
Do NOT add opt and home from .filetool.sh.  Remove them.
Title: Re: Skip waitusb?
Post by: Juanito on July 04, 2011, 09:29:52 PM
Since there's a need to make /etc/init persist across boots, I'd suggest using backup/restore rather than persistent home or opt (boot codes home=, opt=).

By default, /opt/.filetool.lst will make a backup of the contents of home and /opt/bootlocal.sh, so you only need to add etc/init and then make a backup.
Title: Re: Skip waitusb?
Post by: Rich on July 04, 2011, 09:45:25 PM

According to this he switched back to backup/restore.

Quote
i'll just add opt and home to filetool.lst instead.