From aee022b07aa7bcfbb907c778b2375215bbeb2281 Mon Sep 17 00:00:00 2001 From: Ivan Davidov Date: Fri, 8 Aug 2014 02:30:28 +0300 Subject: [PATCH] =?UTF-8?q?=E2=80=A2=20The=20download=20URL=20for=20the=20?= =?UTF-8?q?kernel=20now=20points=20to=20stable=20version=20"3.16".=20?= =?UTF-8?q?=E2=80=A2=20Minor=20formatting=20changes=20-=20the=20scripts=20?= =?UTF-8?q?should=20be=20more=20readable=20this=20way.=20=E2=80=A2=20Minor?= =?UTF-8?q?=20comment=20updates.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/.config | 2 +- src/1_get_kernel.sh | 1 + src/2_build_kernel.sh | 1 + src/3_get_busybox.sh | 4 ++-- src/4_build_busybox.sh | 2 +- src/5_generate_rootfs.sh | 16 ++++++++++++++-- src/6_pack_rootfs.sh | 11 +++++++---- src/7_generate_iso.sh | 4 +++- src/build_minimal_linux_live.sh | 1 - 9 files changed, 30 insertions(+), 12 deletions(-) diff --git a/src/.config b/src/.config index a8073a5cb..e06a644ce 100644 --- a/src/.config +++ b/src/.config @@ -2,7 +2,7 @@ # # http://kernel.org # -KERNEL_SOURCE_URL=https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.15.6.tar.xz +KERNEL_SOURCE_URL=https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.16.tar.xz # You can find the latest BusyBox source bundles here: # diff --git a/src/1_get_kernel.sh b/src/1_get_kernel.sh index 928ac69c2..4423ccf57 100644 --- a/src/1_get_kernel.sh +++ b/src/1_get_kernel.sh @@ -19,4 +19,5 @@ mkdir ../work/kernel # Extract kernel to folder 'kernel' # Full path will be something like, kernel\linux-3.16 tar -xvf $ARCHIVE_FILE -C ../work/kernel + cd .. diff --git a/src/2_build_kernel.sh b/src/2_build_kernel.sh index 2533dcc50..dad85ed6e 100644 --- a/src/2_build_kernel.sh +++ b/src/2_build_kernel.sh @@ -18,4 +18,5 @@ sed -i "s/.*CONFIG_DEFAULT_HOSTNAME.*/CONFIG_DEFAULT_HOSTNAME=\"minimal-linux-li # 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 + cd ../../.. diff --git a/src/3_get_busybox.sh b/src/3_get_busybox.sh index 3abaa7fe7..2e43c23bc 100644 --- a/src/3_get_busybox.sh +++ b/src/3_get_busybox.sh @@ -16,8 +16,8 @@ wget -c $DOWNLOAD_URL rm -rf ../work/busybox mkdir ../work/busybox -# Extract kernel to folder 'busybox' +# Extract busybox to folder 'busybox' # Full path will be something like, busybox\busybox-1.22.1 tar -xvf $ARCHIVE_FILE -C ../work/busybox -cd .. +cd .. diff --git a/src/4_build_busybox.sh b/src/4_build_busybox.sh index 55cff6571..cc6390c45 100644 --- a/src/4_build_busybox.sh +++ b/src/4_build_busybox.sh @@ -5,7 +5,7 @@ cd work/busybox # Change to the first directory ls finds, e.g/ busybox-1.22.1 cd $(ls -d *) -# Clean's the source? +# Remove previously generated artefacts make clean # Create a default configuration file diff --git a/src/5_generate_rootfs.sh b/src/5_generate_rootfs.sh index 7cb81cad1..9470a8cde 100644 --- a/src/5_generate_rootfs.sh +++ b/src/5_generate_rootfs.sh @@ -1,12 +1,17 @@ -#/bin/sh +#!/bin/sh cd work + rm -rf rootfs + cd busybox cd $(ls -d *) + cp -R _install ../../rootfs cd ../../rootfs + rm -f linuxrc + mkdir dev mkdir etc mkdir proc @@ -15,7 +20,9 @@ mkdir src mkdir sys mkdir tmp chmod 1777 tmp + cd etc + touch bootscript.sh echo '#!/bin/sh' >> bootscript.sh echo 'dmesg -n 1' >> bootscript.sh @@ -24,6 +31,7 @@ echo 'mount -t proc none /proc' >> bootscript.sh echo 'mount -t sysfs none /sys' >> bootscript.sh echo >> bootscript.sh chmod +x bootscript.sh + touch welcome.txt echo >> welcome.txt echo ' #####################################' >> welcome.txt @@ -32,6 +40,7 @@ echo ' # Welcome to "Minimal Linux Live" #' >> welcome.txt echo ' # #' >> welcome.txt echo ' #####################################' >> welcome.txt echo >> welcome.txt + touch inittab echo '::sysinit:/etc/bootscript.sh' >> inittab echo '::restart:/sbin/init' >> inittab @@ -45,15 +54,18 @@ echo 'tty3::respawn:/bin/sh' >> inittab echo 'tty4::once:cat /etc/welcome.txt' >> inittab echo 'tty4::respawn:/bin/sh' >> inittab echo >> inittab + cd .. + touch init echo '#!/bin/sh' >> init echo 'exec /sbin/init' >> init echo >> init chmod +x init + cp ../../*.sh src cp ../../.config src chmod +r src/*.sh chmod +r src/.config -cd ../.. +cd ../.. diff --git a/src/6_pack_rootfs.sh b/src/6_pack_rootfs.sh index 4ae50cceb..764d2a986 100644 --- a/src/6_pack_rootfs.sh +++ b/src/6_pack_rootfs.sh @@ -1,8 +1,11 @@ #!/bin/sh cd work -rm -f rootfs.cpio.gz -cd rootfs -find . | cpio -H newc -o | gzip > ../rootfs.cpio.gz -cd ../.. +rm -f rootfs.cpio.gz + +cd rootfs + +find . | cpio -H newc -o | gzip > ../rootfs.cpio.gz + +cd ../.. diff --git a/src/7_generate_iso.sh b/src/7_generate_iso.sh index cbb2880bd..a94c459de 100644 --- a/src/7_generate_iso.sh +++ b/src/7_generate_iso.sh @@ -1,9 +1,11 @@ #/bin/sh rm -f minimal_linux_live.iso + cd work/kernel cd $(ls -d *) + make isoimage FDINITRD=../../rootfs.cpio.gz cp arch/x86/boot/image.iso ../../../minimal_linux_live.iso -cd ../../.. +cd ../../.. diff --git a/src/build_minimal_linux_live.sh b/src/build_minimal_linux_live.sh index 7e945f84c..89db69171 100644 --- a/src/build_minimal_linux_live.sh +++ b/src/build_minimal_linux_live.sh @@ -8,4 +8,3 @@ ./5_generate_rootfs.sh ./6_pack_rootfs.sh ./7_generate_iso.sh -