diff options
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/Makefile.build | 2 | ||||
| -rwxr-xr-x | scripts/faddr2line | 2 | ||||
| -rw-r--r-- | scripts/gcc-plugins/stackleak_plugin.c | 8 | ||||
| -rwxr-xr-x | scripts/kconfig/merge_config.sh | 7 | ||||
| -rwxr-xr-x | scripts/package/builddeb | 6 | ||||
| -rwxr-xr-x | scripts/package/mkdebian | 7 | ||||
| -rwxr-xr-x | scripts/package/mkspec | 11 | ||||
| -rwxr-xr-x | scripts/setlocalversion | 2 | ||||
| -rwxr-xr-x | scripts/spdxcheck.py | 1 | ||||
| -rw-r--r-- | scripts/unifdef.c | 4 |
10 files changed, 27 insertions, 23 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index a8e7ba9f73e8..6a6be9f440cf 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
| @@ -236,10 +236,8 @@ ifdef CONFIG_GCOV_KERNEL | |||
| 236 | objtool_args += --no-unreachable | 236 | objtool_args += --no-unreachable |
| 237 | endif | 237 | endif |
| 238 | ifdef CONFIG_RETPOLINE | 238 | ifdef CONFIG_RETPOLINE |
| 239 | ifneq ($(RETPOLINE_CFLAGS),) | ||
| 240 | objtool_args += --retpoline | 239 | objtool_args += --retpoline |
| 241 | endif | 240 | endif |
| 242 | endif | ||
| 243 | 241 | ||
| 244 | 242 | ||
| 245 | ifdef CONFIG_MODVERSIONS | 243 | ifdef CONFIG_MODVERSIONS |
diff --git a/scripts/faddr2line b/scripts/faddr2line index a0149db00be7..6c6439f69a72 100755 --- a/scripts/faddr2line +++ b/scripts/faddr2line | |||
| @@ -71,7 +71,7 @@ die() { | |||
| 71 | 71 | ||
| 72 | # Try to figure out the source directory prefix so we can remove it from the | 72 | # Try to figure out the source directory prefix so we can remove it from the |
| 73 | # addr2line output. HACK ALERT: This assumes that start_kernel() is in | 73 | # addr2line output. HACK ALERT: This assumes that start_kernel() is in |
| 74 | # kernel/init.c! This only works for vmlinux. Otherwise it falls back to | 74 | # init/main.c! This only works for vmlinux. Otherwise it falls back to |
| 75 | # printing the absolute path. | 75 | # printing the absolute path. |
| 76 | find_dir_prefix() { | 76 | find_dir_prefix() { |
| 77 | local objfile=$1 | 77 | local objfile=$1 |
diff --git a/scripts/gcc-plugins/stackleak_plugin.c b/scripts/gcc-plugins/stackleak_plugin.c index 2f48da98b5d4..dbd37460c573 100644 --- a/scripts/gcc-plugins/stackleak_plugin.c +++ b/scripts/gcc-plugins/stackleak_plugin.c | |||
| @@ -363,10 +363,12 @@ __visible int plugin_init(struct plugin_name_args *plugin_info, | |||
| 363 | PASS_POS_INSERT_BEFORE); | 363 | PASS_POS_INSERT_BEFORE); |
| 364 | 364 | ||
| 365 | /* | 365 | /* |
| 366 | * The stackleak_cleanup pass should be executed after the | 366 | * The stackleak_cleanup pass should be executed before the "*free_cfg" |
| 367 | * "reload" pass, when the stack frame size is final. | 367 | * pass. It's the moment when the stack frame size is already final, |
| 368 | * function prologues and epilogues are generated, and the | ||
| 369 | * machine-dependent code transformations are not done. | ||
| 368 | */ | 370 | */ |
| 369 | PASS_INFO(stackleak_cleanup, "reload", 1, PASS_POS_INSERT_AFTER); | 371 | PASS_INFO(stackleak_cleanup, "*free_cfg", 1, PASS_POS_INSERT_BEFORE); |
| 370 | 372 | ||
| 371 | if (!plugin_default_version_check(version, &gcc_version)) { | 373 | if (!plugin_default_version_check(version, &gcc_version)) { |
| 372 | error(G_("incompatible gcc/plugin versions")); | 374 | error(G_("incompatible gcc/plugin versions")); |
diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh index da66e7742282..0ef906499646 100755 --- a/scripts/kconfig/merge_config.sh +++ b/scripts/kconfig/merge_config.sh | |||
| @@ -102,7 +102,8 @@ if [ ! -r "$INITFILE" ]; then | |||
| 102 | fi | 102 | fi |
| 103 | 103 | ||
| 104 | MERGE_LIST=$* | 104 | MERGE_LIST=$* |
| 105 | SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(${CONFIG_PREFIX}[a-zA-Z0-9_]*\)[= ].*/\2/p" | 105 | SED_CONFIG_EXP1="s/^\(${CONFIG_PREFIX}[a-zA-Z0-9_]*\)=.*/\1/p" |
| 106 | SED_CONFIG_EXP2="s/^# \(${CONFIG_PREFIX}[a-zA-Z0-9_]*\) is not set$/\1/p" | ||
| 106 | 107 | ||
| 107 | TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX) | 108 | TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX) |
| 108 | 109 | ||
| @@ -116,7 +117,7 @@ for MERGE_FILE in $MERGE_LIST ; do | |||
| 116 | echo "The merge file '$MERGE_FILE' does not exist. Exit." >&2 | 117 | echo "The merge file '$MERGE_FILE' does not exist. Exit." >&2 |
| 117 | exit 1 | 118 | exit 1 |
| 118 | fi | 119 | fi |
| 119 | CFG_LIST=$(sed -n "$SED_CONFIG_EXP" $MERGE_FILE) | 120 | CFG_LIST=$(sed -n -e "$SED_CONFIG_EXP1" -e "$SED_CONFIG_EXP2" $MERGE_FILE) |
| 120 | 121 | ||
| 121 | for CFG in $CFG_LIST ; do | 122 | for CFG in $CFG_LIST ; do |
| 122 | grep -q -w $CFG $TMP_FILE || continue | 123 | grep -q -w $CFG $TMP_FILE || continue |
| @@ -159,7 +160,7 @@ make KCONFIG_ALLCONFIG=$TMP_FILE $OUTPUT_ARG $ALLTARGET | |||
| 159 | 160 | ||
| 160 | 161 | ||
| 161 | # Check all specified config values took (might have missed-dependency issues) | 162 | # Check all specified config values took (might have missed-dependency issues) |
| 162 | for CFG in $(sed -n "$SED_CONFIG_EXP" $TMP_FILE); do | 163 | for CFG in $(sed -n -e "$SED_CONFIG_EXP1" -e "$SED_CONFIG_EXP2" $TMP_FILE); do |
| 163 | 164 | ||
| 164 | REQUESTED_VAL=$(grep -w -e "$CFG" $TMP_FILE) | 165 | REQUESTED_VAL=$(grep -w -e "$CFG" $TMP_FILE) |
| 165 | ACTUAL_VAL=$(grep -w -e "$CFG" "$KCONFIG_CONFIG") | 166 | ACTUAL_VAL=$(grep -w -e "$CFG" "$KCONFIG_CONFIG") |
diff --git a/scripts/package/builddeb b/scripts/package/builddeb index 90c9a8ac7adb..f43a274f4f1d 100755 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb | |||
| @@ -81,11 +81,11 @@ else | |||
| 81 | cp System.map "$tmpdir/boot/System.map-$version" | 81 | cp System.map "$tmpdir/boot/System.map-$version" |
| 82 | cp $KCONFIG_CONFIG "$tmpdir/boot/config-$version" | 82 | cp $KCONFIG_CONFIG "$tmpdir/boot/config-$version" |
| 83 | fi | 83 | fi |
| 84 | cp "$($MAKE -s image_name)" "$tmpdir/$installed_image_path" | 84 | cp "$($MAKE -s -f $srctree/Makefile image_name)" "$tmpdir/$installed_image_path" |
| 85 | 85 | ||
| 86 | if grep -q "^CONFIG_OF=y" $KCONFIG_CONFIG ; then | 86 | if grep -q "^CONFIG_OF_EARLY_FLATTREE=y" $KCONFIG_CONFIG ; then |
| 87 | # Only some architectures with OF support have this target | 87 | # Only some architectures with OF support have this target |
| 88 | if grep -q dtbs_install "${srctree}/arch/$SRCARCH/Makefile"; then | 88 | if [ -d "${srctree}/arch/$SRCARCH/boot/dts" ]; then |
| 89 | $MAKE KBUILD_SRC= INSTALL_DTBS_PATH="$tmpdir/usr/lib/$packagename" dtbs_install | 89 | $MAKE KBUILD_SRC= INSTALL_DTBS_PATH="$tmpdir/usr/lib/$packagename" dtbs_install |
| 90 | fi | 90 | fi |
| 91 | fi | 91 | fi |
diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian index 663a7f343b42..edcad61fe3cd 100755 --- a/scripts/package/mkdebian +++ b/scripts/package/mkdebian | |||
| @@ -88,6 +88,7 @@ set_debarch() { | |||
| 88 | version=$KERNELRELEASE | 88 | version=$KERNELRELEASE |
| 89 | if [ -n "$KDEB_PKGVERSION" ]; then | 89 | if [ -n "$KDEB_PKGVERSION" ]; then |
| 90 | packageversion=$KDEB_PKGVERSION | 90 | packageversion=$KDEB_PKGVERSION |
| 91 | revision=${packageversion##*-} | ||
| 91 | else | 92 | else |
| 92 | revision=$(cat .version 2>/dev/null||echo 1) | 93 | revision=$(cat .version 2>/dev/null||echo 1) |
| 93 | packageversion=$version-$revision | 94 | packageversion=$version-$revision |
| @@ -205,10 +206,12 @@ cat <<EOF > debian/rules | |||
| 205 | #!$(command -v $MAKE) -f | 206 | #!$(command -v $MAKE) -f |
| 206 | 207 | ||
| 207 | build: | 208 | build: |
| 208 | \$(MAKE) KERNELRELEASE=${version} ARCH=${ARCH} KBUILD_SRC= | 209 | \$(MAKE) KERNELRELEASE=${version} ARCH=${ARCH} \ |
| 210 | KBUILD_BUILD_VERSION=${revision} KBUILD_SRC= | ||
| 209 | 211 | ||
| 210 | binary-arch: | 212 | binary-arch: |
| 211 | \$(MAKE) KERNELRELEASE=${version} ARCH=${ARCH} KBUILD_SRC= intdeb-pkg | 213 | \$(MAKE) KERNELRELEASE=${version} ARCH=${ARCH} \ |
| 214 | KBUILD_BUILD_VERSION=${revision} KBUILD_SRC= intdeb-pkg | ||
| 212 | 215 | ||
| 213 | clean: | 216 | clean: |
| 214 | rm -rf debian/*tmp debian/files | 217 | rm -rf debian/*tmp debian/files |
diff --git a/scripts/package/mkspec b/scripts/package/mkspec index e05646dc24dc..009147d4718e 100755 --- a/scripts/package/mkspec +++ b/scripts/package/mkspec | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | # how we were called determines which rpms we build and how we build them | 12 | # how we were called determines which rpms we build and how we build them |
| 13 | if [ "$1" = prebuilt ]; then | 13 | if [ "$1" = prebuilt ]; then |
| 14 | S=DEL | 14 | S=DEL |
| 15 | MAKE="$MAKE -f $srctree/Makefile" | ||
| 15 | else | 16 | else |
| 16 | S= | 17 | S= |
| 17 | fi | 18 | fi |
| @@ -78,19 +79,19 @@ $S %prep | |||
| 78 | $S %setup -q | 79 | $S %setup -q |
| 79 | $S | 80 | $S |
| 80 | $S %build | 81 | $S %build |
| 81 | $S make %{?_smp_mflags} KBUILD_BUILD_VERSION=%{release} | 82 | $S $MAKE %{?_smp_mflags} KBUILD_BUILD_VERSION=%{release} |
| 82 | $S | 83 | $S |
| 83 | %install | 84 | %install |
| 84 | mkdir -p %{buildroot}/boot | 85 | mkdir -p %{buildroot}/boot |
| 85 | %ifarch ia64 | 86 | %ifarch ia64 |
| 86 | mkdir -p %{buildroot}/boot/efi | 87 | mkdir -p %{buildroot}/boot/efi |
| 87 | cp \$(make image_name) %{buildroot}/boot/efi/vmlinuz-$KERNELRELEASE | 88 | cp \$($MAKE image_name) %{buildroot}/boot/efi/vmlinuz-$KERNELRELEASE |
| 88 | ln -s efi/vmlinuz-$KERNELRELEASE %{buildroot}/boot/ | 89 | ln -s efi/vmlinuz-$KERNELRELEASE %{buildroot}/boot/ |
| 89 | %else | 90 | %else |
| 90 | cp \$(make image_name) %{buildroot}/boot/vmlinuz-$KERNELRELEASE | 91 | cp \$($MAKE image_name) %{buildroot}/boot/vmlinuz-$KERNELRELEASE |
| 91 | %endif | 92 | %endif |
| 92 | $M make %{?_smp_mflags} INSTALL_MOD_PATH=%{buildroot} KBUILD_SRC= modules_install | 93 | $M $MAKE %{?_smp_mflags} INSTALL_MOD_PATH=%{buildroot} modules_install |
| 93 | make %{?_smp_mflags} INSTALL_HDR_PATH=%{buildroot}/usr KBUILD_SRC= headers_install | 94 | $MAKE %{?_smp_mflags} INSTALL_HDR_PATH=%{buildroot}/usr headers_install |
| 94 | cp System.map %{buildroot}/boot/System.map-$KERNELRELEASE | 95 | cp System.map %{buildroot}/boot/System.map-$KERNELRELEASE |
| 95 | cp .config %{buildroot}/boot/config-$KERNELRELEASE | 96 | cp .config %{buildroot}/boot/config-$KERNELRELEASE |
| 96 | bzip2 -9 --keep vmlinux | 97 | bzip2 -9 --keep vmlinux |
diff --git a/scripts/setlocalversion b/scripts/setlocalversion index 79f7dd57d571..71f39410691b 100755 --- a/scripts/setlocalversion +++ b/scripts/setlocalversion | |||
| @@ -74,7 +74,7 @@ scm_version() | |||
| 74 | fi | 74 | fi |
| 75 | 75 | ||
| 76 | # Check for uncommitted changes | 76 | # Check for uncommitted changes |
| 77 | if git status -uno --porcelain | grep -qv '^.. scripts/package'; then | 77 | if git diff-index --name-only HEAD | grep -qv "^scripts/package"; then |
| 78 | printf '%s' -dirty | 78 | printf '%s' -dirty |
| 79 | fi | 79 | fi |
| 80 | 80 | ||
diff --git a/scripts/spdxcheck.py b/scripts/spdxcheck.py index 839e190bbd7a..5056fb3b897d 100755 --- a/scripts/spdxcheck.py +++ b/scripts/spdxcheck.py | |||
| @@ -168,7 +168,6 @@ class id_parser(object): | |||
| 168 | self.curline = 0 | 168 | self.curline = 0 |
| 169 | try: | 169 | try: |
| 170 | for line in fd: | 170 | for line in fd: |
| 171 | line = line.decode(locale.getpreferredencoding(False), errors='ignore') | ||
| 172 | self.curline += 1 | 171 | self.curline += 1 |
| 173 | if self.curline > maxlines: | 172 | if self.curline > maxlines: |
| 174 | break | 173 | break |
diff --git a/scripts/unifdef.c b/scripts/unifdef.c index 7493c0ee51cc..db00e3e30a59 100644 --- a/scripts/unifdef.c +++ b/scripts/unifdef.c | |||
| @@ -395,7 +395,7 @@ usage(void) | |||
| 395 | * When we have processed a group that starts off with a known-false | 395 | * When we have processed a group that starts off with a known-false |
| 396 | * #if/#elif sequence (which has therefore been deleted) followed by a | 396 | * #if/#elif sequence (which has therefore been deleted) followed by a |
| 397 | * #elif that we don't understand and therefore must keep, we edit the | 397 | * #elif that we don't understand and therefore must keep, we edit the |
| 398 | * latter into a #if to keep the nesting correct. We use strncpy() to | 398 | * latter into a #if to keep the nesting correct. We use memcpy() to |
| 399 | * overwrite the 4 byte token "elif" with "if " without a '\0' byte. | 399 | * overwrite the 4 byte token "elif" with "if " without a '\0' byte. |
| 400 | * | 400 | * |
| 401 | * When we find a true #elif in a group, the following block will | 401 | * When we find a true #elif in a group, the following block will |
| @@ -450,7 +450,7 @@ static void Idrop (void) { Fdrop(); ignoreon(); } | |||
| 450 | static void Itrue (void) { Ftrue(); ignoreon(); } | 450 | static void Itrue (void) { Ftrue(); ignoreon(); } |
| 451 | static void Ifalse(void) { Ffalse(); ignoreon(); } | 451 | static void Ifalse(void) { Ffalse(); ignoreon(); } |
| 452 | /* modify this line */ | 452 | /* modify this line */ |
| 453 | static void Mpass (void) { strncpy(keyword, "if ", 4); Pelif(); } | 453 | static void Mpass (void) { memcpy(keyword, "if ", 4); Pelif(); } |
| 454 | static void Mtrue (void) { keywordedit("else"); state(IS_TRUE_MIDDLE); } | 454 | static void Mtrue (void) { keywordedit("else"); state(IS_TRUE_MIDDLE); } |
| 455 | static void Melif (void) { keywordedit("endif"); state(IS_FALSE_TRAILER); } | 455 | static void Melif (void) { keywordedit("endif"); state(IS_FALSE_TRAILER); } |
| 456 | static void Melse (void) { keywordedit("endif"); state(IS_FALSE_ELSE); } | 456 | static void Melse (void) { keywordedit("endif"); state(IS_FALSE_ELSE); } |
