WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: How is busybox added to the rootfs?  (Read 3562 times)

Offline aw

  • Newbie
  • *
  • Posts: 45
How is busybox added to the rootfs?
« on: December 03, 2020, 08:44:01 AM »
Hello,

It seems there are missing some steps in the build process for the TC rootfs.

I found the 3 following files/repos:

- http://repo.tinycorelinux.net/11.x/x86_64/release/src/toolchain/compile_tc11_x86_64
- http://repo.tinycorelinux.net/11.x/x86_64/release/src/busybox/compile_busybox
- https://github.com/tinycorelinux/Core-scripts

But it doesn't explain how Busybox, the kernel, and the compiled binaries get merged into a rootfs. Are there other files added which I'm not aware of? Is there a script somewhere?

Thanks.
github.com/aw

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14756
Re: How is busybox added to the rootfs?
« Reply #1 on: December 03, 2020, 10:33:23 AM »
I imagine that in the beginning Robert created a rootfs much as lfs do.

Since then the rootfs has been over-written with the new files manually.

There is a sorter script in tinycore git to create the kernel driver extensions.
« Last Edit: December 03, 2020, 12:00:25 PM by Juanito »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11516
Re: How is busybox added to the rootfs?
« Reply #2 on: December 03, 2020, 11:50:41 AM »
Hi aw
... But it doesn't explain how Busybox, the kernel, and the compiled binaries get merged into a rootfs. ...
The kernel does not get merged into the rootfs.

Offline aw

  • Newbie
  • *
  • Posts: 45
Re: How is busybox added to the rootfs?
« Reply #3 on: December 04, 2020, 04:32:48 AM »
Thanks for the correction regarding the kernel.

Ok so you take an existing rootfs (ex: 10.x), extract with cpio, overwrite the files with 11.x busybox etc, then regenerate the rootfs with cpio?
github.com/aw

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14756
Re: How is busybox added to the rootfs?
« Reply #4 on: December 04, 2020, 04:46:01 AM »
Affirmative

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11516
Re: How is busybox added to the rootfs?
« Reply #5 on: December 04, 2020, 07:50:57 AM »
Hi aw
To unpack:
Code: [Select]
mkdir tempdir
cd tempdir
zcat /path/to/existing/rootfs.gz | sudo cpio -i

To repack:
Code: [Select]
cd tempdir
sudo find . | sudo cpio -o -H newc | gzip > /path/to/new/rootfs.gz