Bläddra i källkod

Introduce recipe for packaging the kernel

Change-Id: I3416273b5d27a7d16016b0f3a8ef04faad5bcbd9
Donald Carr 8 år sedan
incheckning
3b0826648f
3 ändrade filer med 87 tillägg och 0 borttagningar
  1. 36 0
      PKGBUILD
  2. 37 0
      spudd.install
  3. 14 0
      spudd.preset

+ 36 - 0
PKGBUILD

@@ -0,0 +1,36 @@
+# Maintainer: Donald Carr <sirspudd at gmail dot com>
+
+# set -x
+
+pkgname=linux-spudd
+pkgrel=1
+pkgver=4.11.rc3.r6.g4c4c9bb32aaa
+pkgdesc="Kernel build from head"
+arch=("x86_64")
+license=("GPL2.1")
+install=spudd.install
+_xcompile_args="ARCH=arm64 CROSS_COMPILE=/opt/aarch64-rpi3-linux-gnueabi/bin/aarch64-rpi3-linux-gnueabi-"
+
+pkgver() {
+  cd /opt/dev/src/OSS/linux/linux
+  git describe --tags | cut -c2- | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
+}
+
+build() {
+  cd /opt/dev/src/OSS/linux/linux
+  #git clean -xdff
+  make
+}
+
+package() {
+  boot_dir="${pkgdir}/boot"
+  usr_dir="${pkgdir}/usr"
+  preset_dir=${pkgdir}/etc/mkinitcpio.d
+
+  cd /opt/dev/src/OSS/linux/linux
+  INSTALL_MOD_PATH=${usr_dir} make modules_install
+  mkdir -p ${boot_dir}
+  mkdir -p ${preset_dir}
+  cp arch/x86/boot/bzImage ${boot_dir}/vmlinuz-spudd
+  cp ${startdir}/spudd.preset ${preset_dir}
+}

+ 37 - 0
spudd.install

@@ -0,0 +1,37 @@
+generate_initramfs() {
+    mkinitcpio -p spudd
+}
+
+## arg 1:  the new package version
+pre_install() {
+    echo ""
+}
+
+## arg 1:  the new package version
+post_install() {
+    generate_initramfs
+}
+#post_install
+
+## arg 1:  the new package version
+## arg 2:  the old package version
+pre_upgrade() {
+    echo ""
+}
+
+## arg 1:  the new package version
+## arg 2:  the old package version
+post_upgrade() {
+    generate_initramfs
+}
+
+## arg 1:  the old package version
+pre_remove() {
+    echo ""
+}
+#pre_remove
+
+## arg 1:  the old package version
+post_remove() {
+    rm /boot/initramfs-spudd*.img
+}

+ 14 - 0
spudd.preset

@@ -0,0 +1,14 @@
+# mkinitcpio preset file for the 'spudd' package
+
+ALL_config="/etc/mkinitcpio.conf"
+ALL_kver="/boot/vmlinuz-spudd"
+
+PRESETS=('default' 'fallback')
+
+#default_config="/etc/mkinitcpio.conf"
+default_image="/boot/initramfs-spudd.img"
+#default_options=""
+
+#fallback_config="/etc/mkinitcpio.conf"
+fallback_image="/boot/initramfs-spudd-fallback.img"
+fallback_options="-S autodetect"