mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
fix init to exit on failure (#1788)
This commit is contained in:
16
build/init-with-sound.sh
Executable file
16
build/init-with-sound.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
function flatline {
|
||||
echo -n "0" > /sys/class/pwm/pwmchip0/export
|
||||
sleep 0.5
|
||||
echo -n "2272727" > /sys/class/pwm/pwmchip0/pwm0/period
|
||||
echo -n "1136364" > /sys/class/pwm/pwmchip0/pwm0/duty_cycle
|
||||
echo -n "1" > /sys/class/pwm/pwmchip0/pwm0/enable
|
||||
}
|
||||
|
||||
initialization.sh
|
||||
STATUS=$?
|
||||
if [ $STATUS -ne 0 ]; then
|
||||
flatline
|
||||
exit $STATUS
|
||||
fi
|
||||
@@ -4,7 +4,7 @@ After=network-online.target systemd-time-wait-sync.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/local/bin/initialization.sh
|
||||
ExecStart=/usr/local/bin/init-with-sound.sh
|
||||
RemainAfterExit=true
|
||||
StandardOutput=append:/var/log/initialization.log
|
||||
|
||||
|
||||
@@ -1,15 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
function flatline {
|
||||
echo -n "0" > /sys/class/pwm/pwmchip0/export
|
||||
sleep 0.5
|
||||
echo -n "2272727" > /sys/class/pwm/pwmchip0/pwm0/period
|
||||
echo -n "1136364" > /sys/class/pwm/pwmchip0/pwm0/duty_cycle
|
||||
echo -n "1" > /sys/class/pwm/pwmchip0/pwm0/enable
|
||||
exit 1
|
||||
}
|
||||
|
||||
(set -e
|
||||
set -e
|
||||
|
||||
# introduce start9 username and embassy as default password
|
||||
if ! awk -F: '{ print $1 }' /etc/passwd | grep start9
|
||||
@@ -64,7 +54,6 @@ apt-get install -y \
|
||||
pgloader
|
||||
|
||||
# Setup repository from The Guardian Project and install latest stable Tor daemon
|
||||
touch /etc/apt/sources.list.d/tor.list
|
||||
echo "deb [arch=arm64 signed-by=/usr/share/keyrings/tor-archive-keyring.gpg] https://deb.torproject.org/torproject.org bullseye main" >> /etc/apt/sources.list.d/tor.list
|
||||
echo "deb-src [arch=arm64 signed-by=/usr/share/keyrings/tor-archive-keyring.gpg] https://deb.torproject.org/torproject.org bullseye main" >> /etc/apt/sources.list.d/tor.list
|
||||
wget -qO- https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --dearmor | tee /usr/share/keyrings/tor-archive-keyring.gpg >/dev/null
|
||||
@@ -159,5 +148,4 @@ echo "fs.inotify.max_user_watches=1048576" > /etc/sysctl.d/97-embassy.conf
|
||||
sync
|
||||
|
||||
reboot
|
||||
) || flatline
|
||||
|
||||
|
||||
@@ -95,6 +95,7 @@ if [[ "$ENVIRONMENT" =~ (^|-)dev($|-) ]]; then
|
||||
else
|
||||
sudo cp ./build/initialization.sh /tmp/eos-mnt/usr/local/bin
|
||||
fi
|
||||
sudo cp ./build/init-with-sound.sh /tmp/eos-mnt/usr/local/bin
|
||||
|
||||
sudo cp ./build/initialization.service /tmp/eos-mnt/etc/systemd/system/initialization.service
|
||||
sudo ln -s /etc/systemd/system/initialization.service /tmp/eos-mnt/etc/systemd/system/multi-user.target.wants/initialization.service
|
||||
|
||||
Reference in New Issue
Block a user