summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorSebastian Schmelzer2011-04-21 15:36:16 +0200
committerSebastian Schmelzer2011-04-21 15:36:16 +0200
commitc61ac386c2dbf70c629d8e5364c5872563510aed (patch)
tree5f5dd1451866093afeab1edd72a1029d292fd7d0 /bin
parentfbgui update (shutdowm button fix...) (diff)
downloadusb-boot-stick-c61ac386c2dbf70c629d8e5364c5872563510aed.tar.gz
usb-boot-stick-c61ac386c2dbf70c629d8e5364c5872563510aed.tar.xz
usb-boot-stick-c61ac386c2dbf70c629d8e5364c5872563510aed.zip
script tuning :) + vesamenu
Diffstat (limited to 'bin')
-rw-r--r--bin/build-preboot-kernel26
-rwxr-xr-xbin/build.initramfs.sh18
-rwxr-xr-xbin/build.kernel.sh33
-rwxr-xr-xbin/env.setup-kernel.sh33
-rwxr-xr-xbin/env.setup-syslinux.sh44
-rwxr-xr-xbin/initramfs.update9
6 files changed, 128 insertions, 35 deletions
diff --git a/bin/build-preboot-kernel b/bin/build-preboot-kernel
deleted file mode 100644
index d03810d..0000000
--- a/bin/build-preboot-kernel
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/bash
-
-ROOT_DIR=$(readlink -f $(dirname $(readlink -f $0))/..)
-
-. $ROOT_DIR/config/setup.conf
-
-
-
-cd $ROOT_DIR/build
-if [ ! -f linux-${kernel_version}.tar.bz2 ]; then
- echo "download kernel"
- wget -c "$kernel_url"
-fi
-
-if [ ! -d linux-${kernel_version} ]; then
- echo "unpack kernel"
- tar xjf linux-${kernel_version}.tar.bz2
-fi
-
-cd linux-${kernel_version}
-cp ${ROOT_DIR}/config/kernel.config ./.config
-
-linux32 make oldconfig
-linux32 make -j 4
-
-cp arch/x86/boot/bzImage ../kernel-preboot-latest
diff --git a/bin/build.initramfs.sh b/bin/build.initramfs.sh
new file mode 100755
index 0000000..36ee4eb
--- /dev/null
+++ b/bin/build.initramfs.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+ROOT_DIR=$(readlink -f $(dirname $(readlink -f $0))/..)
+
+cd ${ROOT_DIR}/build/rootfs
+echo "[build-initramfs] \t Create initramfs."
+find . | cpio -H newc -o > ../initramfs-default.cpio
+cd ..
+gzip initramfs-default.cpio
+
+mv initramfs-default.cpio.gz initramfs-default
+INITRAMFS_SIZE=$(stat -c %s ${ROOT_DIR}/build/initramfs-default)
+
+cd - > /dev/null 2>&1
+
+echo "[build-initramfs] \t New initramfs created."
+echo "\t\t\t Location: ${ROOT_DIR}/build/initramfs-default."
+echo "\t\t\t Size: ${INITRAMFS_SIZE} bytes."
diff --git a/bin/build.kernel.sh b/bin/build.kernel.sh
new file mode 100755
index 0000000..309e24a
--- /dev/null
+++ b/bin/build.kernel.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+ROOT_DIR=$(readlink -f $(dirname $(readlink -f $0))/..)
+
+. $ROOT_DIR/config/setup.conf
+
+cd $ROOT_DIR/build
+
+if [ ! -d linux-${kernel_version} ]; then
+ echo "[build-kernel] \t\t Can't find kernel-sources. Re-run kernel env setup."
+ $ROOT_DIR/bin/env.setup-kernel.sh
+fi
+
+echo "[build-kernel]\t\t Update Kernel config."
+cd linux-${kernel_version}
+cp ${ROOT_DIR}/config/kernel.config ./.config
+
+mkdir -p $ROOT_DIR/build/log
+
+yes "" | linux32 make oldconfig > $ROOT_DIR/build/log/kernel-oldconfig.log 2>&1
+
+echo "[build-kernel]\t\t Build Kernel (Could take some time)."
+linux32 make -j $make_num_jobs > $ROOT_DIR/build/log/kernel-compile.log 2>&1
+
+cp arch/x86/boot/bzImage ../kernel-preboot-latest
+
+KERNEL_SIZE=$(stat -c %s ${ROOT_DIR}/build/kernel-preboot-latest)
+
+echo "[build-kernel] \t\t New Kernel build successfully."
+echo "\t\t\t Location: ${ROOT_DIR}/build/kernel-preboot-latest ."
+echo "\t\t\t Size: ${KERNEL_SIZE} bytes."
+
+cd - >/dev/null 2>&1
diff --git a/bin/env.setup-kernel.sh b/bin/env.setup-kernel.sh
new file mode 100755
index 0000000..82a8c4a
--- /dev/null
+++ b/bin/env.setup-kernel.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+ROOT_DIR=$(readlink -f $(dirname $(readlink -f $0))/..)
+
+. $ROOT_DIR/config/setup.conf
+
+cd $ROOT_DIR/build
+if [ ! -f linux-${kernel_version}.tar.bz2 ]; then
+ echo "[setup-kernel]\t\t Download Kernel ($kernel_version)."
+ wget -q -c "$kernel_url"
+else
+ echo "[setup-kernel]\t\t Found Kernel package - skip download."
+fi
+
+if [ ! -d linux-${kernel_version} ]; then
+ echo "[setup-kernel]\t\t Unpack Kernel."
+ tar xjf linux-${kernel_version}.tar.bz2
+else
+ echo "[setup-kernel]\t\t Found unpacked kernel - continue."
+fi
+
+echo "[setup-kernel]\t\t Update Kernel config."
+cd linux-${kernel_version}
+cp ${ROOT_DIR}/config/kernel.config ./.config
+
+mkdir -p $ROOT_DIR/build/log
+
+yes "" | linux32 make oldconfig > $ROOT_DIR/build/log/kernel-oldconfig.log 2>&1
+echo "[setup-kernel]\t\t Details can be found in the log file: $ROOT_DIR/build/log/kernel-oldconfig.log"
+
+cd - >/dev/null 2>&1
+
+
diff --git a/bin/env.setup-syslinux.sh b/bin/env.setup-syslinux.sh
new file mode 100755
index 0000000..065b4e9
--- /dev/null
+++ b/bin/env.setup-syslinux.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+ROOT_DIR=$(readlink -f $(dirname $(readlink -f $0))/..)
+
+. $ROOT_DIR/config/setup.conf
+
+if [ "$syslinux_use_testing" = "1" ]; then
+ SYSLINUX_URL=$syslinux_testing_url
+ SYSLINUX_VERSION=$syslinux_testing_version
+ SYSLINUX_TESTING="x"
+else
+ SYSLINUX_URL=$syslinux_stable_url
+ SYSLINUX_VERSION=$syslinux_stable_version
+ SYSLINUX_STABLE="x"
+fi
+
+
+get_syslinux ()
+{
+ wget -q $SYSLINUX_URL
+ tar xjf $SYSLINUX_VERSION.tar.bz2
+ rm $SYSLINUX_VERSION.tar.bz2
+ rm latest
+ ln -sf $SYSLINUX_VERSION/ latest
+}
+
+
+cd $ROOT_DIR/contrib/syslinux
+
+if [ "x$(readlink -e latest)" != "x" ]; then
+ if [ "$(basename $(readlink -e latest))" = "$SYSLINUX_VERSION" ]; then
+ echo "[setup-syslinux] \t Found up-to-date syslinux ($SYSLINUX_VERSION)"
+ else
+ echo "[setup-syslinux] \t Found different syslinux version ($(basename $(readlink -e latest))). Switch to $SYSLINUX_VERSION."
+ get_syslinux
+ fi
+else
+ echo "[setup-syslinux] \t Install $SYSLINUX_VERSION."
+ get_syslinux
+fi
+
+cd - 2>&1 > /dev/null
+
+
diff --git a/bin/initramfs.update b/bin/initramfs.update
deleted file mode 100755
index b194705..0000000
--- a/bin/initramfs.update
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/bash
-
-ROOT_DIR=$(readlink -f $(dirname $(readlink -f $0))/..)
-
-cd ${ROOT_DIR}/build/rootfs
-find . | cpio -H newc -o > ../initramfs-default.cpio
-cd ..
-gzip initramfs-default.cpio
-mv initramfs-default.cpio.gz initramfs-default