forked from TheSin-/rpi-img-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.mk
78 lines (71 loc) · 1.48 KB
/
common.mk
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
DIST ?= jessie
REPO ?= Raspbian
RPI ?= 2
DIST_ARCH ?= armhf
ARCH ?= rpix
UNAME ?= pi
UPASS ?= raspberry
RPASS ?= raspberry
LOCALE ?= en_US.UTF-8
IMAGE_MB ?= -1
BOOT_MB ?= 128
INC_REC ?= 0
REPOBASE := Raspbian
REPOS := $(REPO)
RPIV := $(RPI)
DARCH := $(DIST_ARCH)
BOOT_DIR := boot
UBOOT_DIR := rpi_2
QEMU := qemu-arm-static
ifeq ($(findstring Raspbian,$(REPOS)),Raspbian)
ifneq ($(findstring Foundation,$(REPOS)),Foundation)
REPOS += Foundation
endif
REPOBASE := Raspbian
DARCH := armhf
ARCH := rpix
else ifeq ($(findstring Ubuntu,$(REPOS)),Ubuntu)
REPOBASE := Ubuntu
ifeq ($(findstring jessie,$(DIST)),jessie)
DIST := yakkety
endif
BOOT_DIR := boot/firmware
ARCH := raspi2
DARCH := armhf
RPIV := 2
else ifeq ($(findstring Debian,$(REPOS)),Debian)
REPOBASE := Debian
BOOT_DIR := boot/firmware
ifeq ($(DARCH),arm64)
ARCH := arm64
UBOOT_DIR := rpi_3
else ifeq ($(DARCH),armel)
ARCH := armel
UBOOT_DIR := rpi
else
ifeq ($(RPIV),3)
UBOOT_DIR := rpi_3_32b
endif
DARCH := armhf
ifneq ($(findstring armmp,$(ARCH)),armmp)
ARCH := armmp
endif
endif
endif
ifeq ($(DARCH),arm64)
QEMU := qemu-aarch64-static
RPIV := 3
endif
ifeq ($(shell test $(BOOT_MB) -lt 38; echo $$?),0)
BOOT_MB := 38
endif
ifeq ($(IMAGE_MB),-1)
ROOT_MB := -1
else
ROOT_MB := $(shell expr $(IMAGE_MB) - $(BOOT_MB))
endif
TIMESTAMP := $(shell date +'%Y-%m-%dT%H:%M:%S')
ROOT_DEV := /dev/mmcblk0p2
BASE_DIR := $(shell pwd)
ROOTFS_DIR := $(BASE_DIR)/rootfs
IMAGE_FILE := $(REPOBASE)-$(DIST)-$(ARCH)