-
-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Replace raspbian by raspios due to renaming of the OS * (beta) Added initial support for building 64-bit images * Set default runlevel to multi-user.target, disable auto-login * Update documentation Signed-off-by: Holger Friedrich <[email protected]>
- Loading branch information
1 parent
0eaaa06
commit 0a31499
Showing
5 changed files
with
102 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# 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=stable | ||
|
||
# debug verbosity mode | ||
# off, on (verbose output in log) or maximum (show every command) | ||
# as long as image is still beta, default to on | ||
debugmode=on | ||
|
||
# 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 | ||
# stretch, buster | ||
# bionic, focal | ||
#release=buster | ||
|
||
# Java architecture mode | ||
# Valid arguments: "Adopt11", "Zulu8-32", "Zulu8-64", "Zulu11-32", or "Zulu11-64" | ||
java_opt=Zulu11-64 | ||
|
||
# vim: filetype=sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ set -e | |
|
||
usage() { | ||
echo -e "Usage: $(basename "$0") <platform> [dev-git|dev-url] <branch> <url>" | ||
echo -e "\\nCurrently supported platforms: rpi" | ||
echo -e "\\nCurrently supported platforms: rpi, rpi64 (beta)" | ||
} | ||
|
||
########################## | ||
|
@@ -141,9 +141,13 @@ echo_process "This script will build the openHABian image file." | |
|
||
# Identify hardware platform | ||
if [ "$1" == "rpi" ]; then | ||
hw_platform="pi-raspbian" | ||
hw_platform="pi-raspios32" | ||
echo_process "Hardware platform: Raspberry Pi (rpi)" | ||
|
||
elif [ "$1" == "rpi64" ]; then | ||
hw_platform="pi-raspios64beta" | ||
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-raspios32" ] || [ "$hw_platform" == "pi-raspios64beta" ]; then | ||
if [ "$hw_platform" == "pi-raspios64beta" ]; 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 | ||
|
@@ -309,6 +323,16 @@ elif [ "$hw_platform" == "pi-raspbian" ]; then | |
echo_process "Injecting 'openhabian-installer.service', 'first-boot.bash' and 'openhabian.conf'... " | ||
cp $sourcefolder/openhabian-installer.service $buildfolder/root/etc/systemd/system/ | ||
ln -s $buildfolder/root/etc/systemd/system/openhabian-installer.service $buildfolder/root/etc/systemd/system/multi-user.target.wants/openhabian-installer.service | ||
|
||
echo_process "Setting default runlevel multiuser.target... " | ||
( # open a subshell, returns to current dir automatically | ||
cd $buildfolder/root/etc/systemd/system/ || exit 1 | ||
rm -rf default.target | ||
ln -s ../../../lib/systemd/system/multi-user.target default.target | ||
# disable autologin | ||
rm -f $buildfolder/root/etc/systemd/system/[email protected]/autologin.conf | ||
) | ||
|
||
touch $buildfolder/root/opt/openHABian-install-inprogress | ||
# maybe we should use a trap to get this done in case of error | ||
umount_image_file_root "$imagefile" "$buildfolder" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters