diff options
author | bill-auger <mr.j.spam.me@gmail.com> | 2022-07-17 05:05:00 -0400 |
---|---|---|
committer | bill-auger <mr.j.spam.me@gmail.com> | 2022-07-17 19:17:56 -0400 |
commit | 8dc356706598da18a3e6a81e843803bb78c85514 (patch) | |
tree | 1675b56e60292b94c2dcdf5d322fd2ce775602ba /libre | |
parent | c22a0659a4d69fbef47a9038555e48c76c800f73 (diff) | |
download | abslibre-8dc356706598da18a3e6a81e843803bb78c85514.tar.gz abslibre-8dc356706598da18a3e6a81e843803bb78c85514.tar.bz2 abslibre-8dc356706598da18a3e6a81e843803bb78c85514.zip |
finalize linux-libre-64
Diffstat (limited to 'libre')
-rw-r--r-- | libre/linux-libre-64/PKGBUILD | 89 |
1 files changed, 45 insertions, 44 deletions
diff --git a/libre/linux-libre-64/PKGBUILD b/libre/linux-libre-64/PKGBUILD index db8c2378c..c3210ab6a 100644 --- a/libre/linux-libre-64/PKGBUILD +++ b/libre/linux-libre-64/PKGBUILD @@ -1,4 +1,15 @@ -# Maintainers: Parabola hackers <dev@lists.parabola.nu> +# Contributor: David P. <megver83@parabola.nu> +# Contributor: André Silva <emulatorman@hyperbola.info> +# Contributor: Márcio Silva <coadde@hyperbola.info> +# Contributor: fauno <fauno@parabola.nu> +# Contributor: Sorin-Mihai Vârgolici <smv@yobicore.org> +# Contributor: Michał Masłowski <mtjm@mtjm.eu> +# Contributor: Luke R. <g4jc@openmailbox.org> +# Contributor: Andreas Grapentin <andreas@grapentin.org> +# Maintainer: Parabola Hackers <dev@lists.parabola.nu> + +# Based on linux package +# Based on linux-libre package, actually - megver83 will become maintainer eventually # WIP: This PKGBUILD is derived from the 'linux-libre' PKGBUILD, # and includes a lot of unused cruft, to minimize the diff. @@ -12,33 +23,26 @@ # is over-ridden for the special purpose of the cross-compilation. # # The makedepends_armv7h, source_armv7h, and sha512sums_armv7h arrays -# (also source_aarch64 and sha512sums_aarch64 obviously), -# and any lines with comment: '# cross-compile over-ride', -# indicate code that would eventually be deleted or associated with -# $CARCH 'aarch64', if/when aarch64 becomes a valid target. +# (also source_aarch64 and sha512sums_aarch64 obviously), and the comments: +# '# cross-compile over-ride' and +# '# TODO: merge into 'linux-libre' PKGBUILD', +# indicate code that would eventually be deleted, merged into, +# or associated with $CARCH: 'aarch64', if/when aarch64 becomes a valid target. # All other LOCs of consequence in this file, -# except for the `make` and `strip` commands, # should be identical to the linux-libre PKGBUILD. # In this way, the diff is minimal against the linux-libre PKGBUILD; -# and it is obvious which parts are intended to become aarch64-specific -# (eg: source_armv7h simply becomes source_aarch64). -# -# NOTE: There is no need to upload or publish the generated *.src.tar.gz package. -# Because this 'pkgbase' is identical to the 'linux-libre' PKGBUILD; -# the generated *.src.tar.gz package will be identical, in name and contents. -# After running `librestage`, you can delete the staging/ directory, -# before running `librerelease`. -# $ rm -rf $(source /etc/libretools.conf ; echo ${WORKDIR} ;)/staging/sources +# and it is obvious which parts are intended to become aarch64-specific, +# or exist only for cross-compiling the aarch64 kernel for armv7h systems. _replacesarchkernel=('linux%') # '%' gets replaced with kernel suffix _replacesoldkernels=() # '%' gets replaced with kernel suffix _replacesoldmodules=() # '%' gets replaced with kernel suffix -pkgbase=linux-libre +pkgbase=linux-libre-64 # cross-compile over-ride pkgver=5.18.5 -pkgrel=1 -pkgdesc='Linux-libre' +pkgrel=2 +pkgdesc="The Linux-libre kernel and modules" # TODO: merge into 'linux-libre' PKGBUILD pkgdesc+=' 64-bit (aarch64) for Parabola armv7h' # cross-compile over-ride rcnver=5.18.2 rcnrel=armv7-x6 @@ -58,10 +62,13 @@ source=( "https://linux-libre.fsfla.org/pub/linux-libre/releases/${_srcname##*-}-gnu/linux-libre-${_srcname##*-}-gnu.tar.xz"{,.sign} "https://linux-libre.fsfla.org/pub/linux-libre/releases/$pkgver-gnu/patch-${_srcname##*-}-gnu-$pkgver-gnu.xz"{,.sign} "https://repo.parabola.nu/other/linux-libre/logos/logo_linux_"{clut224.ppm,vga16.ppm,mono.pbm}{,.sig} + # TODO: Move config.i686 config.armv7h, linux-armv7h.preset, + # and "kernel"{.its,.keyblock,_data_key.vbprivk} + # into their respective source_<CARCH> arrays. + # Rename linux-armv7h.preset to linux-arm.preset, or add a new one for aarch64 config.i686 config.x86_64 config.armv7h # the main kernel config files linux-armv7h.preset # armv7h preset file for mkinitcpio ramdisk "kernel"{.its,.keyblock,_data_key.vbprivk} # files for signing Chromebooks kernels - # maintain the TTY over USB disconnects # http://www.coreboot.org/EHCI_Gadget_Debug 0001-usb-serial-gadget-no-TTY-hangup-on-USB-disconnect-WI.patch @@ -75,6 +82,7 @@ source=( ) source_i686=( # avoid using zstd compression in ultra mode (exhausts virtual memory) + # Arch Linux 32 patches no-ultra-zstd.patch ) source_armv7h=( @@ -141,15 +149,18 @@ sha512sums_armv7h=( ${sha512sums_aarch64[*]} ) # cross-compile over-ride _replacesarchkernel=("${_replacesarchkernel[@]/\%/${pkgbase#linux-libre}}") _replacesoldkernels=("${_replacesoldkernels[@]/\%/${pkgbase#linux-libre}}") _replacesoldmodules=("${_replacesoldmodules[@]/\%/${pkgbase#linux-libre}}") +_replacesarchkernel=("${_replacesarchkernel[@]/-64/}") # cross-compile over-ride case "$CARCH" in armv7h) KARCH=arm64 ; CROSS_COMPILE=aarch64-linux-gnu- ;; # cross-compile over-ride + aarch64) KARCH=arm64;; # TODO: merge into 'linux-libre' PKGBUILD i686|x86_64) KARCH=x86;; armv7h) KARCH=arm;; esac export KBUILD_BUILD_HOST=parabola export KBUILD_BUILD_USER=$pkgbase +export KBUILD_BUILD_USER=${pkgbase/-64/} # cross-compile over-ride export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})" prepare() { @@ -168,7 +179,6 @@ prepare() { scripts/setlocalversion --save-scmversion echo "-$pkgrel" > localversion.10-pkgrel echo "${pkgbase#linux-libre}" > localversion.20-pkgname - echo "${pkgbase#linux-libre}-64" > localversion.20-pkgname # cross-compile over-ride if [ "$CARCH" = "armv7h" ]; then local src_armv7h @@ -192,7 +202,8 @@ prepare() { done fi - if [ "$CARCH" = "aarch64" ]; then # TODO: (unused) aarch64 is not yet a valid parabola target + if [ "$CARCH" = "aarch64" ]; then # TODO: merge into 'linux-libre' PKGBUILD + # TODO: better yet, all of these per-arch patching routines should be DRY-ed out local src_aarch64 for src_aarch64 in "${source_aarch64[@]}"; do src_aarch64="${src_aarch64%%::*}" @@ -239,7 +250,7 @@ _package() { optdepends=('wireless-regdb: to set the correct wireless channels of your country' 'linux-libre-firmware: firmware images needed for some devices') provides=(VIRTUALBOX-GUEST-MODULES WIREGUARD-MODULE) - conflicts=() # FIXME: in 'linux-libre', conflicts array is appended before declared + conflicts=() # TODO: merge into 'linux-libre' PKGBUILD (conflicts array is appended before declared) replaces=(virtualbox-guest-modules-arch wireguard-arch) provides+=("${_replacesarchkernel[@]/%/=$pkgver}" "LINUX-ABI_VERSION=$pkgver") conflicts+=("${_replacesarchkernel[@]}" "${_replacesoldkernels[@]}" "${_replacesoldmodules[@]}") @@ -248,8 +259,8 @@ _package() { # NOTE: Above is providing/replacing the archarm armv7h 'linux' with the armv7h 'linux-libre'. # We do not want this aarch64 'linux-libre-64' to provide nor replace the archarm armv7h 'linux'; # for the obvious reason. Anyways, the parabola armv7h 'linux-libre' serves that purpose. - # Below is providing/replacing 'linux-libre' and the obsolete parabola 'linux-libre-aarch64'. - # These are defined analogougly in _package-headers(), _package-docs(), and _package-chromebook(). + # Below is providing/replacing 'linux-libre' and the obsoleted parabola 'linux-libre-aarch64'. + # These are defined analogously in _package-headers(), _package-docs(), and _package-chromebook(). conflicts=( ${conflicts[*]/linux*/} ) # cross-compile over-ride replaces=( ${replaces[*]/linux*/} ) # cross-compile over-ride provides_armv7h=( linux-libre ) # cross-compile over-ride @@ -265,6 +276,7 @@ _package() { # https://github.com/systemd/systemd/commit/edda44605f06a41fb86b7ab8128dcf99161d2344 # The default arm64 image target is 'Image.gz' (per `make -s image_name`); # but some u-boot configs/versions don't support that, so we build 'Image' instead. + # TODO: merge into 'linux-libre' PKGBUILD [[ "$KARCH" == "arm64" ]] && \ install -Dm644 arch/$KARCH/boot/Image "$modulesdir/vmlinuz" || \ install -Dm644 "$(make -s image_name)" "$modulesdir/vmlinuz" @@ -277,7 +289,6 @@ _package() { # Used by mkinitcpio to name the kernel echo "$pkgbase" | install -Dm644 /dev/stdin "$modulesdir/pkgbase" - echo "${pkgbase}-64" > "$modulesdir/pkgbase" # cross-compile over-ride echo "Installing modules..." make ARCH=$KARCH CROSS_COMPILE=$CROSS_COMPILE INSTALL_MOD_PATH="$pkgdir/usr" INSTALL_MOD_STRIP=1 modules_install # cross-compile over-ride @@ -294,12 +305,6 @@ _package() { echo "Installing mkinitcpio preset..." sed "s|%PKGBASE%|$pkgbase|g;s|%KERNVER%|$kernver|g" ../linux-armv7h.preset \ | install -Dm644 /dev/stdin "$pkgdir/etc/mkinitcpio.d/$pkgbase.preset" - - local preset_file="${pkgdir}"/etc/mkinitcpio.d/${pkgbase}.preset # cross-compile over-ride - mv "${pkgdir}"/boot/dtbs/${pkgbase}{,-64} # cross-compile over-ride - backup=( ${backup[*]/${pkgbase}/${pkgbase}-64} ) # cross-compile over-ride - sed -i "s|${pkgbase}|${pkgbase}-64|g" "${preset_file}" # cross-compile over-ride - mv "${preset_file}" "${preset_file/\.preset/-64\.preset}" # cross-compile over-ride fi } @@ -343,7 +348,6 @@ _package-headers() { cp -t "$builddir/arch/$KARCH" -a arch/$KARCH/include install -Dt "$builddir/arch/$KARCH/kernel" -m644 arch/$KARCH/kernel/asm-offsets.s - [[ "$KARCH" == "arm64" ]] || # cross-compile over-ride # from linux-armv7 if [ "$CARCH" = "armv7h" ]; then for i in dove omap2; do @@ -413,7 +417,6 @@ _package-headers() { echo "Adding symlink..." mkdir -p "$pkgdir/usr/src" ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase" - mv "${pkgdir}"/usr/src/${pkgbase}{,-64} # cross-compile over-ride } _package-docs() { @@ -441,7 +444,6 @@ _package-docs() { echo "Adding symlink..." mkdir -p "$pkgdir/usr/share/doc" ln -sr "$builddir/Documentation" "$pkgdir/usr/share/doc/$pkgbase" - mv "${pkgdir}"/usr/share/doc/${pkgbase}{,-64} # cross-compile over-ride } _package-chromebook() { @@ -451,12 +453,11 @@ _package-chromebook() { conflicts=("${_replacesarchkernel[@]/%/-armv7-chromebook}" "${_replacesoldkernels[@]/%/-armv7-chromebook}") replaces=("${_replacesarchkernel[@]/%/-armv7-chromebook}" "${_replacesoldkernels[@]/%/-armv7-chromebook}") install=$pkgbase-chromebook.install - # cross-compile over-rides - see note in _package() - depends=( ${depends[*]/${pkgbase}/${pkgbase}-64} ) # cross-compile over-ride - provides=( ${provides[*]/armv7/aarch64} ) # cross-compile over-ride - conflicts=( ${conflicts[*]/armv7/aarch64} ) # cross-compile over-ride - replaces=( ${replaces[*]/armv7/aarch64} ) # cross-compile over-ride - install=${install/${pkgbase}/${pkgbase}-64} # cross-compile over-ride + # NOTE: when aarch64 becomes a supported target, 'armv7' above should be changed to "${CARCH}" + depends=( ${depends[*]/linux-libre/${pkgbase}} ) # cross-compile over-ride + provides=( ${provides[*]/armv7/aarch64} ) # cross-compile over-ride + conflicts=( ${conflicts[*]/armv7/aarch64} ) # cross-compile over-ride + replaces=( ${replaces[*]/armv7/aarch64} ) # cross-compile over-ride cd $_srcname @@ -465,6 +466,7 @@ _package-chromebook() { dd if=/dev/zero of=bootloader.bin bs=512 count=1 echo 'console=tty0 init=/sbin/init root=PARTUUID=%U/PARTNROFF=1 rootwait rw noinitrd' > cmdline + # TODO: merge into 'linux-libre' PKGBUILD (--arch ${KARCH}) echo "Creating kernel sign..." vbutil_kernel \ --pack vmlinux.kpart \ @@ -482,16 +484,15 @@ _package-chromebook() { } pkgname=("$pkgbase" "$pkgbase-headers" "$pkgbase-docs") -pkgname=( ${pkgname[*]/${pkgbase}/${pkgbase}-64} ) # cross-compile over-ride # The chromebook package is disabled until the following error is fixed: # | ==> Starting package_linux-libre-64-chromebook()... # | FATAL ERROR: Couldn't open "arch/arm/boot/zImage": No such file or directory # | mkimage: Can't read kernel.signed.tmp: Invalid argument -# [[ "${KARCH}" != aarch64 ]] || pkgname+=("$pkgbase-chromebook") # cross-compile over-ride +# [[ $CARCH = armv7h ]] && pkgname+=("$pkgbase-chromebook") # cross-compile over-ride for _p in "${pkgname[@]}"; do eval "package_$_p() { - $(declare -f "_package${_p#${pkgbase}-64}") # cross-compile over-ride - _package${_p#${pkgbase}-64} # cross-compile over-ride + $(declare -f "_package${_p#$pkgbase}") + _package${_p#$pkgbase} }" done |