Skip to content

Commit bc46dca

Browse files
Merge pull request #144 from Githubguy132010/fixes
Enhance build and release workflows, improve logging and configuration handling, and refine sound management scripts
2 parents ca9036d + 8b14666 commit bc46dca

File tree

9 files changed

+115
-27
lines changed

9 files changed

+115
-27
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
uses: actions/cache@v4
4141
with:
4242
path: ${{ env.PACMAN_CACHE }}
43-
key: archlinux-pacman-${{ github.run_id }}
43+
key: archlinux-pacman-${{ hashFiles('packages.x86_64', 'bootstrap_packages.x86_64') }}
4444
restore-keys: |
4545
archlinux-pacman-
4646

.github/workflows/release-notes.yml

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,47 @@ jobs:
112112
} > $TEMP_NOTES_FILE
113113
fi
114114
115-
cat $TEMP_NOTES_FILE
115+
cat $TEMP_NOTES_FILE
116+
117+
- name: Update release with detailed notes
118+
uses: actions/github-script@v7
119+
with:
120+
script: |
121+
const fs = require('fs');
122+
const path = require('path');
123+
124+
// Read the detailed release notes
125+
const notesPath = path.join(process.env.GITHUB_WORKSPACE, 'DETAILED_RELEASE_NOTES.md');
126+
let releaseNotes = '';
127+
128+
try {
129+
releaseNotes = fs.readFileSync(notesPath, 'utf8');
130+
} catch (error) {
131+
console.log('Could not read detailed release notes, using fallback');
132+
releaseNotes = `## Changes in ${process.env.CURRENT_TAG}\n\nDetailed release notes could not be generated.`;
133+
}
134+
135+
// Get the current release
136+
const { owner, repo } = context.repo;
137+
const releases = await github.rest.repos.listReleases({
138+
owner,
139+
repo,
140+
per_page: 1
141+
});
142+
143+
if (releases.data.length === 0) {
144+
console.log('No releases found');
145+
return;
146+
}
147+
148+
const currentRelease = releases.data[0];
149+
150+
// Update the release with detailed notes
151+
await github.rest.repos.updateRelease({
152+
owner,
153+
repo,
154+
release_id: currentRelease.id,
155+
body: releaseNotes
156+
});
157+
158+
console.log(`Updated release ${currentRelease.tag_name} with detailed notes`);

airootfs/etc/systemd/system/no-beep.service

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
Description=Disable system beeps
33
Documentation=https://github.com/Githubguy132010/Arch-Linux-without-the-beeps
44
DefaultDependencies=no
5-
Before=sysinit.target
5+
Before=sysinit.target shutdown.target
66
After=local-fs.target
7+
Conflicts=shutdown.target
78

89
[Service]
910
Type=oneshot

airootfs/usr/local/bin/livecd-sound

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ usage() {
88
Usage: livecdsound [OPTION]
99
OPTIONS
1010
-u, --unmute unmute all sound cards
11-
-p, --pick select a card for speetch output
11+
-p, --pick select a card for speech output
1212
-h, --help Show this usage message
1313
1414
_EOF_
@@ -183,8 +183,9 @@ play_on_card() {
183183
# using auditory feedback.
184184
pick_a_card() {
185185
set -f
186-
usable_cards="$(list_non_pcsp_cards)"
187-
num_usable_cards="$(wc -w <<<"$usable_cards")"
186+
local usable_cards
187+
readarray -t usable_cards <<< "$(list_non_pcsp_cards)"
188+
local num_usable_cards=${#usable_cards[@]}
188189

189190
if (( num_usable_cards == 1 )); then
190191
systemd-cat -t "livecdsound" printf "Only one sound card is detected\n"

profiledef.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ if [ "$(nproc)" -gt 2 ]; then
2121
# For multi-core systems: use XZ with bcj x86 filter for better compression
2222
airootfs_image_tool_options=('-comp' 'xz' '-Xbcj' 'x86' '-b' '1M' '-Xdict-size' '1M')
2323
else
24-
# For single/dual-core systems: use the same options but may be slower
25-
airootfs_image_tool_options=('-comp' 'xz' '-Xbcj' 'x86' '-b' '1M' '-Xdict-size' '75%')
24+
# For single/dual-core systems: use safe fixed dictionary size
25+
airootfs_image_tool_options=('-comp' 'xz' '-Xbcj' 'x86' '-b' '1M' '-Xdict-size' '512K')
2626
fi
2727

2828
bootstrap_tarball_compression=('zstd' '-c' '-T0' '--auto-threads=logical' '--long' '-19')

scripts/entrypoint.sh

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,25 @@ 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'
60+
else
61+
cat > "airootfs/usr/share/libalpm/hooks/99-no-beep.hook" << 'EOF'
5862
[Trigger]
5963
Type = Package
6064
Operation = Install
@@ -66,21 +70,35 @@ Description = Disabling system beeps in various configuration files...
6670
When = PostTransaction
6771
Exec = /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"
6872
EOF
73+
fi
6974
fi
7075

7176
# Add settings to disable terminal bell in bash
7277
if [ ! -f "airootfs/etc/skel/.bashrc" ]; then
7378
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
79+
if ! mkdir -p "airootfs/etc/skel/" 2>/dev/null; then
80+
warn "Failed to create skel directory, continuing..."
81+
else
82+
echo "# Disable terminal bell" > "airootfs/etc/skel/.bashrc"
83+
echo "bind 'set bell-style none'" >> "airootfs/etc/skel/.bashrc"
84+
fi
85+
else
86+
echo "# Disable terminal bell" > "airootfs/etc/skel/.bashrc"
87+
echo "bind 'set bell-style none'" >> "airootfs/etc/skel/.bashrc"
88+
fi
7789
fi
7890

7991
# Set bell-style none in global inputrc
8092
if [ ! -f "airootfs/etc/inputrc" ]; then
8193
log "Setting bell-style none in global inputrc..."
82-
mkdir -p airootfs/etc
83-
echo "set bell-style none" > airootfs/etc/inputrc
94+
if ! mkdir -p "airootfs/etc" 2>/dev/null; then
95+
warn "Failed to create etc directory, continuing..."
96+
else
97+
echo "set bell-style none" > "airootfs/etc/inputrc"
98+
fi
99+
else
100+
echo "set bell-style none" > "airootfs/etc/inputrc"
101+
fi
84102
fi
85103

86104
# Optimize the build process with parallel compression

scripts/package_tracking/config.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ LOG_LEVEL="INFO" # Options: DEBUG, INFO, WARNING, ERROR
99
DATA_DIR="/tmp/package-versions"
1010

1111
# Update settings
12-
REPOS="core extra community multilib" # Repositories to check for updates
12+
REPOS="core extra multilib" # Repositories to check for updates (community merged into extra)
1313
CHECK_INTERVAL=86400 # Update interval in seconds (86400 = 24 hours)
1414
NOTIFY="true" # Whether to display notifications
1515

scripts/package_tracking/track_package_updates.sh

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,20 @@
88
set -e
99

1010
# Default configuration options (can be overridden by config file)
11-
CONFIG_FILE="/etc/package_tracking/config.conf"
12-
LOG_FILE="/var/log/package_tracking.log"
11+
# Use more portable paths that work in containers
12+
CONFIG_FILE="${XDG_CONFIG_HOME:-${HOME}/.config}/package_tracking/config.conf"
13+
if [ -w "/etc" ] 2>/dev/null; then
14+
CONFIG_FILE="/etc/package_tracking/config.conf"
15+
fi
16+
17+
LOG_FILE="${XDG_STATE_HOME:-${HOME}/.local/state}/package_tracking.log"
18+
if [ -w "/var/log" ] 2>/dev/null; then
19+
LOG_FILE="/var/log/package_tracking.log"
20+
fi
21+
1322
LOG_LEVEL="INFO" # Options: DEBUG, INFO, WARNING, ERROR
1423
DATA_DIR="/tmp/package-versions"
15-
REPOS="core extra community multilib"
24+
REPOS="core extra multilib" # Updated to remove deprecated 'community' repo
1625
CHECK_INTERVAL=86400 # 24 hours in seconds
1726
NOTIFY="true"
1827
TIMEOUT=30 # Connection timeout in seconds
@@ -33,10 +42,17 @@ UPDATES_FILE="${DATA_DIR}/package_updates.md"
3342
LAST_RUN_FILE="${DATA_DIR}/last_run.timestamp"
3443

3544
# Create directory for storing log files if it doesn't exist
36-
mkdir -p "$(dirname "$LOG_FILE")" 2>/dev/null || true
45+
if ! mkdir -p "$(dirname "$LOG_FILE")" 2>/dev/null; then
46+
# Fall back to current directory if we can't create the log directory
47+
LOG_FILE="./package_tracking.log"
48+
echo "Warning: Could not create log directory, using current directory" >&2
49+
fi
3750

3851
# Create data directory if it doesn't exist
39-
mkdir -p "${DATA_DIR}" 2>/dev/null || true
52+
if ! mkdir -p "${DATA_DIR}" 2>/dev/null; then
53+
echo "Error: Could not create data directory: ${DATA_DIR}" >&2
54+
exit 1
55+
fi
4056

4157
# Load configuration if exists
4258
if [ -f "$CONFIG_FILE" ]; then
@@ -175,6 +191,7 @@ get_current_versions() {
175191
log "DEBUG" "Found $total_packages packages to process"
176192

177193
> "${CURRENT_VERSIONS_FILE}.tmp" # Create or truncate the temporary file
194+
chmod 600 "${CURRENT_VERSIONS_FILE}.tmp" 2>/dev/null || log "WARNING" "Could not set restrictive permissions on temporary file ${CURRENT_VERSIONS_FILE}.tmp"
178195

179196
while IFS= read -r pkg; do
180197
# Skip empty lines and comments

scripts/select-mirrors.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,15 @@ log "Selecting fastest mirrors..."
1818

1919
# Create mirror directory if it doesn't exist
2020
mkdir -p airootfs/etc/pacman.d/
21-
cp /etc/pacman.d/mirrorlist airootfs/etc/pacman.d/mirrorlist.backup 2>/dev/null || true
21+
22+
# Backup existing mirrorlist if it exists
23+
if [ -f /etc/pacman.d/mirrorlist ]; then
24+
cp /etc/pacman.d/mirrorlist airootfs/etc/pacman.d/mirrorlist.backup 2>/dev/null || {
25+
warn "Failed to backup mirrorlist, continuing without backup"
26+
}
27+
else
28+
warn "No system mirrorlist found to backup"
29+
fi
2230

2331
# Install reflector if not already installed
2432
if ! command -v reflector &> /dev/null; then

0 commit comments

Comments
 (0)