Address installation inside a chroot
This commit is contained in:
parent
21f60a960b
commit
092b2ba51c
13
install.sh
13
install.sh
@ -7,7 +7,18 @@ export PATH="$HOME/.local/share/omarchy/bin:$PATH"
|
||||
OMARCHY_INSTALL=~/.local/share/omarchy/install
|
||||
|
||||
# Chroot installations have some differences
|
||||
export OMARCHY_CHROOT_INSTALL=$(! cmp -s /proc/1/root/ / && echo 1 || echo 0)
|
||||
if ! cmp -s /proc/1/root/ / 2>/dev/null; then
|
||||
export OMARCHY_CHROOT_INSTALL=1
|
||||
fi
|
||||
|
||||
chrootable_systemctl_enable() {
|
||||
local args=("$@")
|
||||
if [ -n "${OMARCHY_CHROOT_INSTALL:-}" ]; then
|
||||
sudo systemctl "${args[@]}" enable
|
||||
else
|
||||
sudo systemctl "${args[@]}" enable --now
|
||||
fi
|
||||
}
|
||||
|
||||
# Give people a chance to retry running the installation
|
||||
catch_errors() {
|
||||
|
@ -4,12 +4,7 @@
|
||||
# This can happen if archinstall used ethernet
|
||||
if ! command -v iwctl &>/dev/null; then
|
||||
yay -S --noconfirm --needed iwd
|
||||
|
||||
if [ -n "${OMARCHY_CHROOT_INSTALL:-}" ]; then
|
||||
sudo systemctl enable iwd.service
|
||||
else
|
||||
sudo systemctl enable --now iwd.service
|
||||
fi
|
||||
chrootable_systemctl_enable iwd.service
|
||||
fi
|
||||
|
||||
# Prevent systemd-networkd-wait-online timeout on boot
|
||||
|
@ -9,7 +9,7 @@ if ls /sys/class/power_supply/BAT* &>/dev/null; then
|
||||
powerprofilesctl set balanced || true
|
||||
|
||||
# Enable battery monitoring timer for low battery notifications
|
||||
systemctl --user enable --now omarchy-battery-monitor.timer || true
|
||||
chrootable_systemctl_enable --user omarchy-battery-monitor.timer || true
|
||||
else
|
||||
# This computer runs on power outlet
|
||||
powerprofilesctl set performance || true
|
||||
|
@ -4,4 +4,4 @@
|
||||
yay -S --noconfirm --needed blueberry
|
||||
|
||||
# Turn on bluetooth by default
|
||||
sudo systemctl enable --now bluetooth.service
|
||||
chrootable_systemctl_enable bluetooth.service
|
||||
|
@ -1,16 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
sudo pacman -S --noconfirm cups cups-pdf cups-filters cups-browsed system-config-printer avahi nss-mdns
|
||||
sudo systemctl enable --now cups.service
|
||||
chrootable_systemctl_enable cups.service
|
||||
|
||||
# Disable multicast dns in resolved. Avahi will provide this for better network printer discovery
|
||||
sudo mkdir -p /etc/systemd/resolved.conf.d
|
||||
echo -e "[Resolve]\nMulticastDNS=no" | sudo tee /etc/systemd/resolved.conf.d/10-disable-multicast.conf
|
||||
sudo systemctl enable --now avahi-daemon.service
|
||||
chrootable_systemctl_enable avahi-daemon.service
|
||||
|
||||
# Enable automatically adding remote printers
|
||||
if ! grep -q '^CreateRemotePrinters Yes' /etc/cups/cups-browsed.conf; then
|
||||
echo 'CreateRemotePrinters Yes' | sudo tee -a /etc/cups/cups-browsed.conf
|
||||
fi
|
||||
|
||||
sudo systemctl enable --now cups-browsed.service
|
||||
chrootable_systemctl_enable cups-browsed.service
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
if ! command -v ufw &>/dev/null; then
|
||||
if ! command -v ufw &>/dev/null && -z "${OMARCHY_CHROOT_INSTALL:-}"; then
|
||||
yay -S --noconfirm --needed ufw ufw-docker
|
||||
|
||||
# Allow nothing in, everything out
|
||||
|
Loading…
x
Reference in New Issue
Block a user