Skip to content

Commit c641706

Browse files
Enhance Arch Linux build process by implementing no beep features, optimizing package installation, and improving logging. Includes updates to Dockerfile, GRUB configuration, pacman settings, and various scripts for better user experience and performance.
1 parent 77432ad commit c641706

File tree

13 files changed

+345
-26
lines changed

13 files changed

+345
-26
lines changed

airootfs/etc/inputrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Disable all bell sounds in readline applications
2+
set bell-style none
3+
4+
# Make Tab autocomplete regardless of filename case
5+
set completion-ignore-case on
6+
7+
# Show all autocomplete results at once
8+
set page-completions off
9+
10+
# If there are more than 200 possible completions for a word, ask to show them all
11+
set completion-query-items 200
12+
13+
# Show extra file information when completing, like `ls -F` does
14+
set visible-stats on
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Performance optimizations for mkinitcpio
2+
# Use all available CPU cores for compression
3+
COMPRESSION_OPTIONS=(-T0)
4+
5+
# Use faster zstd compression with good ratio
6+
COMPRESSION="zstd"
7+
8+
# Use better hooks order for faster boot
9+
HOOKS=(base udev autodetect modconf block filesystems keyboard)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Disable PC speaker beeps through ALSA
2+
options snd_hda_intel beep_mode=0
3+
options snd_hda_core beep_mode=0
4+
# Some hardware may require this as well
5+
options snd-pcsp index=-2
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Disable PC Speaker
2+
blacklist pcspkr
3+
blacklist snd_pcsp
4+
5+
# Disable additional beep modules
6+
blacklist hpilo
7+
blacklist ipmi_si
8+
blacklist hpwdt
9+
blacklist toshiba_acpi
10+
11+
# PC speaker options if module is loaded anyway
12+
options pcspkr enable=0
13+
options snd_pcsp enable=0
14+
15+
# Explicitly install the dummy module instead
16+
install pcspkr /bin/true
17+
install snd_pcsp /bin/true

airootfs/etc/skel/.bashrc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# ~/.bashrc: executed by bash for non-login shells
2+
3+
# Disable terminal bell in bash
4+
bind 'set bell-style none'
5+
6+
# If not running interactively, don't do anything else
7+
[[ $- != *i* ]] && return
8+
9+
# Color prompt
10+
PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
11+
12+
# Enable color support
13+
alias ls='ls --color=auto'
14+
alias grep='grep --color=auto'
15+
alias fgrep='fgrep --color=auto'
16+
alias egrep='egrep --color=auto'
17+
18+
# Add useful aliases
19+
alias ll='ls -l'
20+
alias la='ls -la'
21+
22+
# History settings
23+
HISTCONTROL=ignoreboth
24+
HISTSIZE=1000
25+
HISTFILESIZE=2000
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[Unit]
2+
Description=Disable system beeps
3+
Documentation=https://github.com/Githubguy132010/Arch-Linux-without-the-beeps
4+
DefaultDependencies=no
5+
Before=sysinit.target
6+
After=local-fs.target
7+
8+
[Service]
9+
Type=oneshot
10+
RemainAfterExit=yes
11+
ExecStart=/bin/bash -c "rmmod pcspkr snd_pcsp 2>/dev/null || true"
12+
ExecStart=/bin/bash -c "echo 'blacklist pcspkr' > /etc/modprobe.d/nobeep.conf"
13+
ExecStart=/bin/bash -c "echo 'blacklist snd_pcsp' >> /etc/modprobe.d/nobeep.conf"
14+
ExecStart=/bin/bash -c "if [ -f /sys/module/i8042/parameters/nopnp ]; then echo 1 > /sys/module/i8042/parameters/nopnp; fi"
15+
16+
[Install]
17+
WantedBy=sysinit.target
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/etc/systemd/system/no-beep.service

dockerfile

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,35 @@
1-
FROM archlinux:latest
1+
FROM archlinux:latest AS builder
22

3-
# Install necessary packages
3+
# Set up parallel downloads and other optimizations
4+
COPY pacman.conf /etc/pacman.conf
5+
6+
# Update system and install necessary packages
47
RUN pacman -Syu --noconfirm && \
5-
pacman -S --noconfirm git archiso grub
8+
pacman -S --noconfirm --needed \
9+
git \
10+
archiso \
11+
grub \
12+
base-devel \
13+
&& pacman -Scc --noconfirm
14+
15+
# Set the working directory
16+
WORKDIR /build
17+
18+
# Copy only necessary files for package installation
19+
COPY packages.x86_64 bootstrap_packages.x86_64 profiledef.sh ./
20+
21+
# Create a new final image
22+
FROM builder AS final
623

724
# Set the working directory
825
WORKDIR /workdir
926

10-
# Copy files into the container
27+
# Copy the rest of the files
1128
COPY . .
1229

13-
# Instead of running mkarchiso here, we leave it for later execution
14-
# Create an entrypoint or leave it to manual execution
15-
CMD ["/bin/bash"]
30+
# Use an entrypoint script for better flexibility
31+
COPY ./scripts/entrypoint.sh /entrypoint.sh
32+
RUN chmod +x /entrypoint.sh
33+
34+
ENTRYPOINT ["/entrypoint.sh"]
35+
CMD ["build"]

grub/grub.cfg

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,16 @@ fi
4545

4646
# Set default menu entry
4747
default=archlinux
48-
timeout=15
48+
# Reduced timeout for faster boot
49+
timeout=5
4950
timeout_style=menu
5051

5152

5253
# Menu entries
5354

5455
menuentry "Arch Linux install medium (%ARCH%, ${archiso_platform})" --class arch --class gnu-linux --class gnu --class os --id 'archlinux' {
5556
set gfxpayload=keep
56-
linux /%INSTALL_DIR%/boot/%ARCH%/vmlinuz-linux archisobasedir=%INSTALL_DIR% archisosearchuuid=%ARCHISO_UUID%
57+
linux /%INSTALL_DIR%/boot/%ARCH%/vmlinuz-linux archisobasedir=%INSTALL_DIR% archisosearchuuid=%ARCHISO_UUID% quiet loglevel=3 udev.log_level=3 vt.global_cursor_default=0
5758
initrd /%INSTALL_DIR%/boot/%ARCH%/initramfs-linux.img
5859
}
5960

@@ -102,6 +103,4 @@ menuentry 'System restart' --class reboot --class restart {
102103
reboot
103104
}
104105

105-
106-
# GRUB init tune for accessibility
107-
play 600 988 1 1319 4
106+
# Removed accessibility beep

pacman.conf

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
# If you wish to use different paths, uncomment and update the paths.
1212
#RootDir = /
1313
#DBPath = /var/lib/pacman/
14-
#CacheDir = /var/cache/pacman/pkg/
14+
CacheDir = /var/cache/pacman/pkg/
1515
#LogFile = /var/log/pacman.log
1616
#GPGDir = /etc/pacman.d/gnupg/
1717
#HookDir = /etc/pacman.d/hooks/
1818
HoldPkg = pacman glibc
19-
#XferCommand = /usr/bin/curl -L -C - -f -o %o %u
19+
XferCommand = /usr/bin/curl -L -C - -f -o %o %u --retry 3 --retry-delay 3 --connect-timeout 10
2020
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
21-
#CleanMethod = KeepInstalled
21+
CleanMethod = KeepInstalled
2222
Architecture = auto
2323

2424
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
@@ -30,12 +30,12 @@ Architecture = auto
3030

3131
# Misc options
3232
#UseSyslog
33-
#Color
34-
#NoProgressBar
33+
Color
34+
ILoveCandy
35+
ParallelDownloads = 16
3536
# We cannot check disk space from within a chroot environment
3637
#CheckSpace
37-
#VerbosePkgLists
38-
ParallelDownloads = 64
38+
VerbosePkgLists
3939
DownloadUser = alpm
4040
#DisableSandbox
4141

@@ -90,8 +90,8 @@ Include = /etc/pacman.d/mirrorlist
9090
#[multilib-testing]
9191
#Include = /etc/pacman.d/mirrorlist
9292

93-
#[multilib]
94-
#Include = /etc/pacman.d/mirrorlist
93+
[multilib]
94+
Include = /etc/pacman.d/mirrorlist
9595

9696
# An example of a custom package repository. See the pacman manpage for
9797
# tips on creating your own repositories.

0 commit comments

Comments
 (0)