Compare commits

..

17 Commits

Author SHA1 Message Date
f6a2a43906 Default etc/environment file added. 2024-03-05 18:13:18 -05:00
9f8355514f Updated configure-stormux stub. 2024-03-03 14:38:44 -05:00
563362985f Fix removal part of first boot script. 2024-03-03 14:24:24 -05:00
51f8c1b3d4 Updated the .bash_aliases file. 2024-02-26 00:25:23 -05:00
cdfd1d31a2 Make sure the greeting for configure stormux only appears on the tty where it spawns. 2024-02-16 02:54:54 -05:00
2af9365e22 Updated the first boot script. 2024-02-16 01:36:59 -05:00
3a37c33a64 New attempt at getting configure-stormux to run on first boot. 2024-02-16 01:35:39 -05:00
2144432ec5 Added package raspberrypi-utils 2024-02-16 01:14:10 -05:00
3dbf1f97fb Updated firmware package name. 2023-12-29 11:44:19 -05:00
4f7dbb4f82 Updated configure-stormus stub file. Because it is ran initially as root, no need for the sudo calls. Also handle removal of the cron job that causes it to run on the first boot of the image. 2023-09-24 15:47:42 -04:00
7ed27d5c65 Changed firstrun script to not delete itself. This will be handled in configure-stormux past a certain point. This way if something goes wrong, the script will stil run if the Pi had to be powered down without completing setup. 2023-09-24 15:35:31 -04:00
4c23704b2a Use cron to run configure-stormux on first boot. 2023-09-24 15:31:14 -04:00
7d15478e18 Updated the p3 build script. 2023-08-19 19:51:59 -04:00
110e7d9253 Added screen to installed packages. 2023-08-19 18:04:24 -04:00
2dc2f72e22 Missed a couple spots for audible prompt. 2023-08-19 12:48:51 -04:00
cea6ad9988 Update the configure-stormux stub to use the audible prompt. 2023-08-19 10:37:02 -04:00
340ebb5861 Put the skel stuff in the wrong place... More cofrfee please. 2023-08-19 09:03:30 -04:00
16 changed files with 174 additions and 37 deletions

View File

@ -112,7 +112,7 @@ fi
# make sure the needed tools are installed
if [[ "$(uname -m)" == "x86_64" ]]; then
if ! pacman -Q qemu-user-static &> /dev/null ; then
if ! pacman -Q qemu-user-static &> /dev/null ; then
echo "Please install qemu-user-static and qemu-user-static-binfmt before continuing."
exit 1
fi
@ -121,7 +121,7 @@ if ! pacman -Q qemu-user-static &> /dev/null ; then
exit 1
fi
fi
for i in dosfstools parted wget ; do
for i in arch-install-scripts dosfstools parted wget ; do
if ! pacman -Q $i &> /dev/null ; then
echo "Please install $i before continuing."
exit 1
@ -167,10 +167,13 @@ pacman -Su --needed --noconfirm \
bluez \
bluez-utils \
brltty \
cloud-utils \
cronie \
dbus-broker \
espeak-ng \
fake-hwclock \
git \
go \
magic-wormhole \
man \
man-pages \
@ -180,11 +183,18 @@ pacman -Su --needed --noconfirm \
pipewire-alsa \
pipewire-jack \
pipewire-pulse \
poppler \
python-pyudev \
python-daemonize \
python-evdev \
python-dbus \
python-pyte \
raspberrypi-firmware \
realtime-privileges \
rhvoice-voice-bdl \
rng-tools \
rsync \
screen \
sox \
w3m \
wget \
@ -215,30 +225,41 @@ echo -e "stormux\nstormux" | passwd "stormux"
sudo -iu stormux
# Create desktop, downloads, music, and other directories.
xdg-user-dirs-update
# Install the yay package manager
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si --noconfirm
cd ~
rm -rf yay
yay -S --removemake --noconfirm fenrir-git growpartfs log2ram
rm -rf .cache/yay
/usr/share/fenrirscreenreader/tools/configure_pipewire.sh
# Build AUR packages
export aurPackages=(fenrir-git \
growpartfs \
log2ram \
yay)
export PKGDEST=~/packages
for p in "\${aurPackages[@]}" ; do
git clone https://aur.archlinux.org/\${p}.git
cd ~/\${p}
makepkg -A
cd ~
rm -rf \${p}
done
exit
# Install built packages
for p in /home/stormux/packages/* ; do
pacman -U --noconfirm \${p}
done
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 wireplumber.service
systemctl --global enable dbus-broker.service 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
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 fenrirscreenreader.service log2ram.service NetworkManager.service ntpd.service
systemctl enable brltty.path cronie.service dbus-broker.service fake-hwclock.service fenrirscreenreader.service log2ram.service NetworkManager.service ntpd.service
systemctl disable dbus.service
# Cleanup packages
pacman -Sc --noconfirm
pacman -R --noconfirm go
# Update fstab for Raspberry Pi 4. Not needed until linux-aarch64 works.
# [[ $imageVersion -eq 4 ]] && sed -i 's/mmcblk0/mmcblk1/g' /etc/fstab
@ -249,6 +270,7 @@ cp -rv ../files/boot/* /mnt/boot
cp -rv ../files/etc/* /mnt/etc
cp -rv ../files/var/* /mnt/var
cp -rv ../files/usr/* /mnt/usr
find ../files/etc/skel/ -mindepth 1 -exec cp -rv "{}" /mnt/home/stormux/ \;
# Exiting calls the cleanup function to unmount.
exit 0

View File

@ -1,14 +1,16 @@
#!/bin/bash
trap 'popd &> /dev/null' EXIT
export SUDO_ASKPASS=/etc/audibleprompt.sh
if [[ ! -d /opt/configure-stormux ]]; then
# Offer to switch fenrir layout.
echo "Would you like to switch Fenrir to laptop layout? (y/n)"
read -r continue
continue="${continue::1}"
if [[ "${continue,}" == "y" ]];then
sudo sed -i 's/=desktop/=laptop/' /etc/fenrirscreenreader/settings/settings.conf
sudo systemctl restart fenrirscreenreader.service
sudo -A sed -i 's/=desktop/=laptop/' /etc/fenrirscreenreader/settings/settings.conf
sudo -A systemctl restart fenrirscreenreader.service
clear
fi
if ! ping -c1 stormux.org &> /dev/null ; then
@ -24,19 +26,19 @@ if [[ ! -d /opt/configure-stormux ]]; then
nmtui-connect
fi
# Check for internet connectivity
if ping -qc1 -W 1 gnu.org &> /dev/null; then
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
sudo date -s "$date_time"
sudo -A date -s "$date_time"
else
echo "Please connect to the internet and run ${0##*/} again."
exit 1
fi
echo "Installing configure-stormux..."
sudo git -C /opt clone -q https://git.stormux.org/storm/configure-stormux || exit 1
sudo -A git -C /opt clone -q https://git.stormux.org/storm/configure-stormux || exit 1
fi
pushd /opt/configure-stormux

View File

@ -178,6 +178,7 @@ pacman -Su --needed --noconfirm \
dbus-broker \
espeak-ng \
fake-hwclock \
firmware-raspberrypi \
git \
go \
magic-wormhole \
@ -195,11 +196,12 @@ pacman -Su --needed --noconfirm \
python-evdev \
python-dbus \
python-pyte \
raspberrypi-firmware \
raspberrypi-utils \
realtime-privileges \
rhvoice-voice-bdl \
rng-tools \
rsync \
screen \
sox \
w3m \
wget \
@ -275,7 +277,7 @@ cp -rv ../files/boot/* /mnt/boot
cp -rv ../files/etc/* /mnt/etc
cp -rv ../files/var/* /mnt/var
cp -rv ../files/usr/* /mnt/usr
cp -rv ../files/etc/skel/{.,}* /mnt/home/stormux/
find ../files/etc/skel/ -mindepth 1 -exec cp -rv "{}" /mnt/home/stormux/ \;
# Exiting calls the cleanup function to unmount.
exit 0

12
pi4/files/etc/environment Normal file
View File

@ -0,0 +1,12 @@
#
# This file is parsed by pam_env module
#
# Syntax: simple "KEY=VAL" pairs on separate lines
#
# Accessibility variables
export ACCESSIBILITY_ENABLED=1
export GTK_MODULES=gail:atk-bridge
export GNOME_ACCESSIBILITY=1
export QT_ACCESSIBILITY=1
export QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1
export SAL_USE_VCLPLUGIN=gtk3

View File

@ -0,0 +1,18 @@
#!/usr/bin/env bash
if [[ "$(tty)" = "/dev/tty1" ]]; then
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.
When that happens, type the word stormux and press enter.
You will not receive any speech feedback for this process.
That is completely normal, and speech will return after you have typed the password.
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

View File

@ -0,0 +1,3 @@
# Raspberry Pi Information
alias pi-temp='/usr/bin/vcgencmd measure_temp'
alias pi-version='cat /sys/firmware/devicetree/base/model;echo'

View File

@ -0,0 +1,21 @@
memuse() {
ps axo rss,comm,pid \
| awk '{ proc_list[$2] += $1; } END \
{ for (proc in proc_list) { printf("%d\t%s\n", proc_list[proc],proc); }}' \
| sort -n | tail -n 10 | sort -rn \
| awk '{$1/=1024;printf "%.0fMB\t",$1}{print $2}'
}
pdf()
{
if [[ $# -ne 1 ]]; then
echo 'Usage: pdf <file>' >&2
else
local dir=$(mktemp -d -p /tmp pdf_conversion.XXXXXX)
local outFile="${1##*/}"
local outFile="${outFile%.*}"
pdftohtml -noframes -i -s "$1" "${dir}/${outFile}.html"
w3m -s "${dir}/${outFile}.html"
fi
}

View File

@ -0,0 +1,24 @@
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
#Change directories without using cd
shopt -s autocd
# Keep bash history in screen
export HISTFILE="${HISTFILE}${WINDOW:+.${WINDOW}}"
# load Aliases and functions
[[ -f ".bash_aliases" ]] && source .bash_aliases
[[ -f ".bash_functions" ]] && source .bash_functions
#Invironment variables
PS1='[\u@\h \W] \$ '
export DIALOGOPTS='--no-lines --visit-items'
GPG_TTY=$(tty)
export GPG_TTY
# Don't put commands prefixed with space, or duplicate commands in history
export HISTCONTROL=ignoreboth

View File

@ -0,0 +1,6 @@
# Reload changes with control+x followed by control+r
set echo-control-characters off
# History searching with up and down arrows.
"\e[A": history-search-backward
"\e[B": history-search-forward

View File

@ -0,0 +1,18 @@
vbell off
bell_msg ""
hardstatus off
startup_message off
defscrollback 4096
bind ! select 10
bind @ select 11
bind \# select 12
bind $ select 13
bind % select 14
bind ^ select 15
bind & select 16
bind * select 17
bind ( select 18
bind ) select 19
bind b eval "writebuf" 'exec !!! xclip -selection "clipboard" -i /tmp/screen-exchange'
#termcapinfo xterm|xterms|xs|rxvt ti@:te@
termcapinfo xterm* ti@:te@

View File

@ -1,14 +1,16 @@
#!/bin/bash
trap 'popd &> /dev/null' EXIT
export SUDO_ASKPASS=/etc/audibleprompt.sh
if [[ ! -d /opt/configure-stormux ]]; then
# Offer to switch fenrir layout.
echo "Would you like to switch Fenrir to laptop layout? (y/n)"
read -r continue
continue="${continue::1}"
if [[ "${continue,}" == "y" ]];then
sudo sed -i 's/=desktop/=laptop/' /etc/fenrirscreenreader/settings/settings.conf
sudo systemctl restart fenrirscreenreader.service
sed -i 's/=desktop/=laptop/' /etc/fenrirscreenreader/settings/settings.conf
systemctl restart fenrirscreenreader.service
clear
fi
if ! ping -c1 stormux.org &> /dev/null ; then
@ -23,23 +25,30 @@ if [[ ! -d /opt/configure-stormux ]]; then
read -r continue
nmtui-connect
fi
# Check for internet connectivity
if ping -qc1 -W 1 gnu.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
sudo date -s "$date_time"
else
echo "Please connect to the internet and run ${0##*/} again."
exit 1
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..."
sudo git -C /opt clone -q https://git.stormux.org/storm/configure-stormux || exit 1
git -C /opt clone -q https://git.stormux.org/storm/configure-stormux || exit 1
fi
pushd /opt/configure-stormux
./configure-stormux.sh
echo
echo "Initial setup is complete."
echo
echo "If you would like more options, run configure-stormux,"
echo "or you may configure your system manually."
echo
echo "Thank you for choosing Stormux."
exit 0