mirror of
https://github.com/riptidewave93/UNVR-NAS.git
synced 2025-02-15 03:51:54 +00:00
* add our own fan controller, will need more tuning with time, but it's a great start * add restart/shutdown hooks for ulcmd, so the display shows the state of the system * change how we expose unifi's libs to binaries * Fixup systemd hang at boot due to networking * move ubnthal to systemd task, since we don't load modules due to the unifi initramfs in the prebuilt kernel
61 lines
2.6 KiB
Bash
Executable file
61 lines
2.6 KiB
Bash
Executable file
#!/bin/bash
|
|
set -e
|
|
|
|
echo "Starting 001-bootstrap within chroot!"
|
|
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
export APT_LISTCHANGES_FRONTEND=none
|
|
|
|
# Conf debconf
|
|
debconf-set-selections /debconf.set
|
|
rm -f /debconf.set
|
|
|
|
# Initial package install
|
|
apt-get clean
|
|
apt-get update
|
|
apt-mark hold linux-image-* # We do not want these, as we run our own kernel!
|
|
|
|
# Setup our services
|
|
systemctl enable load-ubnt-modules
|
|
systemctl enable mock-ubnt-api
|
|
systemctl enable ulcmd
|
|
systemctl enable ulcmd-reboot-hook
|
|
systemctl enable ulcmd-shutdown-hook
|
|
systemctl enable unvr-fan-daemon
|
|
|
|
# Now that we have our wanted kernel in place, do the rest of our installs
|
|
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 \
|
|
libc-ares2
|
|
|
|
# Locale gen
|
|
locale-gen
|
|
|
|
# Setup OMV repo
|
|
wget --quiet --output-document=- https://packages.openmediavault.org/public/archive.key | gpg --dearmor --yes --output "/usr/share/keyrings/openmediavault-archive-keyring.gpg"
|
|
cat <<EOF >> /etc/apt/sources.list.d/openmediavault.list
|
|
deb [signed-by=/usr/share/keyrings/openmediavault-archive-keyring.gpg] https://packages.openmediavault.org/public sandworm main
|
|
# deb [signed-by=/usr/share/keyrings/openmediavault-archive-keyring.gpg] https://downloads.sourceforge.net/project/openmediavault/packages sandworm main
|
|
## This software is not part of OpenMediaVault, but is offered by third-party
|
|
## developers as a service to OpenMediaVault users.
|
|
deb [signed-by=/usr/share/keyrings/openmediavault-archive-keyring.gpg] https://packages.openmediavault.org/public sandworm partner
|
|
# deb [signed-by=/usr/share/keyrings/openmediavault-archive-keyring.gpg] https://downloads.sourceforge.net/project/openmediavault/packages sandworm partner
|
|
EOF
|
|
|
|
# Install OMV
|
|
apt-get update
|
|
apt-get --yes --auto-remove --show-upgraded \
|
|
--allow-downgrades --allow-change-held-packages \
|
|
--no-install-recommends \
|
|
--option DPkg::Options::="--force-confdef" \
|
|
--option DPkg::Options::="--force-confold" \
|
|
install openmediavault openmediavault-md || true # We "fail" all apt cmds from here on til we boot on HW
|
|
|
|
# Cleanup stuff we don't want floating around
|
|
apt-get autoclean || true
|
|
apt-get --purge -y autoremove || true
|
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /etc/resolv.conf
|
|
rm -rf /var/lib/dbus/machine-id /etc/machine-id # Nuke machine IDs
|