Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable UART 1 for RaspbeeII #5

Open
wants to merge 3 commits into
base: nymea
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
deploy/*
work/*
config
postrun.sh
SKIP
SKIP_IMAGES
.pc
*-pc
apt-cacher-ng/
4 changes: 4 additions & 0 deletions config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
IMG_NAME=nymea-buster
FIRST_USER_NAME="nymea"
FIRST_USER_PASS="nymea"
ENABLE_SSH=1
2 changes: 2 additions & 0 deletions export-image/prerun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ BOOT_LENGTH=$(echo "$PARTED_OUT" | grep -e '^1:' | cut -d':' -f 4 | tr -d B)
ROOT_OFFSET=$(echo "$PARTED_OUT" | grep -e '^2:' | cut -d':' -f 2 | tr -d B)
ROOT_LENGTH=$(echo "$PARTED_OUT" | grep -e '^2:' | cut -d':' -f 4 | tr -d B)

sleep 5

BOOT_DEV=$(losetup --show -f -o "${BOOT_OFFSET}" --sizelimit "${BOOT_LENGTH}" "${IMG_FILE}")
ROOT_DEV=$(losetup --show -f -o "${ROOT_OFFSET}" --sizelimit "${ROOT_LENGTH}" "${IMG_FILE}")
echo "/boot: offset $BOOT_OFFSET, length $BOOT_LENGTH"
Expand Down
70 changes: 70 additions & 0 deletions stage2/04-nymea/00-run-chroot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Add nymea repository
echo -e "\n## nymea repo\ndeb http://repository.nymea.io buster rpi\n#deb-src http://repository.nymea.io buster rpi" | tee /etc/apt/sources.list.d/nymea.list
wget -qO - http://repository.nymea.io/repository-pubkey.gpg | apt-key add -

# Set repository priority (prefer packages from raspbian section)
cat <<EOM >/etc/apt/preferences.d/nymea
Package: *
Pin: release c=raspbian
Pin-Priority: 700

Package: *
Pin: origin repository.nymea.io c=main
Pin-Priority: 500
EOM

apt-get update

cat <<EOM > /etc/motd
_ __ _ _ _ __ ___ ___ __ _
| '_ \| | | | '_ \` _ \ / _ \/ _\` |
| | | | |_| | | | | | | __/ (_| |
|_| |_|\__, |_| |_| |_|\___|\__,_|
__/ |
|___/

EOM


cat <<EOM > /etc/machine-info
PRETTY_HOSTNAME=nymea
EOM

cat <<EOM > /etc/issue.net
nymea - nymea.io | Debian GNU/Linux 10
EOM

cat <<EOM > /etc/issue
nymea - nymea.io | Debian GNU/Linux 10 \n \l
EOM

# Change hostname to nymea
echo nymea > /etc/hostname
sed -i 's/localhost/localhost nymea/' /etc/hosts

# Enable i2c
echo dtparam=i2c_arm=on >> /boot/config.txt
echo i2c-dev >> /etc/modules

# Rotate internal display by default
echo lcd_rotate=2 >> /boot/config.txt

# Enable fake KMS driver
echo dtoverlay=vc4-fkms-v3d >> /boot/config.txt

# Get away with the low voltage warning
echo avoid_warnings=1 >> /boot/config.txt

# Enable ttyS0 uart on GPIO header
echo enable_uart=1 >> /boot/config.txt

# Drop packages conflicting with network-manager
apt-get purge --yes openresolv dhcpcd5

# Disable BlueZ plugins QtBluetooth can't deal with
mkdir /etc/systemd/system/bluetooth.service.d
cat <<EOM > /etc/systemd/system/bluetooth.service.d/01-disable-battery-plugin.conf
[Service]
ExecStart=
ExecStart=/usr/lib/bluetooth/bluetoothd --noplugin=battery,sap
EOM
4 changes: 4 additions & 0 deletions stage2/04-nymea/05-packages
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
nymea
nymea-plugins
nymea-networkmanager
nymea-app-kiosk
Empty file added stage3/SKIP
Empty file.
Empty file added stage3/SKIP_IMAGES
Empty file.
Empty file added stage4/SKIP
Empty file.
Empty file added stage4/SKIP_IMAGES
Empty file.
Empty file added stage5/SKIP
Empty file.
Empty file added stage5/SKIP_IMAGES
Empty file.