device-clockworkpi-uconsole-radxa-cm5: refactor to remove akms module
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7918>
This commit is contained in:
parent
e193c5d1ed
commit
e6de1d0cc2
5 changed files with 38 additions and 109 deletions
|
|
@ -1,92 +1,39 @@
|
|||
# Archived: linux-radxa-dev packages x86_64 binaries in aarch64 package which makes akms part of this device fail when built on aarch64
|
||||
# Reference: <https://postmarketos.org/devicepkg>
|
||||
maintainer="Antoine Martin (ayakael) <dev@ayakael.net>"
|
||||
pkgname=device-clockworkpi-uconsole-radxa-cm5
|
||||
pkgdesc="Clockwork Tech ClockworkPi uConsole Radxa CM5"
|
||||
pkgver=6
|
||||
pkgver=7
|
||||
_commit=2e8040ec92f85e3d43caf3e44557cb0659db4531
|
||||
_dtso_commit=c2204834e1d7d0acfd64e1b7874d432bc142f1a4
|
||||
pkgrel=0
|
||||
url="https://postmarketos.org"
|
||||
license="MIT"
|
||||
arch="aarch64"
|
||||
options="!archcheck"
|
||||
options="!check !archcheck"
|
||||
install="$pkgname-openrc.post-install $pkgname-openrc.post-upgrade"
|
||||
depends="
|
||||
linux-radxa
|
||||
linux-clockworkpi-uconsole-radxa-cm5
|
||||
postmarketos-base
|
||||
u-boot-radxa-cm5
|
||||
u-boot-clockworkpi-uconsole-radxa-cm5
|
||||
"
|
||||
makedepends="
|
||||
devicepkg-dev
|
||||
clang
|
||||
dtc
|
||||
linux-radxa
|
||||
linux-radxa-dev
|
||||
"
|
||||
subpackages="
|
||||
$pkgname-openrc
|
||||
$pkgname-x11
|
||||
$pkgname-akms
|
||||
"
|
||||
source="
|
||||
clockworkradxa-linux-$_commit.tar.gz::https://github.com/ak-rex/ClockworkRadxa-linux/archive/$_commit.tar.gz
|
||||
radxa-cm5-uconsole-$_dtso_commit.tar.gz::https://github.com/dev-null2019/radxa-cm5-uconsole/archive/$_dtso_commit.tar.gz
|
||||
|
||||
deviceinfo
|
||||
kernel-cmdline.conf
|
||||
modules-initfs
|
||||
modules-load.conf
|
||||
modprobe.conf
|
||||
partition-table.txt
|
||||
xorg.conf
|
||||
|
||||
driver-makefile.in
|
||||
driver-akmbuild.in
|
||||
"
|
||||
builddir="$srcdir"/ClockworkRadxa-linux-$_commit
|
||||
|
||||
# Location of out-of-tree drivers to be built using AKMS
|
||||
_drivers="
|
||||
drivers/pinctrl/pinctrl-axp209.c
|
||||
drivers/power/supply/axp20x_usb_power.c
|
||||
drivers/iio/adc/axp20x_adc.c
|
||||
drivers/iio/adc/ti-adc081c.c
|
||||
drivers/mfd/axp20x-i2c.c
|
||||
drivers/mfd/axp20x.c
|
||||
drivers/regulator/axp20x-regulator.c
|
||||
drivers/input/misc/axp20x-pek.c
|
||||
drivers/power/supply/axp20x_ac_power.c
|
||||
drivers/power/supply/axp20x_battery.c
|
||||
drivers/video/backlight/ocp8178_bl.c
|
||||
drivers/gpu/drm/panel/panel-cwu50.c
|
||||
"
|
||||
|
||||
build() {
|
||||
devicepkg_build $startdir $pkgname
|
||||
|
||||
local _modules=
|
||||
local _objects=
|
||||
local _file=
|
||||
|
||||
# setup akms folder
|
||||
# this also generates information to complete AKMBUILD and Makefile
|
||||
mkdir -p "$builddir"/akms
|
||||
for driver in $_drivers; do
|
||||
_file=${driver##*\/}
|
||||
cp "$builddir"/$driver "$builddir"/akms/$_file
|
||||
_modules="$_modules ${_file/.c/.ko}"
|
||||
_objects="$_objects ${_file/.c/.o}"
|
||||
done
|
||||
sed -e "s/%%MODVER%%/$pkgver/" -e "s/%%DRIVER_MOD%%/$_modules/" "$srcdir"/driver-akmbuild.in > "$builddir"/akms/AKMBUILD
|
||||
sed "s/%%DRIVER_OBJ%%/$_objects/" "$srcdir"/driver-makefile.in > "$builddir"/akms/Makefile
|
||||
|
||||
# generate dtbo for uconsole
|
||||
_kernel_ver=$(find /lib/modules -maxdepth 1 -mindepth 1 | sed 's|.*/||g')
|
||||
cp -r "$srcdir"/radxa-cm5-uconsole-$_dtso_commit/devicetree_overlays "$builddir"/dtso
|
||||
echo ">>> Generating dtbo against $_kernel_ver"
|
||||
for dts in "$builddir"/dtso/*.dts; do
|
||||
cpp -nostdinc -I "/usr/src/linux-headers-$_kernel_ver/include" -I arch -undef -x assembler-with-cpp $dts $dts.preprocessed
|
||||
dtc -O dtb -o ${dts/.dts/.dtbo} $dts.preprocessed
|
||||
done
|
||||
}
|
||||
|
||||
x11() {
|
||||
|
|
@ -97,51 +44,20 @@ x11() {
|
|||
|
||||
package() {
|
||||
devicepkg_package $startdir $pkgname
|
||||
|
||||
# merge dtbos with soc dtb for uconsole
|
||||
mkdir -p "$pkgdir"/boot/dtbs/rockchip
|
||||
fdtoverlay -i /boot/dtbs/rockchip/rk3588s-radxa-cm5-rpi-cm4-io.dtb "$builddir"/dtso/*.dtbo -o "$pkgdir"/boot/dtbs/rockchip/rk3588s-radxa-cm5-uconsole.dtb
|
||||
}
|
||||
|
||||
# Test build of drivers against kernel
|
||||
check() {
|
||||
_kernel_ver=$(find /lib/modules -maxdepth 1 -mindepth 1 | sed 's|.*/||g')
|
||||
for ver in $_kernel_ver; do
|
||||
echo ">>> Testing module build against $ver"
|
||||
cp -R "$builddir"/akms "$builddir"/akms-$ver
|
||||
(
|
||||
cd "$builddir"/akms-$ver
|
||||
make KVER=$ver
|
||||
)
|
||||
done
|
||||
}
|
||||
|
||||
akms() {
|
||||
pkgdesc="uConsole kernel module (AKMS)"
|
||||
depends="akms linux-radxa-dev build-base"
|
||||
install_if="$pkgname=$pkgver-r$pkgrel"
|
||||
|
||||
mkdir -p "$subpkgdir"/usr/src
|
||||
cp -R "$builddir"/akms "$subpkgdir"/usr/src/clockworkpi-radxa
|
||||
chmod -R u=rwX,go=rX-w "$subpkgdir"/usr/src/clockworkpi-radxa
|
||||
}
|
||||
|
||||
openrc() {
|
||||
depends=openrc
|
||||
install_if="$pkgname=$pkgver-r$pkgrel openrc"
|
||||
install="$subpkgname.post-install $subpkgname.post-upgrade"
|
||||
mkdir -p "$subpkgdir"
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
a9c48c3470d5641113e351456d6cfa1e2283e6577cf54eea9a2d49ba4f6269e46cba16039584b34e07c7d8006f6dec112e970148f155f2c3ff0670521568a5a7 clockworkradxa-linux-2e8040ec92f85e3d43caf3e44557cb0659db4531.tar.gz
|
||||
a15eb74d9db9114022e96ba04542d18350cf6d637c5efa49f4a5a65c33c5fd20a7997095a049a561fb7aac767a299f367489c5a342138a5259cc32ebb6152384 radxa-cm5-uconsole-c2204834e1d7d0acfd64e1b7874d432bc142f1a4.tar.gz
|
||||
0afdcebb4b42ab9d489bfeb32912f03de0ee30875eba760112b24def4bb04185eca5f827c737da4824081940ec998c2c26a99e9105267e90e9d852b0afa76539 deviceinfo
|
||||
1c39895682e8c28ad80a7fe7d62e23fc34510502efd09c85117812e882c6fe4094191852346162550fcbcfb10d4a5b07db85f5671d016ff62bbe16f90cfb85c2 deviceinfo
|
||||
fa6332b91b62572528b1f919370382d67f521b0a65c3c9f416df67545ebae7b01f31729340a42e656b5589cdbde676ec8fe0eb9537a34e02ec20f5309bf43b12 kernel-cmdline.conf
|
||||
85d573bfd51ac4aa502336452b0384af77b6ec095f5c4760e8f287b8452b3ccb4521051bc01c53fa0856440d52231f535f3f0258d62ad578161ad464344413e9 modules-initfs
|
||||
642cdb1b4ac02b8c3ab7b72f4eeef615ac4911b42bcd845b54305f0ff64c07b86f4a807a97d395cb6c0cd0a5f5eed15e68d9e4ccb69db8e38fb65c8be4acaeeb modules-load.conf
|
||||
a5324ed5118168b846d359dc2c8e76ccdc624003d157a28e4c9728ddedd9b52c6deb95af9c3a9d94faf52413f2f830dc45ec6c0093458d27149ef17de5dceef5 modprobe.conf
|
||||
da2656ecb5f1a88c3b85a973adae0a11e48d4cb32ea7465076827a883e0f74fde4500c03edd4de66a6bf0af2da196f2210a02a1297f360d77bd70af4c21ae5dd partition-table.txt
|
||||
939cb4ca50e0f54258dd92bdfbf91e6fa7b33b386022d058ba0d4b4e4f6d855cba9f5fffda0652f18c8b9b95d5dbbfc766e0931f0de53841f96d9d8975bf27e7 xorg.conf
|
||||
51a1fc5ba9336e784fe8dfb97eed8d3f51fd181a9a76c5266e227e1670aa423fdaec04b869795a2abd5afca6d472a1f107f30a0f0efd242ee16c8910773ddcc2 driver-makefile.in
|
||||
576346f3e5611dcba4fd3a5f5bf97e51febb844ff8006b5e4e8aba429df0c1835f702548d61120439cf0279b56d337f4ab9e2389ae8fa0c024b0a3afd4422b2f driver-akmbuild.in
|
||||
"
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ deviceinfo_name="Clockwork Tech ClockworkPi uConsole Radxa CM5"
|
|||
deviceinfo_manufacturer="Clockwork Tech"
|
||||
deviceinfo_codename="clockworkpi-uconsole-radxa-cm5"
|
||||
deviceinfo_year="2023"
|
||||
deviceinfo_dtb="rockchip/rk3588s-radxa-cm5-uconsole"
|
||||
deviceinfo_arch="aarch64"
|
||||
deviceinfo_disable_dhcpd="true"
|
||||
|
||||
|
|
@ -17,10 +18,34 @@ deviceinfo_screen_width="1280"
|
|||
deviceinfo_screen_height="720"
|
||||
deviceinfo_getty="ttyFIQ0;1500000"
|
||||
|
||||
# Bootloader related
|
||||
deviceinfo_boot_filesystem="fat32"
|
||||
deviceinfo_dtb="rockchip/rk3588s-radxa-cm5-uconsole"
|
||||
deviceinfo_sd_embed_firmware="u-boot/radxa-cm5/rpi-cm4-io/idbloader.img:64,u-boot/radxa-cm5/rpi-cm4-io/u-boot.itb:16384"
|
||||
# initfs
|
||||
|
||||
# Flash related
|
||||
deviceinfo_flash_method="rkdeveloptool"
|
||||
deviceinfo_flash_rk_partition_kernel="boot"
|
||||
deviceinfo_flash_rk_partition_rootfs="os1"
|
||||
|
||||
# sd embed
|
||||
deviceinfo_sd_embed_firmware="u-boot/clockworkpi-uconsole-radxa-cm5/idbloader.img:64,u-boot/clockworkpi-uconsole-radxa-cm5/u-boot.itb:16384"
|
||||
deviceinfo_sd_embed_firmware_step_size="512"
|
||||
deviceinfo_boot_part_start="32768"
|
||||
|
||||
# Partition table
|
||||
# pmbootstrap does not support flashing a partition table using rkdeveloptool, manual steps:
|
||||
# enable `write-partition-table` commands
|
||||
# > rkdeveloptool boot $chroot/usr/share/u-boot/clockworkpi-uconsole-radxa/rk3588_spl_loader_v1.19.113.bin
|
||||
# >
|
||||
# write new GPT partition table
|
||||
# > rkdeveloptool write-partition-table partition-table.txt
|
||||
# >
|
||||
# deviceinfo_flash_rk_partition_table="partition-table.txt"
|
||||
|
||||
# Bootloader
|
||||
# pmbootstrap does not support flashing u-boot using rkdeveloptool, manual steps:
|
||||
# > rkdeveloptool write-partition idbloader $chroot/usr/share/u-boot/clockworkpi-uconsole-radxa-cm5/idbloader.img
|
||||
# > rkdeveloptool write-partition uboot $chroot/usr/share/u-boot/clockworkpi-uconsole-radxa-cm5/uboot.img
|
||||
# >
|
||||
|
||||
deviceinfo_boot_filesystem="fat32"
|
||||
deviceinfo_generate_extlinux_config="true"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
modname=clockworkpi-radxa
|
||||
modver=%%MODVER%%
|
||||
built_modules='%%DRIVER_MOD%%'
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
obj-m += %%DRIVER_OBJ%%
|
||||
USER := $(shell whoami)
|
||||
KVER ?= $(shell uname -r)
|
||||
KDIR ?= /lib/modules/$(KVER)/build
|
||||
|
||||
all:
|
||||
make -C $(KDIR) M=$(PWD) modules
|
||||
|
||||
clean:
|
||||
make -C $(KDIR) M=$(PWD) clean
|
||||
|
|
@ -0,0 +1 @@
|
|||
mtdparts=rk3588mmc:0x3FC0@0x40(idbloader),0x20000@0x4000(uboot),0x85800@0x8000(boot:bootable),-@0x8d800(os1:grow)
|
||||
Loading…
Add table
Add a link
Reference in a new issue