mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
Feature/multi platform (#1866)
* wip * wip * wip * wip * wip * wip * remove debian dir * lazy env and git hash * remove env and git hash on clean * don't leave project dir * use docker for native builds * start9 rust * correctly mount registry * remove systemd config * switch to /usr/bin * disable sound for now * wip * change disk list * multi-arch images * multi-arch system images * default aarch64 * edition 2021 * dynamic wifi interface name * use wifi interface from config * bugfixes * add beep based sound * wip * wip * wip * separate out raspberry pi specific files * fixes * use new initramfs always * switch journald conf to sed script * fixes * fix permissions * talking about kernel modules not scripts * fix * fix * switch to MBR * install to /usr/lib * fixes * fixes * fixes * fixes * add media config to cfg path * fixes * fixes * fixes * raspi image fixes * fix test * fix workflow * sync boot partition * gahhhhh
This commit is contained in:
93
build/lib/scripts/postinst
Executable file
93
build/lib/scripts/postinst
Executable file
@@ -0,0 +1,93 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
SYSTEMCTL=systemctl
|
||||
if [ -n "$DPKG_MAINTSCRIPT_PACKAGE" ]; then
|
||||
SYSTEMCTL=deb-systemd-helper
|
||||
fi
|
||||
|
||||
if [ -f /usr/sbin/grub-probe ]; then
|
||||
mv /usr/sbin/grub-probe /usr/sbin/grub-probe-default
|
||||
ln -s /usr/lib/embassy/scripts/grub-probe-eos /usr/sbin/grub-probe
|
||||
fi
|
||||
|
||||
cp /usr/lib/embassy/scripts/embassy-initramfs-module /etc/initramfs-tools/scripts/embassy
|
||||
|
||||
if ! grep overlay /etc/initramfs-tools/modules > /dev/null; then
|
||||
echo overlay >> /etc/initramfs-tools/modules
|
||||
fi
|
||||
|
||||
update-initramfs -u -k all
|
||||
|
||||
if [ -f /etc/default/grub ]; then
|
||||
sed -i '/\(^\|#\)GRUB_CMDLINE_LINUX=/c\GRUB_CMDLINE_LINUX="boot=embassy"' /etc/default/grub
|
||||
fi
|
||||
|
||||
# change timezone
|
||||
rm -f /etc/localtime
|
||||
ln -s /usr/share/zoneinfo/Etc/UTC /etc/localtime
|
||||
|
||||
# switch to systemd-resolved & network-manager
|
||||
echo "#" > /etc/network/interfaces
|
||||
ln -rsf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
|
||||
cat << EOF > /etc/NetworkManager/NetworkManager.conf
|
||||
[main]
|
||||
plugins=ifupdown,keyfile
|
||||
dns=systemd-resolved
|
||||
|
||||
[ifupdown]
|
||||
managed=true
|
||||
EOF
|
||||
$SYSTEMCTL enable systemd-resolved.service
|
||||
$SYSTEMCTL disable wpa_supplicant.service
|
||||
|
||||
$SYSTEMCTL disable postgresql.service
|
||||
$SYSTEMCTL disable bluetooth.service
|
||||
$SYSTEMCTL disable hciuart.service
|
||||
$SYSTEMCTL disable triggerhappy.service
|
||||
|
||||
$SYSTEMCTL mask sleep.target
|
||||
$SYSTEMCTL mask suspend.target
|
||||
$SYSTEMCTL mask hibernate.target
|
||||
$SYSTEMCTL mask hybrid-sleep.target
|
||||
|
||||
if which gsettings > /dev/null; then
|
||||
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout '0'
|
||||
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout '0'
|
||||
fi
|
||||
|
||||
sed -i 's/Restart=on-failure/Restart=always/g' /lib/systemd/system/tor@default.service
|
||||
sed -i 's/ExecStart=\/usr\/bin\/dockerd/ExecStart=\/usr\/bin\/dockerd --exec-opt native.cgroupdriver=systemd/g' /lib/systemd/system/docker.service
|
||||
sed -i '/}/i \ \ \ \ application\/wasm \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ wasm;' /etc/nginx/mime.types
|
||||
sed -i 's/# server_names_hash_bucket_size 64;/server_names_hash_bucket_size 128;/g' /etc/nginx/nginx.conf
|
||||
sed -i '/\(^\|#\)entries-per-entry-group-max=/c\entries-per-entry-group-max=128' /etc/avahi/avahi-daemon.conf
|
||||
sed -i '/\(^\|#\)Storage=/c\Storage=persistent' /etc/systemd/journald.conf
|
||||
sed -i '/\(^\|#\)Compress=/c\Compress=yes' /etc/systemd/journald.conf
|
||||
sed -i '/\(^\|#\)SystemMaxUse=/c\SystemMaxUse=1G' /etc/systemd/journald.conf
|
||||
sed -i '/\(^\|#\)ForwardToSyslog=/c\ForwardToSyslog=no' /etc/systemd/journald.conf
|
||||
mkdir -p /etc/docker
|
||||
ln -sf /usr/lib/embassy/docker-engine.slice /etc/systemd/system/docker-engine.slice
|
||||
echo '{ "cgroup-parent": "docker-engine.slice" }' > /etc/docker/daemon.json
|
||||
mkdir -p /etc/nginx/ssl
|
||||
|
||||
# fix to suppress docker warning, fixed in 21.xx release of docker cli: https://github.com/docker/cli/pull/2934
|
||||
mkdir -p /root/.docker
|
||||
touch /root/.docker/config.json
|
||||
|
||||
cat << EOF > /etc/tor/torrc
|
||||
SocksPort 0.0.0.0:9050
|
||||
SocksPolicy accept 127.0.0.1
|
||||
SocksPolicy accept 172.18.0.0/16
|
||||
SocksPolicy reject *
|
||||
ControlPort 9051
|
||||
CookieAuthentication 1
|
||||
EOF
|
||||
|
||||
rm -rf /var/lib/tor/*
|
||||
|
||||
echo "fs.inotify.max_user_watches=1048576" > /etc/sysctl.d/97-embassy.conf
|
||||
|
||||
rm -f /etc/motd
|
||||
ln -sf /usr/lib/embassy/motd /etc/update-motd.d/00-embassy
|
||||
chmod -x /etc/update-motd.d/*
|
||||
chmod +x /etc/update-motd.d/00-embassy
|
||||
Reference in New Issue
Block a user