summaryrefslogblamecommitdiff
path: root/system/easy-kernel/APKBUILD
blob: 57ccd4e8c5622be8ef50ab7e9441bc9c7cab2fc5 (plain) (tree)
1
2
3
4
5
6
7
8
                                                  
                                                                        


                                                        

               
                                   


                                                         
                                       
                      
          
                                              
                                                 
                                                        

                                           


                                                                                           
                                                                                             
                            
                    
                  
                     
                   
                      

                      
                
         
                                      
 




































































                        














                      
 
           


                                                                          
                       
 
                    

                                                    


         
                       

                              
                                             
                                       




                                                                                                      


           



                                            


                                              
                                                                               


                                              
                                                                               

          







                                                                                  
 
                                                              
                                                                                          



                                                          
                                                                 
                                                                       

                                                  





                                                                                

 


                                                             
                                                          












                                                                                 

                                                             

 
       
                                                             
                                                             
                                     
                                                                                     
 
 
                                                                                                                                                               
                                                                                                                                                                
                                                                                                                                                      






                                                                                                                                                
                                                                                                                                           
# Contributor: A. Wilcox <awilfox@adelielinux.org>
# Maintainer: Adelie Platform Group <adelie-devel@lists.adelielinux.org>
# KEEP THIS IN SYNC with the other easy-kernel packages.
_kflavour=""
_pkgname=easy-kernel$_kflavour
pkgver=4.14.149
pkgrel=16
pkgname=$_pkgname-$pkgver-mc$pkgrel
pkgdesc="The Linux kernel, packaged for your convenience"
url="https://kernel.org/"
arch="all"
options="!check !dbg !strip !tracedeps"
license="GPL-2.0-only"
depends=""
makedepends="bc gzip kmod lzop openssl-dev xz"
provides="easy-kernel$_kflavour=$pkgver-r$pkgrel"
subpackages="$_pkgname-modules-$pkgver-mc$pkgrel:modules
	$_pkgname-src-$pkgver-mc$pkgrel:src
	linux-headers:headers"
_pkgmajver=${pkgver%%.*}
_pkgminver=${pkgver%.*}
source="https://cdn.kernel.org/pub/linux/kernel/v${_pkgmajver}.x/linux-${_pkgminver}.tar.xz
	https://distfiles.adelielinux.org/source/linux-${_pkgminver}-mc$pkgrel-patches.tar.xz
	ast-endianness.patch
	config-ppc64
	config-ppc
	config-x86_64
	config-pmmx
	config-aarch64
	config-sparc64
	config-m68k
	kernel.h
	"
builddir="$srcdir/linux-${_pkgminver}"

# secfixes: linux_kernel
#   4.14.0-r0:
#     - CVE-2017-1000410
#   4.14.8-r2:
#     - CVE-2018-14619
#     - CVE-2017-1000407
#   4.14.33-r6:
#     - CVE-2018-1068
#     - CVE-2018-1130
#     - CVE-2018-8781
#   4.14.48-r8:
#     - CVE-2018-1120
#     - CVE-2018-10021
#     - CVE-2018-10940
#     - CVE-2018-11508
#     - CVE-2018-1000204
#   4.14.56-r9:
#     - CVE-2018-1118
#     - CVE-2018-10853
#     - CVE-2018-10878
#     - CVE-2018-10879
#     - CVE-2018-10880
#     - CVE-2018-10881
#     - CVE-2018-11412
#     - CVE-2018-12904
#     - CVE-2018-13406
#     - CVE-2018-16276
#     - CVE-2018-20856
#   4.14.76-r11:
#     - CVE-2017-18216
#     - CVE-2017-18224
#     - CVE-2018-5390
#     - CVE-2018-5391
#     - CVE-2018-6554
#     - CVE-2018-6555
#     - CVE-2018-15572
#     - CVE-2018-15594
#     - CVE-2018-16658
#     - CVE-2018-16871
#     - CVE-2018-18021
#     - CVE-2018-20511
#   4.14.127-r14:
#     - CVE-2018-18281
#     - CVE-2018-18397
#     - CVE-2018-18690
#     - CVE-2018-19854
#     - CVE-2018-20169
#     - CVE-2018-20784
#     - CVE-2018-20836
#     - CVE-2018-1000026
#     - CVE-2019-6974
#     - CVE-2019-10638
#     - CVE-2019-10639
#     - CVE-2019-11486
#     - CVE-2019-11599
#     - CVE-2019-11810
#     - CVE-2019-11815
#     - CVE-2019-11884
#     - CVE-2019-12818
#     - CVE-2019-12819
#   4.14.138-mc15:
#     - CVE-2018-20855
#     - CVE-2019-1125
#     - CVE-2019-3900
#     - CVE-2019-13272
#     - CVE-2019-13631
#     - CVE-2019-13648
#     - CVE-2019-14283
#     - CVE-2019-14284
#   4.14.149-mc16:
#     - CVE-2019-14814
#     - CVE-2019-14815
#     - CVE-2019-14816
#     - CVE-2019-14821
#     - CVE-2019-14835
#     - CVE-2019-15030
#     - CVE-2019-15117
#     - CVE-2019-15118
#     - CVE-2019-15505
#     - CVE-2019-15538
#     - CVE-2019-16746
#     - CVE-2019-17054
#     - CVE-2019-17055
#     - CVE-2019-17056

prepare() {
	for patch in "$srcdir/linux-${_pkgminver}-mc$pkgrel-patches"/*; do
		patch -p1 -i "$patch"
	done
	default_prepare

	cd "$srcdir"
	cp config-$CARCH linux-${_pkgminver}/.config
	cp -pr linux-${_pkgminver} linux-src
}

build() {
	make LDFLAGS=""

	cd "$srcdir/linux-src"
	make LDFLAGS="" modules_prepare clean
	cp "$builddir/Module.symvers" .

	# Kernel bug: crtsavres.o is required to build modules, but modules_prepare doesn't create it.
	if [ $CARCH = ppc ]; then
		cp "$builddir/arch/powerpc/lib/crtsavres.o" arch/powerpc/lib/
	fi
}

package() {
	mkdir -p "$pkgdir"/boot
	make INSTALL_PATH="$pkgdir"/boot \
		INSTALL_MOD_PATH="$pkgdir" \
		install modules_install

	if [ -f "$pkgdir"/boot/vmlinuz ]; then
		mv "$pkgdir"/boot/vmlinuz \
			"$pkgdir"/boot/vmlinuz-$pkgver-mc$pkgrel-easy$_kflavour
	fi
	if [ -f "$pkgdir"/boot/vmlinux ]; then
		mv "$pkgdir"/boot/vmlinux \
			"$pkgdir"/boot/vmlinux-$pkgver-mc$pkgrel-easy$_kflavour
	fi

	if [ -f "$pkgdir"/boot/System.map ]; then
		mv "$pkgdir"/boot/System.map \
			"$pkgdir"/boot/System.map-$pkgver-mc$pkgrel-easy$_kflavour
	fi

	case $CARCH in
	aarch64|arm*)	make INSTALL_PATH="$pkgdir"/boot dtbs_install ;;
	esac

	install -D "$builddir"/include/config/kernel.release \
		"$pkgdir"/usr/share/kernel/easy-$pkgver-mc$pkgrel$_kflavour/kernel.release
}

modules() {
	pkgdesc="Modules / device drivers for easy-kernel"
	provides="easy-kernel$_kflavour-modules=$pkgver-r$pkgrel"
	autodeps=0  # modules should not depend on src just for symlink
	mkdir -p "$subpkgdir"/lib
	mv "$pkgdir"/lib/modules "$subpkgdir"/lib/
	rm "$subpkgdir"/lib/modules/$pkgver-mc$pkgrel-easy$_kflavour/build
	rm "$subpkgdir"/lib/modules/$pkgver-mc$pkgrel-easy$_kflavour/source
	ln -s "../../../usr/src/linux-$pkgver-mc$pkgrel$_kflavour" \
		"$subpkgdir"/lib/modules/$pkgver-mc$pkgrel-easy$_kflavour/build
	ln -s "../../../usr/src/linux-$pkgver-mc$pkgrel$_kflavour" \
		"$subpkgdir"/lib/modules/$pkgver-mc$pkgrel-easy$_kflavour/source
}

headers() {
	pkgdesc="System headers provided by the Linux kernel"
	cd "$builddir"
	patch -Np1 -i "$startdir"/revert-broken-uapi.patch

	mkdir -p "$subpkgdir"/usr
	make headers_install INSTALL_HDR_PATH="$subpkgdir/usr"

	find "$subpkgdir/usr" \( -name .install -o -name ..install.cmd \) -exec \
		rm -f {} \;

	# provided by libdrm
	rm -rf "$subpkgdir"/usr/include/drm

	# needed for spl, VMware on x86, etc
	install -D -m644 "$builddir"/include/generated/utsrelease.h \
		"$subpkgdir"/usr/include/linux/utsrelease.h

	cp "$srcdir"/kernel.h "$subpkgdir"/usr/include/linux/
}

src() {
	pkgdesc="Kernel source code used to build the kernel"
	provides="easy-kernel$_kflavour-src=$pkgver-r$pkgrel"
	mkdir -p "$subpkgdir"/usr/src
	mv "$srcdir"/linux-src "$subpkgdir"/usr/src/linux-$pkgver-mc$pkgrel$_kflavour
}

sha512sums="77e43a02d766c3d73b7e25c4aafb2e931d6b16e870510c22cef0cdb05c3acb7952b8908ebad12b10ef982c6efbe286364b1544586e715cf38390e483927904d8  linux-4.14.tar.xz
c38d64091dfd9bbf326d345c1b488d90a36b8a6c18882d62883c1dc39d4c5394f254b09813252bad57e6ddbbee80c1de90374257bd96ba50fee0241ed53c6bc2  linux-4.14-mc16-patches.tar.xz
e41d9111219342ad13367902242444ecdd847a93575c3f9709d6c6a075bc650f4a15be9db1a8798435fc0a0b56d41705829bfe0d2c2d88f8d1c28931e27ef5be  ast-endianness.patch
2299b107b0b9fe503095e0dbdd4edd4134c05fc4a86e650805781aaa508f18a2e4eda59341355f62a0fdc7b301b4876f452c3109c042cbb218f23e0d314a4ff9  config-ppc64
e35c70c7ac02a2894a3c4197070b9afa3315c403bf5e178ce251e63bf21609525871c55cbad4fd449af63104be68c7625ea1e1383c077d0bbc0f1960c2b6c4a9  config-ppc
27deb4d449853eb725501b5f69eb8d4169d4fac951b33dc184ade8df1f8fe72f192fa4c4d0d34cd98cf6ef40da3bedbed6f87268fa6a05c0a348d3b727e4d766  config-x86_64
9e089209e69c7bb7ca16d425d7e76d7160622288299247ee544f93337b21fb4aec3e2cd594703eb877155cfb9d82dedf1f3945055cdb2b9369e73c7c9fd21e8d  config-pmmx
13137f8706b176b395b30154a97903ba3f7bf3b0a3ff241e8c2f67e1a0fb92ad34609ba1d3f6ab262a5032bc9dbff45bbc749f0ad9dc2aa008c9bbac0c0247ef  config-aarch64
dd7a6bb6fe26426e758fa85e57377d93a8fba4fe77dc67fc5ac0feb98316b9782971b9b4ef17a0fa8c158ea9ae348a6b93dc6dc0be8d28130aa7fbe4a68fb752  config-sparc64
e6000e88d97144907c1f5c424d52a8b95f2eac82a707bef97c39c2b1658b08b9765451a0297bcc6a297ab9f0a3ab993d59f977009325066e2512aa1a820acc88  config-m68k
fdd94b9de7b374f1812dec0f9971c05f5e52177ca4a16c8071daa620c18265b38f656f528e7045a24f30af01f05e53e54546fb0a9e93773cf191866e87de505d  kernel.h"