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:
parent
7f03e39f58
commit
2c03dce947
@ -527,50 +527,38 @@ GETTY
|
|||||||
# Auto-start installer via profile.d (runs after auto-login, no getty race)
|
# Auto-start installer via profile.d (runs after auto-login, no getty race)
|
||||||
# This is the same approach the working Debian Live build used.
|
# This is the same approach the working Debian Live build used.
|
||||||
mkdir -p /installer/etc/profile.d
|
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
|
#!/bin/bash
|
||||||
# Auto-start Archipelago installer on login — only run once
|
# 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
|
return 0 2>/dev/null || exit 0
|
||||||
fi
|
fi
|
||||||
export INSTALLER_STARTED=1
|
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
|
sleep 1
|
||||||
clear
|
clear
|
||||||
echo ""
|
echo ""
|
||||||
cc "\${W}a r c h i p e l a g o\${N}"
|
echo -e "\033[1;37m a r c h i p e l a g o\033[0m"
|
||||||
cc "\${O}━━━━━━━━━━━━━━━━━━━━━\${N}"
|
echo -e "\033[1;33m ━━━━━━━━━━━━━━━━━━━━━\033[0m"
|
||||||
cc "\${D}Automatic Installer\${N}"
|
echo -e "\033[37m automatic installer\033[0m"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
BOOT_MEDIA=""
|
BOOT_MEDIA=""
|
||||||
for dev in /run/live/medium /lib/live/mount/medium /run/archiso /cdrom /media/cdrom /mnt/iso; do
|
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
|
if [ -f "$dev/archipelago/auto-install.sh" ]; then
|
||||||
BOOT_MEDIA="\$dev"
|
BOOT_MEDIA="$dev"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -n "\$BOOT_MEDIA" ]; then
|
if [ -n "$BOOT_MEDIA" ]; then
|
||||||
cc "\${D}Found installer at: \$BOOT_MEDIA\${N}"
|
echo -e " \033[37mFound installer at: $BOOT_MEDIA\033[0m"
|
||||||
echo ""
|
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
|
read -s
|
||||||
bash "\$BOOT_MEDIA/archipelago/auto-install.sh"
|
bash "$BOOT_MEDIA/archipelago/auto-install.sh"
|
||||||
else
|
else
|
||||||
cc "\${D}Installer not found on boot media.\${N}"
|
echo -e " \033[37mInstaller not found on boot media.\033[0m"
|
||||||
cc "\${D}Try: sudo bash /path/to/archipelago/auto-install.sh\${N}"
|
|
||||||
echo ""
|
echo ""
|
||||||
fi
|
fi
|
||||||
PROFILE
|
PROFILE
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user