fix: heredoc escaping in installer profile.d (build failure)
The z99-archipelago-installer.sh heredoc used $'\033[...]' ANSI-C quoting inside an unquoted <<PROFILE heredoc. Bash misparses this during expansion, treating multi-line content as a single ANSI-C quoted string. Fix: switch to <<'PROFILE' (quoted, no expansion) and use raw \033 escape codes in echo -e instead of $'...' variables. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -527,50 +527,38 @@ GETTY
|
||||
# Auto-start installer via profile.d (runs after auto-login, no getty race)
|
||||
# This is the same approach the working Debian Live build used.
|
||||
mkdir -p /installer/etc/profile.d
|
||||
cat > /installer/etc/profile.d/z99-archipelago-installer.sh <<PROFILE
|
||||
cat > /installer/etc/profile.d/z99-archipelago-installer.sh <<'PROFILE'
|
||||
#!/bin/bash
|
||||
# Auto-start Archipelago installer on login — only run once
|
||||
if [ -n "\$INSTALLER_STARTED" ]; then
|
||||
if [ -n "$INSTALLER_STARTED" ]; then
|
||||
return 0 2>/dev/null || exit 0
|
||||
fi
|
||||
export INSTALLER_STARTED=1
|
||||
|
||||
# Colors
|
||||
O=\$'\\033[1;33m' # Bold yellow (orange accent)
|
||||
W=\$'\\033[1;37m' # Bold white
|
||||
D=\$'\\033[37m' # Dim
|
||||
N=\$'\\033[0m' # Reset
|
||||
|
||||
# Center-print
|
||||
TW=\$(tput cols 2>/dev/null || echo 60)
|
||||
[ "\$TW" -gt 120 ] && TW=120
|
||||
cc() { local s=\$(echo -e "\$1" | sed 's/\\x1b\\[[0-9;]*m//g'); local p=\$(( (TW - \${#s}) / 2 )); [ \$p -lt 0 ] && p=0; printf "%*s" "\$p" ""; echo -e "\$1"; }
|
||||
|
||||
sleep 1
|
||||
clear
|
||||
echo ""
|
||||
cc "\${W}a r c h i p e l a g o\${N}"
|
||||
cc "\${O}━━━━━━━━━━━━━━━━━━━━━\${N}"
|
||||
cc "\${D}Automatic Installer\${N}"
|
||||
echo -e "\033[1;37m a r c h i p e l a g o\033[0m"
|
||||
echo -e "\033[1;33m ━━━━━━━━━━━━━━━━━━━━━\033[0m"
|
||||
echo -e "\033[37m automatic installer\033[0m"
|
||||
echo ""
|
||||
|
||||
BOOT_MEDIA=""
|
||||
for dev in /run/live/medium /lib/live/mount/medium /run/archiso /cdrom /media/cdrom /mnt/iso; do
|
||||
if [ -f "\$dev/archipelago/auto-install.sh" ]; then
|
||||
BOOT_MEDIA="\$dev"
|
||||
if [ -f "$dev/archipelago/auto-install.sh" ]; then
|
||||
BOOT_MEDIA="$dev"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -n "\$BOOT_MEDIA" ]; then
|
||||
cc "\${D}Found installer at: \$BOOT_MEDIA\${N}"
|
||||
if [ -n "$BOOT_MEDIA" ]; then
|
||||
echo -e " \033[37mFound installer at: $BOOT_MEDIA\033[0m"
|
||||
echo ""
|
||||
cc "Press Enter to install | \${W}Ctrl+C\${N} for shell"
|
||||
echo -e " Press Enter to install | \033[1;37mCtrl+C\033[0m for shell"
|
||||
read -s
|
||||
bash "\$BOOT_MEDIA/archipelago/auto-install.sh"
|
||||
bash "$BOOT_MEDIA/archipelago/auto-install.sh"
|
||||
else
|
||||
cc "\${D}Installer not found on boot media.\${N}"
|
||||
cc "\${D}Try: sudo bash /path/to/archipelago/auto-install.sh\${N}"
|
||||
echo -e " \033[37mInstaller not found on boot media.\033[0m"
|
||||
echo ""
|
||||
fi
|
||||
PROFILE
|
||||
|
||||
Reference in New Issue
Block a user