Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: GAI on April 01, 2021, 02:52:52 AM

Title: Can I install this system into RAM
Post by: GAI on April 01, 2021, 02:52:52 AM
I hope it's very open, but at present it takes about 25 seconds to boot, load the module and run the program
Title: Re: Can I install this system into RAM
Post by: polikuo on April 01, 2021, 03:06:42 AM
Hi, GAI

What you're looking for is call copy2fs.

Read the book (http://tinycorelinux.net/book.html) for more details.

The more extensions you load, the slower the system boots.
Title: Re: Can I install this system into RAM
Post by: GAI on April 01, 2021, 03:13:47 AM
I didn't load any extra kernel modules or drivers
Title: Re: Can I install this system into RAM
Post by: bmarkus on April 01, 2021, 03:18:48 AM
Copying extensions to RAM will slow down booting.
Title: Re: Can I install this system into RAM
Post by: GAI on April 01, 2021, 03:21:59 AM
Do you have anything faster
Title: Re: Can I install this system into RAM
Post by: Juanito on April 01, 2021, 03:33:44 AM
It would help others to help you if you could provide details of your hardware, what version and architecture of tinycore you are using and if you are loading any extensions "onboot".
Title: Re: Can I install this system into RAM
Post by: GAI on April 01, 2021, 03:43:12 AM

hardware :  raspberry  cm3+

os  :   tiny  core   13.03

Onboot I only loaded SSH

bootloacal:
......
  inomod  serial.ko 
  inomod  ch341.ko

ifconfig eth0  up

ifconfig  192.168.1.121
cd /mnt/mmc/tce
./mypro


what can I do , it can start faster




Title: Re: Can I install this system into RAM
Post by: polikuo on April 01, 2021, 04:26:57 AM
25 seconds is oddly slow for cm3+

It takes me 17 seconds to boot RPI4 with mylocale, openssh, wifi

10 seconds needed before TC kernel takeover.

I have no idea what program you run.

I guess that's the problem.

Anyway, does a few seconds really matter for you ?
Title: Re: Can I install this system into RAM
Post by: GAI on April 01, 2021, 04:31:57 AM
Yes, it's very important. I burn the system into MMC. Its startup time is 15s. But my builderroot startup time is only 12 seconds


I want him to be faster, at least faster than buildroot
Title: Re: Can I install this system into RAM
Post by: polikuo on April 01, 2021, 07:07:41 AM
In that case, you could

  A: Remaster the filesystem (rootfs-piCore*.gz)

  B: Merge all extensions (http://forum.tinycorelinux.net/index.php/topic,20709.msg129934.html#msg129934) into one (you only have openssh though)

  C: Recompile the kernel natively to see if it goes faster.

  D: Refactor the Core-scripts (https://github.com/tinycorelinux/Core-scripts) to drop all the redundant processes for piCore.

  E: Overclock your RPI

  F: Buy a  faster raspberry pi (I guess it takes time for CM to check the peripherals)

Anyway, it's getting off topic cause the idea of install this system into RAM is not exactly what you're looking for.

Set the copy2fs.flg would copy all extensions into RAM which is time consuming in its nature.

Decompressing the archives and creating the symbolic links are the bottleneck.
Title: Re: Can I install this system into RAM
Post by: GAI on April 01, 2021, 11:45:56 PM
  D: Refactor the Core-scripts to drop all the redundant processes for piCore.

what should i do?

this  is  12.0   I use  13.03
Title: Re: Can I install this system into RAM
Post by: CNK on April 02, 2021, 03:17:30 AM
If you go with polikuo's option D, then you'll also have to do option A, because the boot scripts are built-in and run before extensions are unpacked.

For option A (see remastering guide on the Wiki (http://wiki.tinycorelinux.net/doku.php?id=wiki:remastering)), you really are installing things to RAM so this isn't really off-topic. This way you avoid the "symbolic links" bottleneck and could also trim down/eliminate lots of stuff in the start-up scripts (depending on what you're actually doing of course) - specifically /etc/init.d/rcS and /etc/init.d/tc-config. Maybe adjusting the compression settings for the initramfs when you remaster it may speed up boot, but whether to increase or decrease compression depends on whether the bottleneck is the CPU decompressing the data, or actually reading the data from the flash storage.

Bare minimum if you just want the Linux kernel to run one program, with no other processes started and only built-in kernel modules available, is to edit the boot command line adding "init=[program you want to run with full path]". You'll still need to remaster in order to include the program you want to run in the initramfs. Whether that option is even remotely suitable depends entirely on the details of your application. It's the fastest way to run something in Linux, but you'll probably run into odd problems unless you know absolutely everything that your program is doing (preferably, you wrote all of it yourself with this in mind).