Added more detailed comment descriptions in some of the scripts.
This commit is contained in:
parent
47db7efdd0
commit
86d24fb37d
@ -7,11 +7,14 @@ rm -rf rootfs
|
|||||||
cd busybox
|
cd busybox
|
||||||
cd $(ls -d *)
|
cd $(ls -d *)
|
||||||
|
|
||||||
|
# Copy all BusyBox generated stuff to the location of our "initramfs" folder.
|
||||||
cp -R _install ../../rootfs
|
cp -R _install ../../rootfs
|
||||||
cd ../../rootfs
|
cd ../../rootfs
|
||||||
|
|
||||||
|
# Remove "linuxrc" which is used when we boot in "RAM disk" mode.
|
||||||
rm -f linuxrc
|
rm -f linuxrc
|
||||||
|
|
||||||
|
# Create root FS folders
|
||||||
mkdir dev
|
mkdir dev
|
||||||
mkdir etc
|
mkdir etc
|
||||||
mkdir proc
|
mkdir proc
|
||||||
@ -19,10 +22,16 @@ mkdir root
|
|||||||
mkdir src
|
mkdir src
|
||||||
mkdir sys
|
mkdir sys
|
||||||
mkdir tmp
|
mkdir tmp
|
||||||
|
|
||||||
|
# "1" means that only the owner of a file/directory (or root) can remove it.
|
||||||
chmod 1777 tmp
|
chmod 1777 tmp
|
||||||
|
|
||||||
cd etc
|
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
|
cat > bootscript.sh << EOF
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
@ -40,6 +49,7 @@ EOF
|
|||||||
|
|
||||||
chmod +x bootscript.sh
|
chmod +x bootscript.sh
|
||||||
|
|
||||||
|
# The script "/etc/rc.dhcp" is automatically invoked for each network device.
|
||||||
cat > rc.dhcp << EOF
|
cat > rc.dhcp << EOF
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
@ -53,6 +63,8 @@ EOF
|
|||||||
|
|
||||||
chmod +x rc.dhcp
|
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
|
cat > welcome.txt << EOF
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
@ -63,6 +75,9 @@ cat > welcome.txt << EOF
|
|||||||
|
|
||||||
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
|
cat > inittab << EOF
|
||||||
::sysinit:/etc/bootscript.sh
|
::sysinit:/etc/bootscript.sh
|
||||||
::restart:/sbin/init
|
::restart:/sbin/init
|
||||||
@ -80,6 +95,8 @@ EOF
|
|||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
|
# The "/init" script passes the execution to "/sbin/init" which in turn looks
|
||||||
|
# for the configuration file "/etc/inittab".
|
||||||
cat > init << EOF
|
cat > init << EOF
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
@ -89,6 +106,7 @@ EOF
|
|||||||
|
|
||||||
chmod +x init
|
chmod +x init
|
||||||
|
|
||||||
|
# Copy all source files to "/src". Note that the scripts won't work there.
|
||||||
cp ../../*.sh src
|
cp ../../*.sh src
|
||||||
cp ../../.config src
|
cp ../../.config src
|
||||||
chmod +r src/*.sh
|
chmod +r src/*.sh
|
||||||
|
@ -2,10 +2,12 @@
|
|||||||
|
|
||||||
cd work
|
cd work
|
||||||
|
|
||||||
|
# Remove the old initramfs archive if it exists.
|
||||||
rm -f rootfs.cpio.gz
|
rm -f rootfs.cpio.gz
|
||||||
|
|
||||||
cd rootfs
|
cd rootfs
|
||||||
|
|
||||||
|
# Packs the current folder structure in "cpio.gz" archive.
|
||||||
find . | cpio -H newc -o | gzip > ../rootfs.cpio.gz
|
find . | cpio -H newc -o | gzip > ../rootfs.cpio.gz
|
||||||
|
|
||||||
cd ../..
|
cd ../..
|
||||||
|
@ -5,7 +5,9 @@ rm -f minimal_linux_live.iso
|
|||||||
cd work/kernel
|
cd work/kernel
|
||||||
cd $(ls -d *)
|
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
|
sed -i 's/mkisofs/genisoimage/g' arch/x86/boot/Makefile
|
||||||
|
|
||||||
# Generate the ISO image with optimization for "parallel jobs" = "number of processors"
|
# Generate the ISO image with optimization for "parallel jobs" = "number of processors"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user