diff --git a/config/path b/config/path index 8fedc34dcd..6aa978ee15 100644 --- a/config/path +++ b/config/path @@ -78,6 +78,7 @@ SED="sed -i" PKG_SHORTDESC="$1 (autogenerated)" PKG_LONGDESC="" PKG_IS_ADDON="no" + PKG_PATCH_DIRS="" if [ -n "$1" ]; then _PKG_ROOT_NAME=${1%:*} diff --git a/packages/linux/package.mk b/packages/linux/package.mk index 1f96bf83d5..57778abd79 100644 --- a/packages/linux/package.mk +++ b/packages/linux/package.mk @@ -58,6 +58,7 @@ case "$LINUX" in *) PKG_VERSION="4.8.12" PKG_URL="http://www.kernel.org/pub/linux/kernel/v4.x/$PKG_NAME-$PKG_VERSION.tar.xz" + PKG_PATCH_DIRS="default" ;; esac diff --git a/packages/linux/patches/4.8.12/linux-004-fix-build-with-gcc-5.patch b/packages/linux/patches/default/linux-004-fix-build-with-gcc-5.patch similarity index 100% rename from packages/linux/patches/4.8.12/linux-004-fix-build-with-gcc-5.patch rename to packages/linux/patches/default/linux-004-fix-build-with-gcc-5.patch diff --git a/packages/linux/patches/4.8.12/linux-051-ouya_controller_support.patch b/packages/linux/patches/default/linux-051-ouya_controller_support.patch similarity index 100% rename from packages/linux/patches/4.8.12/linux-051-ouya_controller_support.patch rename to packages/linux/patches/default/linux-051-ouya_controller_support.patch diff --git a/packages/linux/patches/4.8.12/linux-052-XBOX_remote_support.patch b/packages/linux/patches/default/linux-052-XBOX_remote_support.patch similarity index 100% rename from packages/linux/patches/4.8.12/linux-052-XBOX_remote_support.patch rename to packages/linux/patches/default/linux-052-XBOX_remote_support.patch diff --git a/packages/linux/patches/4.8.12/linux-053-spinelplus-remote-0.2.patch b/packages/linux/patches/default/linux-053-spinelplus-remote-0.2.patch similarity index 100% rename from packages/linux/patches/4.8.12/linux-053-spinelplus-remote-0.2.patch rename to packages/linux/patches/default/linux-053-spinelplus-remote-0.2.patch diff --git a/packages/linux/patches/4.8.12/linux-054-nuvoton_revert_d7b290a1056c5564eec8a1b169c6e84ff3.6.114c13.patch b/packages/linux/patches/default/linux-054-nuvoton_revert_d7b290a1056c5564eec8a1b169c6e84ff3.6.114c13.patch similarity index 100% rename from packages/linux/patches/4.8.12/linux-054-nuvoton_revert_d7b290a1056c5564eec8a1b169c6e84ff3.6.114c13.patch rename to packages/linux/patches/default/linux-054-nuvoton_revert_d7b290a1056c5564eec8a1b169c6e84ff3.6.114c13.patch diff --git a/packages/linux/patches/4.8.12/linux-057-Removed-MCE-customer-code-restriction-in-rc6-decode.patch b/packages/linux/patches/default/linux-057-Removed-MCE-customer-code-restriction-in-rc6-decode.patch similarity index 100% rename from packages/linux/patches/4.8.12/linux-057-Removed-MCE-customer-code-restriction-in-rc6-decode.patch rename to packages/linux/patches/default/linux-057-Removed-MCE-customer-code-restriction-in-rc6-decode.patch diff --git a/packages/linux/patches/4.8.12/linux-058.05-hid_sony-add_autorepeat_for_PS3_remotes.patch b/packages/linux/patches/default/linux-058.05-hid_sony-add_autorepeat_for_PS3_remotes.patch similarity index 100% rename from packages/linux/patches/4.8.12/linux-058.05-hid_sony-add_autorepeat_for_PS3_remotes.patch rename to packages/linux/patches/default/linux-058.05-hid_sony-add_autorepeat_for_PS3_remotes.patch diff --git a/packages/linux/patches/4.8.12/linux-062-imon_pad_ignore_diagonal.patch b/packages/linux/patches/default/linux-062-imon_pad_ignore_diagonal.patch similarity index 100% rename from packages/linux/patches/4.8.12/linux-062-imon_pad_ignore_diagonal.patch rename to packages/linux/patches/default/linux-062-imon_pad_ignore_diagonal.patch diff --git a/packages/linux/patches/4.8.12/linux-203-stb0899_enable_low_symbol_rate.patch b/packages/linux/patches/default/linux-203-stb0899_enable_low_symbol_rate.patch similarity index 100% rename from packages/linux/patches/4.8.12/linux-203-stb0899_enable_low_symbol_rate.patch rename to packages/linux/patches/default/linux-203-stb0899_enable_low_symbol_rate.patch diff --git a/packages/linux/patches/4.8.12/linux-212-mantis_stb0899_faster_lock.patch b/packages/linux/patches/default/linux-212-mantis_stb0899_faster_lock.patch similarity index 100% rename from packages/linux/patches/4.8.12/linux-212-mantis_stb0899_faster_lock.patch rename to packages/linux/patches/default/linux-212-mantis_stb0899_faster_lock.patch diff --git a/packages/linux/patches/4.8.12/linux-221-ddbridge-features.patch b/packages/linux/patches/default/linux-221-ddbridge-features.patch similarity index 100% rename from packages/linux/patches/4.8.12/linux-221-ddbridge-features.patch rename to packages/linux/patches/default/linux-221-ddbridge-features.patch diff --git a/packages/linux/patches/4.8.12/linux-222-stb0899_signal_quality.patch b/packages/linux/patches/default/linux-222-stb0899_signal_quality.patch similarity index 100% rename from packages/linux/patches/4.8.12/linux-222-stb0899_signal_quality.patch rename to packages/linux/patches/default/linux-222-stb0899_signal_quality.patch diff --git a/packages/linux/patches/4.8.12/linux-227-ds3000-invalid-symbol-rate.patch b/packages/linux/patches/default/linux-227-ds3000-invalid-symbol-rate.patch similarity index 100% rename from packages/linux/patches/4.8.12/linux-227-ds3000-invalid-symbol-rate.patch rename to packages/linux/patches/default/linux-227-ds3000-invalid-symbol-rate.patch diff --git a/packages/linux/patches/4.8.12/linux-950-saa716x_PCIe_interface_chipset.patch.todo b/packages/linux/patches/default/linux-950-saa716x_PCIe_interface_chipset.patch.todo similarity index 100% rename from packages/linux/patches/4.8.12/linux-950-saa716x_PCIe_interface_chipset.patch.todo rename to packages/linux/patches/default/linux-950-saa716x_PCIe_interface_chipset.patch.todo diff --git a/packages/linux/patches/4.8.12/linux-990.06-hda-Avoid-outputting-HDMI-audio-before-prepare-.patch b/packages/linux/patches/default/linux-990.06-hda-Avoid-outputting-HDMI-audio-before-prepare-.patch similarity index 100% rename from packages/linux/patches/4.8.12/linux-990.06-hda-Avoid-outputting-HDMI-audio-before-prepare-.patch rename to packages/linux/patches/default/linux-990.06-hda-Avoid-outputting-HDMI-audio-before-prepare-.patch diff --git a/packages/linux/patches/4.8.12/linux-999-i915-Fix-random-GPU-hang-Bug-156851.patch b/packages/linux/patches/default/linux-999-i915-Fix-random-GPU-hang-Bug-156851.patch similarity index 100% rename from packages/linux/patches/4.8.12/linux-999-i915-Fix-random-GPU-hang-Bug-156851.patch rename to packages/linux/patches/default/linux-999-i915-Fix-random-GPU-hang-Bug-156851.patch diff --git a/packages/linux/patches/4.8.12/linux-999-i915-chris-wilson-limit-depth-of-display-pipeline.patch b/packages/linux/patches/default/linux-999-i915-chris-wilson-limit-depth-of-display-pipeline.patch similarity index 100% rename from packages/linux/patches/4.8.12/linux-999-i915-chris-wilson-limit-depth-of-display-pipeline.patch rename to packages/linux/patches/default/linux-999-i915-chris-wilson-limit-depth-of-display-pipeline.patch diff --git a/packages/linux/patches/4.8.12/linux-999-i915-fixes-and-diagnostics-for-braswell.patch b/packages/linux/patches/default/linux-999-i915-fixes-and-diagnostics-for-braswell.patch similarity index 100% rename from packages/linux/patches/4.8.12/linux-999-i915-fixes-and-diagnostics-for-braswell.patch rename to packages/linux/patches/default/linux-999-i915-fixes-and-diagnostics-for-braswell.patch diff --git a/packages/linux/patches/4.8.12/linux-999-i915-implement-passthrough-colors.patch b/packages/linux/patches/default/linux-999-i915-implement-passthrough-colors.patch similarity index 100% rename from packages/linux/patches/4.8.12/linux-999-i915-implement-passthrough-colors.patch rename to packages/linux/patches/default/linux-999-i915-implement-passthrough-colors.patch diff --git a/packages/linux/patches/4.8.12/linux-999-i915-use-legacy-turbo.patch b/packages/linux/patches/default/linux-999-i915-use-legacy-turbo.patch similarity index 100% rename from packages/linux/patches/4.8.12/linux-999-i915-use-legacy-turbo.patch rename to packages/linux/patches/default/linux-999-i915-use-legacy-turbo.patch diff --git a/packages/linux/patches/4.8.12/linux-999-partly-revert-media-rc-core.patch b/packages/linux/patches/default/linux-999-partly-revert-media-rc-core.patch similarity index 100% rename from packages/linux/patches/4.8.12/linux-999-partly-revert-media-rc-core.patch rename to packages/linux/patches/default/linux-999-partly-revert-media-rc-core.patch diff --git a/packages/linux/patches/4.8.12/linux-999.02-0001-pm-disable-async-suspend-resume-by-default.patch b/packages/linux/patches/default/linux-999.02-0001-pm-disable-async-suspend-resume-by-default.patch similarity index 100% rename from packages/linux/patches/4.8.12/linux-999.02-0001-pm-disable-async-suspend-resume-by-default.patch rename to packages/linux/patches/default/linux-999.02-0001-pm-disable-async-suspend-resume-by-default.patch diff --git a/packages/linux/patches/4.8.12/linux-999.05-eMMC-Don-t-initialize-partitions-on-RPMB-flagged-are.patch b/packages/linux/patches/default/linux-999.05-eMMC-Don-t-initialize-partitions-on-RPMB-flagged-are.patch similarity index 100% rename from packages/linux/patches/4.8.12/linux-999.05-eMMC-Don-t-initialize-partitions-on-RPMB-flagged-are.patch rename to packages/linux/patches/default/linux-999.05-eMMC-Don-t-initialize-partitions-on-RPMB-flagged-are.patch diff --git a/scripts/unpack b/scripts/unpack index 3e3d1855af..76f9584f18 100755 --- a/scripts/unpack +++ b/scripts/unpack @@ -122,29 +122,52 @@ else PATCH_ARCH="$TARGET_ARCH" fi +PATCH_DIRS_PKG="" +PATCH_DIRS_PRJ="" +if [ -n "$PKG_PATCH_DIRS" ]; then + for patch_dir in $PKG_PATCH_DIRS; do + [ -d $PKG_DIR/patches/$patch_dir ] && PATCH_DIRS_PKG="$PATCH_DIRS_PKG $PKG_DIR/patches/$patch_dir/*.patch" + [ -d $PROJECT_DIR/$PROJECT/patches/$PKG_NAME/$patch_dir ] && PATCH_DIRS_PRJ="$PATCH_DIRS_PRJ $PROJECT_DIR/$PROJECT/patches/$PKG_NAME/$patch_dir/*.patch" + done +fi + for i in $PKG_DIR/patches/$PKG_NAME-*.patch \ $PKG_DIR/patches/$PATCH_ARCH/$PKG_NAME-*.patch \ + $PATCH_DIRS_PKG \ $PKG_DIR/patches/$PKG_VERSION/*.patch \ $PKG_DIR/patches/$PKG_VERSION/$PATCH_ARCH/*.patch \ $PROJECT_DIR/$PROJECT/patches/$PKG_NAME/*.patch \ $PROJECT_DIR/$PROJECT/patches/$PKG_NAME/$PATCH_ARCH/*.patch \ + $PATCH_DIRS_PRJ \ $PROJECT_DIR/$PROJECT/patches/$PKG_NAME/$PKG_VERSION/*.patch \ $PROJECT_DIR/$PROJECT/devices/$DEVICE/patches/$PKG_NAME/*.patch; do - if [ $(dirname $i) = "$PKG_DIR/patches" ]; then + thisdir="$(dirname "$i")" + + if [ "$thisdir" = "$PKG_DIR/patches" ]; then PATCH_DESC="(common)" - elif [ $(dirname $i) = "$PKG_DIR/patches/$PATCH_ARCH" ]; then + elif [ "$thisdir" = "$PKG_DIR/patches/$PATCH_ARCH" ]; then PATCH_DESC="(common - $PATCH_ARCH)" - elif [ $(dirname $i) = "$PKG_DIR/patches/$PKG_VERSION/$PATCH_ARCH" ]; then + elif [ "$thisdir" = "$PKG_DIR/patches/$PKG_VERSION" ]; then + PATCH_DESC="(common - $PKG_VERSION)" + elif [ "$thisdir" = "$PKG_DIR/patches/$PKG_VERSION/$PATCH_ARCH" ]; then PATCH_DESC="($PKG_VERSION - $PATCH_ARCH)" - elif [ $(dirname $i) = "$PROJECT_DIR/$PROJECT/patches/$PKG_NAME" ]; then + elif [ "$thisdir" = "$PROJECT_DIR/$PROJECT/patches/$PKG_NAME" ]; then PATCH_DESC="(project)" - elif [ $(dirname $i) = "$PROJECT_DIR/$PROJECT/patches/$PKG_NAME/$PATCH_ARCH" ]; then + elif [ "$thisdir" = "$PROJECT_DIR/$PROJECT/patches/$PKG_NAME/$PATCH_ARCH" ]; then PATCH_DESC="(project - $PATCH_ARCH)" - elif [ $(dirname $i) = "$PROJECT_DIR/$PROJECT/patches/$PKG_NAME/$PKG_VERSION" ]; then + elif [ "$thisdir" = "$PROJECT_DIR/$PROJECT/patches/$PKG_NAME/$PKG_VERSION" ]; then PATCH_DESC="(project - $PKG_VERSION)" - elif [ $(dirname $i) = "$PROJECT_DIR/$PROJECT/devices/$DEVICE/patches/$PKG_NAME" ]; then + elif [ "$thisdir" = "$PROJECT_DIR/$PROJECT/devices/$DEVICE/patches/$PKG_NAME" ]; then PATCH_DESC="(device)" + else + if [[ "$thisdir" =~ ^$PKG_DIR/.* ]]; then + PATCH_DESC="(common - $(basename "$thisdir"))" + elif [[ "$thisdir" =~ ^$PROJECT_DIR/.* ]]; then + PATCH_DESC="(project - $(basename "$thisdir"))" + else + PATCH_DESC="(unknown - $(basename "$thisdir"))" + fi fi if [ -f "$i" ]; then