-#!/bin/sh
+#!/bin/bash
set -o errexit
# Reading system configuration informations, functions and package versions.
VERSION=$(get_pkg_ver ${PACKAGE})
SCRIPT=${LFS}/usr/src/compile-kernel-minimal
-echo "#!/bin/sh" > ${SCRIPT}
+echo "#!/bin/bash" > ${SCRIPT}
+echo "set -o errexit" >> ${SCRIPT}
echo "KERNEL_VERSION=${VERSION}" >> ${SCRIPT}
echo "KERNEL_NAME=clfs-\${KERNEL_VERSION}" >> ${SCRIPT}
echo "DEST=${LFS}/boot" >> ${SCRIPT}
echo "PATH=\${PATH}:${LFS}/cross-tools/bin" >> ${SCRIPT}
echo "" >> ${SCRIPT}
-echo "make ARCH=${HVL_TARGET} CROSS_COMPILE=${CLFS_TARGET}- menuconfig &&" >> ${SCRIPT}
+echo "make ARCH=${CLFS_ARCH} CROSS_COMPILE=${CLFS_TARGET}- menuconfig" >> ${SCRIPT}
# Compile the kernel image:
-echo "make ARCH=${HVL_TARGET} CROSS_COMPILE=${CLFS_TARGET}- &&" >> ${SCRIPT}
+echo "make ARCH=${CLFS_ARCH} CROSS_COMPILE=${CLFS_TARGET}-" >> ${SCRIPT}
# Install the kernel:
-echo "cp -v arch/${HVL_TARGET}/boot/bzImage \${DEST}/vmlinuz-\${KERNEL_NAME} &&" >> ${SCRIPT}
+echo "cp -v arch/${CLFS_ARCH}/boot/bzImage \${DEST}/vmlinuz-\${KERNEL_NAME}" >> ${SCRIPT}
# Install map file:
-echo "cp -v System.map \${DEST}/System.map-\${KERNEL_NAME} &&" >> ${SCRIPT}
+echo "cp -v System.map \${DEST}/System.map-\${KERNEL_NAME}" >> ${SCRIPT}
# Install config file:
echo "cp -v .config \${DEST}/config-\${KERNEL_NAME}" >> ${SCRIPT}
-cat >> ${SCRIPT} << "EOF"
-
-if [ $? -ne 0 ]; then
- echo "*** Kernel compilation error ***."
- exit 1
-fi
-
-exit 0
-EOF
-
chmod -v u+x ${SCRIPT}
exit $?