summaryrefslogtreecommitdiff
path: root/libre-testing
diff options
context:
space:
mode:
authorDavid P <megver83@parabola.nu>2018-12-09 14:45:37 -0300
committerDavid P <megver83@parabola.nu>2018-12-09 14:45:37 -0300
commit22d17f153183fa86b44816581c1677ca57cc1a79 (patch)
treeb5f1c2add51607a84a357fa6dcc33c12cab0a4d6 /libre-testing
parent488fc282c92bdf93c38cdc54d6170974b993dbe7 (diff)
downloadabslibre-22d17f153183fa86b44816581c1677ca57cc1a79.tar.gz
abslibre-22d17f153183fa86b44816581c1677ca57cc1a79.tar.bz2
abslibre-22d17f153183fa86b44816581c1677ca57cc1a79.zip
addpkg: libre-testing/chromebook-kernel 20181209-1
Signed-off-by: David P <megver83@parabola.nu>
Diffstat (limited to 'libre-testing')
-rw-r--r--libre-testing/chromebook-kernel/PKGBUILD50
-rw-r--r--libre-testing/chromebook-kernel/kernel.its35
-rw-r--r--libre-testing/chromebook-kernel/kernel.keyblockbin0 -> 1208 bytes
-rw-r--r--libre-testing/chromebook-kernel/kernel_data_key.vbprivkbin0 -> 1199 bytes
-rw-r--r--libre-testing/chromebook-kernel/linux-chromebook.install25
5 files changed, 110 insertions, 0 deletions
diff --git a/libre-testing/chromebook-kernel/PKGBUILD b/libre-testing/chromebook-kernel/PKGBUILD
new file mode 100644
index 000000000..c566e5f7d
--- /dev/null
+++ b/libre-testing/chromebook-kernel/PKGBUILD
@@ -0,0 +1,50 @@
+# Maintainer: David P. <megver83@parabola.nu>
+
+# This is just for testing, I may merge this
+# into the main linux-libre PKGBUILD, or
+# create a new linux-libre-chromebook pkg
+
+pkgname=chromebook-kernel
+pkgdesc='Kernel sign for linux-libre - Chromebooks'
+pkgver=20181209
+pkgrel=1
+arch=(armv7h)
+url="https://notabug.org/nuclearkev/dragora-c201/"
+license=(GPL3)
+source=('kernel.its' 'kernel.keyblock' 'kernel_data_key.vbprivk')
+depends=('linux-libre')
+makedepends=(uboot-tools vboot-utils dtc)
+conflicts=(linux-libre-chromebook)
+install=linux-chromebook.install
+sha512sums=('fc47e98eabef01cd7bea61a2d590b0a83977d9c70c62564e4c56db7d1ecdbae9486b6f9f30a6bcc5baad0855c6841825050d392f76037b202983f3faf8874df8'
+ 'bb6718984a7357c9b00c37e4788480e5b8b75018c172ecc1441bc3fc5d2d42444eb5d8c7f9d2e3a7d6fed6d03acb565e3c0559486e494c40a7fe6bd0570c9ede'
+ '143dea30c6da00e504c99984a98a0eb2411f558fcdd9dfa7f607d6c14e9e7dffff9cb00121d9317044b07e3e210808286598c785ee854084b993ec9cb14d8232')
+
+pkgver() {
+ date +%Y%m%d
+}
+
+package() {
+ cd $srcdir
+
+ msg2 "Setting options for device tree compiler..."
+ #cp ../kernel.its .
+ mkimage -D "-I dts -O dtb -p 2048" -f kernel.its vmlinux.uimg
+ 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
+
+ msg2 "Signing kernel image..."
+ vbutil_kernel \
+ --pack vmlinux.kpart \
+ --version 1 \
+ --vmlinuz vmlinux.uimg \
+ --arch arm \
+ --keyblock kernel.keyblock \
+ --signprivate kernel_data_key.vbprivk \
+ --config cmdline \
+ --bootloader bootloader.bin
+
+ msg2 "Installing kernel sign..."
+ mkdir -p "$pkgdir/boot"
+ cp vmlinux.kpart "$pkgdir/boot"
+}
diff --git a/libre-testing/chromebook-kernel/kernel.its b/libre-testing/chromebook-kernel/kernel.its
new file mode 100644
index 000000000..85d094a3c
--- /dev/null
+++ b/libre-testing/chromebook-kernel/kernel.its
@@ -0,0 +1,35 @@
+/dts-v1/;
+
+/ {
+ description = "Linux kernel image with one or more FDT blobs";
+ #address-cells = <1>;
+ images {
+ kernel@1{
+ description = "kernel";
+ data = /incbin/("/boot/vmlinuz-linux-libre");
+ type = "kernel_noload";
+ arch = "arm";
+ os = "linux";
+ compression = "none";
+ load = <0>;
+ entry = <0>;
+ };
+ fdt@1{
+ description = "rk3288-veyron-speedy.dtb";
+ data = /incbin/("/boot/dtbs/linux-libre/rk3288-veyron-speedy.dtb");
+ type = "flat_dt";
+ arch = "arm";
+ compression = "none";
+ hash@1{
+ algo = "sha1";
+ };
+ };
+ };
+ configurations {
+ default = "conf@1";
+ conf@1{
+ kernel = "kernel@1";
+ fdt = "fdt@1";
+ };
+ };
+}; \ No newline at end of file
diff --git a/libre-testing/chromebook-kernel/kernel.keyblock b/libre-testing/chromebook-kernel/kernel.keyblock
new file mode 100644
index 000000000..9740be4e6
--- /dev/null
+++ b/libre-testing/chromebook-kernel/kernel.keyblock
Binary files differ
diff --git a/libre-testing/chromebook-kernel/kernel_data_key.vbprivk b/libre-testing/chromebook-kernel/kernel_data_key.vbprivk
new file mode 100644
index 000000000..8d392fb29
--- /dev/null
+++ b/libre-testing/chromebook-kernel/kernel_data_key.vbprivk
Binary files differ
diff --git a/libre-testing/chromebook-kernel/linux-chromebook.install b/libre-testing/chromebook-kernel/linux-chromebook.install
new file mode 100644
index 000000000..02e08464d
--- /dev/null
+++ b/libre-testing/chromebook-kernel/linux-chromebook.install
@@ -0,0 +1,25 @@
+flash_kernel() {
+ major=$(mountpoint -d / | cut -f 1 -d ':')
+ minor=$(mountpoint -d / | cut -f 2 -d ':')
+ device=$(cat /proc/partitions | awk {'if ($1 == "'${major}'" && $2 == "'${minor}'") print $4 '})
+ device="/dev/${device/%2/1}"
+
+ echo "A new kernel version needs to be flashed onto ${device}."
+ echo "Do you want to do this now? [y|N]"
+ read -r shouldwe
+ if [[ $shouldwe =~ ^([yY][eE][sS]|[yY])$ ]]; then
+ dd if=/boot/vmlinux.kpart of=${device}
+ sync
+ else
+ echo "You can do this later by running:"
+ echo "# dd if=/boot/vmlinux.kpart of=${device}"
+ fi
+}
+
+post_install () {
+ flash_kernel
+}
+
+post_upgrade() {
+ flash_kernel
+}