Skip to content

Commit 6b28133

Browse files
committed
Restructure configs, and add debian-stretch and ubuntu-zesty
1 parent ca54ea1 commit 6b28133

File tree

19 files changed

+128
-20
lines changed

19 files changed

+128
-20
lines changed

Makefile

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,37 @@
11
export RELEASE_NAME ?= 0.1~dev
22

33
all: \
4-
xenial-mate-$(RELEASE_NAME)-armhf.tar.xz \
5-
xenial-mate-$(RELEASE_NAME)-arm64.tar.xz \
6-
xenial-i3-$(RELEASE_NAME)-arm64.tar.xz \
7-
xenial-i3-$(RELEASE_NAME)-armhf.tar.xz \
8-
xenial-minimal-$(RELEASE_NAME)-arm64.tar.xz \
9-
xenial-minimal-$(RELEASE_NAME)-armhf.tar.xz
4+
ubuntu-xenial-mate-$(RELEASE_NAME)-armhf.tar.xz \
5+
ubuntu-xenial-mate-$(RELEASE_NAME)-arm64.tar.xz \
6+
ubuntu-zesty-mate-$(RELEASE_NAME)-armhf.tar.xz \
7+
ubuntu-zesty-mate-$(RELEASE_NAME)-arm64.tar.xz \
8+
ubuntu-xenial-i3-$(RELEASE_NAME)-arm64.tar.xz \
9+
ubuntu-xenial-i3-$(RELEASE_NAME)-armhf.tar.xz \
10+
ubuntu-zesty-i3-$(RELEASE_NAME)-arm64.tar.xz \
11+
ubuntu-zesty-i3-$(RELEASE_NAME)-armhf.tar.xz \
12+
ubuntu-xenial-minimal-$(RELEASE_NAME)-arm64.tar.xz \
13+
ubuntu-xenial-minimal-$(RELEASE_NAME)-armhf.tar.xz \
14+
ubuntu-zesty-minimal-$(RELEASE_NAME)-arm64.tar.xz \
15+
ubuntu-zesty-minimal-$(RELEASE_NAME)-armhf.tar.xz \
16+
debian-stretch-minimal-$(RELEASE_NAME)-arm64.tar.xz \
17+
debian-stretch-minimal-$(RELEASE_NAME)-armhf.tar.xz \
1018

11-
%.tar.xz:
12-
bash build.sh "$@" "$(shell basename "$@" -$(RELEASE_NAME)-$(BUILD_ARCH).tar.xz)" "$(BUILD_MODE)" "$(BUILD_SUITE)" "$(BUILD_ARCH)"
19+
%.xz: %
20+
pxz -f -3 $<
21+
22+
%.tar:
23+
bash build.sh "$@" \
24+
"$(shell basename "$@" -$(RELEASE_NAME)-$(BUILD_ARCH).tar)" \
25+
"$(BUILD_MODE)" \
26+
"$(BUILD_SUITE)" \
27+
"$(BUILD_ARCH)"
1328

1429
%-armhf.tar.xz: BUILD_ARCH=armhf
1530
%-arm64.tar.xz: BUILD_ARCH=arm64
1631

17-
xenial-%.tar.xz: BUILD_SUITE=xenial
18-
xenial-%.tar.xz: BUILD_MODE=ubuntu
32+
ubuntu-%.tar.xz: BUILD_MODE=ubuntu
33+
ubuntu-xenial-%.tar.xz: BUILD_SUITE=xenial
34+
ubuntu-zesty-%.tar.xz: BUILD_SUITE=zesty
35+
36+
debian-%.tar.xz: BUILD_MODE=debian
37+
debian-stretch-%.tar.xz: BUILD_SUITE=stretch

build.sh

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ ROOT_DIR="$(pwd)"
1717

1818
set -ex
1919

20+
if [[ ! -d "configs/$BUILD_VARIANT" ]]; then
21+
echo "Invalid BUILD_VARIANT: $BUILD_VARIANT (missing configs/$BUILD_VARIANT)"
22+
exit 1
23+
fi
24+
2025
mkdir -p out/
2126

2227
TEMP=$(mktemp -d $(readlink -f out)/build.XXXXX)
@@ -27,37 +32,51 @@ trap cleanup EXIT
2732

2833
pushd $TEMP
2934

30-
QEMU_BUILD_ARCH=$BUILD_ARCH
31-
if [[ "$QEMU_BUILD_ARCH" == "arm64" ]]; then
35+
if [[ "$BUILD_ARCH" == "arm64" ]]; then
3236
QEMU_BUILD_ARCH=aarch64
33-
elif [[ "$QEMU_BUILD_ARCH" == "armhf" ]]; then
37+
elif [[ "$BUILD_ARCH" == "armhf" ]]; then
3438
QEMU_BUILD_ARCH=arm
39+
else
40+
echo "Unsupported BUILD_ARCH: $BUILD_ARCH."
41+
exit 1
42+
fi
43+
44+
if [[ "$BUILD_MODE" == "debian" ]]; then
45+
ARCHIVE_AREAS="main contrib non-free"
46+
elif [[ "$BUILD_MODE" == "ubuntu" ]]; then
47+
ARCHIVE_AREAS="main restricted universe multiverse"
48+
else
49+
echo "Unsupported BUILD_MODE: $BUILD_MODE."
50+
exit 1
3551
fi
3652

3753
lb config \
3854
--apt-indices false \
3955
--apt-recommends false \
4056
--apt-secure true \
4157
--architectures "$BUILD_ARCH" \
42-
--archive-areas 'main restricted universe multiverse' \
58+
--archive-areas "$ARCHIVE_AREAS" \
4359
--backports false \
4460
--binary-filesystem ext4 \
4561
--binary-images tar \
46-
--bootstrap-qemu-arch $BUILD_ARCH \
62+
--bootstrap-qemu-arch "$BUILD_ARCH" \
4763
--bootstrap-qemu-static "/usr/bin/qemu-$QEMU_BUILD_ARCH-static" \
4864
--chroot-filesystem none \
49-
--compression xz \
65+
--compression none \
5066
--distribution "$BUILD_SUITE" \
5167
--linux-flavours none \
5268
--linux-packages none \
5369
--mode "$BUILD_MODE" \
5470
--security true \
5571
--system normal
5672

57-
cp -av $ROOT_DIR/configs/$BUILD_MODE/. config/
58-
cp -av $ROOT_DIR/configs/$BUILD_VARIANT/. config/
73+
for path in $BUILD_MODE $BUILD_MODE-$BUILD_SUITE $BUILD_VARIANT; do
74+
if [[ -d "$ROOT_DIR/configs/$path" ]]; then
75+
cp -av "$ROOT_DIR/configs/$path/." config/
76+
fi
77+
done
5978

6079
sudo lb build
61-
sudo chown "$(id -u)" binary-tar.tar.xz
80+
sudo chown "$(id -u)" binary-tar.tar
6281

63-
mv binary-tar.tar.xz "$BUILD_OUTPUT"
82+
mv binary-tar.tar "$BUILD_OUTPUT"
File renamed without changes.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
dosfstools
2+
curl
3+
xz-utils
4+
iw
5+
rfkill
6+
wpasupplicant
7+
openssh-server
8+
alsa-utils
9+
nano
10+
git
11+
build-essential
12+
vim
13+
jq
14+
ethtool
15+
zram-config
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
systemd
2+
systemd-sysv
3+
udev
4+
apt
5+
kmod
6+
locales
7+
sudo
8+
netbase
9+
net-tools
10+
ethtool
11+
iproute
12+
iputils-ping
13+
ifupdown
14+
dhcpcd5
15+
firmware-brcm80211
16+
wpasupplicant
17+
ssh
18+
avahi-daemon
19+
ntp
20+
wireless-tools
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)