From: gobo72 Date: Sun, 4 Sep 2011 20:41:30 +0000 (+0000) Subject: Installation automatique du kernel au stage2. X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=48619411231621a6b9289bbbad75c5fa7f91dcfe;p=hvlinux.git Installation automatique du kernel au stage2. --- 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/kernel b/stage2/pkg/kernel new file mode 100644 index 0000000..194d734 --- /dev/null +++ b/stage2/pkg/kernel @@ -0,0 +1,45 @@ +#!/bin/bash + +hvbuild() +{ + # Check if kernel sources are still in /usr/src. + # If not, recopy them. + if [ ! -d /usr/src/${PACKAGE} ]; then + # Decompress kernel sources + decompress_package ${PACKAGE} /usr/src + fi + + # 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}) + SCRIPT=/usr/src/compile-kernel + + echo "#!/bin/bash" > ${SCRIPT} + echo "set -o errexit" >> ${SCRIPT} + echo "KERNEL_VERSION=${VERSION}" >> ${SCRIPT} + echo "KERNEL_NAME=clfs-\${KERNEL_VERSION}" >> ${SCRIPT} + echo "DEST=/boot" >> ${SCRIPT} + echo "ARCH=${HVL_TARGET}" >> ${SCRIPT} + echo "unset CROSS_COMPILE" >> ${SCRIPT} + echo "" >> ${SCRIPT} + echo "make" >> ${SCRIPT} + echo "make modules" >> ${SCRIPT} + echo "make modules_install" >> ${SCRIPT} + echo "cp -v arch/${HVL_TARGET}/boot/bzImage \${DEST}/vmlinuz-\${KERNEL_NAME}" >> ${SCRIPT} + echo "cp -v System.map \${DEST}/System.map-\${KERNEL_NAME}" >> ${SCRIPT} + 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 +} diff --git a/stage2/pkg/linux b/stage2/pkg/linux deleted file mode 100644 index a3ee9f5..0000000 --- a/stage2/pkg/linux +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -hvbuild() -{ - # Check if kernel sources from stage0 are still in /usr/src. - # If not, recopy them. - if [ ! -d /usr/src/${PACKAGE} ]; then - cp -a ${LFS_TMP}/${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 - - # Install HV kernel compilation script: - VERSION=$(get_pkg_ver ${PACKAGE}) - SCRIPT=/usr/src/compile-kernel - - echo "#!/bin/bash" > ${SCRIPT} - echo "set -o errexit" >> ${SCRIPT} - echo "KERNEL_VERSION=${VERSION}" >> ${SCRIPT} - echo "KERNEL_NAME=clfs-\${KERNEL_VERSION}" >> ${SCRIPT} - echo "DEST=/boot" >> ${SCRIPT} - echo "ARCH=${HVL_TARGET}" >> ${SCRIPT} - echo "unset CROSS_COMPILE" >> ${SCRIPT} - echo "" >> ${SCRIPT} - echo "make" >> ${SCRIPT} - echo "make modules" >> ${SCRIPT} - echo "make modules_install" >> ${SCRIPT} - echo "cp -v arch/${HVL_TARGET}/boot/bzImage \${DEST}/vmlinuz-\${KERNEL_NAME}" >> ${SCRIPT} - echo "cp -v System.map \${DEST}/System.map-\${KERNEL_NAME}" >> ${SCRIPT} - echo "cp -v .config \${DEST}/config-\${KERNEL_NAME}" >> ${SCRIPT} - - chmod -v u+x ${SCRIPT} -}