Structural improvements.

This commit is contained in:
Ivan Davidov 2016-05-07 03:12:42 +03:00
parent 848f5e5623
commit de5376295f
8 changed files with 66 additions and 33 deletions

View File

@ -8,7 +8,7 @@
#
# http://kernel.org
#
KERNEL_SOURCE_URL=http://kernel.org/pub/linux/kernel/v4.x/linux-4.5.2.tar.xz
KERNEL_SOURCE_URL=http://kernel.org/pub/linux/kernel/v4.x/linux-4.5.3.tar.xz
# You can find the latest GNU libc source bundles here:
#
@ -53,24 +53,24 @@ LINKS_SOURCE_URL=http://links.twibright.com/download/links-2.12.tar.bz2
####################################################
# Use predefined '.config' file when building the kernel. This overrides the
# config generation in '03_build_kernel.sh' and the build process uses the
# config generation in 'xx_build_kernel.sh' and the build process uses the
# config file provided in this parameter. Place the configuration file here:
#
# config_predefined/kernel.config
# minimal_config/kernel.config
#
USE_PREDEFINED_KERNEL_CONFIG=false
# Use predefined '.config' file when building BusyBox. This overrides the config
# generation in '08_build_busybox.sh' and the build process uses the config file
# generation in 'xx_build_busybox.sh' and the build process uses the config file
# provided in this parameter. Place the configuration file here:
#
# config_predefined/busybox.config
# minimal_config/busybox.config
#
USE_PREDEFINED_BUSYBOX_CONFIG=false
# Define the overlay type to use. Possible values are 'sparse' and 'folder'. You
# can use any other value, no value, or comment the property in order to disable
# it. Put your overlay content in the folder '11_generate_iso' and it will be
# it. Put your overlay content in the folder 'minimal_overlay' and it will be
# automatically merged with the root file system on boot. The build process
# creates either '/minimal.img/rootfs' or '/minimal/rootfs' (read below) and
# this folder contains all overlay content in it. The build process also creates
@ -80,7 +80,7 @@ USE_PREDEFINED_BUSYBOX_CONFIG=false
#persisted and preserved on reboot.
#
# sparse - use sparse file 'minimal.img' with hardcoded maximal size of 1MB (see
# 11_generate_iso.sh). The generated ISO image is larger because the
# xx_generate_iso.sh). The generated ISO image is larger because the
# sparse file is treated as regular file. This option requires root
# permissions or otherwise sparse file generation is silently skipped.
# Sparse file is treated as separate disk image and works fine on FAT.
@ -109,7 +109,12 @@ COPY_SOURCE_ROOTFS=true
COPY_SOURCE_ISO=true
# This flag defines whether to build additional overlay software which will be
# placed in the 'minimal_overlay' folder. This software will be visible and
# fully usable after boot. The default is 'false'.
BUILD_OVERLAY_SOFTWARE=true
# placed in the 'work/src/minimal_overlay' folder. This software will be visible
# and fully usable after boot. The default is 'false'. Note that if you set this
# to 'true' and you are using sparse image file for the overlay structure then
# most probably something will go wrong because the additional overlay software
# requires more than 1MB free space. The solution is to use folder overlay or to
# edit the script 'xx_generate_iso.sh' and set it to create sparse image file
# with bigger size.
BUILD_OVERLAY_SOFTWARE=false

View File

@ -35,7 +35,7 @@ cd glibc_objects
# libraries will be installed in '/lib'. Note that on 64-bit machines BusyBox
# will be linked with the libraries in '/lib' while the Linux loader is expected
# to be in '/lib64'. Kernel headers are taken from our already prepared kernel
# header area (see 03_build_kernel.sh). Packages 'gd' and 'selinux' are disabled
# header area (see xx_build_kernel.sh). Packages 'gd' and 'selinux' are disabled
# for better build compatibility with the host system.
echo "Configuring glibc..."
$GLIBC_SRC/configure \

View File

@ -52,7 +52,8 @@ fi
cd work/isoimage
# Copy the precompiled files 'isolinux.bin' and 'ldlinux.c32' in the ISO image root folder.
# Copy the precompiled files 'isolinux.bin' and 'ldlinux.c32' in the ISO image
# root folder.
cp $WORK_SYSLINUX_DIR/bios/core/isolinux.bin .
cp $WORK_SYSLINUX_DIR/bios/com32/elflink/ldlinux/ldlinux.c32 .
@ -76,7 +77,8 @@ if [ "$OVERLAY_TYPE" = "sparse" -a "$(id -u)" = "0" ] ; then
# This is the BusyBox executable that we have already generated.
BUSYBOX=../rootfs/bin/busybox
# Create sparse image file with 1MB size. Note that this increases the ISO image size.
# Create sparse image file with 1MB size. Note that this increases the ISO
# image size.
$BUSYBOX truncate -s 1M minimal.img
# Find available loop device.
@ -123,7 +125,17 @@ fi
echo 'default kernel.xz initrd=rootfs.xz' > ./isolinux.cfg
# Now we generate the ISO image file.
genisoimage -J -r -o ../minimal_linux_live.iso -b isolinux.bin -c boot.cat -input-charset UTF-8 -no-emul-boot -boot-load-size 4 -boot-info-table ./
genisoimage \
-J \
-r \
-o ../minimal_linux_live.iso \
-b isolinux.bin \
-c boot.cat \
-input-charset UTF-8 \
-no-emul-boot \
-boot-load-size 4 \
-boot-info-table \
./
# This allows the ISO image to be bootable if it is burned on USB flash drive.
isohybrid ../minimal_linux_live.iso 2>/dev/null || true

View File

@ -1,3 +1,4 @@
The easiest way to build "Minimal Linux Live" is to run the following script:
sh build_minimal_linux_live.sh
@ -7,6 +8,20 @@ configured. Check the project's website for more information:
http://minimal.linux-bg.org
Once you have your ISO image up and running perhaps you'd like to play with the
configuration file '.config' and see what options you have there. For example
you can set the property 'BUILD_OVERLAY_SOFTWARE=true'. If you do that you will
have additional software being downloaded, built and installed on the ISO image.
Available overlay software:
* Links - text based browser. Requires ~3MB additional space. Use the 'links'
command to activate the browser.
In time there might be other overlay software packages available.
### ### ###
I only provide the build scripts. It's entirely up to you to configure and
prepare your build environment. I use "Linux Mint" both 32 and 64 bit editions.
Your distribution might have different build dependencies but most of the time
@ -15,5 +30,5 @@ there is a single meta-package which installs most of the stuff that you need.
The build proces is slow, so be prepared to wait. In the end you should have
the ISO image file "minimal_linux_live.iso" in the same folder where you
executed the build process. You can burn the ISO image on CD/DVD or (better)
run it with PC emulator like QEMU or VirtualBox.
run it with PC emulator like QEMU or VirtualBox.

View File

@ -2,26 +2,26 @@ The build process allows you to use predefined configuration files for the
kernel and for BusyBox. This is what you need to do in order to use your own
predefined configuration files:
1) First of all you need to have ".config" configuration file. The assumption is
that you already know what ".config" file is and how it is used during the
kernel & BusyBox build process. Take the ".config", place it in this folder
1) First of all you need to have '.config' configuration file. The assumption is
that you already know what '.config' file is and how it is used during the
kernel & BusyBox build process. Take the '.config', place it in this folder
and finally rename the file. The predefined configuration file name is:
kernel.config - for kernel (obviously)
busybox.config - for BusyBox (what a surprise)
2) Change the corresponding property in ".config" (that's the minimal's config
file, you dumbass) to value "true":
2) Change the corresponding property in the main '.config' (that's the minimal's
config file) to value 'true':
USE_PREDEFINED_KERNEL_CONFIG - for kernel
USE_PREDEFINED_BUSYBOX_CONFIG - for BusyBox
3) That's it. Now during the build process instead of generating default
".config" files, the predefined configuration files will be used, That's
'.config' files, the predefined configuration files will be used, That's
particularly useful if you want to experiment with many non-default config
options. In this case it's easier to use configuration file instead of using
the scripts in order to generate tons of options. Another useful scenario is
when you distribute your OS based on "Minimal Linux Live" and you want to use
non-default kernel and/or BusyBox options "out of the box".
when you distribute your OS based on 'Minimal Linux Live' and you want to use
non-default kernel and/or BusyBox options 'out of the box'.

View File

@ -1,12 +1,12 @@
This file has been generated from directory '11_generate_iso'. You can use this
directory to put your own content (files and folders) which will be visible in
the root directory of your 'Minimal Linux Live' system, just like this file is
visible. The files/folders will override the content in the root folder, so be
careful what you put there because you may end up with broken system. If the
boot media is writeable, then all changes on the root file system are persisted
automatically, so be very careful what you do when you use the overlay support.
This file is located in the folder 'minimal_overlay'. You can use this folder to
put your own content (files and folders) which will be visible in the root
folder of your 'Minimal Linux Live' system, just like this file is visible. The
files/folders will override the content in the root folder, so be careful what
you put there because you may end up with broken system. If the boot media is
writeable, then all changes on the root file system are persisted automatically,
so be very careful what you do when you use the overlay support.
Check the file '/src/.config' for more details on the overlay options.
Check the '.config' file in the source folder for more details on the overlay
options and how to use them.

View File

@ -65,6 +65,7 @@ CEOF
if [ "$PID1_SHELL" = "true" ] ; then
# PID1_SHELL flag is set which means we have controlling terminal.
unset PID1_SHELL
exec sh
else
# Interactive shell with controlling tty as PID 1.

View File

@ -14,7 +14,7 @@ echo "Configuring Links..."
./configure \
--prefix=../links_installed \
--disable-graphics \
--enable-utf8 \
--disable-utf8 \
--without-ipv6 \
--without-ssl \
--without-x