Compare commits
20 Commits
16ae09c86d
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
1658a53081 | ||
|
9cc539a6e4 | ||
|
46faab708b | ||
|
e620f80b0e | ||
|
134d25682b | ||
|
88d7d12c69 | ||
|
83b7867da4 | ||
|
af1642b138 | ||
|
51a0fd0883 | ||
|
b22785ab3e | ||
|
ef015add0a | ||
|
81d60bb1b3 | ||
|
50d9099231 | ||
|
aa4ec62c47 | ||
|
7fb1ba5283 | ||
|
386cb3230e | ||
|
0b10dc426b | ||
|
40fd173777 | ||
|
1e24598316 | ||
|
901d5cdb7a |
@@ -1,6 +1,6 @@
|
|||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
#
|
#
|
||||||
# Copyright 2020, Stormux, <storm_dragon@linux-a11y.org>
|
# Copyright 2020, Stormux, <storm_dragon@stormux.org>
|
||||||
#
|
#
|
||||||
# This is free software; you can redistribute it and/or modify it under the
|
# This is free software; you can redistribute it and/or modify it under the
|
||||||
# terms of the GNU General Public License as published by the Free
|
# terms of the GNU General Public License as published by the Free
|
||||||
@@ -91,7 +91,7 @@ done
|
|||||||
|
|
||||||
# make sure variables are set, or use defaults.
|
# make sure variables are set, or use defaults.
|
||||||
export imageVersion="${imageVersion:-64}"
|
export imageVersion="${imageVersion:-64}"
|
||||||
export imageSize="${imageSize:-4G}"
|
export imageSize="${imageSize:-6G}"
|
||||||
imageName="${imageName:-stormux-pi4-${imageVersion}-$(date '+%Y-%m-%d').img}"
|
imageName="${imageName:-stormux-pi4-${imageVersion}-$(date '+%Y-%m-%d').img}"
|
||||||
imageName="${imageName/-64-/-aarch64-}"
|
imageName="${imageName/-64-/-aarch64-}"
|
||||||
imageName="${imageName/-32-/-armv7h-}"
|
imageName="${imageName/-32-/-armv7h-}"
|
||||||
@@ -175,7 +175,6 @@ pacman -Su --needed --noconfirm \
|
|||||||
brltty \
|
brltty \
|
||||||
cloud-utils \
|
cloud-utils \
|
||||||
cronie \
|
cronie \
|
||||||
dbus-broker \
|
|
||||||
espeak-ng \
|
espeak-ng \
|
||||||
fake-hwclock \
|
fake-hwclock \
|
||||||
firmware-raspberrypi \
|
firmware-raspberrypi \
|
||||||
@@ -185,7 +184,6 @@ pacman -Su --needed --noconfirm \
|
|||||||
man \
|
man \
|
||||||
man-pages \
|
man-pages \
|
||||||
networkmanager \
|
networkmanager \
|
||||||
ntp \
|
|
||||||
pipewire \
|
pipewire \
|
||||||
pipewire-alsa \
|
pipewire-alsa \
|
||||||
pipewire-jack \
|
pipewire-jack \
|
||||||
@@ -254,7 +252,7 @@ rm -rf /home/stormux/packages/
|
|||||||
# Enable linger so that hopefully sound will start at login.
|
# Enable linger so that hopefully sound will start at login.
|
||||||
mkdir -p /var/lib/systemd/linger
|
mkdir -p /var/lib/systemd/linger
|
||||||
touch /var/lib/systemd/linger/stormux
|
touch /var/lib/systemd/linger/stormux
|
||||||
systemctl --global enable dbus-broker.service pipewire.service pipewire-pulse.service
|
systemctl --global enable pipewire.service pipewire-pulse.service
|
||||||
/usr/share/fenrirscreenreader/tools/configure_pipewire.sh
|
/usr/share/fenrirscreenreader/tools/configure_pipewire.sh
|
||||||
sudo -u stormux /usr/share/fenrirscreenreader/tools/configure_pipewire.sh
|
sudo -u stormux /usr/share/fenrirscreenreader/tools/configure_pipewire.sh
|
||||||
# Configure sudo for group wheel, remove nopasswd for the stormux user
|
# Configure sudo for group wheel, remove nopasswd for the stormux user
|
||||||
@@ -262,8 +260,8 @@ echo '%wheel ALL=(ALL) ALL' > /etc/sudoers.d/wheel
|
|||||||
# Set the hostname
|
# Set the hostname
|
||||||
echo stormux > /etc/hostname
|
echo stormux > /etc/hostname
|
||||||
# Configure services
|
# Configure services
|
||||||
systemctl enable brltty.path cronie.service dbus-broker.service fake-hwclock.service fenrirscreenreader.service log2ram.service NetworkManager.service ntpd.service
|
systemctl disable systemd-networkd.service systemd-networkd.socket
|
||||||
systemctl disable dbus.service
|
systemctl enable brltty.path cronie.service fake-hwclock.service fenrirscreenreader.service log2ram.service NetworkManager.service
|
||||||
# Cleanup packages
|
# Cleanup packages
|
||||||
pacman -Sc --noconfirm
|
pacman -Sc --noconfirm
|
||||||
pacman -R --noconfirm go
|
pacman -R --noconfirm go
|
||||||
|
@@ -1,20 +1,32 @@
|
|||||||
|
Section "ServerLayout"
|
||||||
|
Identifier "Layout0"
|
||||||
|
Screen 0 "Screen0"
|
||||||
|
EndSection
|
||||||
|
|
||||||
Section "Monitor"
|
Section "Monitor"
|
||||||
Identifier "dummy_monitor"
|
Identifier "Monitor0"
|
||||||
HorizSync 28.0-80.0
|
Option "DPMS" "true"
|
||||||
VertRefresh 48.0-75.0
|
HorizSync 28.0-80.0
|
||||||
Modeline "1920x1080" 172.80 1920 2040 2248 2576 1080 1081 1084 1118
|
VertRefresh 48.0-75.0
|
||||||
|
Modeline "1920x1080" 172.80 1920 2040 2248 2576 1080 1081 1084 1118
|
||||||
EndSection
|
EndSection
|
||||||
|
|
||||||
Section "Device"
|
Section "Device"
|
||||||
Identifier "dummy_card"
|
Identifier "Card0"
|
||||||
VideoRam 256000
|
# Try standard driver
|
||||||
Driver "dummy"
|
Driver "modesetting"
|
||||||
|
# Fallback to dummy
|
||||||
|
Option "FallbackDriver" "dummy"
|
||||||
|
VideoRam 256000
|
||||||
EndSection
|
EndSection
|
||||||
|
|
||||||
Section "Screen"
|
Section "Screen"
|
||||||
Identifier "dummy_screen"
|
Identifier "Screen0"
|
||||||
Device "dummy_card"
|
Device "Card0"
|
||||||
Monitor "dummy_monitor"
|
Monitor "Monitor0"
|
||||||
SubSection "Display"
|
DefaultDepth 24
|
||||||
EndSubSection
|
SubSection "Display"
|
||||||
|
Depth 24
|
||||||
|
Modes "1920x1080"
|
||||||
|
EndSubSection
|
||||||
EndSection
|
EndSection
|
||||||
|
@@ -1,7 +1,25 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
if [[ "$(tty)" = "/dev/tty1" ]]; then
|
if [[ "$(tty)" != "/dev/tty1" ]]; then
|
||||||
cat << "EOF"
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -x /opt/configure-stormux/configure-stormux.sh ]]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! [[ -x /usr/local/bin/configure-stormux ]]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For audible sudo prompts:
|
||||||
|
unset sudoFlags
|
||||||
|
if [[ -x /etc/audibleprompt.sh ]]; then
|
||||||
|
export SUDO_ASKPASS=/etc/audibleprompt.sh
|
||||||
|
export sudoFlags=("-A")
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat << "EOF"
|
||||||
Hello, and welcome to Stormux!
|
Hello, and welcome to Stormux!
|
||||||
|
|
||||||
Let's get you set up. After you press enter, you will be prompted for the sudo password.
|
Let's get you set up. After you press enter, you will be prompted for the sudo password.
|
||||||
@@ -12,7 +30,5 @@ Once again, the password is stormux in all lower case letters.
|
|||||||
|
|
||||||
Please press enter to continue.
|
Please press enter to continue.
|
||||||
EOF
|
EOF
|
||||||
read -r
|
read -r
|
||||||
sudo configure-stormux
|
sudo "${sudoFlags[@]}" configure-stormux
|
||||||
sudo rm -- "/etc/profile.d/stormux_first_boot.sh"
|
|
||||||
fi
|
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
# Raspberry Pi Information
|
# Raspberry Pi Information
|
||||||
alias pi-temp='/usr/bin/vcgencmd measure_temp'
|
alias pi-temp='/usr/bin/vcgencmd measure_temp'
|
||||||
alias pi-version='cat /sys/firmware/devicetree/base/model;echo'
|
alias pi-version='cat /sys/firmware/devicetree/base/model;echo'
|
||||||
|
alias pi-ip='ip a | grep -v "127.0.0.1" | grep -E -o "([0-9]{1,3}\.){3}[0-9]{1,3}/[0-9]{1,2}"'
|
||||||
|
11
pi4/files/etc/systemd/system/time_sync_at_boot.service
Normal file
11
pi4/files/etc/systemd/system/time_sync_at_boot.service
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Update system time from worldtimeapi.org
|
||||||
|
After=network-online.target
|
||||||
|
Wants=network-online.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/usr/local/bin/sync_time.sh
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
@@ -1,7 +1,22 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# For audible sudo prompts:
|
||||||
|
unset sudoFlags
|
||||||
|
if [[ -x /etc/audibleprompt.sh ]]; then
|
||||||
|
export SUDO_ASKPASS=/etc/audibleprompt.sh
|
||||||
|
export sudoFlags=("-A")
|
||||||
|
fi
|
||||||
|
|
||||||
|
trap cleanup EXIT
|
||||||
|
cleanup() {
|
||||||
|
popd &> /dev/null
|
||||||
|
if ! [[ -x /opt/configure-stormux/configure-stormux.sh ]]; then
|
||||||
|
echo "Initial setup is not complete."
|
||||||
|
echo "To continue setup, please run:"
|
||||||
|
echo "sudo configure-stormux"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
export SUDO_ASKPASS=/etc/audibleprompt.sh
|
|
||||||
trap 'popd &> /dev/null' EXIT
|
|
||||||
|
|
||||||
if [[ -x /opt/configure-stormux/configure-stormux.sh ]]; then
|
if [[ -x /opt/configure-stormux/configure-stormux.sh ]]; then
|
||||||
pushd /opt/configure-stormux
|
pushd /opt/configure-stormux
|
||||||
@@ -9,54 +24,116 @@ if [[ -x /opt/configure-stormux/configure-stormux.sh ]]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -d /opt/configure-stormux ]]; then
|
export DIALOGOPTS='--insecure --no-lines --visit-items'
|
||||||
# Offer to switch fenrir layout.
|
|
||||||
echo "Would you like to switch Fenrir to laptop layout? (y/n)"
|
set_timezone() {
|
||||||
|
# Get the list of timezones
|
||||||
|
mapfile -t regions < <(timedatectl --no-pager list-timezones | cut -d '/' -f1 | sort -u)
|
||||||
|
|
||||||
|
# Use the same text twice here and just hide the tag field.
|
||||||
|
region=$(dialog --backtitle "Please select your Region" \
|
||||||
|
--no-tags \
|
||||||
|
--menu "Use up and down arrows or page-up and page-down to navigate the list, and press 'Enter' to make your selection." 0 0 0 \
|
||||||
|
$(for i in ${regions[@]} ; do echo "$i";echo "$i";done) --stdout)
|
||||||
|
|
||||||
|
|
||||||
|
mapfile -t cities < <(timedatectl --no-pager list-timezones | grep "$region" | cut -d '/' -f2 | sort -u)
|
||||||
|
|
||||||
|
# Use the same text twice here and just hide the tag field.
|
||||||
|
city=$(dialog --backtitle "Please select a city near you" \
|
||||||
|
--no-tags \
|
||||||
|
--menu "Use up and down arrow or page-up and page-down to navigate the list." 0 0 10 \
|
||||||
|
$(for i in ${cities[@]} ; do echo "$i";echo "$i";done) --stdout)
|
||||||
|
|
||||||
|
# Set the timezone
|
||||||
|
if [[ -f /etc/localtime ]]; then
|
||||||
|
rm /etc/localtime
|
||||||
|
fi
|
||||||
|
ln -sf /usr/share/zoneinfo/${region}/${city} /etc/localtime
|
||||||
|
timedatectl set-ntp true
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Offer to switch fenrir layout.
|
||||||
|
echo "Would you like to switch Fenrir to laptop layout?"
|
||||||
|
echo "Press y for yes or n for no followed by enter."
|
||||||
|
read -r continue
|
||||||
|
continue="${continue::1}"
|
||||||
|
if [[ "${continue,}" == "y" ]];then
|
||||||
|
sed -i 's/=desktop/=laptop/' /etc/fenrirscreenreader/settings/settings.conf
|
||||||
|
clear
|
||||||
|
systemctl restart fenrirscreenreader.service
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check for possible resize
|
||||||
|
diskSource="$(df --output='source' / | tail -1)"
|
||||||
|
diskSize="$(df -h --output='size' / | tail -1 | tr -cd '[:digit:].')"
|
||||||
|
diskSize=${diskSize%.*}
|
||||||
|
if [[ $diskSize -le 7 ]]; then
|
||||||
|
echo "$diskSource is only $diskSize gigs, which means it probably needs to be resized. Would you like to do this now?"
|
||||||
|
echo "Press y for yes or n for no followed by enter."
|
||||||
read -r continue
|
read -r continue
|
||||||
continue="${continue::1}"
|
continue="${continue::1}"
|
||||||
if [[ "${continue,}" == "y" ]];then
|
if [[ "${continue,}" == "y" ]];then
|
||||||
sed -i 's/=desktop/=laptop/' /etc/fenrirscreenreader/settings/settings.conf
|
sudo "${sudoFlags[@]}" growpartfs $diskSource
|
||||||
systemctl restart fenrirscreenreader.service
|
|
||||||
clear
|
|
||||||
fi
|
fi
|
||||||
if ! ping -c1 stormux.org &> /dev/null ; then
|
|
||||||
echo "No internet connection detected. Press enter to open NetworkManager."
|
|
||||||
echo "Note, it is best to put Fenrir into highlight mode while using NetworkManager."
|
|
||||||
echo "In desktop layout this is done by pressing Fenrir+numpad asterisk."
|
|
||||||
echo "That is the key just above numpad 9."
|
|
||||||
echo "In laptop mode, press Fenrir+y."
|
|
||||||
echo "In desktop mode the Fenrir key is numpad insert."
|
|
||||||
echo "In laptop mode the Fenrir key is the Super key, sometimes called the Windows key."
|
|
||||||
echo "Press enter to continue."
|
|
||||||
read -r continue
|
|
||||||
nmtui-connect
|
|
||||||
fi
|
|
||||||
# Check for internet connectivity
|
|
||||||
if ping -qc1 -W 1 stormux.org &> /dev/null; then
|
|
||||||
echo "Updating the clock to prevent certificate errors..."
|
|
||||||
# Get current date and time
|
|
||||||
date_time=$(curl -s http://worldtimeapi.org/api/ip | grep -oP '(?<="datetime":")[^"]*')
|
|
||||||
echo "Current date and time: $date_time"
|
|
||||||
# set date and time
|
|
||||||
date -s "$date_time"
|
|
||||||
else
|
|
||||||
echo "Please connect to the internet and run ${0##*/} again."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "Installing configure-stormux..."
|
|
||||||
git -C /opt clone -q https://git.stormux.org/storm/configure-stormux || exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ! ping -c1 stormux.org &> /dev/null ; then
|
||||||
|
echo "No internet connection detected. Press enter to open NetworkManager."
|
||||||
|
echo "Note, it is best to put Fenrir into highlight mode while using NetworkManager."
|
||||||
|
echo "In desktop layout this is done by pressing Fenrir+numpad asterisk."
|
||||||
|
echo "That is the key just above numpad 9."
|
||||||
|
echo "In laptop mode, press Fenrir+y."
|
||||||
|
echo "In desktop mode the Fenrir key is numpad insert."
|
||||||
|
echo "In laptop mode the Fenrir key is the Super key, sometimes called the Windows key."
|
||||||
|
echo "After connecting to the internet, remember to go back to cursor mode."
|
||||||
|
echo "It is the same key used to switch to highlight mode."
|
||||||
|
echo "Press enter to continue."
|
||||||
|
read -r continue
|
||||||
|
nmtui-connect
|
||||||
|
fi
|
||||||
|
# Check for internet connectivity
|
||||||
|
if ping -qc1 -W 1 stormux.org &> /dev/null; then
|
||||||
|
echo "Updating the clock to prevent certificate errors..."
|
||||||
|
# Get current date and time
|
||||||
|
date_time=$(curl -s http://worldtimeapi.org/api/ip | grep -oP '(?<="datetime":")[^"]*')
|
||||||
|
echo "Current date and time: $date_time"
|
||||||
|
# set date and time
|
||||||
|
date -s "$date_time"
|
||||||
|
echo "If your Pi does not have a CMOS battery and is powered off regularly, it may take a while for the time to be set correctly after boot."
|
||||||
|
echo "Stormux provides a service to sync the time after internet connection is established."
|
||||||
|
read -rp "Would you like the time to sync as soon as the Pi connects to the internet? " answer
|
||||||
|
answer="${answer:0:1}"
|
||||||
|
if [[ "${answer,,}" == "y" ]]; then
|
||||||
|
systemctl enable time_sync_at_boot.service
|
||||||
|
else
|
||||||
|
echo "Time sync at boot skipped."
|
||||||
|
echo "If you change your mind later, simply type:"
|
||||||
|
echo "sudo systemctl enable time_sync_at_boot.service"
|
||||||
|
fi
|
||||||
|
set_timezone
|
||||||
|
else
|
||||||
|
echo "Please connect to the internet and run ${0##*/} again."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Installing configure-stormux..."
|
||||||
|
git -C /opt clone -q https://git.stormux.org/storm/configure-stormux || exit 1
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Initial setup is complete."
|
echo "Initial setup is complete."
|
||||||
echo
|
echo
|
||||||
echo "If you would like more options, run configure-stormux,"
|
echo "The default passwords are stormux for the stormux user"
|
||||||
|
echo "and root for the root user. It is highly recommended to change them."
|
||||||
|
echo "To change the password for stormux, run:"
|
||||||
|
echo "passwd"
|
||||||
|
echo "To change the password for root, run:"
|
||||||
|
echo "sudo passwd"
|
||||||
|
echo
|
||||||
|
echo "For more configuration options, run configure-stormux,"
|
||||||
echo "or you may configure your system manually."
|
echo "or you may configure your system manually."
|
||||||
echo
|
echo
|
||||||
echo "Thank you for choosing Stormux."
|
echo "Thank you for choosing Stormux."
|
||||||
echo
|
|
||||||
echo "Removing first run script..."
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
4
pi4/files/usr/local/bin/sync_time.sh
Executable file
4
pi4/files/usr/local/bin/sync_time.sh
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
date_time=$(curl -s http://worldtimeapi.org/api/ip | grep -oP '(?<="datetime":")[^"]*')
|
||||||
|
date -s "$date_time"
|
Reference in New Issue
Block a user