linux: (re)store the .config too for autoremove & unpack

Instead of attempting to recreate the .config of the initial build (and
failing at it), just (re)store it along with Module.symvers.

This fixes inconsistencies like CONFIG_EXTRA_FIRMWARE not getting set on
an autoremove+unpack cycle and prepares for #4201.
This commit is contained in:
Andre Heider 2020-02-11 18:21:36 +01:00
parent 361c9366e2
commit ac1cf14c49

View File

@ -66,6 +66,14 @@ for pkg in $(get_pkg_variable initramfs PKG_DEPENDS_TARGET); do
done done
post_patch() { post_patch() {
# linux was already built and its build dir autoremoved - prepare it again for kernel packages
if [ -d $PKG_INSTALL/.image ]; then
cp -p $PKG_INSTALL/.image/.config $PKG_BUILD
kernel_make -C $PKG_BUILD prepare
# restore the required Module.symvers from an earlier build
cp -p $PKG_INSTALL/.image/Module.symvers $PKG_BUILD
else
cp $PKG_KERNEL_CFG_FILE $PKG_BUILD/.config cp $PKG_KERNEL_CFG_FILE $PKG_BUILD/.config
sed -i -e "s|@INITRAMFS_SOURCE@|$BUILD/image/initramfs.cpio|" $PKG_BUILD/.config sed -i -e "s|@INITRAMFS_SOURCE@|$BUILD/image/initramfs.cpio|" $PKG_BUILD/.config
@ -102,14 +110,6 @@ post_patch() {
sed -e "s|^CONFIG_DRM_LIMA=.*$|# CONFIG_DRM_LIMA is not set|" -i $PKG_BUILD/.config sed -e "s|^CONFIG_DRM_LIMA=.*$|# CONFIG_DRM_LIMA is not set|" -i $PKG_BUILD/.config
sed -e "s|^CONFIG_DRM_PANFROST=.*$|# CONFIG_DRM_PANFROST is not set|" -i $PKG_BUILD/.config sed -e "s|^CONFIG_DRM_PANFROST=.*$|# CONFIG_DRM_PANFROST is not set|" -i $PKG_BUILD/.config
fi fi
# prepare the tree for kernel packages if the build dir has been removed and linux get unpacked again
if [ -d $PKG_INSTALL/.image ]; then
kernel_make -C $PKG_BUILD oldconfig
kernel_make -C $PKG_BUILD prepare
# restore the required Module.symvers from an earlier build
cp -p $PKG_INSTALL/.image/Module.symvers $PKG_BUILD
fi fi
} }
@ -238,7 +238,7 @@ make_target() {
makeinstall_target() { makeinstall_target() {
mkdir -p $INSTALL/.image mkdir -p $INSTALL/.image
cp -p arch/${TARGET_KERNEL_ARCH}/boot/${KERNEL_TARGET} System.map Module.symvers $INSTALL/.image/ cp -p arch/${TARGET_KERNEL_ARCH}/boot/${KERNEL_TARGET} System.map .config Module.symvers $INSTALL/.image/
kernel_make INSTALL_MOD_PATH=$INSTALL/$(get_kernel_overlay_dir) modules_install kernel_make INSTALL_MOD_PATH=$INSTALL/$(get_kernel_overlay_dir) modules_install
rm -f $INSTALL/$(get_kernel_overlay_dir)/lib/modules/*/build rm -f $INSTALL/$(get_kernel_overlay_dir)/lib/modules/*/build