Added more detailed comment descriptions in some of the scripts.

This commit is contained in:
Ivan Davidov 2015-08-15 17:58:05 +03:00
parent 47db7efdd0
commit 86d24fb37d
3 changed files with 25 additions and 3 deletions

View File

@ -7,11 +7,14 @@ rm -rf rootfs
cd busybox
cd $(ls -d *)
# Copy all BusyBox generated stuff to the location of our "initramfs" folder.
cp -R _install ../../rootfs
cd ../../rootfs
# Remove "linuxrc" which is used when we boot in "RAM disk" mode.
rm -f linuxrc
# Create root FS folders
mkdir dev
mkdir etc
mkdir proc
@ -19,10 +22,16 @@ mkdir root
mkdir src
mkdir sys
mkdir tmp
# "1" means that only the owner of a file/directory (or root) can remove it.
chmod 1777 tmp
cd etc
# The script "/etc/bootscript.sh" is automatically executed as part of the
# "init" proess. We suppress most kernel messages, mount all crytical file
# systems, loop through all available network devices and we configure them
# through DHCP.
cat > bootscript.sh << EOF
#!/bin/sh
@ -40,6 +49,7 @@ EOF
chmod +x bootscript.sh
# The script "/etc/rc.dhcp" is automatically invoked for each network device.
cat > rc.dhcp << EOF
#!/bin/sh
@ -53,6 +63,8 @@ EOF
chmod +x rc.dhcp
# The file "/etc/welcome.txt" is displayed on every boot of the system in each
# available terminal.
cat > welcome.txt << EOF
#####################################
@ -63,6 +75,9 @@ cat > welcome.txt << EOF
EOF
# The file "/etc/inittab" contains the configuration which defines how the
# system will be initialized. Check the following URL for more details:
# http://git.busybox.net/busybox/tree/examples/inittab
cat > inittab << EOF
::sysinit:/etc/bootscript.sh
::restart:/sbin/init
@ -80,6 +95,8 @@ EOF
cd ..
# The "/init" script passes the execution to "/sbin/init" which in turn looks
# for the configuration file "/etc/inittab".
cat > init << EOF
#!/bin/sh
@ -89,6 +106,7 @@ EOF
chmod +x init
# Copy all source files to "/src". Note that the scripts won't work there.
cp ../../*.sh src
cp ../../.config src
chmod +r src/*.sh

View File

@ -2,10 +2,12 @@
cd work
# Remove the old initramfs archive if it exists.
rm -f rootfs.cpio.gz
cd rootfs
# Packs the current folder structure in "cpio.gz" archive.
find . | cpio -H newc -o | gzip > ../rootfs.cpio.gz
cd ../..

View File

@ -5,7 +5,9 @@ rm -f minimal_linux_live.iso
cd work/kernel
cd $(ls -d *)
# Edit Makefile to look for genisoimage instead of mkisofs
# Edit Makefile to look for genisoimage instead of mkisofs. This was added as a
# workaround for some "Debian" and "Arch Linux" distributions. In general this
# fix should be harmless.
sed -i 's/mkisofs/genisoimage/g' arch/x86/boot/Makefile
# Generate the ISO image with optimization for "parallel jobs" = "number of processors"