Updated the p3 build script.
This commit is contained in:
parent
110e7d9253
commit
7d15478e18
@ -121,7 +121,7 @@ if ! pacman -Q qemu-user-static &> /dev/null ; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
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
|
if ! pacman -Q $i &> /dev/null ; then
|
||||||
echo "Please install $i before continuing."
|
echo "Please install $i before continuing."
|
||||||
exit 1
|
exit 1
|
||||||
@ -167,10 +167,13 @@ pacman -Su --needed --noconfirm \
|
|||||||
bluez \
|
bluez \
|
||||||
bluez-utils \
|
bluez-utils \
|
||||||
brltty \
|
brltty \
|
||||||
|
cloud-utils \
|
||||||
cronie \
|
cronie \
|
||||||
dbus-broker \
|
dbus-broker \
|
||||||
espeak-ng \
|
espeak-ng \
|
||||||
|
fake-hwclock \
|
||||||
git \
|
git \
|
||||||
|
go \
|
||||||
magic-wormhole \
|
magic-wormhole \
|
||||||
man \
|
man \
|
||||||
man-pages \
|
man-pages \
|
||||||
@ -180,11 +183,18 @@ pacman -Su --needed --noconfirm \
|
|||||||
pipewire-alsa \
|
pipewire-alsa \
|
||||||
pipewire-jack \
|
pipewire-jack \
|
||||||
pipewire-pulse \
|
pipewire-pulse \
|
||||||
|
poppler \
|
||||||
|
python-pyudev \
|
||||||
|
python-daemonize \
|
||||||
|
python-evdev \
|
||||||
|
python-dbus \
|
||||||
|
python-pyte \
|
||||||
raspberrypi-firmware \
|
raspberrypi-firmware \
|
||||||
realtime-privileges \
|
realtime-privileges \
|
||||||
rhvoice-voice-bdl \
|
rhvoice-voice-bdl \
|
||||||
rng-tools \
|
rng-tools \
|
||||||
rsync \
|
rsync \
|
||||||
|
screen \
|
||||||
sox \
|
sox \
|
||||||
w3m \
|
w3m \
|
||||||
wget \
|
wget \
|
||||||
@ -215,30 +225,41 @@ echo -e "stormux\nstormux" | passwd "stormux"
|
|||||||
sudo -iu stormux
|
sudo -iu stormux
|
||||||
# Create desktop, downloads, music, and other directories.
|
# Create desktop, downloads, music, and other directories.
|
||||||
xdg-user-dirs-update
|
xdg-user-dirs-update
|
||||||
# Install the yay package manager
|
# Build AUR packages
|
||||||
git clone https://aur.archlinux.org/yay.git
|
export aurPackages=(fenrir-git \
|
||||||
cd yay
|
growpartfs \
|
||||||
makepkg -si --noconfirm
|
log2ram \
|
||||||
|
yay)
|
||||||
|
export PKGDEST=~/packages
|
||||||
|
for p in "\${aurPackages[@]}" ; do
|
||||||
|
git clone https://aur.archlinux.org/\${p}.git
|
||||||
|
cd ~/\${p}
|
||||||
|
makepkg -A
|
||||||
cd ~
|
cd ~
|
||||||
rm -rf yay
|
rm -rf \${p}
|
||||||
yay -S --removemake --noconfirm fenrir-git growpartfs log2ram
|
done
|
||||||
rm -rf .cache/yay
|
|
||||||
/usr/share/fenrirscreenreader/tools/configure_pipewire.sh
|
|
||||||
exit
|
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.
|
# 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 wireplumber.service
|
systemctl --global enable dbus-broker.service 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
|
||||||
# Configure sudo for group wheel, remove nopasswd for the stormux user
|
# Configure sudo for group wheel, remove nopasswd for the stormux user
|
||||||
echo '%wheel ALL=(ALL) ALL' > /etc/sudoers.d/wheel
|
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 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
|
systemctl disable dbus.service
|
||||||
# Cleanup packages
|
# Cleanup packages
|
||||||
pacman -Sc --noconfirm
|
pacman -Sc --noconfirm
|
||||||
|
pacman -R --noconfirm go
|
||||||
|
|
||||||
# Update fstab for Raspberry Pi 4. Not needed until linux-aarch64 works.
|
# Update fstab for Raspberry Pi 4. Not needed until linux-aarch64 works.
|
||||||
# [[ $imageVersion -eq 4 ]] && sed -i 's/mmcblk0/mmcblk1/g' /etc/fstab
|
# [[ $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/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
|
||||||
|
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
pi3/files/etc/skel/.bash_aliases
Normal file
1
pi3/files/etc/skel/.bash_aliases
Normal file
@ -0,0 +1 @@
|
|||||||
|
alias sudo='sudo '
|
21
pi3/files/etc/skel/.bash_functions
Normal file
21
pi3/files/etc/skel/.bash_functions
Normal 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
|
||||||
|
}
|
24
pi3/files/etc/skel/.bashrc
Normal file
24
pi3/files/etc/skel/.bashrc
Normal 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
|
||||||
|
|
6
pi3/files/etc/skel/.inputrc
Normal file
6
pi3/files/etc/skel/.inputrc
Normal 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
|
18
pi3/files/etc/skel/.screenrc
Normal file
18
pi3/files/etc/skel/.screenrc
Normal 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@
|
@ -1,14 +1,16 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
trap 'popd &> /dev/null' EXIT
|
trap 'popd &> /dev/null' EXIT
|
||||||
|
|
||||||
|
export SUDO_ASKPASS=/etc/audibleprompt.sh
|
||||||
if [[ ! -d /opt/configure-stormux ]]; then
|
if [[ ! -d /opt/configure-stormux ]]; then
|
||||||
# Offer to switch fenrir layout.
|
# Offer to switch fenrir layout.
|
||||||
echo "Would you like to switch Fenrir to laptop layout? (y/n)"
|
echo "Would you like to switch Fenrir to laptop layout? (y/n)"
|
||||||
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 -A sed -i 's/=desktop/=laptop/' /etc/fenrirscreenreader/settings/settings.conf
|
||||||
sudo systemctl restart fenrirscreenreader.service
|
sudo -A systemctl restart fenrirscreenreader.service
|
||||||
clear
|
clear
|
||||||
fi
|
fi
|
||||||
if ! ping -c1 stormux.org &> /dev/null ; then
|
if ! ping -c1 stormux.org &> /dev/null ; then
|
||||||
@ -24,19 +26,19 @@ if [[ ! -d /opt/configure-stormux ]]; then
|
|||||||
nmtui-connect
|
nmtui-connect
|
||||||
fi
|
fi
|
||||||
# Check for internet connectivity
|
# 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..."
|
echo "Updating the clock to prevent certificate errors..."
|
||||||
# Get current date and time
|
# Get current date and time
|
||||||
date_time=$(curl -s http://worldtimeapi.org/api/ip | grep -oP '(?<="datetime":")[^"]*')
|
date_time=$(curl -s http://worldtimeapi.org/api/ip | grep -oP '(?<="datetime":")[^"]*')
|
||||||
echo "Current date and time: $date_time"
|
echo "Current date and time: $date_time"
|
||||||
# set date and time
|
# set date and time
|
||||||
sudo date -s "$date_time"
|
sudo -A date -s "$date_time"
|
||||||
else
|
else
|
||||||
echo "Please connect to the internet and run ${0##*/} again."
|
echo "Please connect to the internet and run ${0##*/} again."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "Installing configure-stormux..."
|
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
|
fi
|
||||||
|
|
||||||
pushd /opt/configure-stormux
|
pushd /opt/configure-stormux
|
||||||
|
Loading…
Reference in New Issue
Block a user