Tiny Core Linux

Tiny Core Base => Corepure64 => Topic started by: aw on December 03, 2020, 05:44:01 AM

Title: How is busybox added to the rootfs?
Post by: aw on December 03, 2020, 05: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.
Title: Re: How is busybox added to the rootfs?
Post by: Juanito on December 03, 2020, 07: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.
Title: Re: How is busybox added to the rootfs?
Post by: Rich on December 03, 2020, 08: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.
Title: Re: How is busybox added to the rootfs?
Post by: aw on December 04, 2020, 01: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?
Title: Re: How is busybox added to the rootfs?
Post by: Juanito on December 04, 2020, 01:46:01 AM
Affirmative
Title: Re: How is busybox added to the rootfs?
Post by: Rich on December 04, 2020, 04: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