Skip to content

Commit

Permalink
Rework compile (#3124)
Browse files Browse the repository at this point in the history
* DEBUG code

* make M=scripts clean before creating the package

Move the cleanup of the scripts target from the postinst script
to the logically correct place so that the cleanup occurs with
the same arguments of the make command and the same compiler.

Signed-off-by: The-going <[email protected]>

* clear all files in target directory

* Debugging for version 5.10.10 and higher

* Return to version 5.12

Since version 5.12, there are no collisions
with deleting the scripts/module.lds file.

This pathology begins with 5.10 and ends on 5.11 inclusive,
and this is due to internal migration in the core.

* Change the order of creating packages

The linux-headers package must be built in the last queue

Signed-off-by: The-going <[email protected]>

* Revert "DEBUG code"

This reverts commit 6bd8dca.
  • Loading branch information
The-going authored Sep 6, 2021
1 parent 208f378 commit 593104a
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions packages/armbian/builddeb
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,12 @@ EOT
if [ "$3" = "headers" ]; then

# Set the time for all files to the current time.
# Clean up the executables that are left over from
# cross-compilation for a different host architecture.
# And build them for the current architecture.
cat >> $pdir/DEBIAN/postinst << EOT
cd /usr/src/linux-headers-$version
echo "Compiling headers - please wait ..."
NCPU=\$(grep -c 'processor' /proc/cpuinfo)
find -type f -exec touch {} +
make -j\$NCPU M=scripts clean >/dev/null
yes "" | make oldconfig >/dev/null
make -j\$NCPU -s scripts >/dev/null
make -j\$NCPU -s M=scripts/mod/ >/dev/null
Expand All @@ -88,10 +85,10 @@ EOT

# After the configuration and compilation processes, new files
# appear that the package manager does not know anything about.
# Just clear the entire target directory.
# Just clear all the files in the target directory.
cat >> $pdir/DEBIAN/prerm << EOT
cd /usr/src/linux-headers-$version
rm -rf ./*
find ./ -type f -exec rm {} +
exit 0
EOT

Expand Down Expand Up @@ -330,20 +327,24 @@ mountpoint -q /boot && check_and_unmount
exit 0
EOT

create_package "$packagename" "$tmpdir"

if [ "$ARCH" != "um" ]; then
create_package "$dtb_packagename" "$dtb_dir" "dtb"

deploy_libc_headers $libc_headers_dir
create_package $libc_headers_packagename $libc_headers_dir

if is_enabled CONFIG_MODULES; then
# Clean up the executables that are left over from
# cross-compilation for a different host architecture.
(cd $srctree; make M=scripts clean;)
deploy_kernel_headers $kernel_headers_dir
create_package $kernel_headers_packagename $kernel_headers_dir "headers"
fi

create_package "$dtb_packagename" "$dtb_dir" "dtb"
fi

create_package "$packagename" "$tmpdir"

if [ -n "$BUILD_DEBUG" ] ; then
# Build debug package
# Different tools want the image in different locations
Expand Down

0 comments on commit 593104a

Please sign in to comment.