fix: network improvements

Move to networkd since OMV uses it, also means first boot is a bit faster.
Also improve readme.
This commit is contained in:
Chris Blake 2024-05-21 21:26:22 -05:00
parent b37bdd27d4
commit 459d0a4758
5 changed files with 16 additions and 47 deletions

View file

@ -27,9 +27,10 @@ Note that the 1U UNVR is not currently supported!
Note that currently the install process requires UART to modify the u-boot env for booting.
1. Make sure your UNVR is running the same Unifi firmware as referenced in the README.md in the unifi-firmware directory.
1. Build the firmware image (follow the Usage section), and then throw it on an HDD/SSD formatted to ext4. Put said HDD in the UNVR Pro as the only hard drive.
2. Hook up UART to the UNVR Pro (4 pin header on the PCB near the DC Power Backup port)
3. Boot the UNVR Pro, and press esc twice when prompted to get to the u-boot shell
2. Hook up UART to the UNVR Pro (4 pin header on the PCB near the DC Power Backup port).
3. Boot the UNVR Pro, and press Escape twice when prompted to get to the u-boot shell. You only have 2 seconds to do this!
4. Run the following commands to update the kernel cmdline and save the changes:
```
@ -43,15 +44,18 @@ Note that currently the install process requires UART to modify the u-boot env f
`run bootcmdrecovery`
6. Once recovery boots up, login with `ubnt:ubnt` or `root:ubnt`. You can also use telnet for this instead of UART if you prefer.
7. Mount your HDD with the firmware image, backup the Unifi firmware, and then flash our custom firmware to the EMMC. (below command example assumes your ext4 disk partition is at /dev/sda1)
7. Mount your HDD with the firmware image, backup the Unifi firmware, your u-boot env partitions, and then flash our custom firmware to the EMMC. (below command example assumes your ext4 disk partition is at /dev/sda1)
```
mount /dev/sda1 /mnt
cd /mnt
dd if=/dev/boot of=./unvrpro-emmc-backup.bin bs=4M
dd if=/dev/boot of=/mnt/unvrpro-emmc-backup.bin bs=4M
dd if=/dev/mtd1 of=/mnt/unvrpro-mtd1-uboot-env.bin
dd if=/dev/mtd2 of=/mnt/unvrpro-mtd2-uboot-env-redundant.bin
gunzip debian-UNVRPRO.img.gz
dd if=./debian-UNVRPRO.img of=/dev/boot bs=4M
sync; reboot
sync
reboot
```
8. At this point you can remove the HDD/SSD you used, and enjoy Debian 12 with OpenMediaVault on your UNVR Pro! Default login for OpenMediaVault is `admin:openmediavault`. SSH login information is `debian:debian`.

View file

@ -101,6 +101,10 @@ system_info:
groups: [adm, audio, cdrom, dialout, dip, floppy, netdev, plugdev, sudo, video]
sudo: ["ALL=(ALL) NOPASSWD:ALL"]
shell: /bin/bash
# systemd networking for omv
network:
renderers: ['networkd']
activators: ['networkd']
# Other config here will be given to the distro class and/or path classes
paths:
cloud_dir: /var/lib/cloud/

View file

@ -1,34 +0,0 @@
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (at your option)
# any later version.
#
# Entries in this file show the compile time defaults. Local configuration
# should be created by either modifying this file, or by creating "drop-ins" in
# the resolved.conf.d/ subdirectory. The latter is generally recommended.
# Defaults can be restored by simply deleting this file and all drop-ins.
#
# Use 'systemd-analyze cat-config systemd/resolved.conf' to display the full config.
#
# See resolved.conf(5) for details.
[Resolve]
# Some examples of DNS servers which may be used for DNS= and FallbackDNS=:
# Cloudflare: 1.1.1.1#cloudflare-dns.com 1.0.0.1#cloudflare-dns.com 2606:4700:4700::1111#cloudflare-dns.com 2606:4700:4700::1001#cloudflare-dns.com
# Google: 8.8.8.8#dns.google 8.8.4.4#dns.google 2001:4860:4860::8888#dns.google 2001:4860:4860::8844#dns.google
# Quad9: 9.9.9.9#dns.quad9.net 149.112.112.112#dns.quad9.net 2620:fe::fe#dns.quad9.net 2620:fe::9#dns.quad9.net
DNS=1.1.1.1#cloudflare-dns.com 1.0.0.1#cloudflare-dns.com 2606:4700:4700::1111#cloudflare-dns.com 2606:4700:4700::1001#cloudflare-dns.com
FallbackDNS=8.8.8.8#dns.google 8.8.4.4#dns.google 2001:4860:4860::8888#dns.google 2001:4860:4860::8844#dns.google
#Domains=
#DNSSEC=no
#DNSOverTLS=no
#MulticastDNS=yes
#LLMNR=yes
#Cache=yes
#CacheFromLocalhost=no
#DNSStubListener=yes
#DNSStubListenerExtra=
#ReadEtcHosts=yes
#ResolveUnicastSingleLabel=no

View file

@ -24,7 +24,8 @@ apt-get -o Dpkg::Options::="--force-confold" -y --allow-downgrades \
--allow-remove-essential --allow-change-held-packages install cloud-init \
bsdextrautils git binutils ca-certificates e2fsprogs haveged parted curl \
locales console-common openssh-server less vim net-tools wireguard-tools \
ntpsec u-boot-tools wget u-boot-menu initramfs-tools python3-flask gnupg
ntpsec u-boot-tools wget u-boot-menu initramfs-tools python3-flask gnupg \
libc-ares2
# Locale gen
locale-gen
@ -49,12 +50,6 @@ apt-get --yes --auto-remove --show-upgraded \
--option DPkg::Options::="--force-confold" \
install openmediavault openmediavault-md || true # We "fail" all apt cmds from here on til we boot on HW
# Disable systemd-networkd
systemctl disable systemd-networkd
systemctl disable systemd-networkd-wait-online
systemctl mask systemd-networkd
systemctl mask systemd-networkd-wait-online
# Cleanup stuff we don't want floating around
apt-get autoclean || true
apt-get --purge -y autoremove || true

View file

@ -51,7 +51,7 @@ for file in libgrpc++.so.1 libgrpc.so.10 libprotobuf.so.23 \
libssl.so.1.1 libcrypto.so.1.1 libabsl*.so.20200923 libatomic.so.1; do
cp -H ${build_path}/fw-extract/rootfs/usr/lib/aarch64-linux-gnu/${file} "${build_path}/rootfs/usr/lib/ubnt-fw/"
done
sed -i 's|Type=simple|Type=simple\nEnvironment="LD_LIBRARY_PATH=/usr/lib/ubnt-fw"|g' "${build_path}/rootfs/lib/systemd/system/ulcmd.service" # Add library path
sed -i 's|Type=simple|Type=simple\nEnvironment="LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/ubnt-fw"|g' "${build_path}/rootfs/lib/systemd/system/ulcmd.service" # Add library path
# Kick off bash setup script within chroot
cp ${docker_scripts_path}/bootstrap/001-bootstrap ${build_path}/rootfs/bootstrap