Skip to content

Commit dd965f1

Browse files
committed
kbuild: buildtar: fix tar error when CONFIG_MODULES is disabled
$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>
1 parent cfd6373 commit dd965f1

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎scripts/package/buildtar‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,14 @@ esac
5151
#
5252
rm -rf -- "${tmpdir}"
5353
mkdir -p -- "${tmpdir}/boot"
54-
54+
dirs=boot
5555

5656
#
5757
# Try to install modules
5858
#
5959
if grep -q '^CONFIG_MODULES=y' "${KCONFIG_CONFIG}"; then
6060
make ARCH="${ARCH}" O="${objtree}" KBUILD_SRC= INSTALL_MOD_PATH="${tmpdir}" modules_install
61+
dirs="$dirs lib"
6162
fi
6263

6364

@@ -129,7 +130,7 @@ esac
129130
if tar --owner=root --group=root --help >/dev/null 2>&1; then
130131
opts="--owner=root --group=root"
131132
fi
132-
tar cf - -C "$tmpdir" boot/ lib/ $opts | ${compress} > "${tarball}${file_ext}"
133+
tar cf - -C "$tmpdir" $dirs $opts | ${compress} > "${tarball}${file_ext}"
133134
)
134135

135136
echo "Tarball successfully created in ${tarball}${file_ext}"

0 commit comments

Comments
 (0)