WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [Solved] Reduce boottime  (Read 5419 times)

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1063
Re: Reduce boottime
« Reply #15 on: February 05, 2022, 09:21:09 AM »
I’m not sure you have shown us your onboot.lst. 40 extensions seems like a lot for WiFi ssh and sound.

Offline michnixweiss

  • Newbie
  • *
  • Posts: 25
Re: Reduce boottime
« Reply #16 on: February 06, 2022, 01:06:25 AM »
onboot.lst attached
« Last Edit: February 06, 2022, 01:17:08 AM by michnixweiss »

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1063
Re: Reduce boottime
« Reply #17 on: February 06, 2022, 09:57:34 AM »
So you have extra extensions loaded that are only needed for development.
 
i2c-tools
p_ython3.8-pip
nano

Not sure what is in your startUp extension

The tcz startup scripts taking 10seconds to run seems quite long.

Offline michnixweiss

  • Newbie
  • *
  • Posts: 25
Re: Reduce boottime
« Reply #18 on: February 07, 2022, 12:51:00 PM »
Hi @Paul_123,

I switched i2c-tools to ondemand, without change. I temporarely removed all python from the onboot.lst but I'm still at
Code: [Select]
cat /tmp/bootlog.txt
   0.0 - Build TCZ list
   2.3 - Mount TCZ (35)
   2.6 - Add to file system
  10.2 - Execute startup scripts
   0.1 - udev trigger
My startUp extension is/was a test for the easiest way to autostart things. I want to save me the need for an entry in bootlocal.sh
I think using the tce.installed folder will be the easier way...
But for boottime it doesn't matter from where things are startet.

So onboot.lst is now
Code: [Select]
firmware-rpi-wifi.tcz
wifi.tcz
openssh.tcz
nano.tcz
onoffshim-1.2.tcz
wm8960min_5.10.77-piCore.tcz
alsa.tcz
alsa-utils.tcz
alsa-plugins.tcz
rng-tools.tcz

bootsync.sh (without comments) is not changed
Code: [Select]
/usr/bin/sethostname box
/opt/bootlocal.sh &

bootlocal.sh is this
Code: [Select]
cannot post this - attached file

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1063
Re: Reduce boottime
« Reply #19 on: February 07, 2022, 01:22:23 PM »
The problem is that using a tce.installed script is a blocking activity.  It is best to put your startup activities in bootlocal.sh.  And run them in the background if possible.

Offline michnixweiss

  • Newbie
  • *
  • Posts: 25
Re: Reduce boottime
« Reply #20 on: February 07, 2022, 02:25:27 PM »
The problem is that using a tce.installed script is a blocking activity.  It is best to put your startup activities in bootlocal.sh.  And run them in the background if possible.
Ok, get it.

How can I figure out what is causing the 10sec?

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1063
Re: Reduce boottime
« Reply #21 on: February 07, 2022, 05:21:30 PM »
If I have to guess, it’s ca-certificates.   Look in /usr/local/tce.installed. The scripts are there,  if there is no script, tce-load just creates a zero length file so the system knows it’s loaded.


Offline michnixweiss

  • Newbie
  • *
  • Posts: 25
Re: Reduce boottime
« Reply #22 on: February 08, 2022, 11:25:24 AM »
/usr/local/tce.installed/ca-certificates
Code: [Select]
cannot post the script, file attached
But what shall I do with it to fasten it up? ca-cerfificates extension is required by openssh, python, wifi, etc
I could include the files to the filetool.lst and remove the script from the extension if that helps!?
Otherwise there are only scripts from wifi and file. The rest in tce.installed are zerofiles.

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1063
Re: Reduce boottime
« Reply #23 on: February 08, 2022, 11:37:55 AM »
Not much.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: Reduce boottime
« Reply #24 on: February 08, 2022, 12:48:14 PM »
Hi michnixweiss
Try this:
Remove the startup script from  ca-certificates.tcz  and save it to  /opt.
Then make sure it's executable:
Code: [Select]
sudo chmod 775 /opt/ca-certificates
Place the following in  bootlocal.sh:
Code: [Select]
cp -f /opt/ca-certificates /usr/local/tce.installed
/usr/local/tce.installed/ca-certificates &

Offline michnixweiss

  • Newbie
  • *
  • Posts: 25
Re: Reduce boottime
« Reply #25 on: February 09, 2022, 11:27:26 AM »
First of all many thanks! Now I'm at
Code: [Select]
cat /tmp/bootlog.txt
   0.0 - Build TCZ list
   2.3 - Mount TCZ (34)
   2.5 - Add to file system
   3.8 - Execute startup scripts
   0.1 - udev trigger
And ssh is reachable after about 28sec.

One question to the "trick": why copy ca-certification back to tce.installed before run it?

Is there anything else I can optimize to reduce boot time?

Offline michnixweiss

  • Newbie
  • *
  • Posts: 25
Re: Reduce boottime
« Reply #26 on: February 09, 2022, 12:30:13 PM »
I decided to make a bootlocal dir for extensions
As an example the ca-certification.tcz:
Code: [Select]
- in squashfs-root -
mv usr/local/tce.installed/ca-certificates usr/local/tce.installed/ca-certificates.sh
mv usr/local/tce.installed usr/local/bootlocal
Then added to my /opt/bootlocal.sh
Code: [Select]
cannot post - attached fileDoes the job, I can use it for my own extensions and have a small log for them  ;D

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: Reduce boottime
« Reply #27 on: February 09, 2022, 06:14:26 PM »
Hi michnixweiss
... One question to the "trick": why copy ca-certification back to tce.installed before run it? ...
Simple, I didn't think that one through. You could just execute it from  /opt/.

Offline michnixweiss

  • Newbie
  • *
  • Posts: 25
Re: Reduce boottime
« Reply #28 on: February 19, 2022, 03:13:55 AM »
So if there is no more possiblity to reduce boot time this can be set to solved.

Thanks @Rich and @Paul_123

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: [Solved] Reduce boottime
« Reply #29 on: February 19, 2022, 08:58:36 AM »
Hi michnixweiss
Then solved it is.