Improved comments.

This commit is contained in:
Ivan Davidov 2015-09-13 16:21:01 +03:00
parent ffed43447a
commit c05e0580cf
7 changed files with 37 additions and 31 deletions

View File

@ -4,9 +4,9 @@
#
KERNEL_SOURCE_URL=https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.1.6.tar.xz
# You can find the latest BusyBox source bundles here:
# You can find the latest ToyBox source bundles here:
#
# http://busybox.net
# http://landley.net/toybox
#
TOYBOX_SOURCE_URL=http://landley.net/toybox/downloads/toybox-0.6.0.tar.gz

View File

@ -3,6 +3,6 @@
rm -rf work
mkdir work
# -p stops errors if the directory already exists
# -p stops errors if the directory already exists.
mkdir -p source

View File

@ -1,23 +1,23 @@
#!/bin/sh
# Grab everything after the '=' character
# Grab everything after the '=' character.
DOWNLOAD_URL=$(grep -i KERNEL_SOURCE_URL .config | cut -f2 -d'=')
# Grab everything after the last '/' character
# Grab everything after the last '/' character.
ARCHIVE_FILE=${DOWNLOAD_URL##*/}
cd source
# Downloading kernel file
# -c option allows the download to resume
# Downloading kernel file.
# -c option allows the download to resume.
wget -c $DOWNLOAD_URL
# Delete folder with previously extracted kernel
# Delete folder with previously extracted kernel.
rm -rf ../work/kernel
mkdir ../work/kernel
# Extract kernel to folder 'work/kernel'
# Full path will be something like 'work/kernel/linux-3.16.1'
# Extract kernel to folder 'work/kernel'.
# Full path will be something like 'work/kernel/linux-4.1.6'.
tar -xvf $ARCHIVE_FILE -C ../work/kernel
cd ..

View File

@ -2,20 +2,20 @@
cd work/kernel
# Change to the first directory ls finds, e.g. 'linux-3.18.6'
# Change to the first directory ls finds, e.g. 'linux-3.18.6'.
cd $(ls -d *)
# Cleans up the kernel sources, including configuration files
# Cleans up the kernel sources, including configuration files.
make mrproper
# Create a default configuration file for the kernel
# Create a default configuration file for the kernel.
make defconfig
# Changes the name of the system
# Changes the name of the system.
sed -i "s/.*CONFIG_DEFAULT_HOSTNAME.*/CONFIG_DEFAULT_HOSTNAME=\"minimal\"/" .config
# Compile the kernel with optimization for "parallel jobs" = "number of processors"
# Good explanation of the different kernels
# Compile the kernel with optimization for "parallel jobs" = "number of processors".
# Good explanation of the different kernels:
# http://unix.stackexchange.com/questions/5518/what-is-the-difference-between-the-following-kernel-makefile-terms-vmlinux-vmlinux
make bzImage -j $(grep ^processor /proc/cpuinfo | wc -l)

View File

@ -1,23 +1,23 @@
#!/bin/sh
# Grab everything after the '=' character
# Grab everything after the '=' character.
DOWNLOAD_URL=$(grep -i TOYBOX_SOURCE_URL .config | cut -f2 -d'=')
# Grab everything after the last '/' character
# Grab everything after the last '/' character.
ARCHIVE_FILE=${DOWNLOAD_URL##*/}
cd source
# Downloading toybox source
# -c option allows the download to resume
# Downloading ToyBox source.
# -c option allows the download to resume.
wget -c $DOWNLOAD_URL
# Delete folder with previously extracted toybox
# Delete folder with previously extracted ToyBox.
rm -rf ../work/toybox
mkdir ../work/toybox
# Extract toybox to folder 'toybox'
# Full path will be something like 'work/toybox/toybox-0.6.0'
# Extract toybox to folder 'toybox'.
# Full path will be something like 'work/toybox/toybox-0.6.0'.
tar -xvf $ARCHIVE_FILE -C ../work/toybox
cd ..

View File

@ -5,24 +5,31 @@ cd work/toybox
# Change to the first directory ls finds, e.g. 'toybox-0.6.0'
cd $(ls -d *)
# Remove previously generated artefacts
# Remove previously generated artefacts.
make distclean
# Create a default configuration file
# Create a configuration file with all possible selections.
make allyesconfig
# Static linking
export LDFLAGS="--static"
# Compile toybox with optimization for "parallel jobs" = "number of processors"
# Compile ToyBox with optimization for "parallel jobs" = "number of processors".
make toybox -j $(grep ^processor /proc/cpuinfo | wc -l)
# We no longer need flags for static linking.
unset LDFLAGS
rm -rf rootfs
mkdir rootfs
# Directory where ToyBox binary and symlink will be instaled.
export PREFIX=rootfs
# Create the symlinks for toybox
# Create the symlinks for toybox in single folder.
make install_flat
# We no longer need this environment variable.
unset PREFIX
cd ../../..

View File

@ -8,7 +8,7 @@ mkdir rootfs
cd toybox
cd $(ls -d *)
# Copy all toybox generated stuff to the location of our "initramfs" folder.
# Copy all toybox generated stuff to the location of our "initramfs/bin" folder.
cp -R rootfs ../../rootfs/bin
cd ../../rootfs
@ -26,8 +26,7 @@ chmod 1777 tmp
cd etc
# The file "/etc/welcome.txt" is displayed on every boot of the system in each
# available terminal.
# The file "/etc/welcome.txt" is displayed on every boot.
cat > welcome.txt << EOF
#####################################
@ -40,7 +39,7 @@ EOF
cd ..
# Problem setting default path
# For now we have simple console.
cat > init << EOF
#!/bin/sh
dmesg -n 1