Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornachoparker <nacho@ownyourbits.com>2019-12-19 20:56:18 +0300
committernachoparker <nacho@ownyourbits.com>2019-12-21 06:18:40 +0300
commitf854afaba1005dbb7ede91e180abb0e9c800cbd8 (patch)
treede42d34a62ff32ace803273cc20067041019d285
parentf75c415214d39c5a33e7cd1fab3aa234cc10a60f (diff)
armbian: fix distro build
Signed-off-by: nachoparker <nacho@ownyourbits.com>
-rw-r--r--.gitignore1
-rw-r--r--armbian.sh1
-rwxr-xr-xbatch.sh7
-rwxr-xr-xbuild-SD-armbian.sh21
-rwxr-xr-xbuild-SD-berryboot.sh5
-rwxr-xr-xbuild-SD-rpi.sh6
-rwxr-xr-xbuild-VM.sh6
-rw-r--r--buildlib.sh15
-rw-r--r--config-bananapi.conf5
-rw-r--r--config-odroidxu4.conf2
10 files changed, 48 insertions, 21 deletions
diff --git a/.gitignore b/.gitignore
index da3509e3..5124aef2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
.*.swp
qemu-raspbian-network/
+archive/
output/
cache/
torrent/
diff --git a/armbian.sh b/armbian.sh
index 5390bdf7..b594d28e 100644
--- a/armbian.sh
+++ b/armbian.sh
@@ -37,6 +37,7 @@ cp etc/ncp-config.d/nc-nextcloud.cfg /usr/local/etc/ncp-config.d/
cp etc/library.sh /usr/local/etc/
cp etc/ncp.cfg /usr/local/etc/
+hostname -F /etc/hostname # fix 'sudo resolve host' errors
install_app lamp.sh
install_app bin/ncp/CONFIG/nc-nextcloud.sh
run_app_unsafe bin/ncp/CONFIG/nc-nextcloud.sh
diff --git a/batch.sh b/batch.sh
index 97b4c286..e1990a99 100755
--- a/batch.sh
+++ b/batch.sh
@@ -17,9 +17,14 @@ source buildlib.sh # initializes $IMGNAME
[[ "$FTPPASS" == "" ]] && {
echo -e "\e[1mNo FTPPASS variable found, FTP won't work.\nYou can ^C to cancel now\e[0m"
- sleep 5
}
+[[ "$CLEAN" != "0" ]] && {
+ echo -e "\e[1mNOTE: CLEAN is enabled\nYou can ^C to cancel now\e[0m"
+}
+
+sleep 5
+
# Raspbian
./build-SD-rpi.sh
IMG="$( ls -1t tmp/*.img | head -1 )"
diff --git a/build-SD-armbian.sh b/build-SD-armbian.sh
index 6af6d872..58b9be0e 100755
--- a/build-SD-armbian.sh
+++ b/build-SD-armbian.sh
@@ -15,6 +15,9 @@ NCPCFG=etc/ncp.cfg
IMG="NextCloudPi_${BNAME}_$( date "+%m-%d-%y" ).img"
IMG=tmp/"$IMG"
+TAR=output/"$( basename "$IMG" .img ).tar.bz2"
+
+test -f "$TAR" && { echo "$TAR already exists. Skipping... "; exit 0; }
set -e
source buildlib.sh
@@ -34,35 +37,37 @@ rsync -Aax --delete --exclude-from .gitignore --exclude *.img --exclude *.bz2 .
# GENERATE IMAGE
+CONF=armbian/userpatches/config-ncp.conf
+
# default parameters
-cat > armbian/config-docker-guest.conf <<EOF
+cat > "$CONF" <<EOF
BOARD="$BOARD"
-BRANCH=default
+BRANCH=current
RELEASE=$RELEASE
KERNEL_ONLY=no
KERNEL_CONFIGURE=no
BUILD_DESKTOP=no
+BUILD_MINIMAL=yes
USE_CCACHE=yes
EOF
[[ "$CLEAN" == "0" ]] && {
- cat >> armbian/config-docker-guest.conf <<EOF
+ cat >> "$CONF" <<EOF
CLEAN_LEVEL="" # study this: it is much faster, but generated images might be broken (#548)
# NO_APT_CACHER=no # this will also improve build times, but doesn't seem very reliable
EOF
}
# board specific parameters
-CONF="config-$BOARD".conf
-[[ -f "$CONF" ]] && cat "$CONF" >> armbian/config-docker-guest.conf
+EXTRA_CONF="config-$BOARD".conf
+[[ -f "$EXTRA_CONF" ]] && cat "$EXTRA_CONF" >> "$CONF"
# build
rm -rf armbian/output/images
-armbian/compile.sh docker
-rm armbian/config-docker-guest.conf
+armbian/compile.sh docker ncp
+rm "$CONF"
# pack image
mv armbian/output/images/Armbian*.img "$IMG"
-TAR=output/"$( basename "$IMG" .img ).tar.bz2"
pack_image "$IMG" "$TAR"
# test
diff --git a/build-SD-berryboot.sh b/build-SD-berryboot.sh
index 10decd60..4857902d 100755
--- a/build-SD-berryboot.sh
+++ b/build-SD-berryboot.sh
@@ -10,10 +10,13 @@
SRC="$1"
IMG="NextCloudPi_RPi_Berryboot_$( date "+%m-%d-%y" ).img"
+TAR=output/"$( basename "$IMG" .img ).tar.bz2"
set -e
source buildlib.sh
+test -f "$TAR" && { echo "$TAR already exists. Skipping... "; exit 0; }
+
[[ -f "$SRC" ]] || { echo "$SRC not found"; exit 1; }
# convert to Berryboot
@@ -30,8 +33,6 @@ sudo mksquashfs raspbian_root "$IMG" -comp lzo -e lib/modules
umount_raspbian
## pack
-
-TAR=output/"$( basename "$IMG" .img ).tar.bz2"
pack_image "$IMG" "$TAR"
# upload
diff --git a/build-SD-rpi.sh b/build-SD-rpi.sh
index d4195ebd..d13cc70b 100755
--- a/build-SD-rpi.sh
+++ b/build-SD-rpi.sh
@@ -14,15 +14,18 @@ source buildlib.sh
SIZE=3G # Raspbian image size
#CLEAN=0 # Pass this envvar to skip cleaning download cache
IMG="NextCloudPi_RPi_$( date "+%m-%d-%y" ).img"
+TAR=output/"$( basename "$IMG" .img ).tar.bz2"
##############################################################################
+test -f "$TAR" && { echo "$TAR already exists. Skipping... "; exit 0; }
pgrep -f qemu-arm-static &>/dev/null && { echo "qemu-arm-static already running. Abort"; exit 1; }
## preparations
IMG=tmp/"$IMG"
+trap clean_chroot_raspbian EXIT
prepare_dirs # tmp cache output
download_raspbian "$IMG"
resize_image "$IMG" "$SIZE"
@@ -94,11 +97,10 @@ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
mv /ld.so.preload /etc
EOFCHROOT
+trap '' EXIT
clean_chroot_raspbian
## pack
-
-TAR=output/"$( basename "$IMG" .img ).tar.bz2"
pack_image "$IMG" "$TAR"
## test
diff --git a/build-VM.sh b/build-VM.sh
index a0bcbdbc..656db373 100755
--- a/build-VM.sh
+++ b/build-VM.sh
@@ -15,6 +15,9 @@ IP=${1:-192.168.0.145} # For QEMU automated testing (optional)
SIZE=3G # Raspbian image size
#CLEAN=0 # Pass this envvar to skip cleaning download cache
IMG="NextCloudPi_RPi_$( date "+%m-%d-%y" ).img"
+TAR=output/"$( basename "$IMG" .img ).tar.bz2"
+
+test -f "$TAR" && { echo "$TAR already exists. Skipping... "; exit 0; }
##############################################################################
@@ -24,6 +27,7 @@ IMG="NextCloudPi_VM_$( date "+%m-%d-%y" ).img"
IMG=tmp/"$IMG"
VM="/var/lib/libvirt/images/nextcloudpi_default.img"
+test -f "$TAR" && { echo "$TAR already exists. Skipping... "; exit 0; }
set -e
prepare_dirs # tmp cache output
@@ -41,8 +45,6 @@ sudo chown "$USER" "$VM"
sudo cp -a --reflink=auto --sparse=auto "$VM" "$IMG"
## pack
-
-TAR=output/"$( basename "$IMG" .img ).tar.bz2"
pack_image "$IMG" "$TAR"
## test
diff --git a/buildlib.sh b/buildlib.sh
index 2d2bc4fe..c7464d5c 100644
--- a/buildlib.sh
+++ b/buildlib.sh
@@ -361,6 +361,21 @@ EOF
cd -
}
+upload_all()
+{
+ test -d output || { echo "No uploads found. Nothing to do"; return; }
+ [[ "$FTPPASS" == "" ]] && {
+ echo -e "\e[1mNo FTPPASS variable found, FTP won't work.\nYou can ^C to cancel now\e[0m"
+ sleep 5
+ }
+
+ mkdir -p archive
+ for img in $(find output -name '*.tar.bz2'); do
+ upload_ftp "${img}" && mv "${img}" archive
+ done
+}
+
+
function test_image()
{
local IMG="$1"
diff --git a/config-bananapi.conf b/config-bananapi.conf
deleted file mode 100644
index 8f7d3a22..00000000
--- a/config-bananapi.conf
+++ /dev/null
@@ -1,5 +0,0 @@
-#
-# Place here configuration options that differ from standard NCP build options
-#
-
-BRANCH=next
diff --git a/config-odroidxu4.conf b/config-odroidxu4.conf
index 8f7d3a22..38e1a2d0 100644
--- a/config-odroidxu4.conf
+++ b/config-odroidxu4.conf
@@ -2,4 +2,4 @@
# Place here configuration options that differ from standard NCP build options
#
-BRANCH=next
+BRANCH=dev