linux-purism-librem5: Modernize packaging

refs #1814, #4594

Related to !8124, !8578

Port changes from !8578 authored by Aster Boese to currently developed MR for the librem5.

Co-authored-by: Aster Boese asterboese@mailbox.org
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8751>
This commit is contained in:
Daniel Kulesz 2026-06-14 11:45:51 +02:00 committed by The Friendly Meow (merge) Bot
parent eafc62dd74
commit 7116a079b8
No known key found for this signature in database
2 changed files with 94 additions and 14 deletions

View file

@ -20,26 +20,21 @@ options="!strip !check !tracedeps
pmb:kconfigcheck-librem5
"
makedepends="
bash
bison
clang
devicepkg-dev
findutils
flex
installkernel
linux-headers
lld
llvm
openssl-dev
perl
rsync
xz
postmarketos-installkernel
python3
zstd
"
install="$pkgname.post-upgrade"
# Source
_repository="linux"
# kconfig generated with: ARCH=arm64 make defconfig KBUILD_DEFCONFIG=librem5_defconfig
_config="config-$_flavor.$arch"
@ -47,13 +42,13 @@ _config="config-$_flavor.$arch"
source="
$pkgname-$_purismver.tar.gz::https://source.puri.sm/Librem5/linux/-/archive/pureos/$_purismver/linux-pureos-$_purismver.tar.gz
$_config
treewide-remove-unnecessary-linux-version.h-inclusion.patch
"
builddir="$srcdir/$_repository-pureos-$_purismver"
builddir="$srcdir/linux-pureos-$_purismver"
prepare() {
default_prepare
REPLACE_GCCH=0 \
. downstreamkernel_prepare
cp "$srcdir/config-$_flavor.$arch" .config
####### Rebase config
# The kernel config needs to be periodically rebased to enable new
@ -79,22 +74,30 @@ prepare() {
build() {
unset LDFLAGS
make ARCH="$_carch" LLVM=1 \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS" \
LOCALVERSION=".$_purismrel"
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-$_flavor"
}
package() {
downstreamkernel_package "$builddir" "$pkgdir" "$_carch" "$_flavor"
make modules_install dtbs_install \
make dtbs_install install modules_install \
ARCH="$_carch" \
LLVM=1 \
INSTALL_PATH="$pkgdir"/boot \
INSTALL_MOD_PATH="$pkgdir"/usr \
INSTALL_DTBS_PATH="$pkgdir/boot/dtbs"
INSTALL_MOD_STRIP=1 \
INSTALL_DTBS_PATH="$pkgdir"/boot/dtbs
rm -f "$pkgdir"/usr/lib/modules/*/build "$pkgdir"/usr/lib/modules/*/source
install -D "$builddir"/include/config/kernel.release \
"$pkgdir"/usr/share/kernel/"$_flavor"/kernel.release
}
sha512sums="
d51709ee85ac8ebe271fc57ba60e2ab5f90225bd045b813a281553b0f76ae4c227317201fbb509e59af9813ea3e49947e83ac7d82b97cede15212cadd90fc372 linux-purism-librem5-6.6.139pureos1.tar.gz
92837e9d725d2f6e6aebfc10e79007dc671cbc57ddb10c9af91b0b666131275f0897e355c77705f2b57c4c87472f4f8264d32060765582878fde04891c49f997 config-purism-librem5.aarch64
76c1e07b5479fe7be0d1e4a74a8f4a2cd8fc25fbeb3a4efcaf8300e27817a320c0c1340ea6c00ad1c3dd86cc2cb192280de8a91360bad80665115701ba11632d treewide-remove-unnecessary-linux-version.h-inclusion.patch
"

View file

@ -0,0 +1,77 @@
From e332a5aba83500e8d422c90d2a84d8a5f888673e Mon Sep 17 00:00:00 2001
From: Masahiro Yamada <masahiroy@kernel.org>
Date: Thu, 8 Aug 2024 02:47:28 +0900
Subject: [PATCH] treewide: remove unnecessary <linux/version.h> inclusion
These files do not use any macros defined in <linux/version.h>.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
---
drivers/accessibility/speakup/genmap.c | 1 -
drivers/accessibility/speakup/makemapdata.c | 1 -
drivers/staging/media/atomisp/include/linux/atomisp.h | 1 -
samples/trace_events/trace_custom_sched.c | 1 -
sound/soc/codecs/cs42l42.c | 1 -
5 files changed, 5 deletions(-)
diff --git a/drivers/accessibility/speakup/genmap.c b/drivers/accessibility/speakup/genmap.c
index 0125000e00d9ab..0882bab10fb87a 100644
--- a/drivers/accessibility/speakup/genmap.c
+++ b/drivers/accessibility/speakup/genmap.c
@@ -10,7 +10,6 @@
#include <stdio.h>
#include <libgen.h>
#include <string.h>
-#include <linux/version.h>
#include <ctype.h>
#include "utils.h"
diff --git a/drivers/accessibility/speakup/makemapdata.c b/drivers/accessibility/speakup/makemapdata.c
index d7d41bb9b05fbb..55e4ef8a93dc99 100644
--- a/drivers/accessibility/speakup/makemapdata.c
+++ b/drivers/accessibility/speakup/makemapdata.c
@@ -10,7 +10,6 @@
#include <stdio.h>
#include <libgen.h>
#include <string.h>
-#include <linux/version.h>
#include <ctype.h>
#include "utils.h"
diff --git a/drivers/staging/media/atomisp/include/linux/atomisp.h b/drivers/staging/media/atomisp/include/linux/atomisp.h
index 16c9da172c0317..fefbe3cd08f33d 100644
--- a/drivers/staging/media/atomisp/include/linux/atomisp.h
+++ b/drivers/staging/media/atomisp/include/linux/atomisp.h
@@ -20,7 +20,6 @@
#define _ATOM_ISP_H
#include <linux/types.h>
-#include <linux/version.h>
/* struct media_device_info.hw_revision */
#define ATOMISP_HW_REVISION_MASK 0x0000ff00
diff --git a/samples/trace_events/trace_custom_sched.c b/samples/trace_events/trace_custom_sched.c
index b99d9ab7db858f..dd409b704b35b6 100644
--- a/samples/trace_events/trace_custom_sched.c
+++ b/samples/trace_events/trace_custom_sched.c
@@ -8,7 +8,6 @@
#define pr_fmt(fmt) fmt
#include <linux/trace_events.h>
-#include <linux/version.h>
#include <linux/module.h>
#include <linux/sched.h>
diff --git a/sound/soc/codecs/cs42l42.c b/sound/soc/codecs/cs42l42.c
index 60d366e53526ff..6400ac875e6f6c 100644
--- a/sound/soc/codecs/cs42l42.c
+++ b/sound/soc/codecs/cs42l42.c
@@ -11,7 +11,6 @@
#include <linux/module.h>
#include <linux/moduleparam.h>
-#include <linux/version.h>
#include <linux/types.h>
#include <linux/init.h>
#include <linux/delay.h>