From 2af4344765669f6cc431041d3e75d85a3f82354d Mon Sep 17 00:00:00 2001 From: Holger Friedrich Date: Fri, 29 May 2020 21:41:57 +0200 Subject: [PATCH] Introduction of Raspbian Pi OS * Replace raspbian by raspios due to renaming of the OS * (beta) Added initial support for building 64-bit images Signed-off-by: Holger Friedrich --- build-image/openhabian.pi-raspbian64.conf | 58 +++++++++++++++++++++++ build.bash | 30 ++++++++---- 2 files changed, 80 insertions(+), 8 deletions(-) create mode 100644 build-image/openhabian.pi-raspbian64.conf diff --git a/build-image/openhabian.pi-raspbian64.conf b/build-image/openhabian.pi-raspbian64.conf new file mode 100644 index 000000000..0d218d8b8 --- /dev/null +++ b/build-image/openhabian.pi-raspbian64.conf @@ -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 diff --git a/build.bash b/build.bash index 7593b3168..b3e781d91 100755 --- a/build.bash +++ b/build.bash @@ -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)" @@ -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" @@ -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