Compare commits
39 Commits
89ab28a79c
...
master
Author | SHA1 | Date | |
---|---|---|---|
1658a53081 | |||
9cc539a6e4 | |||
46faab708b | |||
e620f80b0e | |||
134d25682b | |||
88d7d12c69 | |||
83b7867da4 | |||
af1642b138 | |||
51a0fd0883 | |||
b22785ab3e | |||
ef015add0a | |||
81d60bb1b3 | |||
50d9099231 | |||
aa4ec62c47 | |||
7fb1ba5283 | |||
386cb3230e | |||
0b10dc426b | |||
40fd173777 | |||
1e24598316 | |||
901d5cdb7a | |||
16ae09c86d | |||
b593494374 | |||
f6a2a43906 | |||
9f8355514f | |||
563362985f | |||
51f8c1b3d4 | |||
cdfd1d31a2 | |||
2af9365e22 | |||
3a37c33a64 | |||
2144432ec5 | |||
3dbf1f97fb | |||
4f7dbb4f82 | |||
7ed27d5c65 | |||
4c23704b2a | |||
7d15478e18 | |||
110e7d9253 | |||
2dc2f72e22 | |||
cea6ad9988 | |||
340ebb5861 |
@ -1,254 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
#
|
|
||||||
# Copyright 2020, Stormux, <storm_dragon@linux-a11y.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
|
|
||||||
# Software Foundation; either version 3, or (at your option) any later
|
|
||||||
# version.
|
|
||||||
#
|
|
||||||
# This software is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
# General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this package; see the file COPYING. If not, write to the Free
|
|
||||||
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
||||||
# 02110-1301, USA.
|
|
||||||
#
|
|
||||||
|
|
||||||
# keep track of mounted status for exit function
|
|
||||||
mounted=1
|
|
||||||
|
|
||||||
set -e # Don't want to destroy stuff if this goes majorly wrong.
|
|
||||||
trap cleanup EXIT # make sure the script cleans up after itself before closing.
|
|
||||||
|
|
||||||
|
|
||||||
cleanup() {
|
|
||||||
if [[ $mounted -eq 0 ]]; then
|
|
||||||
umount -R /mnt
|
|
||||||
partx -d "${loopdev}"
|
|
||||||
losetup --detach "${loopdev}"
|
|
||||||
fi
|
|
||||||
if [[ -n "${imageFileName}" ]]; then
|
|
||||||
rm "${imageFileName}"
|
|
||||||
fi
|
|
||||||
exit 0
|
|
||||||
}
|
|
||||||
|
|
||||||
help() {
|
|
||||||
echo -e "Usage:\n"
|
|
||||||
echo "With no arguments, build with default parameters."
|
|
||||||
for i in "${!command[@]}" ; do
|
|
||||||
echo "-${i/:/ <parameter>}: ${command[${i}]}"
|
|
||||||
done | sort
|
|
||||||
exit 0
|
|
||||||
}
|
|
||||||
|
|
||||||
# Array of command line arguments
|
|
||||||
declare -A command=(
|
|
||||||
[h]="This help screen."
|
|
||||||
[l:]="Language default is en_US."
|
|
||||||
[n:]="Image name, default is stormux-pi3-<armv7h|aarch64>-<yyyy-mm-dd>.img"
|
|
||||||
[s:]="image size in GB, default is 4."
|
|
||||||
[v:]="Version of the Raspberry Pi for which you are building. (32|64) default is 64."
|
|
||||||
)
|
|
||||||
|
|
||||||
# Convert the keys of the associative array to a format usable by getopts
|
|
||||||
args="${!command[*]}"
|
|
||||||
args="${args//[[:space:]]/}"
|
|
||||||
while getopts "${args}" i ; do
|
|
||||||
case "$i" in
|
|
||||||
h) help ;;
|
|
||||||
l)
|
|
||||||
imageLanguage="${OPTARG}.UTF-8"
|
|
||||||
;;
|
|
||||||
n)
|
|
||||||
imageName="${OPTARG}"
|
|
||||||
;;
|
|
||||||
s)
|
|
||||||
if [[ "${OPTARG}" =~ ^[[:digit:]]+$ ]]; then
|
|
||||||
imageSize="${OPTARG}G"
|
|
||||||
else
|
|
||||||
echo "Image size must be numeric."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
v)
|
|
||||||
if [[ "${OPTARG}" =~ ^32|64$ ]]; then
|
|
||||||
imageVersion="${OPTARG}"
|
|
||||||
else
|
|
||||||
echo "Image version must be 32 for 32 bit (armv7h), or 64 for 64 bit (aarch64 default)."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
# make sure variables are set, or use defaults.
|
|
||||||
export imageVersion="${imageVersion:-64}"
|
|
||||||
export imageSize="${imageSize:-4G}"
|
|
||||||
imageName="${imageName:-stormux-pi3-${imageVersion}-$(date '+%Y-%m-%d').img}"
|
|
||||||
imageName="${imageName/-64-/-aarch64-}"
|
|
||||||
imageName="${imageName/-32-/-armv7h-}"
|
|
||||||
export imageName
|
|
||||||
export imageLanguage="${imageLanguage:-en_US.UTF-8}"
|
|
||||||
|
|
||||||
# Make sure the image file doesn't exist.
|
|
||||||
if [[ -e "$imageName" ]]; then
|
|
||||||
echo "${imageName} exists, please remove or move it for this script to continue."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Make sure this script is ran as root.
|
|
||||||
if [ "$(whoami)" != "root" ] ; then
|
|
||||||
echo "Error: This script must be run as root."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# make sure the needed tools are installed
|
|
||||||
if [[ "$(uname -m)" == "x86_64" ]]; 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
|
|
||||||
if ! pacman -Q qemu-user-static-binfmt &> /dev/null ; then
|
|
||||||
echo "Please install qemu-user-static and qemu-user-static-binfmt before continuing."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
for i in dosfstools parted wget ; do
|
|
||||||
if ! pacman -Q $i &> /dev/null ; then
|
|
||||||
echo "Please install $i before continuing."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
||||||
# Url for the image to be downloaded.
|
|
||||||
url[32]="http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-armv7-latest.tar.gz"
|
|
||||||
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"
|
|
||||||
mount "${loopdev}p2" /mnt
|
|
||||||
mkdir /mnt/boot
|
|
||||||
mount "${loopdev}p1" /mnt/boot
|
|
||||||
# Things are mounted now, so set mounted to 0 (bash true)
|
|
||||||
mounted=0
|
|
||||||
imageFileName=$(mktemp)
|
|
||||||
wget "${url[$imageVersion]}" -O "${imageFileName}"
|
|
||||||
bsdtar -xpf "${imageFileName}" -C /mnt
|
|
||||||
arch-chroot /mnt << EOF
|
|
||||||
# set up pacman
|
|
||||||
pacman-key --init
|
|
||||||
pacman-key --populate archlinuxarm
|
|
||||||
pacman -Syy
|
|
||||||
# Change kernels for aarch64
|
|
||||||
if [[ "$imageVersion" == "64" ]]; then
|
|
||||||
pacman -R --noconfirm linux-aarch64 uboot-raspberrypi
|
|
||||||
pacman -S --noconfirm linux-rpi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Install packages
|
|
||||||
pacman -Su --needed --noconfirm \
|
|
||||||
alsa-firmware \
|
|
||||||
alsa-utils \
|
|
||||||
base \
|
|
||||||
base-devel \
|
|
||||||
bash-completion \
|
|
||||||
bluez \
|
|
||||||
bluez-utils \
|
|
||||||
brltty \
|
|
||||||
cronie \
|
|
||||||
dbus-broker \
|
|
||||||
espeak-ng \
|
|
||||||
git \
|
|
||||||
magic-wormhole \
|
|
||||||
man \
|
|
||||||
man-pages \
|
|
||||||
networkmanager \
|
|
||||||
ntp \
|
|
||||||
pipewire \
|
|
||||||
pipewire-alsa \
|
|
||||||
pipewire-jack \
|
|
||||||
pipewire-pulse \
|
|
||||||
raspberrypi-firmware \
|
|
||||||
realtime-privileges \
|
|
||||||
rhvoice-voice-bdl \
|
|
||||||
rng-tools \
|
|
||||||
rsync \
|
|
||||||
sox \
|
|
||||||
w3m \
|
|
||||||
wget \
|
|
||||||
wireless-regdb \
|
|
||||||
wireplumber \
|
|
||||||
xdg-user-dirs \
|
|
||||||
xdg-utils
|
|
||||||
|
|
||||||
# set the language
|
|
||||||
sed -i "s/#$imageLanguage/$imageLanguage/" /etc/locale.gen
|
|
||||||
echo "LANG=$imageLanguage" > /etc/locale.conf
|
|
||||||
locale-gen
|
|
||||||
# Configure and enable Hardware Random Number Generator
|
|
||||||
echo 'RNGD_OPTS="-o /dev/random -r /dev/hwrng"' > /etc/conf.d/rngd
|
|
||||||
systemctl enable rngd.service
|
|
||||||
# Set the distribution name.
|
|
||||||
echo 'Stormux \r (\l)' > /etc/issue
|
|
||||||
echo >> /etc/issue
|
|
||||||
# Change the alarm user to be stormux
|
|
||||||
usermod -a -g users -G wheel,realtime,audio,video,network,brlapi -m -d /home/stormux -l stormux alarm
|
|
||||||
# Grant sudo privileges to the stormux user for package installation.
|
|
||||||
echo 'stormux ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers.d/wheel
|
|
||||||
# Set the password for the root user
|
|
||||||
echo -e "root\nroot" | passwd "root"
|
|
||||||
# Set the password for the stormux user
|
|
||||||
echo -e "stormux\nstormux" | passwd "stormux"
|
|
||||||
# Change to the stormux user and install some packages
|
|
||||||
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
|
|
||||||
exit
|
|
||||||
# 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
|
|
||||||
/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 disable dbus.service
|
|
||||||
# Cleanup packages
|
|
||||||
pacman -Sc --noconfirm
|
|
||||||
|
|
||||||
# Update fstab for Raspberry Pi 4. Not needed until linux-aarch64 works.
|
|
||||||
# [[ $imageVersion -eq 4 ]] && sed -i 's/mmcblk0/mmcblk1/g' /etc/fstab
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Copy override files into place.
|
|
||||||
cp -rv ../files/boot/* /mnt/boot
|
|
||||||
cp -rv ../files/etc/* /mnt/etc
|
|
||||||
cp -rv ../files/var/* /mnt/var
|
|
||||||
cp -rv ../files/usr/* /mnt/usr
|
|
||||||
|
|
||||||
# Exiting calls the cleanup function to unmount.
|
|
||||||
exit 0
|
|
@ -1,10 +0,0 @@
|
|||||||
# See /boot/overlays/README for all available options
|
|
||||||
|
|
||||||
dtoverlay=vc4-kms-v3d
|
|
||||||
initramfs initramfs-linux.img followkernel
|
|
||||||
dtparam=audio=on,krnbt=on
|
|
||||||
hdmi_drive=2
|
|
||||||
|
|
||||||
[pi4]
|
|
||||||
# Run as fast as firmware / board allows
|
|
||||||
arm_boost=1
|
|
@ -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
|
|
@ -1,7 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
play -qnV0 synth 3 pluck D3 pluck A3 pluck D4 pluck F4 pluck A4 delay 0 .1 .2 .3 .4 remix - chorus 0.9 0.9 38 0.75 0.3 0.5 -t &
|
|
||||||
read -rsp "$*"$'\n' password
|
|
||||||
echo "$password"
|
|
||||||
|
|
||||||
exit 0
|
|
@ -1 +0,0 @@
|
|||||||
stormux
|
|
@ -1,5 +0,0 @@
|
|||||||
# Static table lookup for hostnames.
|
|
||||||
# See hosts(5) for details.
|
|
||||||
127.0.0.1 localhost
|
|
||||||
::1 localhost
|
|
||||||
127.0.1.1 stormux.localdomain stormux
|
|
@ -1,37 +0,0 @@
|
|||||||
# Configuration file for Log2Ram (https://github.com/azlux/log2ram) under MIT license.
|
|
||||||
# This configuration file is read by the log2ram service
|
|
||||||
|
|
||||||
# Size for the ram folder, it defines the size the log folder will reserve into the RAM.
|
|
||||||
# If it's not enough, log2ram will not be able to use ram. Check you /var/log size folder.
|
|
||||||
# The default is 40M and is basically enough for a lot of applications.
|
|
||||||
# You will need to increase it if you have a server and a lot of log for example.
|
|
||||||
SIZE=128M
|
|
||||||
|
|
||||||
# This variable can be set to true if you prefer "rsync" rather than "cp".
|
|
||||||
# I use the command cp -u and rsync -X, so I don't copy the all folder every time for optimization.
|
|
||||||
# You can choose which one you want. Be sure rsync is installed if you use it.
|
|
||||||
USE_RSYNC=true
|
|
||||||
|
|
||||||
# If there are some errors with available RAM space, a system mail will be send
|
|
||||||
# Change it to false and you will have only a log if there is no place on RAM anymore.
|
|
||||||
MAIL=false
|
|
||||||
|
|
||||||
# Variable for folders to put in RAM. You need to specify the real folder `/path/folder` , the `/path/hdd.folder` will be automatically created. Multiple path can be separeted by `;`. Do not add the final `/` !
|
|
||||||
# example : PATH_DISK="/var/log;/home/test/FolderInRam"
|
|
||||||
PATH_DISK="/var/log"
|
|
||||||
|
|
||||||
# **************** Zram backing conf *************************************************
|
|
||||||
|
|
||||||
# ZL2R Zram Log 2 Ram enables a zram drive when ZL2R=true ZL2R=false is mem only tmpfs
|
|
||||||
ZL2R=false
|
|
||||||
# COMP_ALG this is any compression algorithm listed in /proc/crypto
|
|
||||||
# lz4 is fastest with lightest load but deflate (zlib) and Zstandard (zstd) give far better compression ratios
|
|
||||||
# lzo is very close to lz4 and may with some binaries have better optimisation
|
|
||||||
# COMP_ALG=lz4 for speed or Zstd for compression, lzo or zlib if optimisation or availabilty is a problem
|
|
||||||
COMP_ALG=lz4
|
|
||||||
# LOG_DISK_SIZE is the uncompressed disk size. Note zram uses about 0.1% of the size of the disk when not in use
|
|
||||||
# LOG_DISK_SIZE is expected compression ratio of alg chosen multiplied by log SIZE
|
|
||||||
# lzo/lz4=2.1:1 compression ratio zlib=2.7:1 zstandard=2.9:1
|
|
||||||
# Really a guestimate of a bit bigger than compression ratio whilst minimising 0.1% mem usage of disk size
|
|
||||||
LOG_DISK_SIZE=100M
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
|||||||
Welcome to Stormux, powered by Arch Linux ARM
|
|
||||||
|
|
||||||
Stormux Website: https://stormux.org
|
|
||||||
Arch Linux ARM Forum: https://archlinuxarm.org/forum
|
|
||||||
|
|
||||||
Stormux IRC: #stormux on irc.stormux.org
|
|
||||||
Arch Linux ARM IRC: #archlinuxarm on irc.libera.chat
|
|
||||||
|
|
||||||
Thank you Stormux supporters! https://ko-fi.com/stormux/leaderboard
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
|||||||
#%PAM-1.0
|
|
||||||
|
|
||||||
auth include system-local-login
|
|
||||||
account include system-local-login
|
|
||||||
password include system-local-login
|
|
||||||
session include system-local-login
|
|
@ -1 +0,0 @@
|
|||||||
kernel.printk = 3 3 3 3
|
|
@ -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
|
|
@ -1,2 +0,0 @@
|
|||||||
[Resolve]
|
|
||||||
DNSSEC=no
|
|
@ -1,14 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=Network Time Service
|
|
||||||
After=network.target nss-lookup.target
|
|
||||||
Conflicts=systemd-timesyncd.service
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=forking
|
|
||||||
PrivateTmp=true
|
|
||||||
ExecStartPre=/usr/bin/ntpd -Ggq
|
|
||||||
ExecStart=/usr/bin/ntpd -g -u ntp:ntp
|
|
||||||
Restart=always
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
@ -1,45 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
trap 'popd &> /dev/null' EXIT
|
|
||||||
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
|
|
||||||
clear
|
|
||||||
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 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
|
|
||||||
echo "Installing configure-stormux..."
|
|
||||||
sudo git -C /opt clone -q https://git.stormux.org/storm/configure-stormux || exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
pushd /opt/configure-stormux
|
|
||||||
./configure-stormux.sh
|
|
||||||
|
|
||||||
exit 0
|
|
@ -1,79 +0,0 @@
|
|||||||
state.ALSA {
|
|
||||||
control.1 {
|
|
||||||
iface MIXER
|
|
||||||
name 'PCM Playback Volume'
|
|
||||||
value -197
|
|
||||||
comment {
|
|
||||||
access 'read write'
|
|
||||||
type INTEGER
|
|
||||||
count 1
|
|
||||||
range '-10239 - 400'
|
|
||||||
dbmin -9999999
|
|
||||||
dbmax 400
|
|
||||||
dbvalue.0 -197
|
|
||||||
}
|
|
||||||
}
|
|
||||||
control.2 {
|
|
||||||
iface MIXER
|
|
||||||
name 'PCM Playback Switch'
|
|
||||||
value true
|
|
||||||
comment {
|
|
||||||
access 'read write'
|
|
||||||
type BOOLEAN
|
|
||||||
count 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
control.3 {
|
|
||||||
iface MIXER
|
|
||||||
name 'PCM Playback Route'
|
|
||||||
value 1
|
|
||||||
comment {
|
|
||||||
access 'read write'
|
|
||||||
type INTEGER
|
|
||||||
count 1
|
|
||||||
range '0 - 2'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
control.4 {
|
|
||||||
iface PCM
|
|
||||||
name 'IEC958 Playback Default'
|
|
||||||
value '0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
|
|
||||||
comment {
|
|
||||||
access 'read write'
|
|
||||||
type IEC958
|
|
||||||
count 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
control.5 {
|
|
||||||
iface PCM
|
|
||||||
name 'IEC958 Playback Con Mask'
|
|
||||||
value '0200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
|
|
||||||
comment {
|
|
||||||
access read
|
|
||||||
type IEC958
|
|
||||||
count 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
control.6 {
|
|
||||||
iface PCM
|
|
||||||
name 'IEC958 Playback PCM Stream'
|
|
||||||
value '0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
|
|
||||||
comment {
|
|
||||||
access 'read write inactive'
|
|
||||||
type IEC958
|
|
||||||
count 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
state.vc4hdmi {
|
|
||||||
control.1 {
|
|
||||||
iface PCM
|
|
||||||
name ELD
|
|
||||||
value '100008006a10000100000000000000000469fd22415355532056533232380917070000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
|
|
||||||
comment {
|
|
||||||
access 'read volatile'
|
|
||||||
type BYTES
|
|
||||||
count 128
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -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,16 +175,15 @@ pacman -Su --needed --noconfirm \
|
|||||||
brltty \
|
brltty \
|
||||||
cloud-utils \
|
cloud-utils \
|
||||||
cronie \
|
cronie \
|
||||||
dbus-broker \
|
|
||||||
espeak-ng \
|
espeak-ng \
|
||||||
fake-hwclock \
|
fake-hwclock \
|
||||||
|
firmware-raspberrypi \
|
||||||
git \
|
git \
|
||||||
go \
|
go \
|
||||||
magic-wormhole \
|
magic-wormhole \
|
||||||
man \
|
man \
|
||||||
man-pages \
|
man-pages \
|
||||||
networkmanager \
|
networkmanager \
|
||||||
ntp \
|
|
||||||
pipewire \
|
pipewire \
|
||||||
pipewire-alsa \
|
pipewire-alsa \
|
||||||
pipewire-jack \
|
pipewire-jack \
|
||||||
@ -195,11 +194,12 @@ pacman -Su --needed --noconfirm \
|
|||||||
python-evdev \
|
python-evdev \
|
||||||
python-dbus \
|
python-dbus \
|
||||||
python-pyte \
|
python-pyte \
|
||||||
raspberrypi-firmware \
|
raspberrypi-utils \
|
||||||
realtime-privileges \
|
realtime-privileges \
|
||||||
rhvoice-voice-bdl \
|
rhvoice-voice-bdl \
|
||||||
rng-tools \
|
rng-tools \
|
||||||
rsync \
|
rsync \
|
||||||
|
screen \
|
||||||
sox \
|
sox \
|
||||||
w3m \
|
w3m \
|
||||||
wget \
|
wget \
|
||||||
@ -252,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
|
||||||
@ -260,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
|
||||||
@ -275,7 +275,7 @@ cp -rv ../files/boot/* /mnt/boot
|
|||||||
cp -rv ../files/etc/* /mnt/etc
|
cp -rv ../files/etc/* /mnt/etc
|
||||||
cp -rv ../files/var/* /mnt/var
|
cp -rv ../files/var/* /mnt/var
|
||||||
cp -rv ../files/usr/* /mnt/usr
|
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.
|
# Exiting calls the cleanup function to unmount.
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -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
|
||||||
|
12
pi4/files/etc/environment
Normal file
12
pi4/files/etc/environment
Normal 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
|
34
pi4/files/etc/profile.d/stormux_first_boot.sh
Executable file
34
pi4/files/etc/profile.d/stormux_first_boot.sh
Executable file
@ -0,0 +1,34 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
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.
|
||||||
|
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 "${sudoFlags[@]}" configure-stormux
|
4
pi4/files/etc/skel/.bash_aliases
Normal file
4
pi4/files/etc/skel/.bash_aliases
Normal file
@ -0,0 +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 +0,0 @@
|
|||||||
alias sudo='sudo '
|
|
@ -1,45 +1,139 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
trap 'popd &> /dev/null' EXIT
|
# For audible sudo prompts:
|
||||||
if [[ ! -d /opt/configure-stormux ]]; then
|
unset sudoFlags
|
||||||
# Offer to switch fenrir layout.
|
if [[ -x /etc/audibleprompt.sh ]]; then
|
||||||
echo "Would you like to switch Fenrir to laptop layout? (y/n)"
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if [[ -x /opt/configure-stormux/configure-stormux.sh ]]; then
|
||||||
|
pushd /opt/configure-stormux
|
||||||
|
./configure-stormux.sh
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
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
|
read -r continue
|
||||||
continue="${continue::1}"
|
continue="${continue::1}"
|
||||||
if [[ "${continue,}" == "y" ]];then
|
if [[ "${continue,}" == "y" ]];then
|
||||||
sudo sed -i 's/=desktop/=laptop/' /etc/fenrirscreenreader/settings/settings.conf
|
sudo "${sudoFlags[@]}" growpartfs $diskSource
|
||||||
sudo 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 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
|
|
||||||
echo "Installing configure-stormux..."
|
|
||||||
sudo git -C /opt clone -q https://git.stormux.org/storm/configure-stormux || exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
pushd /opt/configure-stormux
|
if ! ping -c1 stormux.org &> /dev/null ; then
|
||||||
./configure-stormux.sh
|
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 "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."
|
||||||
|
|
||||||
|
|
||||||
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