ivandavidov / minimal-linux-script

One script which generates live Linux ISO image with minimal effort. Based on the first published version of Minimal Linux Live: http://github.com/ivandavidov/minimal
GNU General Public License v3.0
219 stars 70 forks source link

What does exactly this do? #9

Closed jlxip closed 6 years ago

jlxip commented 6 years ago

https://github.com/ivandavidov/minimal-linux-script/blob/efbe1e615718186411c20ee9f6ed5e22b5d11036/minimal.sh#L16

Does this mean that busybox will be installed in the host system? Or will it only be installed in the _install directory?

jlxip commented 6 years ago

Nevermind. I feel stupid. If the command isn't run as root it cannot modify the system. Sorry for the inconvenience.

ivandavidov commented 6 years ago

It's always good to ask questions instead of being in doubt, so no worries.

This line will install BusyBox in the default installation location which is the directory named _install. That's the same directory which we refer later in the script lines when we create the root filesystem.

P.S. This whole chain of commands never do anything with your OS files, regardless of the user privileges.

jlxip commented 6 years ago

By the way, once you have the basic system in the isoimage directory, how could you install a program?

It would be good if I could install gcc and make, and keep going from there, installing the rest programs inside of a chroot, such as bash or util-linux. Would it be possible even to replace BusyBox with GNU Core Utilities?

I lack a lot of experience in this area, but I am really interested in learning.

ivandavidov commented 6 years ago

In Minimal Linux Script (MLS) the only type of programs that work are statically linked programs. That's because MLS doesn't provide GNU C Library and therefore all system libraries, along with the dynamic linker are missing. In this situation only statically linked binaries can be executed, hence the need to explicitly compile BusyBox as statically linked binary.

Currently there is no established procedure how to add more stuff in MLS but in general you'd have to put your statically linked binaries in the _install/bin folder before generating the rootfs.gz file.

In Minimal Linux Live (MLL) the GNU C Library is present and as result many dynamically linked programs work fine. In MLL there is well established procedure how to add more software. The easiest way is to simply put your programs in the minimal_overlay/rootfs folder before you start building MLL.

You can also refer to the tutorial in MLL which explains how the statically linked version of MLL/MLS is built. Unfortunately, I never had enough time to write another tutorial which explains how the dynamically linked version of MLL works.

Feel free to ask further questions and I'll be happy to answer them! :)