Skip to content

Commit c09902a

Browse files
committed
Support lxde variant
1 parent f402dee commit c09902a

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

build-pine64-image.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ case "$VARIANT" in
4848
SIZE=5120
4949
;;
5050

51+
lxde)
52+
SIZE=3500
53+
;;
54+
5155
openmediavault)
5256
SIZE=2048
5357
;;

simpleimage/make_rootfs.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,13 @@ case $DISTRO in
8686
xenial|bionic)
8787
version=$(curl -s https://api.github.com/repos/$RELEASE_REPO/releases/latest | jq -r ".tag_name")
8888
ROOTFS="https://github.com/$RELEASE_REPO/releases/download/${version}/ubuntu-${DISTRO}-${VARIANT}-${version}-${BUILD_ARCH}.tar.xz"
89+
FALLBACK_ROOTFS="https://github.com/$RELEASE_REPO/releases/download/${version}/ubuntu-${DISTRO}-minimal-${version}-${BUILD_ARCH}.tar.xz"
8990
TAR_OPTIONS="-J --strip-components=1 binary"
9091
;;
9192
sid|stretch)
9293
version=$(curl -s https://api.github.com/repos/$RELEASE_REPO/releases/latest | jq -r ".tag_name")
9394
ROOTFS="https://github.com/$RELEASE_REPO/releases/download/${version}/debian-${DISTRO}-${VARIANT}-${version}-${BUILD_ARCH}.tar.xz"
95+
FALLBACK_ROOTFS="https://github.com/$RELEASE_REPO/releases/download/${version}/debian-${DISTRO}-minimal-${version}-${BUILD_ARCH}.tar.xz"
9496
TAR_OPTIONS="-J --strip-components=1 binary"
9597
;;
9698
*)
@@ -99,21 +101,26 @@ case $DISTRO in
99101
;;
100102
esac
101103

102-
mkdir -p $BUILD
103-
TARBALL="$TEMP/$(basename $ROOTFS)"
104+
CACHE_ROOT="${CACHE_ROOT:-tmp}"
105+
mkdir -p "$CACHE_ROOT"
106+
TARBALL="${CACHE_ROOT}/$(basename $ROOTFS)"
104107

105-
mkdir -p "$BUILD"
106108
if [ ! -e "$TARBALL" ]; then
107109
echo "Downloading $DISTRO rootfs tarball ..."
108-
wget -O "$TARBALL" "$ROOTFS"
110+
pushd "$CACHE_ROOT"
111+
if ! flock "$(basename "$ROOTFS").lock" wget -c "$ROOTFS"; then
112+
TARBALL="${CACHE_ROOT}/$(basename "$FALLBACK_ROOTFS")"
113+
echo "Downloading fallback $DISTRO rootfs tarball ..."
114+
flock "$(basename "$FALLBACK_ROOTFS").lock" wget -c "$FALLBACK_ROOTFS"
115+
fi
116+
popd
109117
fi
110118

111119
# Extract with BSD tar
112120
echo -n "Extracting ... "
113121
set -x
114122
tar -xf "$TARBALL" -C "$DEST" $TAR_OPTIONS
115123
echo "OK"
116-
rm -f "$TARBALL"
117124

118125
# Add qemu emulation.
119126
cp /usr/bin/qemu-aarch64-static "$DEST/usr/bin"

0 commit comments

Comments
 (0)