#!/bin/bash # Generate Berryboot image from Raspbian based image # # Copyleft 2018 by Ignacio Nunez Hernanz # GPL licensed (see end of file) * Use at your own risk! # # Usage: ./build-SD-berryboot.sh # set -e source build/buildlib.sh echo -e "\e[1m\n[ Build NCP Berryboot ]\e[0m" SRC="$1" IMG="NextcloudPi_RPi_Berryboot_$( date "+%m-%d-%y" ).img" TAR=output/"$( basename "$IMG" .img ).tar.bz2" test -f "$TAR" && { echo "$TAR already exists. Skipping... "; exit 0; } [[ -f "$SRC" ]] || { echo "$SRC not found"; exit 1; } # convert to Berryboot mount_raspbian "$SRC" sudo bash -c "cat > raspbian_root/etc/fstab" <