@@ -40,21 +40,23 @@ build_iso() {
4040
4141 # Disable PC speaker module in airootfs if present
4242 if [ -f " airootfs/etc/modprobe.d/nobeep.conf" ] \
43- && grep -q " pcspkr" airootfs/etc/modprobe.d/nobeep.conf 2> /dev/null \
44- && grep -q " snd_pcsp" airootfs/etc/modprobe.d/nobeep.conf 2> /dev/null; then
43+ && grep -q " pcspkr" " airootfs/etc/modprobe.d/nobeep.conf" 2> /dev/null \
44+ && grep -q " snd_pcsp" " airootfs/etc/modprobe.d/nobeep.conf" 2> /dev/null; then
4545 log " PC speaker already disabled in airootfs configuration."
4646 else
4747 log " Disabling PC speaker in airootfs configuration..."
48- mkdir -p airootfs/etc/modprobe.d/
49- echo " blacklist pcspkr" > airootfs/etc/modprobe.d/nobeep.conf
50- echo " blacklist snd_pcsp" >> airootfs/etc/modprobe.d/nobeep.conf
48+ mkdir -p " airootfs/etc/modprobe.d/"
49+ echo " blacklist pcspkr" > " airootfs/etc/modprobe.d/nobeep.conf"
50+ echo " blacklist snd_pcsp" >> " airootfs/etc/modprobe.d/nobeep.conf"
5151 fi
5252
5353 # Create a custom hook to disable beeps in various config files
5454 if [ ! -f " airootfs/usr/share/libalpm/hooks/99-no-beep.hook" ]; then
5555 log " Creating custom hook to disable beeps..."
56- mkdir -p airootfs/usr/share/libalpm/hooks/
57- cat > airootfs/usr/share/libalpm/hooks/99-no-beep.hook << 'EOF '
56+ if ! mkdir -p " airootfs/usr/share/libalpm/hooks/" 2> /dev/null; then
57+ warn " Failed to create hooks directory, continuing..."
58+ else
59+ cat > " airootfs/usr/share/libalpm/hooks/99-no-beep.hook" << 'EOF '
5860[Trigger]
5961Type = Package
6062Operation = Install
@@ -66,21 +68,28 @@ Description = Disabling system beeps in various configuration files...
6668When = PostTransaction
6769Exec = /bin/bash -c "mkdir -p /etc/modprobe.d && echo 'blacklist pcspkr' > /etc/modprobe.d/nobeep.conf && echo 'blacklist snd_pcsp' >> /etc/modprobe.d/nobeep.conf && if [ -f /etc/inputrc ]; then grep -q 'set bell-style none' /etc/inputrc || echo 'set bell-style none' >> /etc/inputrc; fi"
6870EOF
71+ fi
6972 fi
7073
7174 # Add settings to disable terminal bell in bash
7275 if [ ! -f " airootfs/etc/skel/.bashrc" ]; then
7376 log " Adding bash configuration to disable terminal bell..."
74- mkdir -p airootfs/etc/skel/
75- echo " # Disable terminal bell" > airootfs/etc/skel/.bashrc
76- echo " bind 'set bell-style none'" >> airootfs/etc/skel/.bashrc
77+ if ! mkdir -p " airootfs/etc/skel/" 2> /dev/null; then
78+ warn " Failed to create skel directory, continuing..."
79+ else
80+ echo " # Disable terminal bell" > " airootfs/etc/skel/.bashrc"
81+ echo " bind 'set bell-style none'" >> " airootfs/etc/skel/.bashrc"
82+ fi
7783 fi
7884
7985 # Set bell-style none in global inputrc
8086 if [ ! -f " airootfs/etc/inputrc" ]; then
8187 log " Setting bell-style none in global inputrc..."
82- mkdir -p airootfs/etc
83- echo " set bell-style none" > airootfs/etc/inputrc
88+ if ! mkdir -p " airootfs/etc" 2> /dev/null; then
89+ warn " Failed to create etc directory, continuing..."
90+ else
91+ echo " set bell-style none" > " airootfs/etc/inputrc"
92+ fi
8493 fi
8594
8695 # Optimize the build process with parallel compression
0 commit comments