kernel image package building, versioning applied, install completes

This commit is contained in:
SolidHal 2020-07-13 22:36:52 -07:00
parent 4970332336
commit afc88c9d6c
8 changed files with 89 additions and 30 deletions

View File

@ -4,38 +4,43 @@ PRAWNOS_ROOT := $(shell git rev-parse --show-toplevel)
include $(PRAWNOS_ROOT)/scripts/BuildScripts/BuildCommon.mk
#package specific vars
VERSION := $(shell cd src/; dpkg-parsechangelog --show-field Version)
PACKAGE_PREFIX := prawnos-linux-image-armhf
VERSION := $(PRAWNOS_KERNEL_IMAGE_CAT_VER)
PACKAGE := prawnos-linux-image-armhf
PACKAGE_ARCH := armhf
#uses the full debian version for the package name
PACKAGE_NAME := $(PACKAGE_PREFIX)_$(VERSION)_$(PACKAGE_ARCH)
PACKAGE_NAME := $(PACKAGE)_$(VERSION)_$(PACKAGE_ARCH)
PACKAGE_NAME_DEB := $(PACKAGE_NAME).deb
#uses only the upstream kernel version for the orig tar
PACKAGE_NAME_ORIG_TAR := $(PACKAGE_PREFIX)_$(KVER).orig.tar.gz
PACKAGE_NAME_ORIG := $(PACKAGE)_$(KVER)-$(PRAWNOS_KERNEL_VER)
PACKAGE_NAME_ORIG_TAR := $(PACKAGE_NAME_ORIG).orig.tar.gz
ORIG := $(PRAWNOS_KERNEL_PACKAGE_IMAGE)/orig
default: $(PACKAGE_NAME_DEB)
$(PACKAGE_NAME_DEB): $(PACKAGE_NAME_ORIG_TAR)
@echo Building $@
# keep the /debian files up to date with the current kernel version
$(PRAWNOS_KERNEL_SCRIPTS_UPDATE_DEB_FILES) $(PRAWNOS_KERNEL_PACKAGE_IMAGE)/src $(DEBKVER)
$(PRAWNOS_KERNEL_SCRIPTS_UPDATE_DEB_FILES) $(PRAWNOS_KERNEL_PACKAGE_IMAGE)/src $(VERSION)
$(PRAWNOS_PACKAGE_SCRIPTS_PBUILD) $(PACKAGE_NAME_DEB) \
$(PBUILDER_VARS) \
$(PRAWNOS_LOCAL_APT_VARS) \
$(PACKAGE_LOCAL_BUILD_DEPS)
mkdir -p $(PRAWNOS_LOCAL_APT_REPO)
cp $(PACKAGE_NAME_DEB) $(PRAWNOS_LOCAL_APT_REPO)
$(PACKAGE_NAME_ORIG_TAR):
make -f $(PRAWNOS_KERNEL)/makefile kernel
cp $(PRAWNOS_KERNEL_BUILT) $(ORIG)/$(PACKAGE_NAME)
cp $(PRAWNOS_KERNEL_BUILT) $(ORIG)/$(PACKAGE_NAME_ORIG)
tar -czf $(PACKAGE_NAME_ORIG_TAR) -C $(ORIG)/ .
.PHONY: clean_all
clean_all: clean clean_orig
.PHONY: clean
clean:
rm -rf $(PRAWNOS_LOCAL_APT_REPO)/$(PACKAGE_NAME_DEB)
rm -rf *.upload
rm -rf *.deb
rm -rf *.changes
@ -45,12 +50,16 @@ clean:
rm -rf *.debian.tar.xz
rm -rf *.buildinfo
rm -f src/debian/debhelper-build-stamp
rm -rf src/debian/$(PACKAGE_PREFIX)*
rm -rf src/debian/$(PACKAGE)*
rm -f src/debian/files
rm -rf src/debian/.debhelper
# kernel package specific
rm -f orig/$(PACKAGE_NAME)
rm -f $(PACKAGE_NAME_ORIG_TAR)
rm -f orig/$(PACKAGE)_*-*
#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
clean_orig:
rm -f $(PACKAGE)_*-*.orig.tar.gz
.PHONY: upload
upload:

View File

@ -117,9 +117,6 @@ ptype=$(get_partition_type_uuid /dev/$devname $pnum_kernel)
[ ! -e "$kimg" ] &&
die "ERROR: cannot find kernel image at $kimg !" 127
[ ! -e "$blnk" ] &&
die "ERROR: cannot find blank image at $blnk !" 127
# Prompt for user's confirmation
echo "

View File

@ -1,3 +1,45 @@
prawnos-linux-image-armhf (5.4.29-3-1) stable; urgency=medium
* release 5.4.29-3-1
-- Hal Emmerich <hal@halemmerich.com> Mon, 13 Jul 2020 22:24:07 -0700
prawnos-linux-image-armhf (5.4.29-2-4) stable; urgency=medium
* release 5.4.29-2-4
-- Hal Emmerich <hal@halemmerich.com> Mon, 13 Jul 2020 22:20:39 -0700
prawnos-linux-image-armhf (5.4.29-2-3) stable; urgency=medium
* release 5.4.29-2-3
-- Hal Emmerich <hal@halemmerich.com> Mon, 13 Jul 2020 22:15:18 -0700
prawnos-linux-image-armhf (5.4.29-2-2) stable; urgency=medium
* release 5.4.29-2-2
-- Hal Emmerich <hal@halemmerich.com> Mon, 13 Jul 2020 22:04:09 -0700
prawnos-linux-image-armhf (5.4.29-2-1) stable; urgency=medium
* release 5.4.29-2-1
-- Hal Emmerich <hal@halemmerich.com> Mon, 13 Jul 2020 21:49:53 -0700
prawnos-linux-image-armhf (5.4.29-1-3) stable; urgency=medium
* release 5.4.29-1-3
-- Hal Emmerich <hal@halemmerich.com> Mon, 13 Jul 2020 21:12:06 -0700
prawnos-linux-image-armhf (5.4.29-1-2) stable; urgency=medium
* release 5.4.29-1-2
-- Hal Emmerich <hal@halemmerich.com> Mon, 13 Jul 2020 21:07:01 -0700
prawnos-linux-image-armhf (5.4.29-1-1) stable; urgency=medium
* Initial packaged release.

View File

@ -1,8 +1,11 @@
#!/bin/bash
VERSION=__DEB_VERSION__
KERNEL_IMAGE=/boot/prawnos-linux-image-armhf_$VERSION_armhf
# the kernel file version doesn't include the debian package version, so we have to do some sed magic to drop it
DEBVERSION=$(dpkg-query --show --showformat='${Version}' prawnos-linux-image-armhf)
VERSION=$(sed 's/\(.*\)-.*/\1/' <<< ${DEBVERSION})
KERNEL_IMAGE="/boot/prawnos-linux-image-armhf_${VERSION}"
set -e

View File

@ -1,9 +1,3 @@
#!/usr/bin/make -f
%:
dh $@
override_dh_installdeb:
dh_installdeb
for pkg in $$(dh_listpackages -i); do \
sed -i -e 's/__DEB_VERSION__/$(DEB_VERSION)/' debian/$$pkg/DEBIAN/*; \
done

View File

@ -3,14 +3,29 @@ BUILD_COMMON_MK := 1
#Place all shared make vars below
#=========================================================================================
### MISC GLOBALS
KVER=5.4.29
# the number of prawnos specific releases made of the above kver. Used for the kernel deb packages
PRAWNOS_KERNEL_RELEASE=2
DEBKVER=$(KVER)-$(PRAWNOS_KERNEL_RELEASE)
### GLOBALS
# upstream kernel version
# when this is changed, PRAWNOS_KERNEL_VER, PRAWNOS_KERNEL_HEADERS_DEBVER, and PRAWNOS_KERNEL_IMAGE_DEBVER should be reset to 1
KVER := 5.4.29
# the version of the prawnos linux kernel. This is incremented whenever changes to the config or patches are made, but the KVER stays the same
# when this is incremented, PRAWNOS_KERNEL_IMAGE_DEBVER, and PRAWNOS_KERNEL_HEADERS_DEBVER should be reset to 1
PRAWNOS_KERNEL_VER := 3
# the version of the prawnos image deb package. This should be incremented with each rebuild/upload of the same KVER and PRAWNOS_KERNEL_IMAGE_VER
PRAWNOS_KERNEL_IMAGE_DEBVER := 1
PRAWNOS_KERNEL_IMAGE_CAT_VER=$(KVER)-$(PRAWNOS_KERNEL_VER)-$(PRAWNOS_KERNEL_IMAGE_DEBVER)
# the version of the prawnos headers deb package. This should be incremented with each rebuild/upload of the same KVER and PRAWNOS_KERNEL_IMAGE_VER
PRAWNOS_KERNEL_HEADERS_DEBVER := 1
PRAWNOS_KERNEL_HEADERS_CAT_VER=$(KVER)-$(PRAWNOS_KERNEL_VER)-$(PRAWNOS_KERNEL_HEADERS_DEBVER)
# Otherwise errors are ignored when output is piped to tee:
SHELL := /bin/bash -o pipefail
### PRAWNOS CORE DIRECTORIES
PRAWNOS_BUILD := $(PRAWNOS_ROOT)/build

View File

@ -35,8 +35,6 @@ OUTNAME=$2
outmnt=$(mktemp -d -p "$(pwd)")
outdev=/dev/loop7
build_resources=resources/BuildResources
#A hacky way to ensure the loops are properly unmounted and the temp files are properly deleted.
#Without this, a reboot is sometimes required to properly clean the loop devices and ensure a clean build
cleanup() {

View File

@ -4,6 +4,7 @@ set -x
set -e
# update the debian/changelog of the kernel packages when the kernel version changes
# returns the current version
# This file is part of PrawnOS (https://www.prawnos.com)
# Copyright (c) 2020 Hal Emmerich <hal@halemmerich.com>