kbuild: buildtar: fix tar error when CONFIG_MODULES is disabled
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Sat, 2 Sep 2017 08:05:34 +0000 (17:05 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Tue, 12 Sep 2017 15:20:31 +0000 (00:20 +0900)
$tmpdir/lib is created by "make modules_install".  It does not exist
if CONFIG_MODULES is disabled, then tar reports the following messages:

tar: lib: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
scripts/package/buildtar

index 483ba00524d5bcade560a55b614205a2b6012606..60dd836a02147af69998c277479e9a23fb52f71a 100755 (executable)
@@ -51,13 +51,14 @@ esac
 #
 rm -rf -- "${tmpdir}"
 mkdir -p -- "${tmpdir}/boot"
-
+dirs=boot
 
 #
 # Try to install modules
 #
 if grep -q '^CONFIG_MODULES=y' "${KCONFIG_CONFIG}"; then
        make ARCH="${ARCH}" O="${objtree}" KBUILD_SRC= INSTALL_MOD_PATH="${tmpdir}" modules_install
+       dirs="$dirs lib"
 fi
 
 
@@ -129,7 +130,7 @@ esac
        if tar --owner=root --group=root --help >/dev/null 2>&1; then
                opts="--owner=root --group=root"
        fi
-       tar cf - -C "$tmpdir" boot/ lib/ $opts | ${compress} > "${tarball}${file_ext}"
+       tar cf - -C "$tmpdir" $dirs $opts | ${compress} > "${tarball}${file_ext}"
 )
 
 echo "Tarball successfully created in ${tarball}${file_ext}"