summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libre/linux-libre-hardened/60-linux.hook11
-rw-r--r--libre/linux-libre-hardened/90-linux.hook11
-rw-r--r--libre/linux-libre-hardened/PKGBUILD83
-rw-r--r--libre/linux-libre-hardened/config (renamed from libre/linux-libre-hardened/config.x86_64)0
-rw-r--r--libre/linux-libre-hardened/linux.install12
-rw-r--r--libre/linux-libre-hardened/linux.preset14
6 files changed, 29 insertions, 102 deletions
diff --git a/libre/linux-libre-hardened/60-linux.hook b/libre/linux-libre-hardened/60-linux.hook
deleted file mode 100644
index 584ce3537..000000000
--- a/libre/linux-libre-hardened/60-linux.hook
+++ /dev/null
@@ -1,11 +0,0 @@
-[Trigger]
-Type = File
-Operation = Install
-Operation = Upgrade
-Operation = Remove
-Target = usr/lib/modules/%KERNVER%/*
-
-[Action]
-Description = Updating %PKGBASE% module dependencies...
-When = PostTransaction
-Exec = /usr/bin/depmod %KERNVER%
diff --git a/libre/linux-libre-hardened/90-linux.hook b/libre/linux-libre-hardened/90-linux.hook
deleted file mode 100644
index be0d88653..000000000
--- a/libre/linux-libre-hardened/90-linux.hook
+++ /dev/null
@@ -1,11 +0,0 @@
-[Trigger]
-Type = File
-Operation = Install
-Operation = Upgrade
-Target = boot/vmlinuz-%PKGBASE%
-Target = usr/lib/initcpio/*
-
-[Action]
-Description = Updating %PKGBASE% initcpios...
-When = PostTransaction
-Exec = /usr/bin/mkinitcpio -p %PKGBASE%
diff --git a/libre/linux-libre-hardened/PKGBUILD b/libre/linux-libre-hardened/PKGBUILD
index a098e1ee6..ac5475a7f 100644
--- a/libre/linux-libre-hardened/PKGBUILD
+++ b/libre/linux-libre-hardened/PKGBUILD
@@ -2,36 +2,32 @@
# Contributor: André Silva <emulatorman@hyperbola.info>
# Contributor: Márcio Silva <coadde@hyperbola.info>
-pkgbase=linux-libre-hardened
-_srcbasever=5.3-gnu
-_srcver=5.3.7-gnu
-_hardenedver=a
+# Based on linux-hardened package
-_replacesarchkernel=('linux%') # '%' gets replaced with _kernelname
-_replacesoldkernels=('linux-grsec' 'linux-libre-grsec') # '%' gets replaced with _kernelname
-_replacesoldmodules=() # '%' gets replaced with _kernelname
+_replacesarchkernel=('linux%') # '%' gets replaced with kernel suffix
+_replacesoldkernels=('linux-grsec' 'linux-libre-grsec') # '%' gets replaced with kernel suffix
+_replacesoldmodules=() # '%' gets replaced with kernel suffix
+pkgbase=linux-libre-hardened
+_srcbasever=5.3-gnu
+_srcver=5.3.8-gnu
_srcname=linux-${_srcbasever%-*}
-_archpkgver=${_srcver%-*}
-pkgver=${_srcver//-/.${_hardenedver}_}
+pkgver=${_srcver//-/.a_}
pkgrel=1
-arch=(x86_64)
url='https://linux-libre.fsfla.org/'
+arch=(x86_64)
license=(GPL2)
makedepends=(
- xmlto kmod inetutils bc libelf python-sphinx python-sphinx_rtd_theme
- graphviz imagemagick
+ xmlto kmod inetutils bc libelf
+ python-sphinx python-sphinx_rtd_theme graphviz imagemagick
)
options=('!strip')
source=(
"https://linux-libre.fsfla.org/pub/linux-libre/releases/$_srcbasever/linux-libre-$_srcbasever.tar.xz"{,.sign}
"https://linux-libre.fsfla.org/pub/linux-libre/releases/$_srcver/patch-$_srcbasever-$_srcver.xz"{,.sign}
- "https://github.com/anthraxx/linux-hardened/releases/download/${_srcver%-*}.${_hardenedver}/linux-hardened-${_srcver%-*}.${_hardenedver}.patch"{,.sig}
+ "https://github.com/anthraxx/linux-hardened/releases/download/${pkgver%%_*}/linux-hardened-${pkgver%%_*}.patch"{,.sig}
"https://repo.parabola.nu/other/linux-libre/logos/logo_linux_"{clut224.ppm,vga16.ppm,mono.pbm}{,.sig}
- config.x86_64 # the main kernel config file
- 60-linux.hook # pacman hook for depmod
- 90-linux.hook # pacman hook for initramfs regeneration
- linux.preset # standard config files for mkinitcpio ramdisk
+ config # the main kernel config file
# maintain the TTY over USB disconnects
# http://www.coreboot.org/EHCI_Gadget_Debug
@@ -49,9 +45,9 @@ validpgpkeys=(
)
sha512sums=('85d83c973ef96ab414354414da70ab3e1c3df19c3088458498cec1594952878b7967a8988bd9e36d4e728cc573a36e6eac056dbcab2f9aa742f18cbb4fb3164f'
'SKIP'
- '22064d7cf6da426eff98b3fd72a52e6dc1349f1c5f53755041b487335fa8ff61fc1083440af38ef631056301d30d827c5c203566d1f720b9a65505e9c2cd3ee8'
+ 'eca168c4c460bf8d8fbf322e1aa9c6b509f205c7597142967648c09402de95c8438ae302b4920c8f120192b1a54286f0fb860955c66414f3a3c376e41f246391'
'SKIP'
- '821d851394863022ee5ed84c4737d319284bf95eb04dc7e05020a3f528daebac65712bb263f55e7933c89b3ffe43a467397c62bbdab566b874778f239a81b72d'
+ 'bfb66281d772b24741471e93ea265a9b6a15081fe2a2c1cd6bde9eef34b2943bcbe42f7908cb7335b97a92c189a8fceff2aa7b753c08447a913928f343eeb336'
'SKIP'
'13cb5bc42542e7b8bb104d5f68253f6609e463b6799800418af33eb0272cc269aaa36163c3e6f0aacbdaaa1d05e2827a4a7c4a08a029238439ed08b89c564bb3'
'SKIP'
@@ -60,16 +56,16 @@ sha512sums=('85d83c973ef96ab414354414da70ab3e1c3df19c3088458498cec1594952878b796
'267295aa0cea65684968420c68b32f1a66a22d018b9d2b2c1ef14267bcf4cb68aaf7099d073cbfefe6c25c8608bdcbbd45f7ac8893fdcecbf1e621abdfe9ecc1'
'SKIP'
'796272cb732bc2ce988037a48891b04f3cfda74ccb6ff3f1f8863f760805f2c66ee083dd66b2ced6783f369638aa1dff498894e67e7d17e3b0cf5fc1ce62946b'
- '6b57a66b870b2f525e2dedd8f224b89474fd4ec6ea18484b0a67a1a2b9a4fc95d025cac181504406ea42a35d6c1b184c0d4e38c92815022935fc55746c69c7c1'
- '4a8b324aee4cccf3a512ad04ce1a272d14e5b05c8de90feb82075f55ea3845948d817e1b0c6f298f5816834ddd3e5ce0a0e2619866289f3c1ab8fd2f35f04f44'
- '2dc6b0ba8f7dbf19d2446c5c5f1823587de89f4e28e9595937dd51a87755099656f2acec50e3e2546ea633ad1bfd1c722e0c2b91eef1d609103d8abdc0a7cbaf'
'02af4dd2a007e41db0c63822c8ab3b80b5d25646af1906dc85d0ad9bb8bbf5236f8e381d7f91cf99ed4b0978c50aee37cb9567cdeef65b7ec3d91b882852b1af'
'b8fe56e14006ab866970ddbd501c054ae37186ddc065bb869cf7d18db8c0d455118d5bda3255fb66a0dde38b544655cfe9040ffe46e41d19830b47959b2fb168')
-_kernelname=${pkgbase#linux-libre}
-_replacesarchkernel=("${_replacesarchkernel[@]/\%/${_kernelname}}")
-_replacesoldkernels=("${_replacesoldkernels[@]/\%/${_kernelname}}")
-_replacesoldmodules=("${_replacesoldmodules[@]/\%/${_kernelname}}")
+_replacesarchkernel=("${_replacesarchkernel[@]/\%/${pkgbase#linux-libre}}")
+_replacesoldkernels=("${_replacesoldkernels[@]/\%/${pkgbase#linux-libre}}")
+_replacesoldmodules=("${_replacesoldmodules[@]/\%/${pkgbase#linux-libre}}")
+
+export KBUILD_BUILD_HOST=parabola
+export KBUILD_BUILD_USER=$pkgbase
+export KBUILD_BUILD_TIMESTAMP="@${SOURCE_DATE_EPOCH:-$(date +%s)}"
prepare() {
cd $_srcname
@@ -84,10 +80,11 @@ prepare() {
../logo_linux_{clut224.ppm,vga16.ppm,mono.pbm}
msg2 "Setting version..."
- sed -e "/^EXTRAVERSION = -gnu/s/= -gnu.*/= .${_hardenedver}-gnu/" -i Makefile
+ local extraver="${pkgver//_/-}"
+ sed -e "/^EXTRAVERSION = -gnu/s/= -gnu.*/= .${extraver##*.}/" -i Makefile
scripts/setlocalversion --save-scmversion
echo "-$pkgrel" > localversion.10-pkgrel
- echo "$_kernelname" > localversion.20-pkgname
+ echo "${pkgbase#linux-libre}" > localversion.20-pkgname
local src
for src in "${source[@]}"; do
@@ -99,7 +96,7 @@ prepare() {
done
msg2 "Setting config..."
- cp ../config.x86_64 .config
+ cp ../config .config
make olddefconfig
make -s kernelrelease > version
@@ -117,11 +114,9 @@ _package() {
optdepends=('crda: to set the correct wireless channels of your country'
'linux-libre-firmware: firmware images needed for some devices'
'usbctl: deny_new_usb control')
- provides=("${_replacesarchkernel[@]/%/=${_archpkgver}}" "LINUX-ABI_VERSION=${_srcver%%-*}")
+ provides=("${_replacesarchkernel[@]/%/=${_srcver%%-*}}" "LINUX-ABI_VERSION=${_srcver%%-*}")
conflicts=("${_replacesarchkernel[@]}" "${_replacesoldkernels[@]}" "${_replacesoldmodules[@]}")
replaces=("${_replacesarchkernel[@]}" "${_replacesoldkernels[@]}" "${_replacesoldmodules[@]}")
- backup=("etc/mkinitcpio.d/$pkgbase.preset")
- install=linux.install
cd $_srcname
local kernver="$(<version)"
@@ -131,7 +126,6 @@ _package() {
# systemd expects to find the kernel here to allow hibernation
# https://github.com/systemd/systemd/commit/edda44605f06a41fb86b7ab8128dcf99161d2344
install -Dm644 "$(make -s image_name)" "$modulesdir/vmlinuz"
- install -Dm644 "$modulesdir/vmlinuz" "$pkgdir/boot/vmlinuz-$pkgbase"
# Used by mkinitcpio to name the kernel
echo "$pkgbase" | install -Dm644 /dev/stdin "$modulesdir/pkgbase"
@@ -142,32 +136,13 @@ _package() {
# remove build and source links
rm "$modulesdir"/{source,build}
- msg2 "Installing hooks..."
- # sed expression for following substitutions
- local subst="
- s|%PKGBASE%|$pkgbase|g
- s|%KERNVER%|$kernver|g
- "
-
- # hack to allow specifying an initially nonexisting install file
- sed "$subst" "$startdir/$install" > "$startdir/$install.pkg"
- true && install=$install.pkg
-
- # fill in mkinitcpio preset and pacman hooks
- sed "$subst" ../linux.preset | install -Dm644 /dev/stdin \
- "$pkgdir/etc/mkinitcpio.d/$pkgbase.preset"
- sed "$subst" ../60-linux.hook | install -Dm644 /dev/stdin \
- "$pkgdir/usr/share/libalpm/hooks/60-$pkgbase.hook"
- sed "$subst" ../90-linux.hook | install -Dm644 /dev/stdin \
- "$pkgdir/usr/share/libalpm/hooks/90-$pkgbase.hook"
-
msg2 "Fixing permissions..."
chmod -Rc u=rwX,go=rX "$pkgdir"
}
_package-headers() {
pkgdesc="Header files and scripts for building modules for ${pkgbase^} kernel"
- provides=("${_replacesarchkernel[@]/%/-headers=${_archpkgver}}")
+ provides=("${_replacesarchkernel[@]/%/-headers=${_srcver%%-*}}")
conflicts=("${_replacesarchkernel[@]/%/-headers}" "${_replacesoldkernels[@]/%/-headers}")
replaces=("${_replacesarchkernel[@]/%/-headers}" "${_replacesoldkernels[@]/%/-headers}")
@@ -248,7 +223,7 @@ _package-headers() {
_package-docs() {
pkgdesc="Kernel hackers manual - HTML documentation that comes with the ${pkgbase^} kernel"
- provides=("${_replacesarchkernel[@]/%/-docs=${_archpkgver}}")
+ provides=("${_replacesarchkernel[@]/%/-docs=${_srcver%%-*}}")
conflicts=("${_replacesarchkernel[@]/%/-docs}" "${_replacesoldkernels[@]/%/-docs}")
replaces=("${_replacesarchkernel[@]/%/-docs}" "${_replacesoldkernels[@]/%/-docs}")
diff --git a/libre/linux-libre-hardened/config.x86_64 b/libre/linux-libre-hardened/config
index ab9e9c519..ab9e9c519 100644
--- a/libre/linux-libre-hardened/config.x86_64
+++ b/libre/linux-libre-hardened/config
diff --git a/libre/linux-libre-hardened/linux.install b/libre/linux-libre-hardened/linux.install
deleted file mode 100644
index f1f033b4e..000000000
--- a/libre/linux-libre-hardened/linux.install
+++ /dev/null
@@ -1,12 +0,0 @@
-post_upgrade() {
- if [ "$(uname -m)" = "x86_64" ] || [ "$(uname -m)" = "i686" ]; then
- if findmnt --fstab -uno SOURCE /boot &>/dev/null && ! mountpoint -q /boot; then
- echo "WARNING: /boot appears to be a separate partition but is not mounted."
- fi
- fi
-}
-
-post_remove() {
- rm -f boot/initramfs-%PKGBASE%.img
- rm -f boot/initramfs-%PKGBASE%-fallback.img
-}
diff --git a/libre/linux-libre-hardened/linux.preset b/libre/linux-libre-hardened/linux.preset
deleted file mode 100644
index 66709a8c1..000000000
--- a/libre/linux-libre-hardened/linux.preset
+++ /dev/null
@@ -1,14 +0,0 @@
-# mkinitcpio preset file for the '%PKGBASE%' package
-
-ALL_config="/etc/mkinitcpio.conf"
-ALL_kver="/boot/vmlinuz-%PKGBASE%"
-
-PRESETS=('default' 'fallback')
-
-#default_config="/etc/mkinitcpio.conf"
-default_image="/boot/initramfs-%PKGBASE%.img"
-#default_options=""
-
-#fallback_config="/etc/mkinitcpio.conf"
-fallback_image="/boot/initramfs-%PKGBASE%-fallback.img"
-fallback_options="-S autodetect"