forked from canonical/core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (38 loc) · 1.54 KB
/
Makefile
File metadata and controls
42 lines (38 loc) · 1.54 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
34
35
36
37
38
39
40
41
42
DPKG_ARCH := $(shell dpkg --print-architecture)
RELEASE := $(shell lsb_release -c -s)
SUDO := sudo
ENV := $(SUDO) PROJECT=ubuntu-core SUBPROJECT=system-image EXTRA_PPAS='snappy-dev/image snappy-dev/edge' IMAGEFORMAT=plain SUITE=$(RELEASE) ARCH=$(DPKG_ARCH)
#ifneq ($(shell grep $(RELEASE)-proposed /etc/apt/sources.list),)
#ENV += PROPOSED=1
#endif
all: check
mkdir -p auto
for f in config build clean; \
do ln -s /usr/share/livecd-rootfs/live-build/auto/$$f auto/; \
done
$(ENV) lb clean
$(ENV) lb config
# lb config copies the live-build/ubuntu-core/hooks/ from the
# livecd-rootfs package to config/hooks/, we want to maintain these
# hooks in the github tree instead, so remove the ones from the
# package and put ours in place instead.
$(SUDO) rm -f config/hooks/*
$(SUDO) cp -a live-build/hooks/* config/hooks/
$(ENV) lb build
install:
echo "I: in install target"
# workaround for http://pad.lv/1605622
$(SUDO) rm -rf binary/boot/filesystem.dir/meta
# make sure /tmp in the snap is mode 1777
$(SUDO) chmod 1777 binary/boot/filesystem.dir/tmp
$(SUDO) mv binary/boot/filesystem.dir/* $(DESTDIR)/
# only copy the manifest file if we are in a launchpad buildd
if [ -e /build/core ]; then \
$(SUDO) mv livecd.ubuntu-core.manifest /build/core/core_16-$$(cat $(DESTDIR)/usr/lib/snapd/info|cut -f2 -d=|cut -f1 -d~|cut -b1-29)_$(DPKG_ARCH).manifest; \
ls -l /build/core; \
fi
check:
# exlucde "useless cat" from checks, while useless also makes
# some things more readable
shellcheck -e SC2002 hooks/* live-build/hooks/*
python3 -m unittest