├── 60-linux.hook ├── 90-linux.hook ├── PKGBUILD ├── config ├── linux.preset └── thunk_64_patch.diff /60-linux.hook: -------------------------------------------------------------------------------- 1 | [Trigger] 2 | Type = File 3 | Operation = Install 4 | Operation = Upgrade 5 | Operation = Remove 6 | Target = usr/lib/modules/%KERNVER%/* 7 | Target = usr/lib/modules/%EXTRAMODULES%/* 8 | 9 | [Action] 10 | Description = Updating %PKGBASE% module dependencies... 11 | When = PostTransaction 12 | Exec = /usr/bin/depmod %KERNVER% 13 | -------------------------------------------------------------------------------- /90-linux.hook: -------------------------------------------------------------------------------- 1 | [Trigger] 2 | Type = File 3 | Operation = Install 4 | Operation = Upgrade 5 | Target = boot/zImage 6 | Target = usr/lib/initcpio/* 7 | 8 | [Action] 9 | Description = Updating %PKGBASE% initcpios... 10 | When = PostTransaction 11 | Exec = /usr/bin/mkinitcpio -p %PKGBASE% 12 | -------------------------------------------------------------------------------- /PKGBUILD: -------------------------------------------------------------------------------- 1 | # Maintainer: 2 | 3 | pkgbase=linux-ps4 4 | pkgver=5.3.18.ps4 5 | pkgrel=1 6 | _desc="Linux for PS4" 7 | url="https://github.com/ps4boot/ps4-linux" 8 | arch=(x86_64) 9 | license=(GPL2) 10 | makedepends=( 11 | bc kmod libelf cpio perl tar xz linux-firmware 12 | git 13 | ) 14 | options=('!strip') 15 | _srcname=ps4-linux 16 | source=( 17 | "$_srcname::git+https://github.com/ps4boot/ps4-linux" 18 | thunk_64_patch.diff 19 | config # the main kernel config file 20 | 60-linux.hook 21 | 90-linux.hook 22 | linux.preset 23 | ) 24 | sha256sums=('SKIP' 25 | '350e6aa2663165b287022267601607431fb577d15a77826b50b4b47f860586b7' 26 | 'f7d4a9781a705325cd12e21ff398e5a9fe9c99b6bef88767bd10b6671dc30242' 27 | 'ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21' 28 | '0922dace35ea3925e37f75ce26fd3a899b9701445c30a747b1ddc49aa22edce9' 29 | '51e49038a089a1e66e7329cadbb288f5c0666406184a8a437c774e4e8dfd96e1') 30 | 31 | export KBUILD_BUILD_HOST=archlinux 32 | export KBUILD_BUILD_USER=$pkgbase 33 | export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})" 34 | 35 | prepare() { 36 | cd $_srcname 37 | 38 | git apply ../thunk_64_patch.diff 39 | 40 | echo "Setting version..." 41 | scripts/setlocalversion --save-scmversion 42 | echo "-$pkgrel" > localversion.10-pkgrel 43 | echo "${pkgbase#linux}" > localversion.20-pkgname 44 | 45 | echo "Setting config..." 46 | cp ../config .config 47 | make olddefconfig 48 | 49 | make -s kernelrelease > version 50 | echo "Prepared $pkgbase version $(=0.7') 63 | optdepends=('crda: to set the correct wireless channels of your country' 64 | 'linux-firmware: firmware images needed for some devices') 65 | provides=("linux=${pkgver}" "WIREGUARD-MODULE") 66 | conflicts=('linux') 67 | 68 | cd $_srcname 69 | KARCH=x86_64 70 | 71 | # get kernel version 72 | _kernver="$(make kernelrelease)" 73 | _basekernel=${_kernver%%-*} 74 | _basekernel=${_basekernel%.*} 75 | 76 | mkdir -p "${pkgdir}"/{boot,usr/lib/modules} 77 | make INSTALL_MOD_PATH="${pkgdir}/usr" modules_install 78 | cp arch/$KARCH/boot/bzImage "${pkgdir}/boot/bzImage" 79 | 80 | # remove build and source links 81 | rm "${pkgdir}"/usr/lib/modules/${_kernver}/{source,build} 82 | 83 | # now we call depmod... 84 | depmod -b "${pkgdir}/usr" -F System.map "${_kernver}" 85 | 86 | # sed expression for following substitutions 87 | local _subst=" 88 | s|%PKGBASE%|${pkgbase}|g 89 | s|%KERNVER%|${_kernver}|g 90 | " 91 | 92 | # install mkinitcpio preset file 93 | sed "${_subst}" ../linux.preset | 94 | install -Dm644 /dev/stdin "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset" 95 | 96 | # install pacman hooks 97 | sed "${_subst}" ../60-linux.hook | 98 | install -Dm644 /dev/stdin "${pkgdir}/usr/share/libalpm/hooks/60-${pkgbase}.hook" 99 | sed "${_subst}" ../90-linux.hook | 100 | install -Dm644 /dev/stdin "${pkgdir}/usr/share/libalpm/hooks/90-${pkgbase}.hook" 101 | } 102 | 103 | _package-headers() { 104 | pkgdesc="Headers and scripts for building modules for the $pkgdesc kernel" 105 | 106 | cd $_srcname 107 | local builddir="$pkgdir/usr/lib/modules/$(