This repository was archived by the owner on Mar 27, 2026. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (30 loc) · 1.7 KB
/
Makefile
File metadata and controls
33 lines (30 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Set an absolute path in the config file for WORK_DIR and DEPLOY_DIR
# DEPLOY_DIR is where the final image will be stored
# WORK_DIR is where all the data is stored before merged into an image
# WORK_DIR can use up to 20GB of storage space
# refer to https://github.com/RPi-Distro/pi-gen/blob/master/README.md
# sudo apt-get install -y make git quilt qemu-user-static debootstrap zerofree libarchive-tools curl pigz arch-test qemu-utils qemu-system-arm qemu-user
# gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf
BUILD_USER ?= $(shell whoami)
BUILD_HOME ?= $(shell eval echo ~$(BUILD_USER))
IMAGE_DIR ?= $(BUILD_HOME)/images
# clone pi-gen into pi-gen-32bit folder
32bit:
[ -d pi-gen-32bit ] || git clone "https://github.com/RPi-Distro/pi-gen.git" pi-gen-32bit
[ -d pi-gen-32bit ] && cd pi-gen-32bit && git pull
[ -f pi-gen-32bit/stage2/EXPORT_IMAGE ] && rm -rf pi-gen-32bit/stage2/EXPORT_IMAGE
sed -i "s|WORK_DIR=.*|WORK_DIR=\"$(BUILD_HOME)/work-32bit\"|" config-32bit
sed -i "s|DEPLOY_DIR=.*|DEPLOY_DIR=\"$(IMAGE_DIR)\"|" config-32bit
sudo ./pi-gen-32bit/build.sh -c config-32bit
mkdir -p $(IMAGE_DIR)
sudo chown $(BUILD_USER):$(BUILD_USER) -R $(IMAGE_DIR)
# clone pi-gen arm64 branch into pi-gen-64bit folder
64bit:
[ -d pi-gen-64bit ] || git clone --branch arm64 "https://github.com/RPI-Distro/pi-gen.git" pi-gen-64bit
[ -d pi-gen-64bit ] && cd pi-gen-64bit && git pull
[ -f pi-gen-64bit/stage2/EXPORT_IMAGE ] && rm -rf pi-gen-64bit/stage2/EXPORT_IMAGE
sed -i "s|WORK_DIR=.*|WORK_DIR=\"$(BUILD_HOME)/work-64bit\"|" config-64bit
sed -i "s|DEPLOY_DIR=.*|DEPLOY_DIR=\"$(IMAGE_DIR)\"|" config-64bit
sudo ./pi-gen-64bit/build.sh -c config-64bit
mkdir -p $(IMAGE_DIR)
sudo chown $(BUILD_USER):$(BUILD_USER) -R $(IMAGE_DIR)