Skip to content

Commit

Permalink
kbuild: buildtar: fix tar error when CONFIG_MODULES is disabled
Browse files Browse the repository at this point in the history
$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 <[email protected]>
  • Loading branch information
masahir0y committed Sep 12, 2017
1 parent cfd6373 commit dd965f1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/package/buildtar
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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}"
Expand Down

0 comments on commit dd965f1

Please sign in to comment.