mirror of
https://github.com/pygos/build.git
synced 2024-11-24 20:10:42 +01:00
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:
parent
06a23feb56
commit
882ce4a8f4
15 changed files with 20 additions and 23 deletions
|
@ -1,4 +1,4 @@
|
||||||
kmod
|
kmod
|
||||||
btrfs-progs
|
btrfs-progs
|
||||||
dosfstools
|
dosfstools
|
||||||
linux-lts
|
linux-modules
|
||||||
|
|
|
@ -7,6 +7,7 @@ GCC_EXTRACFG="--disable-libmpx --disable-cet"
|
||||||
BINUTILS_EXTRACFG="--disable-cet"
|
BINUTILS_EXTRACFG="--disable-cet"
|
||||||
|
|
||||||
PREFERED_PROVIDER[linux]="linux-lts"
|
PREFERED_PROVIDER[linux]="linux-lts"
|
||||||
|
PREFERED_PROVIDER[linux-modules]="linux-lts"
|
||||||
PREFERED_PROVIDER[release]="release-alix"
|
PREFERED_PROVIDER[release]="release-alix"
|
||||||
|
|
||||||
LINUX_TGT="bzImage modules"
|
LINUX_TGT="bzImage modules"
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
linux-lts
|
linux-modules
|
||||||
|
|
|
@ -7,6 +7,7 @@ GCC_EXTRACFG="--enable-libmpx"
|
||||||
BINUTILS_EXTRACFG=""
|
BINUTILS_EXTRACFG=""
|
||||||
|
|
||||||
PREFERED_PROVIDER[linux]="linux-lts"
|
PREFERED_PROVIDER[linux]="linux-lts"
|
||||||
|
PREFERED_PROVIDER[linux-modules]="linux-lts"
|
||||||
PREFERED_PROVIDER[release]="release-qemu"
|
PREFERED_PROVIDER[release]="release-qemu"
|
||||||
|
|
||||||
LINUX_TGT="bzImage"
|
LINUX_TGT="bzImage"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
kmod
|
kmod
|
||||||
btrfs-progs
|
btrfs-progs
|
||||||
dosfstools
|
dosfstools
|
||||||
linux-rpi3
|
linux-modules
|
||||||
firmware-rpi3
|
firmware-rpi3
|
||||||
linux-firmware-rpi3
|
linux-firmware-rpi3
|
||||||
kbd
|
kbd
|
||||||
|
|
|
@ -7,6 +7,7 @@ GCC_EXTRACFG="--with-float=hard --with-fpu=neon-vfpv3"
|
||||||
BINUTILS_EXTRACFG=""
|
BINUTILS_EXTRACFG=""
|
||||||
|
|
||||||
PREFERED_PROVIDER[linux]="linux-rpi3"
|
PREFERED_PROVIDER[linux]="linux-rpi3"
|
||||||
|
PREFERED_PROVIDER[linux-modules]="linux-rpi3"
|
||||||
PREFERED_PROVIDER[release]="release-rpi3"
|
PREFERED_PROVIDER[release]="release-rpi3"
|
||||||
|
|
||||||
LINUX_TGT="zImage dtbs modules"
|
LINUX_TGT="zImage dtbs modules"
|
||||||
|
|
|
@ -8,6 +8,7 @@ TARBALL="linux-$VERSION.tar.xz"
|
||||||
URL="https://www.kernel.org/pub/linux/kernel/v$MAJOR.x"
|
URL="https://www.kernel.org/pub/linux/kernel/v$MAJOR.x"
|
||||||
SHA256SUM="a326d1154324aee3dd9a25ac44bc4ce7242ded097d4ca2e4c131e6f32918e7d9"
|
SHA256SUM="a326d1154324aee3dd9a25ac44bc4ce7242ded097d4ca2e4c131e6f32918e7d9"
|
||||||
DEPENDS="initrd"
|
DEPENDS="initrd"
|
||||||
|
SUBPKG="linux linux-modules"
|
||||||
|
|
||||||
get_linux_cpu() {
|
get_linux_cpu() {
|
||||||
case "$TARGET" in
|
case "$TARGET" in
|
||||||
|
@ -58,28 +59,28 @@ deploy() {
|
||||||
local target
|
local target
|
||||||
|
|
||||||
mkdir -p "$PKGDEPLOYDIR/boot" "$PKGDEPLOYDIR/lib/modules"
|
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
|
for target in $LINUX_TGT; do
|
||||||
case $target in
|
case $target in
|
||||||
*Image)
|
*Image)
|
||||||
cp "arch/$LINUX_CPU/boot/$target" "$PKGDEPLOYDIR/boot/vmlinuz"
|
cp "arch/$LINUX_CPU/boot/$target" "$PKGDEPLOYDIR/vmlinuz"
|
||||||
echo "dir boot 0755 0 0" >> "$PKGDEPLOYDIR/$PKGNAME.files"
|
echo "file vmlinuz 0755 0 0" > "$PKGDEPLOYDIR/linux.files"
|
||||||
echo "file boot/vmlinuz 0755 0 0" >> "$PKGDEPLOYDIR/$PKGNAME.files"
|
|
||||||
;;
|
;;
|
||||||
modules)
|
modules)
|
||||||
export KBUILD_OUTPUT="$PKGBUILDDIR"
|
export KBUILD_OUTPUT="$PKGBUILDDIR"
|
||||||
make -C "$SOURCE" O="$PKGBUILDDIR" ARCH="$LINUX_CPU" CROSS_COMPILE="${TARGET}-" INSTALL_MOD_PATH="$PKGDEPLOYDIR" modules_install
|
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 0755 0 0" > "$PKGDEPLOYDIR/linux-modules.files"
|
||||||
echo "dir lib/modules 0755 0 0" >> "$PKGDEPLOYDIR/$PKGNAME.files"
|
|
||||||
|
|
||||||
pkg_scan_dir "$PKGDEPLOYDIR/lib" |\
|
pkg_scan_dir "$PKGDEPLOYDIR/lib" | \
|
||||||
sed "s#$PKGDEPLOYDIR/##g" >> "$PKGDEPLOYDIR/$PKGNAME.files"
|
sed "s#$PKGDEPLOYDIR/##g" \
|
||||||
|
>> "$PKGDEPLOYDIR/linux-modules.files"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
cp $SCRIPTDIR/pkg/$PKGNAME/*.desc "$PKGDEPLOYDIR"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
check_update() {
|
check_update() {
|
||||||
|
|
|
@ -7,6 +7,7 @@ TARBALL="raspberrypi-kernel_${VERSION}.tar.gz"
|
||||||
URL="https://github.com/raspberrypi/linux/archive"
|
URL="https://github.com/raspberrypi/linux/archive"
|
||||||
SHA256SUM="57ec23478db884eafe8fefd0bc1dbf557e93eda36fda1fe6a1db26e4b3f6fd12"
|
SHA256SUM="57ec23478db884eafe8fefd0bc1dbf557e93eda36fda1fe6a1db26e4b3f6fd12"
|
||||||
DEPENDS="initrd"
|
DEPENDS="initrd"
|
||||||
|
SUBPKG="linux linux-modules"
|
||||||
|
|
||||||
check_update() {
|
check_update() {
|
||||||
local version=$(echo $VERSION | sed 's/-/./g')
|
local version=$(echo $VERSION | sed 's/-/./g')
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
DEPENDS="rootfs"
|
DEPENDS="rootfs linux"
|
||||||
SUBPKG="release"
|
SUBPKG="release"
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
DEPENDS="rootfs"
|
DEPENDS="rootfs linux"
|
||||||
SUBPKG="release"
|
SUBPKG="release"
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
DEPENDS="rootfs boot-rpi3"
|
DEPENDS="rootfs boot-rpi3 linux"
|
||||||
SUBPKG="release"
|
SUBPKG="release"
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
|
|
|
@ -27,13 +27,6 @@ _EOF
|
||||||
sed -i 's#etc/#cfg/preserve/etc/#g' "$PKGDEPLOYDIR/pseudo"
|
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#var/lib/#cfg/preserve/var_lib/#g' "$PKGDEPLOYDIR/pseudo"
|
||||||
sed -i 's#usr/#cfg/preserve/usr/#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() {
|
deploy() {
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
file rootfs.img 0755 0 0
|
file rootfs.img 0755 0 0
|
||||||
file vmlinuz 0755 0 0
|
|
||||||
|
|
Loading…
Reference in a new issue