-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.common
62 lines (44 loc) · 1.71 KB
/
Makefile.common
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
ALL_CURL_OPTS := $(CURL_OPTS) -L --fail --create-dirs
VERSION := 22.03.0
BUILDER := openwrt-imagebuilder-$(VERSION)-$(BOARD)-$(SUBTARGET).Linux-x86_64
EXTRA_IMAGE_NAME := iscsi-usb
PACKAGES := luci open-iscsi tgt kmod-usb-gadget-mass-storage luci-app-commands blkid lsblk atop tcpdump $(PLATFORM_PACKAGES)
BUILD_DIR := build
OUTPUT_DIR := $(BUILD_DIR)/$(BUILDER)/bin/targets/$(BOARD)/$(SUBTARGET)
IMAGE_PREFIX := openwrt-$(VERSION)-$(EXTRA_IMAGE_NAME)-$(BOARD)-$(SUBTARGET)-$(PROFILE)
all: images
deps-debian:
# https://openwrt.org/docs/guide-user/additional-software/imagebuilder#debianubuntu
apt-get install ${PKGMGR_OPTS} --no-install-recommends \
build-essential \
file \
gawk \
gettext \
git \
libncurses5-dev \
libncursesw5-dev \
libssl-dev \
python3 \
rsync \
unzip \
wget \
xsltproc \
zlib1g-dev
# Extra build dependencies
apt-get install ${PKGMGR_OPTS} --no-install-recommends \
ca-certificates \
curl
$(BUILD_DIR)/downloads/$(BUILDER).tar.xz:
mkdir -p $(BUILD_DIR)/downloads.tmp/ $(BUILD_DIR)/downloads/
curl $(ALL_CURL_OPTS) --output-dir $(BUILD_DIR)/downloads.tmp -O https://downloads.openwrt.org/releases/$(VERSION)/targets/$(BOARD)/$(SUBTARGET)/$(BUILDER).tar.xz
mv $(BUILD_DIR)/downloads.tmp/$(BUILDER).tar.xz $(BUILD_DIR)/downloads/
$(BUILD_DIR)/$(BUILDER): $(BUILD_DIR)/downloads/$(BUILDER).tar.xz
cd $(BUILD_DIR) && tar -xf downloads/$(BUILDER).tar.xz
rootfs-contents:
rm -rf $(BUILD_DIR)/rootfs
cp -rv rootfs $(BUILD_DIR)/rootfs
images: $(BUILD_DIR)/$(BUILDER) rootfs-contents
cd $(BUILD_DIR)/$(BUILDER) && make image PROFILE="$(PROFILE)" EXTRA_IMAGE_NAME="$(EXTRA_IMAGE_NAME)" PACKAGES="$(PACKAGES)" FILES="../rootfs"
cat $(OUTPUT_DIR)/sha256sums
clean:
rm -rf build