2018-10-11 22:09:25 +02:00
|
|
|
# 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/>.
|
|
|
|
|
2019-08-26 02:30:11 +02:00
|
|
|
KVER=5.2.9
|
2019-06-07 19:05:58 +02:00
|
|
|
ifeq ($(PRAWNOS_SUITE),)
|
2019-06-07 20:42:25 +02:00
|
|
|
PRAWNOS_SUITE=buster
|
2019-06-07 19:05:58 +02:00
|
|
|
endif
|
|
|
|
OUTNAME=PrawnOS-$(PRAWNOS_SUITE)-Alpha-c201-libre-2GB.img
|
2019-02-27 20:20:11 +01:00
|
|
|
BASE=$(OUTNAME)-BASE
|
|
|
|
|
|
|
|
|
|
|
|
#Usage:
|
|
|
|
#run make image
|
|
|
|
#this will generate two images named OUTNAME and OUTNAME-BASE
|
|
|
|
#-BASE is only the filesystem with no kernel.
|
|
|
|
|
|
|
|
|
|
|
|
#if you make any changes to the kernel or kernel config with make kernel_config
|
|
|
|
#run kernel_inject
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-09-07 18:56:22 +02:00
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
@echo "Enter one of:"
|
|
|
|
@echo " clean_kernel - which deletes the untar'd kernel folder from build"
|
|
|
|
@echo " clean_ath - which deletes the untar'd ath9k driver folder from build"
|
2019-02-27 20:20:11 +01:00
|
|
|
@echo " clean_img - which deletes the built PrawnOS image, this is ran when make image is ran"
|
|
|
|
@echo " clean_fs - which deletes the built PrawnOS base image"
|
2018-09-07 18:56:22 +02:00
|
|
|
@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
|
|
|
|
clean_kernel:
|
2019-09-19 23:57:09 +02:00
|
|
|
rm -rf build/linux-$(KVER)
|
2018-09-07 18:56:22 +02:00
|
|
|
|
|
|
|
.PHONY: clean_ath
|
|
|
|
clean_ath:
|
|
|
|
rm -rf build/open-ath9k-htc-firmware
|
2018-09-07 01:55:46 +02:00
|
|
|
|
2018-09-07 18:56:22 +02:00
|
|
|
.PHONY: clean_img
|
|
|
|
clean_img:
|
2019-02-27 20:20:11 +01:00
|
|
|
rm -f $(OUTNAME)
|
|
|
|
|
|
|
|
.PHONY: clean_fs
|
|
|
|
clean_fs:
|
|
|
|
rm -r $(BASE)
|
2018-09-07 18:56:22 +02:00
|
|
|
|
|
|
|
.PHONY: clean_all
|
|
|
|
clean_all:
|
|
|
|
make clean_kernel
|
|
|
|
make clean_ath
|
|
|
|
make clean_img
|
2019-02-27 20:20:11 +01:00
|
|
|
make clean_fs
|
2018-09-07 01:55:46 +02:00
|
|
|
|
|
|
|
|
2018-09-07 18:56:22 +02:00
|
|
|
.PHONY: kernel
|
2018-09-07 01:55:46 +02:00
|
|
|
kernel:
|
2019-02-27 20:20:11 +01:00
|
|
|
scripts/buildKernel.sh $(KVER)
|
2018-09-07 01:55:46 +02:00
|
|
|
|
2019-02-27 20:20:11 +01:00
|
|
|
#makes the base filesystem image, no kernel only if the base image isnt present
|
2018-09-07 18:56:22 +02:00
|
|
|
.PHONY: filesystem
|
2018-09-07 01:55:46 +02:00
|
|
|
filesystem:
|
2019-02-27 20:20:11 +01:00
|
|
|
[ -f $(BASE) ] || scripts/buildFilesystem.sh $(KVER)
|
2018-09-07 01:55:46 +02:00
|
|
|
|
2018-09-07 18:56:22 +02:00
|
|
|
.PHONY: kernel_inject
|
|
|
|
kernel_inject: #Targets an already built .img and swaps the old kernel with the newly compiled kernel
|
2019-02-27 20:20:11 +01:00
|
|
|
scripts/injectKernelIntoFS.sh $(KVER) $(OUTNAME)
|
|
|
|
|
|
|
|
.PHONY: injected_image
|
|
|
|
injected_image: #makes a copy of the base image with a new injected kernel
|
|
|
|
make kernel
|
2019-06-07 19:05:58 +02:00
|
|
|
cp $(BASE) $(OUTNAME)
|
2019-02-27 20:20:11 +01:00
|
|
|
make kernel_inject
|
2018-09-07 01:55:46 +02:00
|
|
|
|
2018-09-07 18:56:22 +02:00
|
|
|
.PHONY: image
|
2018-09-07 01:55:46 +02:00
|
|
|
image:
|
2018-09-07 18:56:22 +02:00
|
|
|
make clean_img
|
2019-02-27 20:20:11 +01:00
|
|
|
make kernel
|
|
|
|
make filesystem
|
|
|
|
#Make a new copy of the filesystem image
|
|
|
|
cp $(BASE) $(OUTNAME)
|
|
|
|
make kernel_inject
|
|
|
|
|
2018-09-07 01:55:46 +02:00
|
|
|
|
2018-09-07 18:56:22 +02:00
|
|
|
.PHONY: live_image
|
2018-09-07 01:55:46 +02:00
|
|
|
live_image:
|
|
|
|
echo "TODO"
|
|
|
|
|
2018-09-07 18:56:22 +02:00
|
|
|
.PHONY: kernel_config
|
2018-09-07 01:55:46 +02:00
|
|
|
kernel_config:
|
2019-02-27 20:20:11 +01:00
|
|
|
scripts/crossmenuconfig.sh $(KVER)
|
|
|
|
|
|
|
|
.PHONY: patch_kernel
|
|
|
|
patch_kernel:
|
|
|
|
scripts/patchKernel.sh
|