Skip to content

Commit

Permalink
cleanup kernel image packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
SolidHal committed Dec 5, 2020
1 parent 01edc39 commit 3a727a5
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 393 deletions.
6 changes: 4 additions & 2 deletions kernel/packages/prawnos-linux-image-arm64/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ PACKAGE_NAME_DEB := $(PACKAGE_NAME).deb
#uses only the upstream kernel version for the orig tar
PACKAGE_NAME_ORIG := $(PACKAGE)_$(KVER)-$(PRAWNOS_KERNEL_VER)
PACKAGE_NAME_ORIG_TAR := $(PACKAGE_NAME_ORIG).orig.tar.gz
PACKAGE_NAME_ORIG_DIR := $(PACKAGE)_$(KVER)-$(PRAWNOS_KERNEL_VER)-orig

ORIG := $(PRAWNOS_KERNEL_PACKAGE_IMAGE)/orig
ORIG := $(PRAWNOS_BUILD)/$(PACKAGE_NAME_ORIG_DIR)

default: $(PACKAGE_NAME_DEB)

Expand All @@ -36,10 +37,11 @@ $(PACKAGE_NAME_DEB): $(PACKAGE_NAME_ORIG_TAR)

$(PACKAGE_NAME_ORIG_TAR):
make -f $(PRAWNOS_KERNEL)/makefile kernel
mkdir $(ORIG)
cp $(PRAWNOS_KERNEL_BUILT) $(ORIG)/$(PACKAGE_NAME_ORIG)
cp $(PRAWNOS_KERNEL_RESOURCES_SHARED)/FlashKernelPartition.sh $(ORIG)/
tar -czf $(PACKAGE_NAME_ORIG_TAR) -C $(ORIG)/ .


.PHONY: clean_all
clean_all: clean clean_orig

Expand Down
1 change: 0 additions & 1 deletion kernel/packages/prawnos-linux-image-arm64/orig/.gitignore

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
prawnos-linux-image-arm64 (5.9.12-1-1) stable; urgency=medium

* release 5.9.12-1-1

-- Hal Emmerich <[email protected]> Fri, 04 Dec 2020 18:19:30 -0800

prawnos-linux-image-arm64 (5.7.10-1-1) stable; urgency=medium

* Initial packaged release.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
prawnos-linux-image-arm64* boot
install-prawnos-kernel.sh /etc/prawnos/kernel
FlashKernelPartition.sh etc/prawnos/kernel
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set -e

case "$1" in
configure)
/etc/prawnos/kernel/install-prawnos-kernel.sh $KERNEL_IMAGE
/etc/prawnos/kernel/FlashKernelPartition.sh $KERNEL_IMAGE
;;
abort-upgrade|abort-remove|abort-deconfigure)
# Do nothing
Expand Down
10 changes: 6 additions & 4 deletions kernel/packages/prawnos-linux-image-armhf/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PRAWNOS_ROOT := $(shell git rev-parse --show-toplevel)
include $(PRAWNOS_ROOT)/scripts/BuildScripts/BuildCommon.mk

ifeq ($(TARGET),$(PRAWNOS_ARM64))
$(error Cant built armhf kernel package with arm64 target)
$(error Cant build armhf kernel package with arm64 target)
endif

#package specific vars
Expand All @@ -18,8 +18,9 @@ PACKAGE_NAME_DEB := $(PACKAGE_NAME).deb
#uses only the upstream kernel version for the orig tar
PACKAGE_NAME_ORIG := $(PACKAGE)_$(KVER)-$(PRAWNOS_KERNEL_VER)
PACKAGE_NAME_ORIG_TAR := $(PACKAGE_NAME_ORIG).orig.tar.gz
PACKAGE_NAME_ORIG_DIR := $(PACKAGE)_$(KVER)-$(PRAWNOS_KERNEL_VER)-orig

ORIG := $(PRAWNOS_KERNEL_PACKAGE_IMAGE)/orig
ORIG := $(PRAWNOS_BUILD)/$(PACKAGE_NAME_ORIG_DIR)

default: $(PACKAGE_NAME_DEB)

Expand All @@ -36,10 +37,11 @@ $(PACKAGE_NAME_DEB): $(PACKAGE_NAME_ORIG_TAR)

$(PACKAGE_NAME_ORIG_TAR):
make -f $(PRAWNOS_KERNEL)/makefile kernel
mkdir $(ORIG)
cp $(PRAWNOS_KERNEL_BUILT) $(ORIG)/$(PACKAGE_NAME_ORIG)
cp $(PRAWNOS_KERNEL_RESOURCES_SHARED)/FlashKernelPartition.sh $(ORIG)/
tar -czf $(PACKAGE_NAME_ORIG_TAR) -C $(ORIG)/ .


.PHONY: clean_all
clean_all: clean clean_orig

Expand All @@ -58,7 +60,7 @@ clean:
rm -f src/debian/files
rm -rf src/debian/.debhelper
# kernel package specific
rm -f orig/$(PACKAGE)_*-*
rm -f $(ORIG)

#when just changing the debian package version, if we remake the orig as well then reprepro will complain on upload. So we might not always want to remove the orig.
.PHONY: clean_orig
Expand Down
1 change: 0 additions & 1 deletion kernel/packages/prawnos-linux-image-armhf/orig/.gitignore

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
prawnos-linux-image-armhf* boot
install-prawnos-kernel.sh bin
FlashKernelPartition.sh etc/prawnos/kernel
4 changes: 2 additions & 2 deletions kernel/packages/prawnos-linux-image-armhf/src/debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ set -e

case "$1" in
configure)
/bin/install-prawnos-kernel.sh $KERNEL_IMAGE
/etc/prawnos/kernel/FlashKernelPartition.sh $KERNEL_IMAGE
;;
abort-upgrade|abort-remove|abort-deconfigure)
# Do nothing
;;
*)
echo "Unrecognized postinst argument '$1'"
;;
esac
esac
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@


### SHARED CONST AND VARS
# TODO: when these scripts are packaged, place these in a shared script instead of in every file that needs them
device_veyron_speedy="Google Speedy"
device_veyron_minnie="Google Minnie"
device_gru_kevin="Google Kevin"
Expand Down Expand Up @@ -163,10 +162,19 @@ echo "
/!\\ !!! CAUTION !!! /!\\
----------------------------
This will flash a new kernel image onto the running device's kernel partition: $kpart
The detected running device is: $devtype.
The detected running boot device is: $devtype.
The device you are running is: $devname.
DO NOT shutdown or reboot before completing the process!
"

printf "%s" "Do you want to continue? [y/N] "

read ans

[ "$ans" != "y" ] &&
[ "$ans" != "Y" ] &&
die "Aborted by user. Kernel partition unchanged." 1

# put the kernel in the kernel partition
#blank the kernel partition first, with 32MiB of zeros
kernel_size=65536
Expand Down
2 changes: 2 additions & 0 deletions scripts/BuildScripts/BuildCommon.mk
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ PRAWNOS_LOCAL_APT_VARS := $(PRAWNOS_LOCAL_APT_REPO) $(PRAWNOS_LOCAL_APT_SOURCE)

### KERNEL UNIVERSAL
PRAWNOS_KERNEL_PACKAGES := $(PRAWNOS_KERNEL)/packages
PRAWNOS_KERNEL_RESOURCES := $(PRAWNOS_KERNEL)/resources/$(TARGET)
PRAWNOS_KERNEL_RESOURCES_SHARED := $(PRAWNOS_KERNEL)/resources/shared

## KERNEL TARGETED (paths partially defined by $TARGET)
PRAWNOS_KERNEL_BUILD := $(PRAWNOS_BUILD)/linux-$(KVER)
Expand Down
Loading

0 comments on commit 3a727a5

Please sign in to comment.