WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [solved] TCL Custom Bootup  (Read 2922 times)

Offline souren

  • Newbie
  • *
  • Posts: 17
[solved] TCL Custom Bootup
« on: September 08, 2010, 10:38:34 PM »
I have successfully managed to install tiny core linux onto a fairly old piece of hardware at work, that runs on a Pentium 100 with 64MB RAM, and uses a 128MB CF Card. The box is starting up and I can see the Desktop...so that part is all good.

However, the box has an internal watchdog that kicks in after every 30secs of inactivity, unless otherwise stopped. This requires me to write a small bit of code and have it executed at bootup.

Can someone please tell me how I can go about doing this...I am a bit lost at the moment.

Thanks.
Souren
« Last Edit: September 15, 2010, 08:58:16 PM by souren »

Offline souren

  • Newbie
  • *
  • Posts: 17
Re: TCL Custom Bootup
« Reply #1 on: September 08, 2010, 11:31:26 PM »
Just been doing some reading...based on what I need to do, I am guessing that my app needs to go inside the /tce/optional folder.

Is that right? If so, how do I get it auto-execute on bootup?

Please help.

Regards,
Souren

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10965
Re: TCL Custom Bootup
« Reply #2 on: September 09, 2010, 12:37:16 AM »
/opt/bootlocal.sh is for user processes at boot.
The only barriers that can stop you are the ones you create yourself.

Offline souren

  • Newbie
  • *
  • Posts: 17
Re: TCL Custom Bootup
« Reply #3 on: September 09, 2010, 02:19:45 AM »
Thanks.

So, that's a folder (and file) I need to create in the CF card? And on bootup TCL will just pick it up?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14568
Re: TCL Custom Bootup
« Reply #4 on: September 09, 2010, 02:25:31 AM »
You need to create a folder /tce somewhere permanent where your extensions will be stored. Once created the app browser will automatically store extensions there.

You can use panel/apps audit to manipulate how extensions are handled by tc - there's "onboot" (i.e. loaded every boot) and "ondemand" (added to desktop right-click menu) and if you choose neither you can load the extensions manually from the app browser using "local"

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10965
Re: TCL Custom Bootup
« Reply #5 on: September 09, 2010, 05:01:26 AM »
Thanks.

So, that's a folder (and file) I need to create in the CF card? And on bootup TCL will just pick it up?

No, they are inside the TC image, usually stored in your backup.
The only barriers that can stop you are the ones you create yourself.

Offline souren

  • Newbie
  • *
  • Posts: 17
Re: TCL Custom Bootup
« Reply #6 on: September 09, 2010, 05:05:56 AM »
Yes. I know about app browser. But in this particular case I am loading it on an embedded device with a screen that has 7-8 keys on it - no keyboard / mouse.

Whatever configuration is required, it must be done while loading the image onto the CF card. At runtime, I can't launch app browser or do any sort of configuration.

So, from what I gather I need to have a /tce and a /opt in the CF card. The watchdog app that I write will go into the /tce and the bootlocal.sh file will go into the /opt folder. I am assuming that bootlocal.sh will get called by the kernel automatically, and it must have a line containing something like: wdog &

Is that it?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14568
Re: TCL Custom Bootup
« Reply #7 on: September 09, 2010, 05:21:47 AM »
you also need a file /tce/onboot.lst with the names of the extensions (one per line) you'd like to be loaded at boot.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10965
Re: TCL Custom Bootup
« Reply #8 on: September 09, 2010, 06:02:56 AM »
No, /opt is inside tinycore.gz. You could also create an empty /opt directory, add opt=hdaX (your device) to boot codes, boot once. After that the persistent opt dir will be used, and you can edit the bootlocal.sh that is there.
The only barriers that can stop you are the ones you create yourself.

Offline souren

  • Newbie
  • *
  • Posts: 17
Re: TCL Custom Bootup
« Reply #9 on: September 13, 2010, 07:20:07 PM »
OK. I was sick the last few days so I couldn't try out your advice.

However, today I did...and not having much luck! :(

So, here is what I do:
1. Boot up TC from the CD
2. Since usbinstall didn't quite work for me, I followed the TC installation procedure to install it to sda1 (instead of hda1)
3. configured grub using root (hd1,0), setup (hd1)
4. changed the kernel parameter in menu.lst to include ide_core.nodma=0.0
5. Now, I have an app called wdog that I copied to /mnt/sda1/tce
6. Edited onboot.lst /mnt/sda1/tce to include wdog

I took the CF card out of my laptop, put it into the embedded device and although it booted up successfully, after about 30secs it died. The reason it died is because the wdog application failed to be executed - so the device's watchdog kicked in.

Is there something I am missing or doing wrong? Please let me know...thanks.

Offline ^thehatsrule^

  • Administrator
  • Hero Member
  • *****
  • Posts: 1726
Re: TCL Custom Bootup
« Reply #10 on: September 13, 2010, 07:36:14 PM »
1. Did you add anything to start up your application? (i.e. bootlocal.sh, or extension startup scripts)
2. Was the extension properly created?  You can try loading it manually via `tce-load -i /path/to/extension.tcz`

Offline souren

  • Newbie
  • *
  • Posts: 17
Re: TCL Custom Bootup
« Reply #11 on: September 13, 2010, 08:05:09 PM »
I am very new to TC...so I am not familiar with the scripts.

I am not sure what goes into bootlocal.sh, and where it should be...I had a look at: http://www.tinycorelinux.com/wiki/tiki-index.php?page=bootlocal.sh+and+shutdown.sh
But from what I know the /opt folder is inside the tinycore.gz. So, how can I modify that? I followed the installation script and basically copied it striaght from /mnt/hdc/boot/

Right now, under /mnt/sda1 I have boot and tce folders.
tce contains wdog and onboot.lst

I am not sure what you mean by if the extension was properly created? Are you referring to the tcz file?

If so, I did the following:
1. copied wdog to /tmp/package
2. mksquashfs package myapp.tcz
3. mv myapp.tcz /mnt/sda1/tce

I am not sure where to go from here...
« Last Edit: September 13, 2010, 08:18:22 PM by souren »

Offline ^thehatsrule^

  • Administrator
  • Hero Member
  • *****
  • Posts: 1726
Re: TCL Custom Bootup
« Reply #12 on: September 13, 2010, 10:20:39 PM »
Typically it might be covered by a backup, or opt= depending on your setup. If you want to modify it inside tinycore.gz, see remastering.


Yes, I meant the tcz.  It wasn't entirely clear in your previous step 5.

According to your 3 steps above, "wdog" would be located in / after loading.  Thus, assuming it is executable, you could enter "/wdog" on its own line in (any) startup script.

I'll point out that that location isn't entirely standard.  A better location might be in i.e. /usr/local/bin. (and then you could start it with "wdog").

If you don't want to use bootlocal.sh, you can use an extension startup script.  So all you would need is the .tcz file.

Offline souren

  • Newbie
  • *
  • Posts: 17
Re: TCL Custom Bootup
« Reply #13 on: September 13, 2010, 10:37:51 PM »
Thanks.

I have no problem with using bootlocal.sh. Right now, I am following the steps listed in: http://www.tinycorelinux.com/install.html to create a bootable CF loaded with TC.

I'd really appreciate if you could please let me know exactly where in those steps can I create the bootlocal.sh file, so that it calls wdog which would ideally be in /usr/local/bin (like you suggested). I believe the /usr directory is only visible once the embedded device boots up using the CF card. So, what do I need to do while creating the CF card image?

Thanks again!

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: TCL Custom Bootup
« Reply #14 on: September 14, 2010, 12:38:38 AM »

3. mv myapp.tcz /mnt/sda1/tce

mv myapp.tcz /mnt/sda1/tce/optional
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)