From 6cbd8248d64dfffe1716d272a2cd0702c4460d25 Mon Sep 17 00:00:00 2001 From: gobo72 Date: Wed, 22 Aug 2012 00:01:09 +0000 Subject: [PATCH] =?utf8?q?Modifi=C3=A9=20apply=5Fpatches()=20pour=20pouvoi?= =?utf8?q?r=20sp=C3=A9cifier=20n'importe=20quel=20r=C3=A9pertoire=20de=20b?= =?utf8?q?ase.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- config/amd64/config-linux-3.4.7 | 4 ++-- functions/ipkg | 4 +++- functions/main | 22 ++++++++++++++-------- stage1/pkg/linux | 2 ++ stage2/pkg/kernel | 2 ++ stage2/pkg/kernel-headers | 2 ++ 6 files changed, 25 insertions(+), 11 deletions(-) diff --git a/config/amd64/config-linux-3.4.7 b/config/amd64/config-linux-3.4.7 index 057bf86..61edcdd 100644 --- a/config/amd64/config-linux-3.4.7 +++ b/config/amd64/config-linux-3.4.7 @@ -2118,9 +2118,9 @@ CONFIG_RTC_HCTOSYS_DEVICE="rtc0" # # RTC interfaces # -# CONFIG_RTC_INTF_SYSFS is not set +CONFIG_RTC_INTF_SYSFS=y # CONFIG_RTC_INTF_PROC is not set -# CONFIG_RTC_INTF_DEV is not set +CONFIG_RTC_INTF_DEV=y # CONFIG_RTC_DRV_TEST is not set # diff --git a/functions/ipkg b/functions/ipkg index f948ac3..22f1803 100644 --- a/functions/ipkg +++ b/functions/ipkg @@ -152,7 +152,9 @@ ipkg_script() hvpatch_pre fi - hvpatch + if [ "x${DECOMPRESS}" = "x1" ]; then + hvpatch + fi # Execute pre-configure function if applicable if function_exists hvconfig_pre ; then diff --git a/functions/main b/functions/main index 39c7d29..14f39a9 100644 --- a/functions/main +++ b/functions/main @@ -570,11 +570,19 @@ hv_useradd() # Applying patch # First argument is the name of the patch -# Second argument is the package name (target dir in $LFS_TMP) +# Second argument is the package name +# Third argument: optional target directory (default is $LFS_TMP) apply_patch() { local PATCH_FILE=${1} - local TARGET_DIR=${2} + local PACKAGE=${2} + local TARGET_DIR="" + + if [ $# -eq 3 ]; then + TARGET_DIR=${3}/${PACKAGE} + else + TARGET_DIR=${LFS_TMP}/${PACKAGE} + fi if [ -z "${PATCH_FILE}" ]; then echo @@ -589,7 +597,7 @@ apply_patch() fi echo "Applying patch: ${PATCH_FILE}" - patch -Np1 -d ${LFS_TMP}/${TARGET_DIR} -i ${LFS_PKG_DIR}/${PATCH_FILE} + patch -Np1 -d ${TARGET_DIR} -i ${LFS_PKG_DIR}/${PATCH_FILE} } # Applying any patch(es) found for the current package. @@ -602,7 +610,7 @@ apply_patch() apply_patches() { PACKAGE=${1} - local TARGET_DIR=${PACKAGE} + local TARGET_DIR="" # Checking for correct number of arguments if [ $# -gt 2 ]; then @@ -613,15 +621,13 @@ apply_patches() if [ $# -eq 2 ]; then TARGET_DIR=${2} - else - TARGET_DIR=${PACKAGE} fi # Checking if we can find at least one patch. if ls ${LFS_PKG_DIR}/${1}-*.patch 1> /dev/null 2>&1; then cd ${LFS_PKG_DIR} for patch in ${1}-*.patch; do - apply_patch ${patch} ${TARGET_DIR} + apply_patch ${patch} ${PACKAGE} ${TARGET_DIR} done fi @@ -800,7 +806,7 @@ indicate_pkg_build_complete() # Arg. #1: Package name and version (ex: gcc-4.5.1) # Remaining arguments: Additional configure options # Options: -# -c Do not decompress package to ${LFS_TMP} +# -c Do not decompress package # -j Disable parallel make for this package # -l Unique identification label in 'install.log' # (default is package name and version) diff --git a/stage1/pkg/linux b/stage1/pkg/linux index 718bb2b..490a66c 100644 --- a/stage1/pkg/linux +++ b/stage1/pkg/linux @@ -5,6 +5,8 @@ hvbuild() # Decompress kernel sources decompress_package ${PACKAGE} ${LFS}/usr/src + apply_patches ${PACKAGE} ${LFS}/usr/src + # Copy kernel configuration file in source tree. cp -v ${SCRDIR}/../config/${KERNEL_CONFIG} ${LFS}/usr/src/${PACKAGE}/.config diff --git a/stage2/pkg/kernel b/stage2/pkg/kernel index 194d734..0c9ff30 100644 --- a/stage2/pkg/kernel +++ b/stage2/pkg/kernel @@ -7,6 +7,8 @@ hvbuild() if [ ! -d /usr/src/${PACKAGE} ]; then # Decompress kernel sources decompress_package ${PACKAGE} /usr/src + + apply_patches ${PACKAGE} /usr/src fi # Copy kernel configuration file in source tree. diff --git a/stage2/pkg/kernel-headers b/stage2/pkg/kernel-headers index 6516337..f9ee5bb 100644 --- a/stage2/pkg/kernel-headers +++ b/stage2/pkg/kernel-headers @@ -7,6 +7,8 @@ hvbuild() if [ ! -d /usr/src/${PACKAGE} ]; then # Decompress kernel sources decompress_package ${PACKAGE} /usr/src + + apply_patches ${PACKAGE} /usr/src fi # Install headers -- 2.20.1