Skip to content

Commit 446cfa4

Browse files
committed
Updated to archiso 49-1
1 parent 98b0ca3 commit 446cfa4

14 files changed

Lines changed: 328 additions & 3 deletions

File tree

airootfs/etc/mkinitcpio.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ FILES=()
5252
#
5353
## NOTE: If you have /usr on a separate partition, you MUST include the
5454
# usr, fsck and shutdown hooks.
55-
HOOKS=(base udev memdisk archiso_shutdown archiso archiso_loop_mnt archiso_pxe_common archiso_pxe_nbd archiso_pxe_http archiso_pxe_nfs archiso_kms block filesystems keyboard)
55+
HOOKS=(base udev modconf memdisk archiso_shutdown archiso archiso_loop_mnt archiso_pxe_common archiso_pxe_nbd archiso_pxe_http archiso_pxe_nfs archiso_kms block filesystems keyboard)
5656

5757
# COMPRESSION
5858
# Use this to compress the initramfs image. By default, gzip compression
@@ -63,6 +63,7 @@ HOOKS=(base udev memdisk archiso_shutdown archiso archiso_loop_mnt archiso_pxe_c
6363
COMPRESSION="xz"
6464
#COMPRESSION="lzop"
6565
#COMPRESSION="lz4"
66+
#COMPRESSION="zstd"
6667

6768
# COMPRESSION_OPTIONS
6869
# Additional options for the compressor
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
[Unit]
5+
Description=Unmute All Sound Card Controls For Use With The Live Arch Environment
6+
# This needs to run after the audio device becomes available.
7+
Wants=systemd-udev-settle.service
8+
After=systemd-udev-settle.service sound.target
9+
ConditionKernelCommandLine=accessibility=on
10+
11+
[Service]
12+
Type=oneshot
13+
ExecStart=/usr/local/bin/livecd-sound -u
14+
15+
[Install]
16+
WantedBy=sound.target
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
[Unit]
5+
Description=Screen reader service
6+
After=livecd-alsa-unmuter.service
7+
Before=getty@tty1.service
8+
ConditionKernelCommandLine=accessibility=on
9+
10+
[Service]
11+
Type=oneshot
12+
TTYPath=/dev/tty13
13+
ExecStartPre=/usr/bin/chvt 13
14+
ExecStart=/usr/local/bin/livecd-sound -p
15+
ExecStartPost=/usr/bin/chvt 1
16+
ExecStartPost=systemctl start espeakup.service
17+
StandardInput=tty
18+
TTYVHangup=yes
19+
TTYVTDisallocate=yes
20+
RemainAfterExit=true
21+
22+
[Install]
23+
WantedBy=multi-user.target
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/etc/systemd/system/livecd-talk.service
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../livecd-alsa-unmuter.service

airootfs/root/.zlogin

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1+
# fix for screen readers
2+
if grep -Fq 'accessibility=' /proc/cmdline &> /dev/null; then
3+
setopt SINGLE_LINE_ZLE
4+
fi
5+
16
~/.automated_script.sh
Lines changed: 248 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,248 @@
1+
#!/usr/bin/env bash
2+
#
3+
# SPDX-License-Identifier: GPL-3.0-or-later
4+
5+
usage() {
6+
cat <<- _EOF_
7+
live cd sound helper script.
8+
Usage: livecdsound [OPTION]
9+
OPTIONS
10+
-u, --unmute unmute all sound cards
11+
-p, --pick select a card for speetch output
12+
-h, --help Show this usage message
13+
14+
_EOF_
15+
}
16+
17+
bugout () {
18+
printf "/usr/local/bin/livecdsound: programming error"
19+
stat_fail
20+
}
21+
22+
echo_card_indices()
23+
{
24+
if [ -f /proc/asound/cards ] ; then
25+
sed -n -e's/^[[:space:]]*\([0-7]\)[[:space:]].*/\1/p' /proc/asound/cards
26+
fi
27+
}
28+
29+
# The following functions try to set many controls.
30+
# No card has all the controls and so some of the attempts are bound to fail.
31+
# Because of this, the functions can't return useful status values.
32+
33+
# $1 <card id>
34+
# $2 <control>
35+
# $3 <level>
36+
unmute_and_set_level(){
37+
{ [ "$3" ] &&[ "$2" ] && [ "$1" ] ; } || bugout
38+
systemd-cat -t "livecdsound" printf "Setting: %s on card: %s to %s\n" "$2" "$1" "$3"
39+
systemd-cat -t "livecdsound" amixer -c "$1" set "$2" "$3" unmute
40+
return 0
41+
}
42+
43+
# $1 <card id>
44+
# $2 <control>
45+
mute_and_zero_level()
46+
{
47+
{ [ "$1" ] && [ "$2" ] ; } || bugout
48+
systemd-cat -t "livecdsound" printf "Muting control: %s on card: %s\n" "$2" "$1"
49+
systemd-cat -t "livecdsound" amixer -c "$1" set "$2" "0%" mute
50+
return 0
51+
}
52+
53+
# $1 <card ID>
54+
# $2 <control>
55+
# $3 "on" | "off"
56+
switch_control()
57+
{
58+
{ [ "$3" ] && [ "$1" ] ; } || bugout
59+
systemd-cat -t "livecdsound" printf "Switching control: %s on card: %s to %s\n" "$2" "$1" "$3"
60+
systemd-cat -t "livecdsound" amixer -c "$1" set "$2" "$3"
61+
return 0
62+
}
63+
64+
# $1 <card ID>
65+
sanify_levels_on_card()
66+
{
67+
unmute_and_set_level "$1" "Front" "80%"
68+
unmute_and_set_level "$1" "Master" "80%"
69+
unmute_and_set_level "$1" "Master Mono" "80%"
70+
unmute_and_set_level "$1" "Master Digital" "80%" # E.g., cs4237B
71+
unmute_and_set_level "$1" "Playback" "80%"
72+
unmute_and_set_level "$1" "Headphone" "100%"
73+
unmute_and_set_level "$1" "PCM" "80%"
74+
unmute_and_set_level "$1" "PCM,1" "80%" # E.g., ess1969
75+
unmute_and_set_level "$1" "DAC" "80%" # E.g., envy24, cs46xx
76+
unmute_and_set_level "$1" "DAC,0" "80%" # E.g., envy24
77+
unmute_and_set_level "$1" "DAC,1" "80%" # E.g., envy24
78+
unmute_and_set_level "$1" "Synth" "80%"
79+
unmute_and_set_level "$1" "CD" "80%"
80+
unmute_and_set_level "$1" "PC Speaker" "100%"
81+
82+
mute_and_zero_level "$1" "Mic"
83+
mute_and_zero_level "$1" "IEC958" # Ubuntu #19648
84+
85+
# Intel P4P800-MX
86+
switch_control "$1" "Master Playback Switch" on
87+
switch_control "$1" "Master Surround" on
88+
89+
# Trident/YMFPCI/emu10k1:
90+
unmute_and_set_level "$1" "Wave" "80%"
91+
unmute_and_set_level "$1" "Music" "80%"
92+
unmute_and_set_level "$1" "AC97" "80%"
93+
94+
# DRC:
95+
unmute_and_set_level "$1" "Dynamic Range Compression" "80%"
96+
97+
# Required for HDA Intel (hda-intel):
98+
unmute_and_set_level "$1" "Front" "80%"
99+
100+
# Required for SB Live 7.1/24-bit (ca0106):
101+
unmute_and_set_level "$1" "Analog Front" "80%"
102+
103+
# Required at least for Via 823x hardware on DFI K8M800-MLVF Motherboard
104+
switch_control "$1" "IEC958 Capture Monitor" off
105+
106+
# Required for hardware allowing toggles for AC97 through IEC958,
107+
# valid values are 0, 1, 2, 3. Needs to be set to 0 for PCM1.
108+
unmute_and_set_level "$1" "IEC958 Playback AC97-SPSA" "0"
109+
110+
# Required for newer Via hardware
111+
unmute_and_set_level "$1" "VIA DXS,0" "80%"
112+
unmute_and_set_level "$1" "VIA DXS,1" "80%"
113+
unmute_and_set_level "$1" "VIA DXS,2" "80%"
114+
unmute_and_set_level "$1" "VIA DXS,3" "80%"
115+
116+
# Required on some notebooks with ICH4:
117+
switch_control "$1" "Headphone Jack Sense" off
118+
switch_control "$1" "Line Jack Sense" off
119+
120+
# Some machines need one or more of these to be on;
121+
# others need one or more of these to be off:
122+
123+
switch_control "$1" "Audigy Analog/Digital Output Jack" on
124+
switch_control "$1" "SB Live Analog/Digital Output Jack" on
125+
126+
# D1984 -- Thinkpad T61/X61
127+
switch_control "$1" "Speaker" on
128+
switch_control "$1" "Headphone" on
129+
130+
# HDA-Intel w/ "Digital" capture mixer (See Ubuntu #193823)
131+
unmute_and_set_level "$1" "Digital" "80%"
132+
133+
return 0
134+
}
135+
136+
# $1 <card ID> | "all"
137+
sanify_levels()
138+
{
139+
local ttsdml_returnstatus=0
140+
local card
141+
case "$1" in
142+
all)
143+
for card in $(echo_card_indices) ; do
144+
sanify_levels_on_card "$card" || ttsdml_returnstatus=1
145+
done
146+
;;
147+
*)
148+
sanify_levels_on_card "$1" || ttsdml_returnstatus=1
149+
;;
150+
esac
151+
return $ttsdml_returnstatus
152+
}
153+
154+
# List all cards that *should* be usable for PCM audio. In my experience,
155+
# the console speaker (handled by the pcsp driver) isn't a suitable playback
156+
# device, so we'll exclude it.
157+
list_non_pcsp_cards()
158+
{
159+
for card in $(echo_card_indices); do
160+
local cardfile="/proc/asound/card${card}/id"
161+
if [ -r "$cardfile" ] && [ -f "$cardfile" ] && \
162+
[ "$(cat "$cardfile")" != pcsp ]; then
163+
echo "$card"
164+
fi
165+
done
166+
}
167+
168+
# Properly initialize the sound card so that we have audio at boot.
169+
unmute_all_cards()
170+
{
171+
sanify_levels all
172+
}
173+
174+
is_numeric() {
175+
local str=$1
176+
[[ "$str" =~ ^[0-9]+$ ]]
177+
}
178+
179+
set_default_card() {
180+
local card=$1
181+
sed -e "s/%card%/$card/g" < /usr/local/share/livecd-sound/asound.conf.in \
182+
> /etc/asound.conf
183+
}
184+
185+
play_on_card() {
186+
local card=$1 file=$2
187+
aplay -q "-Dplughw:$card,0" "$file"
188+
}
189+
190+
# If there are multiple usable sound cards, prompt the user to choose one,
191+
# using auditory feedback.
192+
pick_a_card()
193+
{
194+
set -f
195+
usable_cards="$(list_non_pcsp_cards)"
196+
num_usable_cards="$(wc -w <<< "$usable_cards")"
197+
198+
if [ "$num_usable_cards" -eq 1 ]; then
199+
systemd-cat -t "livecdsound" printf "Only one sound card is detected\n"
200+
exit 0
201+
fi
202+
systemd-cat -t "livecdsound" printf "multiple sound cards detected\n"
203+
for card in $usable_cards; do
204+
if ! is_numeric "$card"; then
205+
continue
206+
fi
207+
play_on_card "$card" /usr/share/livecd-sounds/pick-a-card.wav&
208+
done
209+
wait
210+
sleep 1
211+
for card in $usable_cards; do
212+
if ! is_numeric "$card"; then
213+
continue
214+
fi
215+
play_on_card "$card" /usr/share/livecd-sounds/beep.wav
216+
if read -r -t 10; then
217+
systemd-cat -t "livecdsound" printf "Selecting %s sound card as default\n" "$card"
218+
set_default_card "$card"
219+
break
220+
fi
221+
done
222+
}
223+
224+
if [[ $# -eq 0 ]]; then
225+
echo "error: No argument passed."
226+
exit 1
227+
fi
228+
while [[ "${1}" != "" ]]; do
229+
case ${1} in
230+
-h|--help)
231+
usage
232+
exit
233+
;;
234+
-u|--unmute)
235+
systemd-cat -t "livecdsound" printf "Unmuting all cards"
236+
unmute_all_cards
237+
;;
238+
-p|--pick)
239+
pick_a_card
240+
;;
241+
*)
242+
echo "error: Unsupported argument"
243+
usage
244+
exit 1
245+
;;
246+
esac
247+
shift
248+
done
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Defaults node
2+
defaults.ctl.card %card%;
3+
defaults.pcm.card %card%;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
title Arch Linux install medium (x86_64, UEFI) with speech
5+
linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux
6+
initrd /%INSTALL_DIR%/boot/intel-ucode.img
7+
initrd /%INSTALL_DIR%/boot/amd-ucode.img
8+
initrd /%INSTALL_DIR%/boot/x86_64/initramfs-linux.img
9+
options archisobasedir=%INSTALL_DIR% archisolabel=%ARCHISO_LABEL% accessibility=on

efiboot/loader/loader.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
22
# SPDX-License-Identifier: GPL-3.0-or-later
33

4-
timeout 3
4+
timeout 15
55
default archiso-x86_64-linux.conf

0 commit comments

Comments
 (0)