From 48619411231621a6b9289bbbad75c5fa7f91dcfe Mon Sep 17 00:00:00 2001 From: gobo72 Date: Sun, 4 Sep 2011 20:41:30 +0000 Subject: [PATCH] Installation automatique du kernel au stage2. --- config/amd64/sysinfos | 2 +- stage2/hv-install-1 | 2 +- stage2/hv-install-2 | 8 ++------ stage2/pkg/{linux => kernel} | 28 +++++++++++++++------------- stage2/pkg/kernel-headers | 23 +++++++++++++++++++++++ 5 files changed, 42 insertions(+), 21 deletions(-) rename stage2/pkg/{linux => kernel} (60%) create mode 100644 stage2/pkg/kernel-headers diff --git a/config/amd64/sysinfos b/config/amd64/sysinfos index 0b5417e..15844bb 100644 --- a/config/amd64/sysinfos +++ b/config/amd64/sysinfos @@ -10,7 +10,7 @@ MAKEJOBS=1 # Destination path where to install new Linux-HV system. This is usually where # you have mounted your new LFS partition, but it can also be any directory. # This is relevant only for stage 0 and 1. -LFS="/mnt/hvlinux-temp" +LFS="/mnt/hvlinux" LFS_PARTITION="/dev/sdb7" BOOT_PARTITION="/dev/sdb1" SWAP_PARTITION="/dev/sdb2" diff --git a/stage2/hv-install-1 b/stage2/hv-install-1 index f596347..832b16b 100755 --- a/stage2/hv-install-1 +++ b/stage2/hv-install-1 @@ -9,7 +9,7 @@ init_log_file rscr mult "Performing pre-install" pre-install ipkg -l "${PERL}-pass1" ${PERL} -ipkg -m noac ${KERNEL} +ipkg -c -m noac -l "kernel-headers" -s "kernel-headers" ${KERNEL} ipkg -m noac ${MANPAGES} ipkg ${EGLIBC} rscr once "Adjusting toolchain" toolchain-adjust diff --git a/stage2/hv-install-2 b/stage2/hv-install-2 index 7bc9846..53b8d15 100755 --- a/stage2/hv-install-2 +++ b/stage2/hv-install-2 @@ -49,6 +49,7 @@ fi ipkg ${NANO} ipkg -m noac ${ACPID} +ipkg -c -m noac -l "kernel" -s "kernel" ${KERNEL} rscr once "Installing HV-utilities" install-hv-utilities rscr once "Installing bootscripts" install-bootscripts @@ -57,18 +58,13 @@ rscr once "Creating default config files" create-config-files rscr mult "Compressing man pages" compressdoc #rscr mult "Stripping" stripping -echo "Total build time: $(get_total_build_time ${LFS_LOG_FILE})h" - # Creating root password passwd root rscr mult "Performing post-install" post-install ldconfig -echo "Stage2 successfully completed." -echo "You must now compile a new kernel (go to /usr/src/linux)." -echo "After that, you can reboot and try your new system." - write_completed_stage +display_stage_build_stats exec /bin/bash --login diff --git a/stage2/pkg/linux b/stage2/pkg/kernel similarity index 60% rename from stage2/pkg/linux rename to stage2/pkg/kernel index a3ee9f5..194d734 100644 --- a/stage2/pkg/linux +++ b/stage2/pkg/kernel @@ -2,23 +2,15 @@ hvbuild() { - # Check if kernel sources from stage0 are still in /usr/src. + # Check if kernel sources are still in /usr/src. # If not, recopy them. if [ ! -d /usr/src/${PACKAGE} ]; then - cp -a ${LFS_TMP}/${PACKAGE} /usr/src + # Decompress kernel sources + decompress_package ${PACKAGE} /usr/src fi - # Install headers - cd /usr/src/${PACKAGE} - make mrproper - make headers_check - - # Remove any previous headers install - rm -rf dest - make INSTALL_HDR_PATH=dest headers_install - cp -rv dest/include/* /usr/include - find /usr/include -name .install -or -name ..install.cmd | xargs rm -fv - rm -rf dest + # Copy kernel configuration file in source tree. + cp -v ${SCRDIR}/../config/${KERNEL_CONFIG} /usr/src/${PACKAGE}/.config # Install HV kernel compilation script: VERSION=$(get_pkg_ver ${PACKAGE}) @@ -40,4 +32,14 @@ hvbuild() echo "cp -v .config \${DEST}/config-\${KERNEL_NAME}" >> ${SCRIPT} chmod -v u+x ${SCRIPT} + + cd ${LFS}/usr/src/${PACKAGE} + + # The 'yes' command repeatedly output a line with all specified string, or + # 'y' by default. So, you can use it to simply "press enter", which will + # result in using the defaults value for the 'make oldconfig' command. + yes "" | make oldconfig + + # Execute compilation script + ${SCRIPT} } diff --git a/stage2/pkg/kernel-headers b/stage2/pkg/kernel-headers new file mode 100644 index 0000000..6516337 --- /dev/null +++ b/stage2/pkg/kernel-headers @@ -0,0 +1,23 @@ +#!/bin/bash + +hvbuild() +{ + # Check if kernel sources from stage0 are still in /usr/src. + # If not, recopy them. + if [ ! -d /usr/src/${PACKAGE} ]; then + # Decompress kernel sources + decompress_package ${PACKAGE} /usr/src + fi + + # Install headers + cd /usr/src/${PACKAGE} + make mrproper + make headers_check + + # Remove any previous headers install + rm -rf dest + make INSTALL_HDR_PATH=dest headers_install + cp -rv dest/include/* /usr/include + find /usr/include -name .install -or -name ..install.cmd | xargs rm -fv + rm -rf dest +} -- 2.20.1