Inital rework/reorganization

more to do
This commit is contained in:
Hal Emmerich 2020-06-21 02:28:45 -05:00
parent ed31f39058
commit 4d4145f16f
78 changed files with 290 additions and 389 deletions

8
filesystem/makefile Normal file
View File

@ -0,0 +1,8 @@
filesystem_packages:
$(MAKE) -C packages all
filesystem_packages_clean:
$(MAKE) -C packages clean
filesystem_packages_install:
$(MAKE) -C packages INSTALL_TARGET=$(INSTALL_TARGET) install

20
initramfs/makefile Normal file
View File

@ -0,0 +1,20 @@
ifndef INITRAMFS_MK
INITRAMFS_MK := 1
ifndef PRAWNOS_ROOT
PRAWNOS_ROOT := $(shell git rev-parse --show-toplevel)
endif
include $(PRAWNOS_ROOT)/scripts/BuildScripts/BuildCommon.mk
INITRAMFS_RESOURCES := $(PRAWNOS_PACKAGE_INITRAMFS)/resources
.PHONY: initramfs initramfs_clean
initramfs: $(PRAWNOS_INITRAMFS)
initramfs_clean:
rm -f $(PRAWNOS_INITRAMFS)
$(PRAWNOS_INITRAMFS):
$(PRAWNOS_INITRAMFS_SCRIPTS_BUILD) $(PRAWNOS_IMAGE_BASE) $(INITRAMFS_RESOURCES) $(PRAWNOS_BUILD)
endif

90
kernel/makefile Normal file
View File

@ -0,0 +1,90 @@
ifndef KERNEL_MK
KERNEL_MK := 1
ifndef PRAWNOS_ROOT
PRAWNOS_ROOT := $(shell git rev-parse --show-toplevel)
endif
include $(PRAWNOS_ROOT)/scripts/BuildScripts/BuildCommon.mk
KERNEL_PATCHED := $(PRAWNOS_KERNEL_BUILD)/.kernel_patched
KERNEL_EXTRACTED := $(PRAWNOS_KERNEL_BUILD)/.kernel_extracted
ATH9K_EXTRACTED := $(PRAWNOS_ATH9K_BUILD)/.ath9k_extracted
KERNEL_RESOURCES := $(PRAWNOS_KERNEL)/resources
KERNEL_SOURCES := $(PRAWNOS_KERNEL)/sources
KERNEL_PATCHES := $(PRAWNOS_KERNEL)/patches
KERNEL_TAR := $(KERNEL_SOURCES)/linux-libre-$(KVER)-gnu.tar.lz
KERNEL_TAR_SIGNATURE := $(KERNEL_TAR).sign
KERNEL_BUILT := $(PRAWNOS_KERNEL_BUILD)/vmlinux.kpart
ATH9K_TAR := $(KERNEL_SOURCES)/open-ath9k-htc-firmware.tar.gz
ATH9K := open-ath9k-htc-firmware
### PHONY TARGETS
.PHONY: kernel
kernel: $(KERNEL_BUILT)
.PHONY: ath9k
ath9k: extract_ath9k
$(PRAWNOS_KERNEL_SCRIPTS_BUILD_ATH9K) $(PRAWNOS_ATH9K_BUILD)
.PHONY: patch_kernel
patch_kernel: $(KERNEL_PATCHED)
.PHONY: extract_kernel
extract_kernel: $(KERNEL_EXTRACTED)
.PHONY: extract_ath9k
extract_ath9k: $(ATH9K_EXTRACTED)
.PHONY: package_kernel
packages: kernel
@echo TODO
### CLEAN TARGETS
.PHONY: clean_kernel
clean_kernel:
rm -rf $(PRAWNOS_KERNEL_BUILD)
.PHONY: clean_ath9k
clean_ath9k:
rm -rf $(PRAWNOS_ATH9K_BUILD)
### DEVELOPER TARGETS
.PHONY: update_ath9k_tar
update_ath9k_tar:
mkdir -p tmp/$(ATH9K)
git clone --depth 1 https://github.com/qca/open-ath9k-htc-firmware.git tmp/$(ATH9K)
cd tmp && tar czvf $(ATH9K_SOURCE) $(ATH9K)
rm -rf tmp/
.PHONY: update_kernel_tar
update_kernel_tar:
wget https://www.linux-libre.fsfla.org/pub/linux-libre/releases/$(KVER)-gnu/linux-libre-$(KVER)-gnu.tar.lz -O $(KERNEL_TAR)
wget https://www.linux-libre.fsfla.org/pub/linux-libre/releases/$KVER-gnu/linux-libre-$(KVER)-gnu.tar.lz.sign -O $(KERNEL_TAR_SIGNATURE)
### REAL TARGETS
$(KERNEL_EXTRACTED): $(PRAWNOS_BUILD)
gpg --import $(KERNEL_RESOURCES)/linux-libre-signing-key.gpg
gpg --verify $(KERNEL_TAR_SIGNATURE) $(KERNEL_TAR)
tar --lzip -xvf $(KERNEL_TAR) -C $(PRAWNOS_BUILD)
touch $(KERNEL_EXTRACTED)
$(ATH9K_EXTRACTED): $(PRAWNOS_BUILD)
tar -xvf $(ATH9K_TAR) -C $(PRAWNOS_BUILD)
touch $(ATH9K_EXTRACTED)
$(KERNEL_PATCHED): $(KERNEL_EXTRACTED)
@echo $(PRAWNOS_KERNEL_BUILD)
$(PRAWNOS_KERNEL_SCRIPTS_PATCH) $(KVER) $(KERNEL_PATCHES) $(PRAWNOS_KERNEL_BUILD)
touch $(KERNEL_PATCHED)
$(KERNEL_BUILT): $(KERNEL_EXTRACTED) $(KERNEL_PATCHED) ath9k
make -C $(PRAWNOS_INITRAMFS)
$(PRAWNOS_KERNEL_SCRIPTS_BUILD) $(KVER) $(KERNEL_RESOURCES) $(PRAWNOS_KERNEL_BUILD) $(PRAWNOS_INITRAMFS_IMAGE)
endif

Binary file not shown.

101
makefile
View File

@ -13,23 +13,15 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with PrawnOS. If not, see <https://www.gnu.org/licenses/>. # along with PrawnOS. If not, see <https://www.gnu.org/licenses/>.
KVER=5.4.29 .DEFAULT_GOAL := image
ifeq ($(DEBIAN_SUITE),)
DEBIAN_SUITE=buster
endif
ifeq ($(PRAWNOS_SUITE),)
PRAWNOS_SUITE=Shiba
endif
OUTNAME=PrawnOS-$(PRAWNOS_SUITE)-c201.img
BASE=$(OUTNAME)-BASE
PRAWNOS_ROOT := $(shell git rev-parse --show-toplevel) PRAWNOS_ROOT := $(shell git rev-parse --show-toplevel)
include $(PRAWNOS_ROOT)/scripts/BuildScripts/BuildCommon.mk include $(PRAWNOS_ROOT)/scripts/BuildScripts/BuildCommon.mk
include $(PRAWNOS_ROOT)/initramfs/makefile
include $(PRAWNOS_ROOT)/kernel/makefile
#Usage: #Usage:
#run make image #run make image
#this will generate two images named OUTNAME and OUTNAME-BASE #this will generate two images named PRAWNOS_IMAGE and PRAWNOS_IMAGE-BASE
#-BASE is only the filesystem with no kernel. #-BASE is only the filesystem with no kernel.
@ -41,79 +33,34 @@ include $(PRAWNOS_ROOT)/scripts/BuildScripts/BuildCommon.mk
.PHONY: clean .PHONY: clean
clean: clean:
@echo "Enter one of:" @echo "Enter one of:"
@echo " clean_kernel - which deletes the untar'd kernel folder from build" #TODO
@echo " clean_ath - which deletes the untar'd ath9k driver folder from build"
@echo " clean_img - which deletes the built PrawnOS image, this is ran when make image is ran"
@echo " clean_basefs - which deletes the built PrawnOS base image"
@echo " clean_initramfs - which deletes the built PrawnOS initramfs image that gets injected into the kernel"
@echo " clean_all - which does all of the above"
@echo " in most cases none of these need to be used manually as most cleanup steps are handled automatically"
.PHONY: clean_kernel .PHONY: clean_image
clean_kernel:
rm -rf build/linux-$(KVER)
.PHONY: clean_ath
clean_ath:
rm -rf build/open-ath9k-htc-firmware
.PHONY: clean_img
clean_img: clean_img:
rm -f $(OUTNAME) rm -f $(PRAWNOS_IMAGE)
.PHONY: clean_basefs .PHONY: clean_basefs
clean_basefs: clean_basefs:
rm -r $(BASE) rm -f $(PRAWNOS_IMAGE_BASE)
.PHONY: clean_initramfs
clean_initramfs:
rm -r build/PrawnOS-initramfs.cpio.gz
.PHONY: clean_packages
clean_packages:
cd packages && $(MAKE) clean
.PHONY: clean_pbuilder .PHONY: clean_pbuilder
clean_pbuilder: clean_pbuilder:
rm -r build/prawnos-pbuilder-armhf-base.tgz rm -r build/prawnos-pbuilder-armhf-base.tgz
.PHONY: clean_all .PHONY: clean_all
clean_all: clean_all: clean_kernel clean_initramfs clean_ath9k clean_image clean_basefs clean_pbuilder
$(MAKE) clean_kernel
$(MAKE) clean_ath
$(MAKE) clean_img
$(MAKE) clean_basefs
$(MAKE) clean_initramfs
$(MAKE) clean_pbuilder
$(MAKE) clean_packages
#:::::::::::::::::::::::::::::: premake prep :::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::: premake prep ::::::::::::::::::::::::::::::
.PHONY: build_dirs .PHONY: build_dirs
build_dirs: build_dirs: $(PRAWNOS_BUILD)
mkdir -p build/logs/
mkdir -p build/apt-cache/
#:::::::::::::::::::::::::::::: kernel :::::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::: kernel ::::::::::::::::::::::::::::::::::::
.PHONY: kernel #included from kernel/makefile
kernel:
$(MAKE) build_dirs
rm -rf build/logs/kernel-log.txt
$(PRAWNOS_KERNEL_SCRIPTS_BUILD) $(KVER) 2>&1 | tee build/logs/kernel-log.txt
.PHONY: kernel_config
kernel_config:
$(PRAWNOS_KERNEL_SCRIPTS_MENUCONFIG) $(KVER)
.PHONY: patch_kernel
patch_kernel:
$(PRAWNOS_KERNEL_SCRIPTS_PATCH)
#:::::::::::::::::::::::::::::: initramfs ::::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::: initramfs :::::::::::::::::::::::::::::::::
.PHONY: initramfs #included from initramfs/makefile
initramfs:
$(MAKE) build_dirs
rm -rf build/logs/initramfs-log.txt
$(PRAWNOS_INITRAMFS_SCRIPTS_BUILD) $(BASE) 2>&1 | tee build/logs/initramfs-log.txt
#:::::::::::::::::::::::::::::: filesystem :::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::: filesystem ::::::::::::::::::::::::::::::::
#makes the base filesystem image without kernel. Only make a new one if the base image isnt present #makes the base filesystem image without kernel. Only make a new one if the base image isnt present
@ -122,33 +69,33 @@ filesystem:
$(MAKE) build_dirs $(MAKE) build_dirs
rm -rf build/logs/fs-log.txt rm -rf build/logs/fs-log.txt
$(MAKE) pbuilder_create $(MAKE) pbuilder_create
$(MAKE) packages $(MAKE) filesystem_packages
[ -f $(BASE) ] || $(PRAWNOS_FILESYSTEM_SCRIPTS_BUILD) $(KVER) $(DEBIAN_SUITE) $(BASE) $(PRAWNOS_ROOT) $(PRAWNOS_SHARED_SCRIPTS) 2>&1 | tee build/logs/fs-log.txt [ -f $(PRAWNOS_IMAGE_BASE) ] || $(PRAWNOS_FILESYSTEM_SCRIPTS_BUILD) $(KVER) $(DEBIAN_SUITE) $(PRAWNOS_IMAGE_BASE) $(PRAWNOS_ROOT) $(PRAWNOS_SHARED_SCRIPTS) 2>&1 | tee build/logs/fs-log.txt
#:::::::::::::::::::::::::::::: packages :::::::::::::::::::::::::::::::: #:::::::::::::::::::::::::::::: packages ::::::::::::::::::::::::::::::::
.PHONY: packages .PHONY: filesystem_packages
packages: filesystem_packages:
cd packages && $(MAKE) $(MAKE) filesystem_packages -C packages
.PHONY: packages_install .PHONY: filesystem_packages_install
packages_install: filesystem_packages_install:
ifndef INSTALL_TARGET ifndef INSTALL_TARGET
$(error INSTALL_TARGET is not set) $(error INSTALL_TARGET is not set)
endif endif
cd packages && $(MAKE) install INSTALL_TARGET=$(INSTALL_TARGET) $(MAKE) filesystem_packages_install INSTALL_TARGET=$(INSTALL_TARGET) -C filesystem
#:::::::::::::::::::::::::::::: image management :::::::::::::::::::::::::: #:::::::::::::::::::::::::::::: image management ::::::::::::::::::::::::::
.PHONY: kernel_install .PHONY: kernel_install
kernel_inject: #Targets an already built .img and swaps the old kernel with the newly compiled kernel kernel_inject: #Targets an already built .img and swaps the old kernel with the newly compiled kernel
$(PRAWNOS_IMAGE_SCRIPTS_INSTALL_KERNEL) $(KVER) $(OUTNAME) $(PRAWNOS_IMAGE_SCRIPTS_INSTALL_KERNEL) $(KVER) $(PRAWNOS_IMAGE)
.PHONY: kernel_update .PHONY: kernel_update
kernel_update: kernel_update:
$(MAKE) clean_img $(MAKE) clean_img
$(MAKE) initramfs $(MAKE) initramfs
$(MAKE) kernel $(MAKE) kernel
cp $(BASE) $(OUTNAME) cp $(PRAWNOS_IMAGE_BASE) $(PRAWNOS_IMAGE)
$(MAKE) kernel_install $(MAKE) kernel_install
.PHONY: image .PHONY: image
@ -157,7 +104,7 @@ image:
$(MAKE) filesystem $(MAKE) filesystem
$(MAKE) initramfs $(MAKE) initramfs
$(MAKE) kernel $(MAKE) kernel
cp $(BASE) $(OUTNAME) cp $(PRAWNOS_IMAGE_BASE) $(PRAWNOS_IMAGE)
$(MAKE) kernel_install $(MAKE) kernel_install
#:::::::::::::::::::::::::::::: pbuilder management ::::::::::::::::::::::: #:::::::::::::::::::::::::::::: pbuilder management :::::::::::::::::::::::

View File

@ -1,13 +0,0 @@
PRAWNOS_ROOT := $(shell git rev-parse --show-toplevel)
include $(PRAWNOS_ROOT)/scripts/BuildScripts/BuildCommon.mk
all:
@echo TODO
clean:
@echo TODO
install:
@echo TODO

View File

@ -1,13 +0,0 @@
PRAWNOS_ROOT := $(shell git rev-parse --show-toplevel)
include $(PRAWNOS_ROOT)/scripts/common.mk
all:
@echo TODO
clean:
@echo TODO
install:
@echo TODO

View File

@ -1,22 +0,0 @@
PRAWNOS_ROOT := $(shell git rev-parse --show-toplevel)
include $(PRAWNOS_ROOT)/scripts/BuildScripts/BuildCommon.mk
SUBDIRS = $(shell ls -d */)
all:
for dir in $(SUBDIRS) ; do \
make -C $$dir ; \
done
clean:
for dir in $(SUBDIRS) ; do \
make clean -C $$dir ; \
done
install:
$(info packages install target is $(INSTALL_TARGET))
for dir in $(SUBDIRS) ; do \
make install INSTALL_TARGET=$(INSTALL_TARGET) -C $$dir ; \
done

View File

@ -1,56 +0,0 @@
## PrawnOS Packaging
All programs, themes, etc that are not part of upstream debian are built as packages
this allows PrawnOS the following benefits:
- the PrawnOS apt repo is not a build dependency
- test builds don't require any special steps-- just make the change locally and rebuild the filesystem
- a user doesn't have to trust the PrawnOS apt repo to build their own image
- the PrawnOS apt repo requires less bandwidth, as only package updates will be gotten from it
Note that some packages that are available upstream, but only in unstable or testing repos or have
fixes only in the unstable or testing repos are packaged as part of PrawnOS
### Updating Packages
By using packages for all parts of PrawnOS, updates are more straightforward.
When an existing PrawnOS install has out of date packages, the user can then either
build the new version themselves or get the update from the repo using the standard "apt upgrade"
### Package folder structure
Packages are stored under component of the final PrawnOS image they belong to
Inside the package folder there are the following items:
- `makefile`
- source folder called `src`
- a `.orig.tar.gz*` containing the package source.
- a `.gitignore` to avoid commiting build artifacts, or unnecessary source files
The contents of the `src` are the following:
- a `debian` folder
- the source files if the package is not packages upstream (by debian)
- the patched source files if there are any PrawnOS specific patches. This is to keep the changes tracked by git.
If the source is from an upstream package, and no PrawnOS specific patches are carried then only the `debian` folder is in the `src` folder
### Building packages
Most packages are built in a host architecture agnostic fashion using pbuilder.
The only notable exceptions to this are font packages, which are not architecture dependent and
the kernel package, which handles cross compilation manually without a chroot.
To build any package, navigate to that packages folder and run
```
make clean
make
```
the resulting .deb will be in that same folder when the build is complete
All packages can be built by running
```
make
```
from the packages directory
### Uploading packages
New packages, and package updates can upload to `deb.prawnos.com` by maintainers
first by building and then running
```
make upload
```

View File

@ -1,142 +0,0 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.9 (GNU/Linux)
mQGiBEh9qqURBACKo3J5VyGBgApcm4QddrLyoS3Sxt+aUX1CQ5t8X8Ue2tXypHOR
jzXRyKiBeAc/yIuLStyE05P0DVQTe6fXZyDIGZbw8Gc6kdzT+wtWmQHQbPLcXV3s
T/7ZDbRg2ShmSleJUNgWABLIKNk8iKGfgMKrzHiUeeLKzr6elf+hYYNMfwCgrQal
gQ/DPIlVjjmJvdnZOYN8ZC0D/3JEoAOFRFtmkufS5q17JMjL0XjDL7HANJc1/hQo
Ap6OckhX6T7o2Pn1QJIJoQAR3fjIqYX/QQn6y+S2PrRtrX0fRqHNGHY/QyjWgdfq
I7lw6H7a7a77O2sD0MfkLWqAU6PQp8xYEQFDwdDXgggmFUEhikWWbNJU/pNialhY
hNypA/wPCAkz47/36RYPL79nZY/p6iCW+tfUtrM5RmkTZ5lqVKxaWv96WppHwoyp
MWk66gkm/EK58zKZASpvh1a5nQ2niWHcazn2TfRfgBgBfFiyaHNgzb6eDwWcIMHF
VglngbUL5hwmBkWVkg2GxSkMk26OCFhrxF59Ibmkf2YxQBXem7Q9bGludXgtbGli
cmUgKEFsZXhhbmRyZSBPbGl2YSkgPGxpbnV4LWxpYnJlK2x4b2xpdmFAZnNmbGEu
b3JnPohgBBMRAgAgBQJIfaqlAhsDBgsJCAcDAgQVAggDBBYCAwECHgECF4AAC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0RB5jjjibljY1gvezRZekRA
REQEREBERAXOenhqW5Zow8cL7x9V0RByp6WGlaRDGGhxudb3XVEQEREBERAREQER
EBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBER
AREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQEREBERAREQf/2YhgBBMR
AgAgBQJMCX7tAhsDBgsJCAcDAgQVAggDBBYCAwECHgECF4AACgkQvLfPh359R6dA
rgCgm6oaTjZw81cHYJCDbRqmgvPnVwUAmgORBOiTA8uJEZjLnW4nCuwr5hPiiEYE
EBECAAYFAkwJf6IACgkQUjSEXfK5IPUN9ACeIxFILNIr1mgEVvssa9hPiS4rytMA
oMCEApLI1XtbOqg/CkaB1lj/Fqq0iF4EEBEIAAYFAkwJhYAACgkQIr13u1gr1/DP
NwD/fBDFJ9RDH/0OnfX7TQtMajowS07v8ZhMZGS8RiG0wxUBAMpk4sBenTzlKVG3
7+1hts8o+2910W8DnrfsUKZTMKP6
=JkKR
-----END PGP PUBLIC KEY BLOCK-----

View File

@ -3,10 +3,38 @@ BUILD_COMMON_MK := 1
#Place all shared make vars below #Place all shared make vars below
#========================================================================================= #=========================================================================================
### MISC GLOBALS
KVER=5.4.29
# Otherwise errors are ignored when output is piped to tee:
SHELL := /bin/bash -o pipefail
### PRAWNOS CORE DIRECTORIES
PRAWNOS_BUILD := $(PRAWNOS_ROOT)/build PRAWNOS_BUILD := $(PRAWNOS_ROOT)/build
PRAWNOS_SCRIPTS := $(PRAWNOS_ROOT)/scripts PRAWNOS_SCRIPTS := $(PRAWNOS_ROOT)/scripts
PRAWNOS_KERNEL := $(PRAWNOS_ROOT)/kernel
PRAWNOS_INITRAMFS := $(PRAWNOS_ROOT)/initramfs
PRAWNOS_FILESYSTEM := $(PRAWNOS_ROOT)/filesystem
### BUILD DIRS
PRAWNOS_BUILD_LOGS := $(PRAWNOS_BUILD)/logs
PRAWNOS_BUILD_APT_CACHE := $(PRAWNOS_BUILD)/apt-cache
### PRAWNOS IMAGES
ifeq ($(DEBIAN_SUITE),)
DEBIAN_SUITE := buster
endif
ifeq ($(PRAWNOS_SUITE),)
PRAWNOS_SUITE := Shiba
endif
PRAWNOS_IMAGE := PrawnOS-$(PRAWNOS_SUITE)-c201.img
PRAWNOS_IMAGE_BASE := $(OUTNAME)-BASE
### BUILD SCRIPTS ### BUILD SCRIPTS
PRAWNOS_BUILD_SCRIPTS := $(PRAWNOS_SCRIPTS)/BuildScripts PRAWNOS_BUILD_SCRIPTS := $(PRAWNOS_SCRIPTS)/BuildScripts
@ -17,6 +45,7 @@ PRAWNOS_KERNEL_SCRIPTS := $(PRAWNOS_BUILD_SCRIPTS)/KernelScripts
PRAWNOS_KERNEL_SCRIPTS_BUILD := $(PRAWNOS_KERNEL_SCRIPTS)/buildKernel.sh PRAWNOS_KERNEL_SCRIPTS_BUILD := $(PRAWNOS_KERNEL_SCRIPTS)/buildKernel.sh
PRAWNOS_KERNEL_SCRIPTS_MENUCONFIG := $(PRAWNOS_KERNEL_SCRIPTS)/crossMenuConfig.sh PRAWNOS_KERNEL_SCRIPTS_MENUCONFIG := $(PRAWNOS_KERNEL_SCRIPTS)/crossMenuConfig.sh
PRAWNOS_KERNEL_SCRIPTS_PATCH := $(PRAWNOS_KERNEL_SCRIPTS)/patchKernel.sh PRAWNOS_KERNEL_SCRIPTS_PATCH := $(PRAWNOS_KERNEL_SCRIPTS)/patchKernel.sh
PRAWNOS_KERNEL_SCRIPTS_BUILD_ATH9K := $(PRAWNOS_KERNEL_SCRIPTS)/buildAth9k.sh
PRAWNOS_IMAGE_SCRIPTS := $(PRAWNOS_BUILD_SCRIPTS)/ImageScripts PRAWNOS_IMAGE_SCRIPTS := $(PRAWNOS_BUILD_SCRIPTS)/ImageScripts
PRAWNOS_IMAGE_SCRIPTS_INSTALL_KERNEL := $(PRAWNOS_IMAGE_SCRIPTS)/installKernelToFs.sh PRAWNOS_IMAGE_SCRIPTS_INSTALL_KERNEL := $(PRAWNOS_IMAGE_SCRIPTS)/installKernelToFs.sh
@ -29,11 +58,9 @@ PRAWNOS_PACKAGE_SCRIPTS_INSTALL := $(PRAWNOS_PACKAGE_SCRIPTS)/installPackage.sh
PRAWNOS_PACKAGE_SCRIPTS_PBUILD := $(PRAWNOS_PACKAGE_SCRIPTS)/pbuildPackage.sh PRAWNOS_PACKAGE_SCRIPTS_PBUILD := $(PRAWNOS_PACKAGE_SCRIPTS)/pbuildPackage.sh
PRAWNOS_PACKAGE_SCRIPTS_UPLOAD := $(PRAWNOS_PACKAGE_SCRIPTS)/uploadPackage.sh PRAWNOS_PACKAGE_SCRIPTS_UPLOAD := $(PRAWNOS_PACKAGE_SCRIPTS)/uploadPackage.sh
### INSTALL SCRIPTS ### INSTALL SCRIPTS
PRAWNOS_INSTALL_SCRIPTS := $(PRAWNOS_SCRIPTS)/InstallScripts PRAWNOS_INSTALL_SCRIPTS := $(PRAWNOS_SCRIPTS)/InstallScripts
### SHARED SCRIPTS ### SHARED SCRIPTS
PRAWNOS_SHARED_SCRIPTS := $(PRAWNOS_SCRIPTS)/Shared PRAWNOS_SHARED_SCRIPTS := $(PRAWNOS_SCRIPTS)/Shared
@ -47,16 +74,34 @@ PBUILDER_HOOKS := $(PBUILDER_DIR)/hooks
PBUILDER_VARS := $(PBUILDER_CHROOT) $(PBUILDER_RC) $(PBUILDER_HOOKS) PBUILDER_VARS := $(PBUILDER_CHROOT) $(PBUILDER_RC) $(PBUILDER_HOOKS)
### LOCAL APT RESOURCES ### LOCAL APT RESOURCES
PRAWNOS_LOCAL_APT_REPO := $(PRAWNOS_BUILD)/prawnos-local-apt-repo PRAWNOS_LOCAL_APT_REPO := $(PRAWNOS_BUILD)/prawnos-local-apt-repo
PRAWNOS_LOCAL_APT_SOURCE := "deb [trusted=yes] file://$(PRAWNOS_LOCAL_APT_REPO) ./" PRAWNOS_LOCAL_APT_SOURCE := "deb [trusted=yes] file://$(PRAWNOS_LOCAL_APT_REPO) ./"
PRAWNOS_LOCAL_APT_VARS := $(PRAWNOS_LOCAL_APT_REPO) $(PRAWNOS_LOCAL_APT_SOURCE) PRAWNOS_LOCAL_APT_VARS := $(PRAWNOS_LOCAL_APT_REPO) $(PRAWNOS_LOCAL_APT_SOURCE)
### MISC GLOBALS ### KERNEL
# Otherwise errors are ignored when output is piped to tee: PRAWNOS_KERNEL_BUILD := $(PRAWNOS_BUILD)/linux-$(KVER)
SHELL := /bin/bash -o pipefail
### INITRAMFS
PRAWNOS_INITRAMFS_IMAGE := $(PRAWNOS_BUILD)/PrawnOS-initramfs.cpio.gz
### ATH9K
PRAWNOS_ATH9K_BUILD := $(PRAWNOS_BUILD)/open-ath9k-htc-firmware
#========================================================================================= #=========================================================================================
#Place all shared make rules below
#=========================================================================================
$(PRAWNOS_BUILD): $(PRAWNOS_BUILD_LOGS) $(PRAWNOS_BUILD_APT_CACHE)
$(PRAWNOS_BUILD_LOGS):
mkdir -p $(PRAWNOS_BUILD_LOGS)
$(PRAWNOS_BUILD_APT_CACHE):
mkdir -p $(PRAWNOS_BUILD_APT_CACHE)
#=========================================================================================
endif # BUILD_COMMON_MK endif # BUILD_COMMON_MK

View File

@ -22,18 +22,29 @@ set -e
# along with PrawnOS. If not, see <https://www.gnu.org/licenses/>. # along with PrawnOS. If not, see <https://www.gnu.org/licenses/>.
outmnt=$(mktemp -d -p "$(pwd)")
outdev=/dev/loop7
if [ -z "$1" ] if [ -z "$1" ]
then then
echo "No base file system image filename supplied" echo "No base file system image supplied"
exit 1
fi
if [ -z "$2" ]
then
echo "No initramfs resources dir supplied"
exit 1
fi
if [ -z "$3" ]
then
echo "No output location supplied"
exit 1 exit 1
fi fi
BASE=$1 BASE=$1
ROOT_DIR="$(pwd)" RESOURCES=$2
build_resources=$ROOT_DIR/resources/BuildResources OUT_DIR=$3
if [ ! -f $ROOT_DIR/$BASE ] outmnt=$(mktemp -d -p "$(pwd)")
outdev=/dev/loop7
if [ ! -f $BASE ]
then then
echo "No base filesystem, run 'make filesystem' first" echo "No base filesystem, run 'make filesystem' first"
exit 1 exit 1
@ -59,7 +70,7 @@ trap cleanup INT TERM EXIT
[ ! -d build ] && mkdir build [ ! -d build ] && mkdir build
losetup -P $outdev $ROOT_DIR/$BASE losetup -P $outdev $$BASE
#mount the root filesystem #mount the root filesystem
mount -o noatime ${outdev}p2 $outmnt mount -o noatime ${outdev}p2 $outmnt
@ -113,7 +124,7 @@ cp $outmnt/lib/arm-linux-gnueabihf/libpthread.so.0 $initramfs_src/lib/arm-linux-
cp $outmnt/lib/arm-linux-gnueabihf/libpcre.so.3 $initramfs_src/lib/arm-linux-gnueabihf/libpcre.so.3 cp $outmnt/lib/arm-linux-gnueabihf/libpcre.so.3 $initramfs_src/lib/arm-linux-gnueabihf/libpcre.so.3
cp $outmnt/lib/arm-linux-gnueabihf/libgcc_s.so.1 $initramfs_src/lib/arm-linux-gnueabihf/libgcc_s.so.1 cp $outmnt/lib/arm-linux-gnueabihf/libgcc_s.so.1 $initramfs_src/lib/arm-linux-gnueabihf/libgcc_s.so.1
#add the init script #add the init script
cp $build_resources/initramfs-init $initramfs_src/init cp $RESOURCES/initramfs-init $initramfs_src/init
chmod +x $initramfs_src/init chmod +x $initramfs_src/init
cp $initramfs_src/init $initramfs_src/sbin/init cp $initramfs_src/init $initramfs_src/sbin/init
@ -127,5 +138,5 @@ ln -s busybox bin/switch_root
ln -s busybox bin/umount ln -s busybox bin/umount
# store for kernel building # store for kernel building
find . -print0 | cpio --null --create --verbose --format=newc | gzip --best > $ROOT_DIR/build/PrawnOS-initramfs.cpio.gz find . -print0 | cpio --null --create --verbose --format=newc | gzip --best > $OUT_DIR/PrawnOS-initramfs.cpio.gz

View File

@ -0,0 +1,34 @@
#!/bin/bash
set -x
set -e
# build AR9271 firmware
# This file is part of PrawnOS (https://www.prawnos.com)
# Copyright (c) 2020 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 build directory supplied"
exit 1
fi
BUILD_DIR=$1
cd $BUILD_DIR
make toolchain
make -C target_firmware

View File

@ -3,11 +3,11 @@
set -x set -x
set -e set -e
#Build kernel, wifi firmware # build Linux-libre, with ath9k_htc firmware and initramfs built in
# This file is part of PrawnOS (https://www.prawnos.com) # This file is part of PrawnOS (https://www.prawnos.com)
# Copyright (c) 2018 Hal Emmerich <hal@halemmerich.com> # Copyright (c) 2018-2020 Hal Emmerich <hal@halemmerich.com>
# PrawnOS is free software: you can redistribute it and/or modify # PrawnOS is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 # it under the terms of the GNU General Public License version 2
@ -26,48 +26,35 @@ then
echo "No kernel version supplied" echo "No kernel version supplied"
exit 1 exit 1
fi fi
if [ -z "$2" ]
KVER=$1
ROOT_DIR="$(pwd)"
RESOURCES=$ROOT_DIR/resources/BuildResources
[ ! -d build ] && mkdir build
cd build
if [ ! -f PrawnOS-initramfs.cpio.gz ]
then then
echo "No initramfs image, run 'make initramfs' first" echo "No resources directory"
cd $ROOT_DIR exit 1
fi
if [ -z "$3" ]
then
echo "No build directory supplied"
exit 1
fi
if [ -z "$4" ]
then
echo "No PrawnOS initramfs supplied"
exit 1 exit 1
fi fi
# build AR9271 firmware
[ ! -d open-ath9k-htc-firmware ] && git clone --depth 1 https://github.com/qca/open-ath9k-htc-firmware.git
cd open-ath9k-htc-firmware
make toolchain
make -C target_firmware
cd ..
# build Linux-libre, with ath9k_htc KVER=$1
[ ! -f linux-libre-$KVER-gnu.tar.lz ] && wget https://www.linux-libre.fsfla.org/pub/linux-libre/releases/$KVER-gnu/linux-libre-$KVER-gnu.tar.lz RESOURCES=$2
[ ! -f linux-libre-$KVER-gnu.tar.lz.sign ] && wget https://www.linux-libre.fsfla.org/pub/linux-libre/releases/$KVER-gnu/linux-libre-$KVER-gnu.tar.lz.sign BUILD_DIR=$3
INITRAMFS=$4
#verify the signature cd $BUILD_DIR
gpg --import $RESOURCES/linux-libre-signing-key.gpg
gpg --verify linux-libre-$KVER-gnu.tar.lz.sign linux-libre-$KVER-gnu.tar.lz
[ ! -d linux-$KVER ] && tar --lzip -xvf linux-libre-$KVER-gnu.tar.lz && FRESH=true
cd linux-$KVER
make clean
make mrproper make mrproper
#Apply the usb and mmc patches if unapplied
[ "$FRESH" = true ] && for i in "$RESOURCES"/patches-tested/kernel/5.x-dwc2/*.patch; do echo $i; patch -p1 < $i; done
[ "$FRESH" = true ] && for i in "$RESOURCES"/patches-tested/DTS/*.patch; do echo $i; patch -p1 < $i; done
[ "$FRESH" = true ] && for i in "$RESOURCES"/patches-tested/kernel/*.patch; do echo $i; patch -p1 < $i; done
#copy in the initramfs and kernel config #copy in the resources, initramfs
cp $ROOT_DIR/build/PrawnOS-initramfs.cpio.gz . cp $INITRAMFS .
cp $RESOURCES/config .config cp $RESOURCES/config .config
cp $RESOURCES/kernel.its .
make -j $(($(nproc) +1)) CROSS_COMPILE=arm-none-eabi- ARCH=arm zImage modules dtbs make -j $(($(nproc) +1)) CROSS_COMPILE=arm-none-eabi- ARCH=arm zImage modules dtbs
[ ! -h kernel.its ] && ln -s $RESOURCES/kernel.its .
mkimage -D "-I dts -O dtb -p 2048" -f kernel.its vmlinux.uimg mkimage -D "-I dts -O dtb -p 2048" -f kernel.its vmlinux.uimg
dd if=/dev/zero of=bootloader.bin bs=512 count=1 dd if=/dev/zero of=bootloader.bin bs=512 count=1
vbutil_kernel --pack vmlinux.kpart \ vbutil_kernel --pack vmlinux.kpart \
@ -78,5 +65,8 @@ vbutil_kernel --pack vmlinux.kpart \
--signprivate /usr/share/vboot/devkeys/kernel_data_key.vbprivk \ --signprivate /usr/share/vboot/devkeys/kernel_data_key.vbprivk \
--config $RESOURCES/cmdline \ --config $RESOURCES/cmdline \
--bootloader bootloader.bin --bootloader bootloader.bin
cd ..
cd $ROOT_DIR RESULT=$?
if [ ! $RESULT -eq 0 ]; then
rm -f vmlinux.kpart
fi

View File

@ -8,20 +8,22 @@ then
echo "No kernel version supplied" echo "No kernel version supplied"
exit 1 exit 1
fi fi
if [ -z "$2" ]
then
echo "No patches directory"
exit 1
fi
if [ -z "$3" ]
then
echo "No build directory supplied"
exit 1
fi
KVER=$1 KVER=$1
PATCHES=$2
BUILD_DIR=$3
ROOT_DIR="$(pwd)" cd $BUILD_DIR
RESOURCES=$ROOT_DIR/resources/BuildResources
[ ! -d build ] && mkdir build
cd build
# build Linux-libre, with ath9k_htc
cd linux-$KVER
make clean
make mrproper make mrproper
#Apply the usb and mmc patches if unapplied #Apply the usb and mmc patches
for i in "$RESOURCES"/patches-tested/DTS/*.patch; do patch -p1 < $i; done for i in "$PATCHES"/DTS/*.patch; do echo $i; patch -p1 < $i; done
for i in "$RESOURCES"/patches-tested/kernel/*.patch; do patch -p1 < $i; done for i in "$PATCHES"/kernel/*.patch; do echo $i; patch -p1 < $i; done
cd $ROOT_DIR