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
|
||||
#
|
||||
# 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
|
||||
# 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.
|
||||
export imageVersion="${imageVersion:-64}"
|
||||
export imageSize="${imageSize:-4G}"
|
||||
export imageSize="${imageSize:-6G}"
|
||||
imageName="${imageName:-stormux-pi4-${imageVersion}-$(date '+%Y-%m-%d').img}"
|
||||
imageName="${imageName/-64-/-aarch64-}"
|
||||
imageName="${imageName/-32-/-armv7h-}"
|
||||
@@ -175,7 +175,6 @@ pacman -Su --needed --noconfirm \
|
||||
brltty \
|
||||
cloud-utils \
|
||||
cronie \
|
||||
dbus-broker \
|
||||
espeak-ng \
|
||||
fake-hwclock \
|
||||
firmware-raspberrypi \
|
||||
@@ -185,7 +184,6 @@ pacman -Su --needed --noconfirm \
|
||||
man \
|
||||
man-pages \
|
||||
networkmanager \
|
||||
ntp \
|
||||
pipewire \
|
||||
pipewire-alsa \
|
||||
pipewire-jack \
|
||||
@@ -254,7 +252,7 @@ rm -rf /home/stormux/packages/
|
||||
# Enable linger so that hopefully sound will start at login.
|
||||
mkdir -p /var/lib/systemd/linger
|
||||
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
|
||||
sudo -u stormux /usr/share/fenrirscreenreader/tools/configure_pipewire.sh
|
||||
# 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
|
||||
echo stormux > /etc/hostname
|
||||
# Configure services
|
||||
systemctl enable brltty.path cronie.service dbus-broker.service fake-hwclock.service fenrirscreenreader.service log2ram.service NetworkManager.service ntpd.service
|
||||
systemctl disable dbus.service
|
||||
systemctl disable systemd-networkd.service systemd-networkd.socket
|
||||
systemctl enable brltty.path cronie.service fake-hwclock.service fenrirscreenreader.service log2ram.service NetworkManager.service
|
||||
# Cleanup packages
|
||||
pacman -Sc --noconfirm
|
||||
pacman -R --noconfirm go
|
||||
|
@@ -1,20 +1,32 @@
|
||||
Section "ServerLayout"
|
||||
Identifier "Layout0"
|
||||
Screen 0 "Screen0"
|
||||
EndSection
|
||||
|
||||
Section "Monitor"
|
||||
Identifier "dummy_monitor"
|
||||
HorizSync 28.0-80.0
|
||||
VertRefresh 48.0-75.0
|
||||
Modeline "1920x1080" 172.80 1920 2040 2248 2576 1080 1081 1084 1118
|
||||
Identifier "Monitor0"
|
||||
Option "DPMS" "true"
|
||||
HorizSync 28.0-80.0
|
||||
VertRefresh 48.0-75.0
|
||||
Modeline "1920x1080" 172.80 1920 2040 2248 2576 1080 1081 1084 1118
|
||||
EndSection
|
||||
|
||||
|
||||
Section "Device"
|
||||
Identifier "dummy_card"
|
||||
VideoRam 256000
|
||||
Driver "dummy"
|
||||
Identifier "Card0"
|
||||
# Try standard driver
|
||||
Driver "modesetting"
|
||||
# Fallback to dummy
|
||||
Option "FallbackDriver" "dummy"
|
||||
VideoRam 256000
|
||||
EndSection
|
||||
|
||||
|
||||
Section "Screen"
|
||||
Identifier "dummy_screen"
|
||||
Device "dummy_card"
|
||||
Monitor "dummy_monitor"
|
||||
SubSection "Display"
|
||||
EndSubSection
|
||||
Identifier "Screen0"
|
||||
Device "Card0"
|
||||
Monitor "Monitor0"
|
||||
DefaultDepth 24
|
||||
SubSection "Display"
|
||||
Depth 24
|
||||
Modes "1920x1080"
|
||||
EndSubSection
|
||||
EndSection
|
||||
|
@@ -1,7 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [[ "$(tty)" = "/dev/tty1" ]]; then
|
||||
cat << "EOF"
|
||||
if [[ "$(tty)" != "/dev/tty1" ]]; then
|
||||
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!
|
||||
|
||||
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.
|
||||
EOF
|
||||
read -r
|
||||
sudo configure-stormux
|
||||
sudo rm -- "/etc/profile.d/stormux_first_boot.sh"
|
||||
fi
|
||||
read -r
|
||||
sudo "${sudoFlags[@]}" configure-stormux
|
||||
|
@@ -1,3 +1,4 @@
|
||||
# Raspberry Pi Information
|
||||
alias pi-temp='/usr/bin/vcgencmd measure_temp'
|
||||
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
|
||||
pushd /opt/configure-stormux
|
||||
@@ -9,54 +24,116 @@ if [[ -x /opt/configure-stormux/configure-stormux.sh ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ ! -d /opt/configure-stormux ]]; then
|
||||
# Offer to switch fenrir layout.
|
||||
echo "Would you like to switch Fenrir to laptop layout? (y/n)"
|
||||
export DIALOGOPTS='--insecure --no-lines --visit-items'
|
||||
|
||||
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
|
||||
continue="${continue::1}"
|
||||
if [[ "${continue,}" == "y" ]];then
|
||||
sed -i 's/=desktop/=laptop/' /etc/fenrirscreenreader/settings/settings.conf
|
||||
systemctl restart fenrirscreenreader.service
|
||||
clear
|
||||
sudo "${sudoFlags[@]}" growpartfs $diskSource
|
||||
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
|
||||
|
||||
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 "Initial setup is complete."
|
||||
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
|
||||
echo "Thank you for choosing Stormux."
|
||||
echo
|
||||
echo "Removing first run script..."
|
||||
|
||||
|
||||
|
||||
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