Skip to content

Commit

Permalink
Introduction of Raspbian Pi OS
Browse files Browse the repository at this point in the history
* Replace raspbian by raspios due to renaming of the OS
* (beta) Added initial support for building 64-bit images

Signed-off-by: Holger Friedrich <[email protected]>
  • Loading branch information
holgerfriedrich committed May 29, 2020
1 parent bfcf7e6 commit 2af4344
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 8 deletions.
58 changes: 58 additions & 0 deletions build-image/openhabian.pi-raspbian64.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Modify your openHABian settings
# Handle with care, only touch if you need to!!

hostname=openhab
username=openhabian
userpw=openhabian

# Language and time. Be sure to set these to valid values
timeserver=0.pool.ntp.org
locales="en_US.UTF-8 de_DE.UTF-8"
system_default_locale="en_US.UTF-8"
#timezone=Europe/Berlin

# Wi-Fi settings. An ethernet connection is recommended
# Requirement: RPi4, RPi3, RPi0W or a supported external Wi-Fi dongle
# Fill in your SSID and password below, leave empty to use ethernet
# ATTENTION: you need to escape these special characters: $, `, ", \, (newline)
# 'Escaping' means to put an additional \ in front of that character
wifi_ssid=""
wifi_psk=""

# Wi-Fi setting. Select a two-letter country code suitable for your location
# E.g. US (default), DE, AU, NZ...
# You may infringe on local legislature otherwise
# See https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 or /usr/share/zoneinfo/zone.tab
wifi_country=""

# Eventually disable all IPv6 e.g. on installation problems
# values: "enable", "disable"
ipv6=enable

# repo to clone from (if not master for build and test)
repositoryurl=https://github.com/openhab/openhabian.git
clonebranch=master

# debug verbosity mode
# values: "unattended", "unattended_debug" (verbose output in log) or "debug_maximum" (show every command in either mode)
mode=unattended

# Hardware
# pi0, pi0w, pi1, cm1, pi2, pi3, cm3, pi3+, cm3+, pi4
#hw=pi3

# Hardware architecture
# x86_64, amd64, armv6l, armv7l, aarch64, arm64
#hwarch=armv7l

# OS Release
# ubuntu, raspbian, debian
# jessie, stretch, buster, bullseye, sid
# trusty, xenial, bionic, focal
#release=buster

# Java architecture mode
# values: "Zulu32", "Zulu64" or "AdoptOpenJDK"
java_arch=64-bit

# vim: filetype=sh
30 changes: 22 additions & 8 deletions build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ if [ "$1" == "rpi" ]; then
hw_platform="pi-raspbian"
echo_process "Hardware platform: Raspberry Pi (rpi)"

elif [ "$1" == "rpi64" ]; then
hw_platform="pi-raspbian64"
echo_process "Hardware platform: Raspberry Pi (rpi64) - BETA -"

elif [ "$1" == "pine64" ]; then
hw_platform="pine64-xenial"
echo_process "Hardware platform: Pine A64 (pine64)"
Expand Down Expand Up @@ -265,7 +269,17 @@ if [ "$hw_platform" == "pine64-xenial" ]; then
if mv $buildfolder/xenial-pine64-*.img $imagefile; then echo "OK"; else echo "FAILED"; exit 1; fi

# Build Raspberry Pi image
elif [ "$hw_platform" == "pi-raspbian" ]; then
elif [ "$hw_platform" == "pi-raspbian" ] || [ "$hw_platform" == "pi-raspbian64" ]; then
if [ "$hw_platform" == "pi-raspbian64" ]; then
zipfile=raspios_lite_arm64_latest.zip
baseurl="https://downloads.raspberrypi.org/raspios_arm64/images/raspios_arm64-2020-05-28/2020-05-27-raspios-buster-arm64.zip"
bits=64
else
zipfile=raspios_lite_armhf_latest.zip
baseurl="https://downloads.raspberrypi.org/raspios_lite_armhf_latest"
bits=32
fi

# Prerequisites
echo_process "Checking prerequisites... "
REQ_COMMANDS="git wget unzip crc32 dos2unix xz"
Expand All @@ -286,16 +300,16 @@ elif [ "$hw_platform" == "pi-raspbian" ]; then
fi
check_command_availability_and_exit "$REQ_COMMANDS" "$REQ_PACKAGES"

if [ -f "raspbian.zip" ]; then
echo_process "Using local copy of Raspbian Lite image, raspbian.zip... "
cp raspbian.zip $buildfolder/raspbian.zip
if [ -f "$zipfile" ]; then
echo_process "Using local copy of Raspberry Pi OS ($bits-bit) Lite image, $zipfile... "
cp $zipfile "$buildfolder/$zipfile"
else
echo_process "Downloading latest Raspbian Lite image (no local copy raspbian.zip found)... "
wget -nv -O $buildfolder/raspbian.zip "https://downloads.raspberrypi.org/raspbian_lite_latest"
echo_process "Downloading latest Raspberry Pi OS ($bits-bit) Lite image (no local copy of $zipfile found)... "
wget -nv -O "$buildfolder/$zipfile" "$baseurl"
fi
echo_process "Unpacking image... "
unzip $buildfolder/raspbian.zip -d $buildfolder
mv $buildfolder/*raspbian*.img $imagefile
unzip $buildfolder/$zipfile -d $buildfolder
mv $buildfolder/*-rasp*.img $imagefile

echo_process "Mounting the image for modifications... "
mkdir -p $buildfolder/boot $buildfolder/root
Expand Down

0 comments on commit 2af4344

Please sign in to comment.