WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Can I install this system into RAM  (Read 3113 times)

Offline GAI

  • Newbie
  • *
  • Posts: 30
Can I install this system into RAM
« 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

Offline polikuo

  • Hero Member
  • *****
  • Posts: 724
Re: Can I install this system into RAM
« Reply #1 on: April 01, 2021, 03:06:42 AM »
Hi, GAI

What you're looking for is call copy2fs.

Read the book for more details.

The more extensions you load, the slower the system boots.

Offline GAI

  • Newbie
  • *
  • Posts: 30
Re: Can I install this system into RAM
« Reply #2 on: April 01, 2021, 03:13:47 AM »
I didn't load any extra kernel modules or drivers

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Can I install this system into RAM
« Reply #3 on: April 01, 2021, 03:18:48 AM »
Copying extensions to RAM will slow down booting.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline GAI

  • Newbie
  • *
  • Posts: 30
Re: Can I install this system into RAM
« Reply #4 on: April 01, 2021, 03:21:59 AM »
Do you have anything faster

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14815
Re: Can I install this system into RAM
« Reply #5 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".

Offline GAI

  • Newbie
  • *
  • Posts: 30
Re: Can I install this system into RAM
« Reply #6 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




« Last Edit: April 01, 2021, 04:10:06 AM by GAI »

Offline polikuo

  • Hero Member
  • *****
  • Posts: 724
Re: Can I install this system into RAM
« Reply #7 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 ?

Offline GAI

  • Newbie
  • *
  • Posts: 30
Re: Can I install this system into RAM
« Reply #8 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

Offline polikuo

  • Hero Member
  • *****
  • Posts: 724
Re: Can I install this system into RAM
« Reply #9 on: April 01, 2021, 07:07:41 AM »
In that case, you could

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

  B: Merge all extensions into one (you only have openssh though)

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

  D: Refactor the 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.

Offline GAI

  • Newbie
  • *
  • Posts: 30
Re: Can I install this system into RAM
« Reply #10 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
« Last Edit: April 01, 2021, 11:48:34 PM by GAI »

Offline CNK

  • Wiki Author
  • Sr. Member
  • *****
  • Posts: 283
Re: Can I install this system into RAM
« Reply #11 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), 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).
« Last Edit: October 27, 2022, 10:24:31 PM by Rich »