build: fixes armbian build

This commit is contained in:
nachoparker 2017-11-30 16:07:06 +01:00
parent 7726f099c9
commit beb8f1cb0c
2 changed files with 24 additions and 7 deletions

View File

@ -25,15 +25,24 @@ Main() {
# your code here
;;
stretch)
# Need sudo access that does not expire
echo -e "1234\n1234" | passwd root
# indicate that this will be an image build
# need sudo access that does not expire during build
chage -d -1 root
# indicate that this will be an Armbian image build
touch /.ncp-image
export ARMBIANBUILD
# install NCP
curl -sSL https://raw.githubusercontent.com/nextcloud/nextcloudpi/master/install.sh | bash
# restore postfix package half-configured status
sed -i '/Package: postfix/{n;d}' /var/lib/dpkg/status
sed -i '/Package: postfix/a;Status: install ok half-configured|' /var/lib/dpkg/status
# force change root password at first login (again)
chage -d 0 root
# cleanup
apt-get autoremove -y
apt-get clean

View File

@ -42,11 +42,17 @@ install()
# Optional packets for Nextcloud and Apps
apt-get update
$APTINSTALL -o "Dpkg::Options::=--force-confold" php-smbclient
$APTINSTALL lbzip2 iputils-ping
debconf-set-selections <<< "postfix postfix/mailname string nextcloudpi"
debconf-set-selections <<< "postfix postfix/main_mailer_type string 'No configuration'"
$APTINSTALL postfix lbzip2 iputils-ping
[[ "$ARMBIANBUILD" != 1 ]] && {
$APTINSTALL postfix
} || {
# post installation script fails, so mark as no problem for the rest of the build
echo "[NCP] Please, ignore the following postfix installation errors ..."
$APTINSTALL postfix || true
sed -i '/Package: postfix/{n;d}' /var/lib/dpkg/status
sed -i '/Package: postfix/a;Status: install ok installed|' /var/lib/dpkg/status
}
# REDIS
$APTINSTALL redis-server php7.0-redis
@ -71,6 +77,8 @@ install()
systemctl start php7.0-fpm
systemctl start mysqld
}
return 0
}
configure()