Ver Fonte

Packaging and build system rework

rework package build system (again) for greater ease of maintenance and flexability
add creation of a local apt repo for package building in pbuilder
add an apt cache to debootstrap to speed up build times and reduce network load
package mosys
more build system improvements to come
Hal Emmerich há 3 anos atrás
pai
commit
c0f14421c1

+ 9 - 4
makefile

@@ -70,7 +70,7 @@ clean_initramfs:
 	rm -r build/PrawnOS-initramfs.cpio.gz
 
 .PHONY: clean_packages
-packages:
+clean_packages:
 	cd packages && $(MAKE) clean
 
 .PHONY: clean_pbuilder
@@ -91,6 +91,7 @@ clean_all:
 .PHONY: build_dirs
 build_dirs:
 	mkdir -p build/logs/
+	mkdir -p build/apt-cache/
 
 #:::::::::::::::::::::::::::::: kernel ::::::::::::::::::::::::::::::::::::
 .PHONY: kernel
@@ -121,7 +122,8 @@ filesystem:
 	$(MAKE) build_dirs
 	rm -rf build/logs/fs-log.txt
 	$(MAKE) pbuilder_create
-	[ -f $(BASE) ] || ./scripts/buildFilesystem.sh $(KVER) $(DEBIAN_SUITE) $(BASE) 2>&1 | tee build/logs/fs-log.txt
+	$(MAKE) packages
+	[ -f $(BASE) ] || ./scripts/buildFilesystem.sh $(KVER) $(DEBIAN_SUITE) $(BASE) $(PRAWNOS_ROOT) 2>&1 | tee build/logs/fs-log.txt
 
 
 #:::::::::::::::::::::::::::::: packages ::::::::::::::::::::::::::::::::
@@ -131,7 +133,11 @@ packages:
 
 .PHONY: packages_install
 install_packages:
-	cd packages && $(MAKE) install INSTALL_TARGET=/tmp/
+ifndef INSTALL_TARGET
+	$(error INSTALL_TARGET is not set)
+endif
+	cd packages && $(MAKE) install INSTALL_TARGET=$(INSTALL_TARGET)
+
 #:::::::::::::::::::::::::::::: image management ::::::::::::::::::::::::::
 
 .PHONY: kernel_inject
@@ -155,7 +161,6 @@ image:
 	cp $(BASE) $(OUTNAME)
 	$(MAKE) kernel_inject
 
-
 #:::::::::::::::::::::::::::::: pbuilder management :::::::::::::::::::::::
 .PHONY: pbuilder_create
 pbuilder_create:

+ 11 - 17
packages/filesystem/flashmap/makefile

@@ -2,17 +2,18 @@
 PRAWNOS_ROOT := $(shell git rev-parse --show-toplevel)
 include $(PRAWNOS_ROOT)/scripts/common.mk
 
-
+#package specific vars
 VERSION := $(shell cd src/; dpkg-parsechangelog --show-field Version)
 PACKAGE_NAME := flashmap_$(VERSION)_armhf
 PACKAGE_NAME_DEB := $(PACKAGE_NAME).deb
 
+PACKAGE_LOCAL_BUILD_DEPS :=
+
 $(PACKAGE_NAME_DEB):
-	@echo Building $@
-	cd src/; pdebuild --configfile $(PBUILDER_RC) \
-                    --buildresult .. \
-                    -- \
-                    --basetgz $(PBUILDER_CHROOT) \
+	$(PRAWNOS_PACKAGE_SCRIPTS_PBUILD_PACKAGE) $(PACKAGE_NAME_DEB) \
+                                            $(PBUILDER_VARS) \
+                                            $(PRAWNOS_LOCAL_APT_VARS) \
+                                            $(PACKAGE_LOCAL_BUILD_DEPS)
 
 .PHONY: clean
 clean:
@@ -25,15 +26,8 @@ clean:
 	rm -rf *.debian.tar.xz
 	rm -rf *.buildinfo
 
-.PHONY: upload
-upload:
-	dput deb.prawnos.com *.changes
-
 install:
-ifndef INSTALL_TARGET
-	$(error INSTALL_TARGET is not set)
-endif
-ifeq ("$(wildcard $(PACKAGE_NAME_DEB))","")
-	$(error $(PACKAGE_NAME_DEB) must be built first)
-endif
-	cp $(PACKAGE_NAME_DEB) $(INSTALL_TARGET)
+	$(PRAWNOS_PACKAGE_SCRIPTS_INSTALL_PACKAGE) $(PACKAGE_NAME_DEB) $(INSTALL_TARGET)
+
+.PHONY: upload
+	$(PRAWNOS_PACKAGE_SCRIPTS_UPLOAD_PACKAGE)

+ 7 - 11
packages/filesystem/font-source-code-pro/makefile

@@ -2,6 +2,7 @@
 PRAWNOS_ROOT := $(shell git rev-parse --show-toplevel)
 include $(PRAWNOS_ROOT)/scripts/common.mk
 
+#package specific vars
 VERSION := $(shell cd src/; dpkg-parsechangelog --show-field Version)
 PACKAGE_NAME := font-source-code-pro_$(VERSION)_all
 PACKAGE_NAME_DEB := $(PACKAGE_NAME).deb
@@ -9,6 +10,8 @@ PACKAGE_NAME_DEB := $(PACKAGE_NAME).deb
 $(PACKAGE_NAME_DEB):
 	@echo Building $@
 	cd src/; debuild -us -uc
+	mkdir -p $PRAWNOS_LOCAL_APT_REPO
+	cp $PACKAGE_NAME $PRAWNOS_LOCAL_APT_REPO
 
 .PHONY: clean
 clean:
@@ -21,15 +24,8 @@ clean:
 	rm -rf *.debian.tar.xz
 	rm -rf *.buildinfo
 
-.PHONY: upload
-upload:
-	dput deb.prawnos.com *.changes
-
 install:
-ifndef INSTALL_TARGET
-	$(error INSTALL_TARGET is not set)
-endif
-ifeq ("$(wildcard $(PACKAGE_NAME_DEB))","")
-	$(error $(PACKAGE_NAME_DEB) must be built first)
-endif
-	cp $(PACKAGE_NAME_DEB) $(INSTALL_TARGET)
+	$(PRAWNOS_PACKAGE_SCRIPTS_INSTALL_PACKAGE) $(PACKAGE_NAME_DEB) $(INSTALL_TARGET)
+
+.PHONY: upload
+	$(PRAWNOS_PACKAGE_SCRIPTS_UPLOAD_PACKAGE)

+ 8 - 0
packages/filesystem/makefile

@@ -19,3 +19,11 @@ install:
 	for dir in $(SUBDIRS) ; do \
 		make install INSTALL_TARGET=$(INSTALL_TARGET) -C  $$dir ; \
 	done
+
+#this allows a makefile or script to specifically build one filesystem package
+.PHONY: build_package
+build_package:
+ifndef BUILD_PACKAGE
+	$(error BUILD_PACKAGE is not set)
+endif
+	make -C $(BUILD_PACKAGE)

+ 29 - 0
packages/filesystem/mosys/.gitignore

@@ -0,0 +1,29 @@
+#since we have not changed upstream, and this is packaged don't keep the source files
+src/*
+!src/debian
+
+#only include specific /debian files
+src/debian/*
+!src/debian/compat
+!src/debian/changelog
+!src/debian/control
+!src/debian/rules
+!src/debian/copyright
+!src/debian/docs
+!src/debian/watch
+!src/debian/source
+!src/debian/source/format
+
+#generic packaging artifacts
+debhelper-build-stamp
+.debhelper
+*.deb
+*.dsc
+*.build
+*.buildinfo
+*.changes
+*.log
+*.substvars
+*.diff.gz
+*.upload
+*.debian.tar.xz

+ 33 - 0
packages/filesystem/mosys/makefile

@@ -0,0 +1,33 @@
+#import all shared make vars
+PRAWNOS_ROOT := $(shell git rev-parse --show-toplevel)
+include $(PRAWNOS_ROOT)/scripts/common.mk
+
+#package specific vars
+VERSION := $(shell cd src/; dpkg-parsechangelog --show-field Version)
+PACKAGE_NAME := mosys_$(VERSION)_armhf
+PACKAGE_NAME_DEB := $(PACKAGE_NAME).deb
+
+PACKAGE_LOCAL_BUILD_DEPS := flashmap
+
+$(PACKAGE_NAME_DEB):
+	$(PRAWNOS_PACKAGE_SCRIPTS_PBUILD_PACKAGE) $(PACKAGE_NAME_DEB) \
+                                            $(PBUILDER_VARS) \
+                                            $(PRAWNOS_LOCAL_APT_VARS) \
+                                            $(PACKAGE_LOCAL_BUILD_DEPS)
+
+.PHONY: clean
+clean:
+	rm -rf *.upload
+	rm -rf *.deb
+	rm -rf *.changes
+	rm -rf *.dsc
+	rm -rf *.build
+	rm -rf *.diff.gz
+	rm -rf *.debian.tar.xz
+	rm -rf *.buildinfo
+
+install:
+	$(PRAWNOS_PACKAGE_SCRIPTS_INSTALL_PACKAGE) $(PACKAGE_NAME_DEB) $(INSTALL_TARGET)
+
+.PHONY: upload
+	$(PRAWNOS_PACKAGE_SCRIPTS_UPLOAD_PACKAGE)

BIN
packages/filesystem/mosys/mosys_69.10895.orig.tar.gz


+ 5 - 0
packages/filesystem/mosys/src/debian/changelog

@@ -0,0 +1,5 @@
+mosys (69.10895) stable; urgency=medium
+
+  * Initial release.
+
+ -- Hal Emmerich <hal@halemmerich.com>  Sun, 14 Jun 2020 15:12:07 -0500

+ 1 - 0
packages/filesystem/mosys/src/debian/compat

@@ -0,0 +1 @@
+10

+ 22 - 0
packages/filesystem/mosys/src/debian/control

@@ -0,0 +1,22 @@
+Source: mosys
+Priority: optional
+Maintainer: Hal Emmerich <hal@halemmerich.com>
+Uploaders: Hal Emmerich <hal@halemmerich.com>
+Build-Depends: debhelper (>= 10),
+               clang,
+               uuid-dev,
+               meson,
+               pkg-config,
+               cmake,
+               libcmocka-dev,
+               cargo,
+               flashmap
+Standards-Version: 4.3.0
+Homepage: https://chromium.googlesource.com/chromiumos/platform/mosys
+Vcs-Browser: https://chromium.googlesource.com/chromiumos/platform/mosys
+Vcs-Git: https://chromium.googlesource.com/chromiumos/platform/mosys
+
+Package: mosys
+Architecture: any
+Depends: flashmap, ${misc:Depends}, ${shlibs:Depends}
+Description: mosys util for use with crosystem from vboot-utils

+ 37 - 0
packages/filesystem/mosys/src/debian/copyright

@@ -0,0 +1,37 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: mosys
+Source: https://chromium.googlesource.com/chromiumos/platform/mosys
+
+Files: *
+Copyright: 2010 Google Inc. All rights reserved.
+
+Files: debian/*
+Copyright: 2020 Hal Emmerich <hal@halemmerich.com>
+License: GPL-2+
+
+License:
+Copyright (c) 2010, Google Inc.
+All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+   * Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+   * Redistributions in binary form must reproduce the above
+     copyright notice, this list of conditions and the following
+     disclaimer in the documentation and/or other materials provided
+     with the distribution.
+   * Neither the name of Google Inc. nor the names of its
+     contributors may be used to endorse or promote products derived
+     from this software without specific prior written permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+ 16 - 0
packages/filesystem/mosys/src/debian/rules

@@ -0,0 +1,16 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+# Use already defined upstream version as DEB_VERSION_UPSTREAM.
+include /usr/share/dpkg/pkg-info.mk
+
+export DH_VERBOSE=1
+
+export DEB_CFLAGS_MAINT_APPEND=-Wno-error
+export CC=clang
+
+%:
+	dh $@
+
+override_dh_auto_configure:
+	dh_auto_configure -- -Darch=arm

+ 12 - 17
packages/filesystem/xsecurelock/makefile

@@ -2,17 +2,18 @@
 PRAWNOS_ROOT := $(shell git rev-parse --show-toplevel)
 include $(PRAWNOS_ROOT)/scripts/common.mk
 
-
+#package specific vars
 VERSION := $(shell cd src/; dpkg-parsechangelog --show-field Version)
 PACKAGE_NAME := xsecurelock_$(VERSION)_armhf
 PACKAGE_NAME_DEB := $(PACKAGE_NAME).deb
 
+PACKAGE_LOCAL_BUILD_DEPS :=
+
 $(PACKAGE_NAME_DEB):
-	@echo Building $@
-	cd src/; pdebuild --configfile $(PBUILDER_RC) \
-                    --buildresult .. \
-                    -- \
-                    --basetgz $(PBUILDER_CHROOT) \
+	$(PRAWNOS_PACKAGE_SCRIPTS_PBUILD_PACKAGE) $(PACKAGE_NAME_DEB) \
+                                            $(PBUILDER_VARS) \
+                                            $(PRAWNOS_LOCAL_APT_VARS) \
+                                            $(PACKAGE_LOCAL_BUILD_DEPS)
 
 .PHONY: clean
 clean:
@@ -21,19 +22,13 @@ clean:
 	rm -rf *.changes
 	rm -rf *.dsc
 	rm -rf *.build
+	rm -rf *.diff.gz
 	rm -rf *.debian.tar.xz
 	rm -rf *.buildinfo
 
-.PHONY: upload
-upload:
-	dput deb.prawnos.com *.changes
-
 install:
-ifndef INSTALL_TARGET
-	$(error INSTALL_TARGET is not set)
-endif
-ifeq ("$(wildcard $(PACKAGE_NAME_DEB))","")
-	$(error $(PACKAGE_NAME_DEB) must be built first)
-endif
-	cp $(PACKAGE_NAME_DEB) $(INSTALL_TARGET)
+	$(PRAWNOS_PACKAGE_SCRIPTS_INSTALL_PACKAGE) $(PACKAGE_NAME_DEB) $(INSTALL_TARGET)
+
+.PHONY: upload
+	$(PRAWNOS_PACKAGE_SCRIPTS_UPLOAD_PACKAGE)
 

+ 2 - 0
resources/BuildResources/pbuilder/hooks/D70update

@@ -0,0 +1,2 @@
+#!/bin/sh
+/usr/bin/apt-get update

+ 1 - 0
scripts/InstallScripts/InstallPackages.sh

@@ -39,6 +39,7 @@ dpkg-reconfigure tzdata
 #Install shared packages
 DEBIAN_FRONTEND=noninteractive apt install -y ${base_debs_download[@]}
 DEBIAN_FRONTEND=noninteractive apt install -y ${mesa_debs_download[@]}
+DEBIAN_FRONTEND=noninteractive apt install -y ${prawnos_debs_prebuilt[@]}
 
 [ "$DE" = "gnome" ] && apt install -y ${gnome_debs_download[@]}
 [ "$DE" = "xfce" ] && apt install -y ${xfce_debs_download[@]}

+ 44 - 0
scripts/PackageScripts/installPackage.sh

@@ -0,0 +1,44 @@
+#!/bin/bash
+
+set -e
+
+# install the target package into the target location
+
+
+# This file is part of PrawnOS (http://www.prawnos.com)
+# Copyright (c) 2018 Hal Emmerich <hal@halemmerich.com>
+
+# PrawnOS is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2
+# as published by the Free Software Foundation.
+
+# PrawnOS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with PrawnOS.  If not, see <https://www.gnu.org/licenses/>.
+
+
+if [ -z "$1" ]
+then
+    echo "No package name supplied"
+    exit 1
+fi
+if [ -z "$2" ]
+then
+    echo "No install location supplied"
+    exit 1
+fi
+
+PACKAGE_NAME=$1
+INSTALL_LOCATION=$2
+
+if [ ! -f "$PACKAGE_NAME" ]; then
+    echo "Error $PACKAGE_NAME must be built first"
+    exit 1
+fi
+
+echo Installing $PACKAGE_NAME to $INSTALL_LOCATION
+cp $PACKAGE_NAME $INSTALL_LOCATION

+ 104 - 0
scripts/PackageScripts/pbuildPackage.sh

@@ -0,0 +1,104 @@
+#!/bin/bash
+
+set -e
+
+# build the supplied package using pbuilder
+# satisfies build dependencies if necessary
+
+
+# This file is part of PrawnOS (http://www.prawnos.com)
+# Copyright (c) 2018 Hal Emmerich <hal@halemmerich.com>
+
+# PrawnOS is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2
+# as published by the Free Software Foundation.
+
+# PrawnOS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with PrawnOS.  If not, see <https://www.gnu.org/licenses/>.
+
+
+if [ -z "$1" ]
+then
+    echo "No package name supplied"
+    exit 1
+fi
+
+if [ -z "$2" ]
+then
+    echo "No pbuilder chroot supplied"
+    exit 1
+fi
+
+if [ -z "$3" ]
+then
+    echo "No pbuilder RC supplied"
+    exit 1
+fi
+
+if [ -z "$4" ]
+then
+    echo "No pbuilder hooks directory supplied"
+    exit 1
+fi
+
+if [ -z "$5" ]
+then
+    echo "No prawnos apt repo directory supplied"
+    exit 1
+fi
+
+if [ -z "$6" ]
+then
+    echo "No prawnos apt repo sources.list line supplied"
+    exit 1
+fi
+
+PACKAGE_NAME=$1
+PBUILDER_CHROOT=$2
+PBUILDER_RC=$3
+PBUILDER_HOOKS=$4
+PRAWNOS_LOCAL_APT_REPO=$5
+PRAWNOS_LOCAL_APT_SOURCE=$6
+
+PACKAGE_DIR=$PWD
+
+# only defined if there are build deps we need to satisfy
+PACKAGE_LOCAL_BUILD_DEPS=$7
+
+
+if [ -z "$PACKAGE_LOCAL_BUILD_DEPS" ]
+then
+	  echo Building $PACKAGE_NAME
+    cd src
+    pdebuild --configfile $PBUILDER_RC \
+                      --buildresult $PACKAGE_DIR \
+                      -- \
+                      --basetgz $PBUILDER_CHROOT
+
+else
+	  echo Satisfying local build deps for $PACKAGE_NAME
+	  for dep in $PACKAGE_LOCAL_BUILD_DEPS ; do \
+		    make build_package BUILD_PACKAGE=$dep -C .. ; \
+	      done
+	  cd $PRAWNOS_LOCAL_APT_REPO && dpkg-scanpackages . /dev/null > Packages
+	  echo $PACKAGE_NAME build deps satisfied
+    cd $PACKAGE_DIR
+	  echo Building $PACKAGE_NAME
+	  cd src
+    pdebuild --configfile $PBUILDER_RC \
+                      --buildresult $PACKAGE_DIR \
+                      -- \
+                      --override-config \
+                      --basetgz $PBUILDER_CHROOT \
+                      --hookdir $PBUILDER_HOOKS \
+                      --bindmounts $PRAWNOS_LOCAL_APT_REPO \
+                      --othermirror "$PRAWNOS_LOCAL_APT_SOURCE"
+fi
+
+mkdir -p $PRAWNOS_LOCAL_APT_REPO
+cp $PACKAGE_DIR/$PACKAGE_NAME $PRAWNOS_LOCAL_APT_REPO

+ 24 - 0
scripts/PackageScripts/uploadPackage.sh

@@ -0,0 +1,24 @@
+#!/bin/bash
+
+set -e
+
+# upload the target package to the official prawnos apt repo
+# (of course this will only work if you can authenticate with the repo)
+
+# This file is part of PrawnOS (http://www.prawnos.com)
+# Copyright (c) 2018 Hal Emmerich <hal@halemmerich.com>
+
+# PrawnOS is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2
+# as published by the Free Software Foundation.
+
+# PrawnOS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with PrawnOS.  If not, see <https://www.gnu.org/licenses/>.
+
+
+dput deb.prawnos.com *.changes

+ 14 - 17
scripts/buildFilesystem.sh

@@ -46,9 +46,15 @@ then
     echo "No base file system image filename supplied"
     exit 1
 fi
+if [ -z "$4" ]
+then
+    echo "No prawnos_root path supplied"
+    exit 1
+fi
 KVER=$1
 DEBIAN_SUITE=$2
 BASE=$3
+PRAWNOS_ROOT=$4
 
 outmnt=$(mktemp -d -p `pwd`)
 
@@ -62,13 +68,6 @@ package_lists=$script_resources/package_lists.sh
 # Import the package lists
 source $package_lists
 
-#HACK XSECURELOCK our usage of stable and unstable packages has caught up to us. We end up carrying conflicting files if
-# we grab build-essential from stable and xsecurelock from unstable. This was fixed by grabbing build-essential from
-# unstable as well, but that conflicts with some of the gnome packages it seems. Luckily, we can now build xsecurelock
-# for buster instead of grabbing it from unstable.
-# I'm rethinking the build system to make (heh) this more elegant, but for now to get the build fixed I'll implement this
-XSECURELOCK_PATH=packages/filesystem/xsecurelock
-
 
 #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
@@ -163,7 +162,7 @@ fi
 # install Debian on it
 export DEBIAN_FRONTEND=noninteractive
 # need ca-certs, gnupg, openssl to handle https apt links and key adding for deb.prawnos.com
-qemu-debootstrap --arch armhf $DEBIAN_SUITE --include  openssl,ca-certificates,gnupg,locales,init --keyring=$build_resources/debian-archive-keyring.gpg $outmnt $PRAWNOS_DEBOOTSTRAP_MIRROR
+qemu-debootstrap --arch armhf $DEBIAN_SUITE --include  openssl,ca-certificates,gnupg,locales,init --keyring=$build_resources/debian-archive-keyring.gpg $outmnt $PRAWNOS_DEBOOTSTRAP_MIRROR --cache-dir=$PRAWNOS_ROOT/build/apt-cache/
 chroot $outmnt passwd -d root
 
 
@@ -222,8 +221,9 @@ chroot $outmnt apt update
 chroot $outmnt apt install -y ${base_debs_install[@]}
 
 #build and install crossystem/mosys, funky way to call the bash function inside the chroot
-export -f build_install_crossystem
-chroot $outmnt /bin/bash -ec "build_install_crossystem"
+# TODO!! UNCOMMENT!
+# export -f build_install_crossystem
+# chroot $outmnt /bin/bash -ec "build_install_crossystem"
 
 #add the live-boot fstab
 cp -f $build_resources/external_fstab $outmnt/etc/fstab
@@ -244,13 +244,10 @@ chroot $outmnt apt install -y libinput-tools xdotool build-essential
 # apt install ./local-package.deb alone doesn't work because apt will resort to downloading it from deb.prawnos.com, which we dont want
 # copy into /var/cache/apt/archives to place it in the cache
 #next call apt install -d on the ./filename or on the package name and apt will recognize it already has the package cached, so will only cache the dependencies
-#HACK XSECURELOCK
-PRAWN_ROOT=$(pwd)
-cd $XSECURELOCK_PATH && make
-cd $PRAWN_ROOT
-#TODO: replace with cd packages && make install $outmnt/var/cache/apt/archives/
-cp $XSECURELOCK_PATH/xsecurelock_*_armhf.deb $outmnt/var/cache/apt/archives/
-chroot $outmnt apt install -y -d xsecurelock
+
+#Copy the built prawnos debs over to the image, and update apts cache
+cd $PRAWNOS_ROOT && make packages_install INSTALL_TARGET=$outmnt/var/cache/apt/archives/
+chroot $outmnt apt install -y -d ${prawnos_debs_prebuilt_download[@]}
 
 #Download the shared packages to be installed by Install.sh:
 chroot $outmnt apt-get install -y -d ${base_debs_download[@]}

+ 18 - 2
scripts/common.mk

@@ -3,9 +3,25 @@ COMMON_MK := 1
 
 #Place all shared make vars below
 #=========================================================================================
-PBUILDER_CHROOT := $(PRAWNOS_ROOT)/build/prawnos-pbuilder-armhf-base.tgz
-PBUILDER_RC := $(PRAWNOS_ROOT)/resources/BuildResources/pbuilder/prawnos-pbuilder.rc
+PRAWNOS_BUILD := $(PRAWNOS_ROOT)/build
+PRAWNOS_LOCAL_APT_REPO := $(PRAWNOS_BUILD)/prawnos-local-apt-repo
+PRAWNOS_LOCAL_APT_SOURCE := "deb [trusted=yes] file://$(PRAWNOS_LOCAL_APT_REPO) ./"
+
+PRAWNOS_SCRIPTS := $(PRAWNOS_ROOT)/scripts
+PRAWNOS_PACKAGE_SCRIPTS := $(PRAWNOS_SCRIPTS)/PackageScripts
+PRAWNOS_PACKAGE_SCRIPTS_INSTALL_PACKAGE := $(PRAWNOS_SCRIPTS)/PackageScripts/installPackage.sh
+PRAWNOS_PACKAGE_SCRIPTS_PBUILD_PACKAGE := $(PRAWNOS_SCRIPTS)/PackageScripts/pbuildPackage.sh
+PRAWNOS_PACKAGE_SCRIPTS_UPLOAD_PACKAGE := $(PRAWNOS_SCRIPTS)/PackageScripts/uploadPackage.sh
+
+PBUILDER_DIR := $(PRAWNOS_ROOT)/resources/BuildResources/pbuilder
+PBUILDER_CHROOT := $(PRAWNOS_BUILD)/prawnos-pbuilder-armhf-base.tgz
+PBUILDER_RC := $(PBUILDER_DIR)/prawnos-pbuilder.rc
+PBUILDER_HOOKS := $(PBUILDER_DIR)/hooks
+
+PBUILDER_VARS := $(PBUILDER_CHROOT) $(PBUILDER_RC) $(PBUILDER_HOOKS)
+PRAWNOS_LOCAL_APT_VARS := $(PRAWNOS_LOCAL_APT_REPO) $(PRAWNOS_LOCAL_APT_SOURCE)
 # Otherwise errors are ignored when output is piped to tee:
 SHELL := /bin/bash -o pipefail
+
 #=========================================================================================
 endif # COMMON_MK

+ 9 - 0
scripts/package_lists.sh

@@ -163,4 +163,13 @@ gnome_debs_download=(
     seahorse
 )
 
+prawnos_debs_prebuilt_download=(
+    font-source-code-pro
+    xsecurelock
+)
+
+prawnos_debs_prebuilt_install=(
+    flashmap
+)
+
 # ====================================== END Package Lists =======================================