Cleanup handling of linux packages and modules

- All linux packages generate "linux" and "linux-modules"
 - Preference mechanism is used to select the right source package
 - Rootfs depends on "linux-modules" to install the selected kernels
   modules into the squashfs image
 - The release pacakge depends on "linux" to install the appropriate
   kernel to the boot partition

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
This commit is contained in:
David Oberhollenzer 2019-03-31 15:13:18 +02:00
parent 06a23feb56
commit 882ce4a8f4
15 changed files with 20 additions and 23 deletions

View File

@ -1,4 +1,4 @@
kmod
btrfs-progs
dosfstools
linux-lts
linux-modules

View File

@ -7,6 +7,7 @@ GCC_EXTRACFG="--disable-libmpx --disable-cet"
BINUTILS_EXTRACFG="--disable-cet"
PREFERED_PROVIDER[linux]="linux-lts"
PREFERED_PROVIDER[linux-modules]="linux-lts"
PREFERED_PROVIDER[release]="release-alix"
LINUX_TGT="bzImage modules"

View File

@ -1 +1 @@
linux-lts
linux-modules

View File

@ -7,6 +7,7 @@ GCC_EXTRACFG="--enable-libmpx"
BINUTILS_EXTRACFG=""
PREFERED_PROVIDER[linux]="linux-lts"
PREFERED_PROVIDER[linux-modules]="linux-lts"
PREFERED_PROVIDER[release]="release-qemu"
LINUX_TGT="bzImage"

View File

@ -1,7 +1,7 @@
kmod
btrfs-progs
dosfstools
linux-rpi3
linux-modules
firmware-rpi3
linux-firmware-rpi3
kbd

View File

@ -7,6 +7,7 @@ GCC_EXTRACFG="--with-float=hard --with-fpu=neon-vfpv3"
BINUTILS_EXTRACFG=""
PREFERED_PROVIDER[linux]="linux-rpi3"
PREFERED_PROVIDER[linux-modules]="linux-rpi3"
PREFERED_PROVIDER[release]="release-rpi3"
LINUX_TGT="zImage dtbs modules"

View File

@ -8,6 +8,7 @@ TARBALL="linux-$VERSION.tar.xz"
URL="https://www.kernel.org/pub/linux/kernel/v$MAJOR.x"
SHA256SUM="a326d1154324aee3dd9a25ac44bc4ce7242ded097d4ca2e4c131e6f32918e7d9"
DEPENDS="initrd"
SUBPKG="linux linux-modules"
get_linux_cpu() {
case "$TARGET" in
@ -58,28 +59,28 @@ deploy() {
local target
mkdir -p "$PKGDEPLOYDIR/boot" "$PKGDEPLOYDIR/lib/modules"
touch "$PKGDEPLOYDIR/linux.desc" "$PKGDEPLOYDIR/linux.files"
touch "$PKGDEPLOYDIR/linux-modules.desc"
touch "$PKGDEPLOYDIR/linux-modules.files"
for target in $LINUX_TGT; do
case $target in
*Image)
cp "arch/$LINUX_CPU/boot/$target" "$PKGDEPLOYDIR/boot/vmlinuz"
echo "dir boot 0755 0 0" >> "$PKGDEPLOYDIR/$PKGNAME.files"
echo "file boot/vmlinuz 0755 0 0" >> "$PKGDEPLOYDIR/$PKGNAME.files"
cp "arch/$LINUX_CPU/boot/$target" "$PKGDEPLOYDIR/vmlinuz"
echo "file vmlinuz 0755 0 0" > "$PKGDEPLOYDIR/linux.files"
;;
modules)
export KBUILD_OUTPUT="$PKGBUILDDIR"
make -C "$SOURCE" O="$PKGBUILDDIR" ARCH="$LINUX_CPU" CROSS_COMPILE="${TARGET}-" INSTALL_MOD_PATH="$PKGDEPLOYDIR" modules_install
echo "dir lib 0755 0 0" >> "$PKGDEPLOYDIR/$PKGNAME.files"
echo "dir lib/modules 0755 0 0" >> "$PKGDEPLOYDIR/$PKGNAME.files"
echo "dir lib 0755 0 0" > "$PKGDEPLOYDIR/linux-modules.files"
pkg_scan_dir "$PKGDEPLOYDIR/lib" |\
sed "s#$PKGDEPLOYDIR/##g" >> "$PKGDEPLOYDIR/$PKGNAME.files"
pkg_scan_dir "$PKGDEPLOYDIR/lib" | \
sed "s#$PKGDEPLOYDIR/##g" \
>> "$PKGDEPLOYDIR/linux-modules.files"
;;
esac
done
cp $SCRIPTDIR/pkg/$PKGNAME/*.desc "$PKGDEPLOYDIR"
}
check_update() {

View File

@ -7,6 +7,7 @@ TARBALL="raspberrypi-kernel_${VERSION}.tar.gz"
URL="https://github.com/raspberrypi/linux/archive"
SHA256SUM="57ec23478db884eafe8fefd0bc1dbf557e93eda36fda1fe6a1db26e4b3f6fd12"
DEPENDS="initrd"
SUBPKG="linux linux-modules"
check_update() {
local version=$(echo $VERSION | sed 's/-/./g')

View File

@ -1,4 +1,4 @@
DEPENDS="rootfs"
DEPENDS="rootfs linux"
SUBPKG="release"
build() {

View File

@ -1,4 +1,4 @@
DEPENDS="rootfs"
DEPENDS="rootfs linux"
SUBPKG="release"
build() {

View File

@ -1,4 +1,4 @@
DEPENDS="rootfs boot-rpi3"
DEPENDS="rootfs boot-rpi3 linux"
SUBPKG="release"
build() {

View File

@ -27,13 +27,6 @@ _EOF
sed -i 's#etc/#cfg/preserve/etc/#g' "$PKGDEPLOYDIR/pseudo"
sed -i 's#var/lib/#cfg/preserve/var_lib/#g' "$PKGDEPLOYDIR/pseudo"
sed -i 's#usr/#cfg/preserve/usr/#g' "$PKGDEPLOYDIR/pseudo"
# don't add stuff for the boot partition to the squashfs image
mv $TCDIR/$TARGET/boot/* "$PKGDEPLOYDIR"
grep -v "^boot/" "$PKGDEPLOYDIR/pseudo" > "$PKGDEPLOYDIR/pseudo.temp"
mv "$PKGDEPLOYDIR/pseudo.temp" "$PKGDEPLOYDIR/pseudo"
echo "boot m 750 0 0" >> "$PKGDEPLOYDIR/pseudo"
}
deploy() {

View File

@ -1,2 +1 @@
file rootfs.img 0755 0 0
file vmlinuz 0755 0 0