Compare commits

...

18 Commits

Author SHA1 Message Date
f80ea1e056 Move volume check to run first, before anything else. 2025-07-13 15:49:16 -04:00
696ddd9bfb Right alt key should now work as expected in the console. 2025-05-11 19:31:14 -04:00
e0806e51da Simplify the internect connection dialog. 2025-05-08 04:54:44 -04:00
3612787274 More improvements to rename-user.sh 2025-04-26 16:54:35 -04:00
41a0592f20 Update linger file. with the rename. 2025-04-26 04:14:26 -04:00
3ebb6f36cf Added convience rename-user script in root's home directory. You still need a temp user if doing this from ssh. 2025-04-26 04:09:03 -04:00
c88bd17709 Added volume check to the beginning of configure-stormux stub. 2025-04-25 16:07:11 -04:00
c1af07bf18 2 characters over the limit for labels, so fixed it. 2025-04-22 21:36:31 -04:00
a88a386ef4 Attempt to make images bootable no matter the source, micro sd, nvme, etc. 2025-04-22 21:27:34 -04:00
034c561a53 Moved the journald configuration to a file in it's drop in directory. Also, explicitly set volatile storage to cut down on SD card writes. 2025-02-09 17:36:02 -05:00
2108f02719 Removed some packages that can be installed after the build is completed. 2025-01-24 12:21:02 -05:00
06282f5ea8 Fixed the removal of packages at the end of image creation. 2025-01-17 01:35:21 -05:00
6bb5267b91 Chroot message just because I'm paranoid now. 2025-01-04 20:47:18 -05:00
b87647756f After scary encounter with some problems, clearly indicate when build system is in chroot. 2025-01-04 20:34:49 -05:00
505028ab44 Dependencies added for package building and removed at completion. 2025-01-04 19:46:08 -05:00
9657719613 In process of moving headless X driver stuff to configure-stormux. 2025-01-04 19:19:44 -05:00
3e4c4d18ee Revert to old working headless driver. 2025-01-04 19:15:52 -05:00
9beea608ed Python accessible_output2 library added. 2025-01-04 15:40:08 -05:00
11 changed files with 148 additions and 85 deletions

View File

@ -136,8 +136,8 @@ url[64]="http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-aarch64-latest.tar.gz"
fallocate -l "$imageSize" "$imageName"
loopdev="$(losetup --find --show "${imageName}")"
parted --script "${loopdev}" mklabel msdos mkpart primary fat32 0% 200M mkpart primary ext4 200M 100%
mkfs.vfat -F32 "${loopdev}p1"
mkfs.ext4 -F "${loopdev}p2"
mkfs.vfat -F32 -n STRMX_BOOT "${loopdev}p1"
mkfs.ext4 -F -L STRMX_ROOT "${loopdev}p2"
mount "${loopdev}p2" /mnt
mkdir /mnt/boot
mount "${loopdev}p1" /mnt/boot
@ -152,7 +152,8 @@ fi
bsdtar -xpf "${imageFileName}" -C /mnt
# Set -e in case it got unset for 32 bit image
set -e
arch-chroot /mnt << EOF
PS1="(Chroot) [\u@\h \W] \$" arch-chroot /mnt << EOF
echo "Chroot started."
# set up pacman
pacman-key --init
pacman-key --populate archlinuxarm
@ -195,6 +196,7 @@ pacman -Su --needed --noconfirm \
python-dbus \
python-pyenchant \
python-pyte \
socat \
raspberrypi-utils \
realtime-privileges \
rhvoice-voice-bdl \

View File

@ -0,0 +1 @@
root=LABEL=STRMX_ROOT rw rootwait console=serial0,115200 console=tty1 fsck.repair=yes

View File

@ -1,4 +0,0 @@
Section "Device"
Identifier "fbdev"
Driver "fbdev"
EndSection

View File

@ -1,20 +0,0 @@
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
EndSection
Section "Device"
Identifier "dummy_card"
VideoRam 256000
Driver "dummy"
EndSection
Section "Screen"
Identifier "dummy_screen"
Device "dummy_card"
Monitor "dummy_monitor"
SubSection "Display"
EndSubSection
EndSection

6
pi4/files/etc/fstab Normal file
View File

@ -0,0 +1,6 @@
# Static information about the filesystems.
# See fstab(5) for details.
# <file system> <dir> <type> <options> <dump> <pass>
LABEL=STRMX_BOOT /boot vfat defaults 0 1
LABEL=STRMX_ROOT / ext4 defaults,noatime 0 1

View File

@ -1,47 +0,0 @@
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (at your option)
# any later version.
#
# Entries in this file show the compile time defaults. Local configuration
# should be created by either modifying this file, or by creating "drop-ins" in
# the journald.conf.d/ subdirectory. The latter is generally recommended.
# Defaults can be restored by simply deleting this file and all drop-ins.
#
# Use 'systemd-analyze cat-config systemd/journald.conf' to display the full config.
#
# See journald.conf(5) for details.
[Journal]
#Storage=auto
#Compress=yes
#Seal=yes
#SplitMode=uid
#SyncIntervalSec=5m
#RateLimitIntervalSec=30s
#RateLimitBurst=10000
SystemMaxUse=20M
#SystemKeepFree=
#SystemMaxFileSize=
#SystemMaxFiles=100
#RuntimeMaxUse=
#RuntimeKeepFree=
#RuntimeMaxFileSize=
#RuntimeMaxFiles=100
#MaxRetentionSec=
#MaxFileSec=1month
#ForwardToSyslog=no
#ForwardToKMsg=no
#ForwardToConsole=no
#ForwardToWall=yes
#TTYPath=/dev/console
#MaxLevelStore=debug
#MaxLevelSyslog=debug
#MaxLevelKMsg=notice
#MaxLevelConsole=info
#MaxLevelWall=emerg
#LineMax=48K
#ReadKMsg=yes
#Audit=yes

View File

@ -0,0 +1,3 @@
[Journal]
Storage=volatile
SystemMaxUse=20M

View File

@ -0,0 +1,3 @@
# This is the fallback vconsole configuration provided by systemd.
KEYMAP=us_alt

103
pi4/files/root/rename-user.sh Executable file
View File

@ -0,0 +1,103 @@
#!/usr/bin/env bash
# Renames a user
# Required arguments: old user name, new user name
set -e
question() {
echo
echo "$@"
read -r answer
answer="${answer:0:1}"
answer="${answer^}"
}
if [[ $# -ne 2 ]]; then
echo "Usage: $0 old-user new-user"
exit 1
fi
oldUser="$1"
newUser="$2"
# Make sure old user exists
if ! id "$oldUser" >/dev/null 2>&1; then
echo "The user $oldUser does not exist."
exit 1
fi
# Make sure old user is not logged in
if pgrep -u "$oldUser" >/dev/null; then
echo "The user $oldUser is currently logged in or has running processes. Cannot continue."
question "Would you like to forcibly log out $oldUser? (Y/N)"
if [[ "$answer" != "Y" ]]; then
exit 1
fi
systemctl stop display-manager
loginctl terminate-user "$oldUser"
sleep 2
if pgrep -u "$oldUser" >/dev/null; then
echo "The user $oldUser still has running processes after termination. Cannot continue."
exit 1
fi
fi
# Make sure new user does not exist
if id "$newUser" >/dev/null 2>&1; then
echo "The user name $newUser is already taken."
exit 1
fi
# Make sure the new name is acceptable
if ! [[ "$newUser" =~ ^[a-z_][a-z0-9_-]{0,31}$ ]]; then
echo "$newUser is not an acceptable user name."
exit 1
fi
# Passed all safety checks, proceed with the rename
echo "Renaming $oldUser to $newUser..."
groups=$(id -nG "$oldUser")
groups="${groups// /,}"
usermod -G "$groups" -m -d "/home/$newUser" -l "$newUser" "$oldUser"
# Update nodm.conf if it exists
if [[ -e /etc/nodm.conf ]]; then
echo "Updating /etc/nodm.conf..."
sed -i -e "s#^NODM_USER=.*#NODM_USER='$newUser'#" -e "s#^NODM_XSESSION=.*#NODM_XSESSION='/home/$newUser/.xinitrc'#" /etc/nodm.conf
fi
# Copy over crontab if it exists
if crontab -u "$oldUser" -l >/tmp/${oldUser}_crontab.bak 2>/dev/null; then
echo "Copying over crontab..."
if crontab -u "$newUser" "/tmp/${oldUser}_crontab.bak"; then
rm "/tmp/${oldUser}_crontab.bak"
else
echo "Warning: failed to restore crontab for $newUser."
rm "/tmp/${oldUser}_crontab.bak"
fi
fi
# Update linger
if [[ -e "/var/lib/systemd/linger/$oldUser" ]]; then
echo "Enabling linger..."
mv "/var/lib/systemd/linger/$oldUser" "/var/lib/systemd/linger/$newUser"
fi
# Optionally update files in new home directory
echo
echo "Would you like to search for references to $oldUser and update them to $newUser in files located in /home/$newUser?"
question "This can take a while. (Y/N)"
if [[ "$answer" == "Y" ]]; then
echo "Updating files..."
find "/home/$newUser" -type f -exec grep -Iq . "{}" \; -and -exec sed -i "s|$oldUser|$newUser|g" "{}" \;
fi
echo
echo "Rename complete. The user, $newUser, is now available."
question "Would you like to reboot?"
if [[ "${answer}" == "Y" ]]; then
reboot
fi
exit 0

View File

@ -24,6 +24,31 @@ if [[ -x /opt/configure-stormux/configure-stormux.sh ]]; then
exit 0
fi
# make sure the system is at a decent volume
volume=50
wait=0
# Wait for pipewire to become available
while [[ $wait -lt 30 ]]; do
if pgrep pipewire &> /dev/null ; then
wait=30 # We don't want to continue the loop
else
sleep 1
continue
fi
while [[ $volume -le 130 ]]; do
clear
spd-say "If this is loud enough, press enter."
if read -t4 ; then
break
else
((volume+=5))
fi
pactl set-sink-volume @DEFAULT_SINK@ "${volume}%"
done
((wait++))
done
export DIALOGOPTS='--insecure --no-lines --visit-items'
set_timezone() {
@ -52,8 +77,6 @@ set_timezone() {
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."
@ -81,17 +104,10 @@ 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
echo "setting set focus#highlight=True" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock
nmtui-connect
echo "setting set focus#highlight=False" | socat - UNIX-CLIENT:/tmp/fenrirscreenreader-deamon.sock
fi
# Check for internet connectivity
if ping -qc1 -W 1 stormux.org &> /dev/null; then