chamesle

chamesle.org: the site of Chamesle, a small Linux distribution
git clone https://github.com/tortr-rs/chamesle
Log | Files | Refs | README

build.sh (18230B)


      1 #!/bin/bash
      2 # builds the iso for one edition
      3 #   sudo EDITION=xfce ./build.sh   -> out/chamesle-VERSION-EDITION-x86_64.iso
      4 #   sudo EDITION=netinst ./build.sh -> out/chamesle-x86_64.iso, the one that installs any of them
      5 # REPO= a dir or url with x86_64/Packages.adb (default work/repo, else the public one), WORK= OUT=
      6 # needs apk-tools 3, mksquashfs, xorriso, grub-mkrescue (bios + efi), readelf, zstd, cpio, depmod, curl
      7 set -euo pipefail
      8 HERE=$(cd "$(dirname "$0")" && pwd)
      9 EDITION=${EDITION:-xfce}
     10 [ -f "$HERE/editions/$EDITION/packages" ] || { echo "build: no edition '$EDITION' (editions/*/packages)" >&2; exit 1; }
     11 VERSION=$(cat "$HERE/VERSION"); CODENAME=$(cat "$HERE/CODENAME" 2>/dev/null || true)
     12 # each update has its own name on top of the codename, 0.7 is "Be Kool"
     13 UPDATE=$(cat "$HERE/UPDATE" 2>/dev/null || true)
     14 # a flavor (astro) is an edition on top of another one: base=gnome brings that edition's packages, overlay, session and
     15 # login, the flavor adds its own
     16 BASE=$(sed -n 's/^base=//p' "$HERE/editions/$EDITION/edition" 2>/dev/null)
     17 EDS="$BASE $EDITION"
     18 # edval KEY: from the edition file, else from its base's
     19 edval() { local e v; for e in $EDITION $BASE; do v=$(sed -n "s/^$1=//p" "$HERE/editions/$e/edition" 2>/dev/null); [ -n "$v" ] && { echo "$v"; return; }; done; return 0; }
     20 EDITION_NAME=$(sed -n 's/^name=//p' "$HERE/editions/$EDITION/edition" 2>/dev/null); EDITION_NAME=${EDITION_NAME:-$EDITION}
     21 WORK=${WORK:-$HERE/work/$EDITION}; ROOT=$WORK/root; ISO_DIR=$WORK/iso
     22 OUT=${OUT:-$HERE/out}; ISO=$OUT/chamesle-$VERSION-$EDITION-x86_64.iso
     23 NETINST=$(edval netinst)
     24 # no version: it installs whatever the repo has, the same link always gets the current one
     25 [ "$NETINST" = yes ] && ISO=$OUT/chamesle-x86_64.iso
     26 # sourceforge's own server, not downloads.sourceforge.net: that one sends each file to a random mirror,
     27 # some of them crawl, and apk waits on them forever
     28 PUBLIC_REPO=https://master.dl.sourceforge.net/project/chameslerepos
     29 # where the netinst installs from: the public repo. NETREPO="v3 URL;v3 URL" to test against others
     30 NETREPO=${NETREPO:-v3 $PUBLIC_REPO}
     31 REPO=${REPO:-$( [ -f "$HERE/work/repo/x86_64/Packages.adb" ] && echo "$HERE/work/repo" || echo "$PUBLIC_REPO")}
     32 APK=${APK:-apk}
     33 IN=$HERE/tools/in-image.sh
     34 
     35 missing=
     36 for t in "$APK" mksquashfs xorriso readelf zstd cpio depmod curl; do command -v "$t" >/dev/null || missing="$missing $t"; done
     37 command -v grub-mkrescue >/dev/null || command -v grub2-mkrescue >/dev/null || missing="$missing grub-mkrescue"
     38 [ -z "$missing" ] || { echo "build: missing tools:$missing" >&2; exit 1; }
     39 GRUB_MKRESCUE=$(command -v grub-mkrescue || command -v grub2-mkrescue)
     40 # an edition with desktop-packages=no (server) lists everything itself, without base.packages' desktop parts
     41 BASEPKGS=$HERE/editions/base.packages; [ "$(edval desktop-packages)" = no ] && BASEPKGS=
     42 packages() { sed 's/#.*//' $BASEPKGS $(for e in $EDS; do echo "$HERE/editions/$e/packages"; done) | tr ' \t' '\n\n' | grep -v '^$' | sort -u; }
     43 
     44 echo "=== [1/5] INSTALLING THE SYSTEM ($EDITION_NAME, from $REPO)"
     45 rm -rf "$WORK"; mkdir -p "$ROOT/etc/apk/keys" "$ISO_DIR/live" "$OUT"
     46 cp "$HERE"/keys/apk/*.pub "$ROOT/etc/apk/keys/"
     47 echo "v3 $REPO" > "$ROOT/etc/apk/repositories"
     48 # install scripts need /dev and /proc
     49 mkdir -p "$ROOT/dev" "$ROOT/proc"
     50 mount --rbind /dev "$ROOT/dev"; mount --make-rslave "$ROOT/dev"; mount -t proc proc "$ROOT/proc"
     51 trap 'umount "$ROOT/proc" 2>/dev/null; umount -lR "$ROOT/dev" 2>/dev/null; true' EXIT
     52 pkg() { "$APK" --root "$ROOT" --arch x86_64 --no-cache --no-interactive "$@"; }
     53 # scripts need sh and coreutils, so those go first without scripts
     54 pkg add --initdb --no-scripts base-files bash coreutils sed grep findutils
     55 pkg fix --reinstall $(pkg info --quiet)
     56 # no runit, ever
     57 pkg add '!runit' '!runit-void' $(packages)
     58 # apk runs a package's script right after unpacking it, so many ran before what they need (useradd, icon and
     59 # font caches...) was there. now everything is: run them all again
     60 mkdir -p "$ROOT/tmp/scripts"
     61 tar -xzf "$ROOT/lib/apk/db/scripts.tar.gz" -C "$ROOT/tmp/scripts"
     62 chroot "$ROOT" /bin/sh -c 'cd / && for s in /tmp/scripts/*.post-install; do sh "$s" >/dev/null; done'
     63 rm -rf "$ROOT/tmp/scripts"
     64 umount "$ROOT/proc" 2>/dev/null || true; umount -lR "$ROOT/dev" 2>/dev/null || true; trap - EXIT
     65 # what the installed system updates from
     66 echo "v3 $PUBLIC_REPO" > "$ROOT/etc/apk/repositories"
     67 mkdir -p "$ROOT/usr/share/chamesle"
     68 cp "$ROOT/etc/apk/repositories" "$ROOT/usr/share/chamesle/repositories"
     69 if [ "$NETINST" = yes ]; then
     70     echo "$NETREPO" | tr ';' '\n' > "$ROOT/etc/apk/repositories"
     71     # the kernel brings all of linux-firmware: only the wi-fi and ethernet parts stay. the installed system gets
     72     # the rest back, chamesle-desktop reinstalls what /etc/chamesle/trimmed names
     73     FWD=$ROOT/usr/lib/firmware; rm -rf "$WORK/firmware"; mv "$FWD" "$WORK/firmware"; mkdir -p "$FWD"
     74     for d in $(sed 's/#.*//' "$HERE/editions/$EDITION/firmware"); do
     75         mkdir -p "$FWD/$(dirname "$d")"
     76         cp -a "$WORK/firmware/$d" "$FWD/$(dirname "$d")/"
     77     done
     78     mkdir -p "$ROOT/etc/chamesle"
     79     pkg info --quiet | grep -E '^(linux-firmware|intel-ucode)' > "$ROOT/etc/chamesle/trimmed"
     80     # iwlwifi: the 3 newest of each chip, the kernel takes the newest it knows
     81     ls "$ROOT/usr/lib/firmware/intel/iwlwifi" | sed -n 's/-\([0-9]*\)\.ucode\.zst$/ \1/p' | sort -k1,1 -k2,2nr |
     82         awk 'n[$1]++ >= 3 { print $1 "-" $2 ".ucode.zst" }' | sed "s|^|$ROOT/usr/lib/firmware/intel/iwlwifi/|" | xargs -r rm -f
     83 fi
     84 # flathub apps on the iso (play: steam). this machine's flatpak installs them into the image's system flatpaks
     85 FLATPAKS=$(edval flatpaks)
     86 if [ -n "$FLATPAKS" ]; then
     87     command -v flatpak >/dev/null || { echo "build: flatpaks=$FLATPAKS needs flatpak on this machine" >&2; exit 1; }
     88     export FLATPAK_SYSTEM_DIR=$ROOT/var/lib/flatpak
     89     # a copy from an earlier build saves the download: install then only brings what's new
     90     FLATPAK_SEED=${FLATPAK_SEED:-$HERE/work/flatpak-seed}
     91     [ -d "$FLATPAK_SEED" ] && { mkdir -p "$FLATPAK_SYSTEM_DIR"; cp -a "$FLATPAK_SEED/." "$FLATPAK_SYSTEM_DIR/"; }
     92     flatpak remote-add --system --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
     93     flatpak install --system -y --noninteractive flathub $FLATPAKS
     94     flatpak update --system -y --noninteractive
     95     unset FLATPAK_SYSTEM_DIR
     96 fi
     97 
     98 echo "=== [2/5] CHAMESLE: SERVICES, LOOK AND BRANDING"
     99 cp -a "$HERE/overlay/." "$ROOT/"
    100 for e in $EDS; do [ -d "$HERE/editions/$e/overlay" ] && cp -a "$HERE/editions/$e/overlay/." "$ROOT/"; done
    101 # services turned on for programs this edition doesn't have (the server has no bluetooth or printing) go off again
    102 for l in "$ROOT"/etc/dinit.d/boot.d/*; do
    103     c=$(sed -n 's/^command *= *\([^ ]*\).*/\1/p' "$ROOT/etc/dinit.d/${l##*/}" 2>/dev/null)
    104     [ -n "$c" ] && [ ! -e "$ROOT$c" ] && rm -f "$l"
    105 done
    106 # every edition, for chamesle-desktop: what jiggity installs on the netinst, and sudo chamesle-desktop later
    107 ED_DIR=$ROOT/usr/share/chamesle/editions; mkdir -p "$ED_DIR"
    108 cp -a "$HERE"/editions/* "$ED_DIR/"
    109 ls "$HERE/overlay/etc/dinit.d/boot.d" > "$ED_DIR/services"
    110 # the installer's slideshow starts with this edition's desktop (the website's picture of it) and how to get around
    111 SLIDES=$ROOT/usr/share/live-installer/slideshow
    112 SHOT=; for e in $EDITION $BASE; do [ -z "$SHOT" ] && [ -f "$HERE/docs/img/$e.png" ] && SHOT=$HERE/docs/img/$e.png; done
    113 if [ -d "$SLIDES" ] && [ -n "$SHOT" ]; then cp "$SHOT" "$SLIDES/desktop.png"; else rm -f "$SLIDES/desktop.png"; fi
    114 TOUR=$(edval tour)
    115 if [ -d "$SLIDES" ] && [ -n "$TOUR" ]; then
    116     sed -i "s|<p id=\"tour\">[^<]*</p>|<p id=\"tour\">${TOUR//&/\\&}</p>|" "$SLIDES/index.html"
    117 fi
    118 # xfce's stock wallpapers -> ours, for monitors xfce4-desktop.xml doesn't name
    119 for f in xfce-x.svg xfce-shapes.svg xfce-stripes.png xfce-teal.png xfce-verticals.png; do
    120     [ -d "$ROOT/usr/share/backgrounds/xfce" ] && ln -sf ../chamesle/default.png "$ROOT/usr/share/backgrounds/xfce/$f"
    121 done
    122 # the Windows key opens the Start menu
    123 KS=$ROOT/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml
    124 if [ -f "$KS" ] && ! grep -q 'xfce4-popup-whiskermenu' "$KS"; then
    125     sed -i 's|^\( *\)<property name="&lt;Super&gt;e" type="string" value="thunar"/>|&\n\1<property name="Super_L" type="string" value="xfce4-popup-whiskermenu"/>|' "$KS"
    126 fi
    127 # identity
    128 SUFFIX=${UPDATE:+ $UPDATE}
    129 cat > "$ROOT/etc/os-release" <<EOF
    130 NAME="Chamesle Linux"
    131 PRETTY_NAME="Chamesle Linux $VERSION$SUFFIX ($EDITION_NAME)"
    132 ID=chamesle
    133 VERSION="$VERSION${UPDATE:+ $UPDATE}${CODENAME:+ ($CODENAME)}"
    134 VERSION_ID="$VERSION"
    135 ${CODENAME:+VERSION_CODENAME=$(echo "$CODENAME" | tr '[:upper:]' '[:lower:]')}
    136 VARIANT="$EDITION_NAME"
    137 VARIANT_ID=$EDITION
    138 HOME_URL="https://chamesle.org/"
    139 LOGO=chamesle-start
    140 EOF
    141 rm -f "$ROOT/usr/lib/os-release"; ln -sf ../../etc/os-release "$ROOT/usr/lib/os-release"
    142 printf 'Chamesle Linux %s%s \\r (\\l)\n\n' "$VERSION" "$SUFFIX" > "$ROOT/etc/issue"
    143 echo chamesle > "$ROOT/etc/hostname"
    144 mkdir -p "$ROOT/usr/share/chamesle"
    145 echo "$VERSION" > "$ROOT/usr/share/chamesle/version"; echo "$EDITION" > "$ROOT/usr/share/chamesle/edition"
    146 grep -qx 'en_US.UTF-8 UTF-8' "$ROOT/etc/default/libc-locales" 2>/dev/null || echo 'en_US.UTF-8 UTF-8' >> "$ROOT/etc/default/libc-locales"
    147 echo 'LANG=en_US.UTF-8' > "$ROOT/etc/locale.conf"
    148 ln -sf /usr/share/zoneinfo/UTC "$ROOT/etc/localtime"
    149 "$IN" "$ROOT" /usr/bin/locale-gen
    150 "$IN" "$ROOT" /usr/bin/fc-cache -f
    151 "$IN" "$ROOT" /usr/bin/gtk-update-icon-cache -q -f /usr/share/icons/hicolor 2>/dev/null || true
    152 
    153 if [ "$NETINST" = yes ]; then
    154 # no live session: every boot entry is jiggity on tty1
    155 rm -f "$ROOT/etc/dinit.d/boot.d/display-manager"
    156 mkdir -p "$ROOT/etc/chamesle"; echo console > "$ROOT/etc/chamesle/login"
    157 else
    158 echo "=== [3/5] THE LIVE USER"
    159 # live user: no password, autologin, sudo. the installer removes all that
    160 "$IN" "$ROOT" /usr/bin/useradd -m -c "Live session" -s /bin/bash -G wheel,audio,video,input,network,storage,optical,scanner,lp,plugdev,users live
    161 "$IN" "$ROOT" /usr/bin/passwd -d live
    162 "$IN" "$ROOT" /usr/bin/passwd -l root
    163 echo 'live ALL=(ALL:ALL) NOPASSWD: ALL' > "$ROOT/etc/sudoers.d/live"; chmod 440 "$ROOT/etc/sudoers.d/live"
    164 # same for the password prompts of the store, drivers and updates: live has no password to type
    165 mkdir -p "$ROOT/etc/polkit-1/rules.d"
    166 printf 'polkit.addRule(function(action, subject) {\n    if (subject.user == "live") return polkit.Result.YES;\n});\n' > "$ROOT/etc/polkit-1/rules.d/49-live.rules"
    167 # no lock screen when idle: live has no password, so a locked live session can't be opened again
    168 mkdir -p "$ROOT/home/live/.config"
    169 printf '[Daemon]\nAutolock=false\nLockOnResume=false\n' > "$ROOT/home/live/.config/kscreenlockerrc"
    170 printf '[org.gnome.desktop.screensaver]\nlock-enabled=false\n\n[org.cinnamon.desktop.screensaver]\nlock-enabled=false\n\n[org.mate.screensaver]\nlock-enabled=false\n' > "$ROOT/usr/share/glib-2.0/schemas/99_chamesle-live.gschema.override"
    171 "$IN" "$ROOT" /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas 2>/dev/null || true
    172 SESSION=$(edval session); SESSION=${SESSION:-${BASE:-$EDITION}}
    173 LOGIN=$(edval login); LOGIN=${LOGIN:-sddm}
    174 # what an installed system starts: the live one, unless the edition says otherwise (gnome and kde: x11 live, where
    175 # the installer is at home, wayland once installed). the installer reads it for autologin
    176 INSTALLED=$(edval installed-session); INSTALLED=${INSTALLED:-$SESSION}
    177 mkdir -p "$ROOT/etc/chamesle"; echo "$INSTALLED" > "$ROOT/etc/chamesle/session"; echo "$LOGIN" > "$ROOT/etc/chamesle/login"
    178 if [ "$LOGIN" = sddm ]; then
    179     mkdir -p "$ROOT/etc/sddm.conf.d"
    180     printf '# the live session only (the installer removes this file)\n[Autologin]\nUser=live\nSession=%s.desktop\n' "$SESSION" \
    181         > "$ROOT/etc/sddm.conf.d/90-live.conf"
    182 elif [ "$LOGIN" = console ]; then
    183     # no sign-in screen: tty1 logs live in, and Install runs jiggity in text there
    184     echo live > "$ROOT/etc/chamesle/autologin"
    185     rm -f "$ROOT/etc/dinit.d/boot.d/display-manager"
    186 elif [ "$LOGIN" = gdm ]; then
    187     # gdm has a single config file, the installer takes these lines out again. the session comes from accountsservice
    188     sed -i 's/^\[daemon\]$/&\n# the live session only\nAutomaticLoginEnable=True\nAutomaticLogin=live/' "$ROOT/etc/gdm/custom.conf"
    189     mkdir -p "$ROOT/var/lib/AccountsService/users"
    190     printf '[User]\nSession=%s\nSystemAccount=false\n' "$SESSION" > "$ROOT/var/lib/AccountsService/users/live"
    191 else
    192     printf '# the live session only (the installer removes this file)\n[Seat:*]\nautologin-user=live\nautologin-session=%s\n' "$SESSION" \
    193         > "$ROOT/etc/lightdm/lightdm.conf.d/90-live.conf"
    194 fi
    195 "$IN" "$ROOT" /usr/bin/xdg-user-dirs-update 2>/dev/null || true
    196 # installer icon on the desktop, marked trusted at login or xfce and caja ask first
    197 mkdir -p "$ROOT/home/live/Desktop" "$ROOT/home/live/.config/autostart"
    198 [ -f "$ROOT/usr/share/applications/chamesle-install.desktop" ] &&
    199     install -m755 "$ROOT/usr/share/applications/chamesle-install.desktop" "$ROOT/home/live/Desktop/"
    200 cat > "$ROOT/home/live/.config/autostart/trust-installer.desktop" <<'EOF'
    201 [Desktop Entry]
    202 Type=Application
    203 Name=Trust the installer icon
    204 Exec=sh -c 'f=$HOME/Desktop/chamesle-install.desktop; gio set "$f" metadata::xfce-exe-checksum "$(sha256sum "$f" | cut -d" " -f1)"; gio set "$f" metadata::trusted true'
    205 NoDisplay=true
    206 EOF
    207 # gnome has no desktop icons: the installer goes first in the dock instead
    208 # the dock of a flavor wins over gnome's: its override sorts last
    209 GNOME_LOOK=$(grep -l '^favorite-apps=' "$ROOT"/usr/share/glib-2.0/schemas/*_chamesle-*.gschema.override 2>/dev/null | sort | tail -n1 || true)
    210 if [ -n "$GNOME_LOOK" ]; then
    211     mkdir -p "$ROOT/home/live/.config/dconf" "$ROOT/tmp/live-dconf"
    212     { echo '[org/gnome/shell]'; sed -n "s/^favorite-apps=\[/&'chamesle-install.desktop', /p" "$GNOME_LOOK"; } > "$ROOT/tmp/live-dconf/live"
    213     "$IN" "$ROOT" /usr/bin/dconf compile /home/live/.config/dconf/user /tmp/live-dconf
    214     rm -rf "$ROOT/tmp/live-dconf"
    215 fi
    216 "$IN" "$ROOT" /usr/bin/chown -R live:live /home/live
    217 fi
    218 rm -f "$ROOT/etc/machine-id" "$ROOT/var/lib/dbus/machine-id"
    219 rm -rf "$ROOT/var/cache/apk"/*
    220 
    221 echo "=== [4/5] KERNEL AND INITRAMFS"
    222 # our kernel, not void's fallback next to it, even when void's has the higher version
    223 KVER=$(ls "$ROOT/usr/lib/modules" | grep -- '-cachyos-lts$' | sort -V | tail -n1)
    224 [ -n "$KVER" ] || KVER=$(ls "$ROOT/usr/lib/modules" | sort -V | tail -n1)
    225 BUILD_ID="$VERSION-$EDITION-$(date +%s)"
    226 cp "$ROOT/boot/vmlinuz-$KVER" "$ISO_DIR/live/vmlinuz"
    227 "$HERE/tools/initrd/build-initrd.sh" "$ROOT" "$KVER" "$ISO_DIR/live/initrd.img" "$BUILD_ID"
    228 echo "$BUILD_ID" > "$ISO_DIR/live/build-id"
    229 cp "$ISO_DIR/live/initrd.img" "$ROOT/boot/initramfs-$KVER.img"
    230 
    231 echo "=== [5/5] SQUASHFS AND ISO"
    232 mksquashfs "$ROOT" "$ISO_DIR/live/rootfs.squashfs" -comp zstd -Xcompression-level 15 -b 1M -noappend -no-xattrs -quiet
    233 mkdir -p "$ISO_DIR/boot/grub"
    234 # the same boot menu theme an installed system gets
    235 THEME=$ROOT/usr/share/grub/themes/chamesle
    236 [ -d "$THEME" ] && mkdir -p "$ISO_DIR/boot/grub/themes" && cp -r "$THEME" "$ISO_DIR/boot/grub/themes/"
    237 cat > "$ISO_DIR/boot/grub/grub.cfg" <<EOF
    238 set default=0
    239 set timeout=5
    240 insmod all_video
    241 insmod gfxterm
    242 set gfxmode=1280x800,1024x768,auto
    243 set gfxpayload=keep
    244 terminal_output gfxterm
    245 if [ -f \$prefix/themes/chamesle/theme.txt ]; then
    246     insmod png
    247     loadfont \$prefix/fonts/unicode.pf2
    248     loadfont \$prefix/themes/chamesle/inter-16.pf2
    249     loadfont \$prefix/themes/chamesle/inter-20.pf2
    250     loadfont \$prefix/themes/chamesle/inter-bold-32.pf2
    251     set theme=\$prefix/themes/chamesle/theme.txt
    252 fi
    253 if [ ! -f /live/vmlinuz ]; then search --no-floppy --set=root --file /live/vmlinuz; fi
    254 # a beep when the menu is up, for whoever can't see it. S starts the installer with a screen reader
    255 insmod play
    256 play 480 440 1
    257 
    258 # two choices, like a Windows USB: try it, or install it. Install starts Jiggity alone on the screen, with no desktop
    259 menuentry "Try Chamesle" {
    260     linux /live/vmlinuz quiet splash loglevel=3 drm.panic_screen=qr_code
    261     initrd /live/initrd.img
    262 }
    263 menuentry "Install Chamesle" {
    264     linux /live/vmlinuz chamesle.install=1 quiet splash loglevel=3 drm.panic_screen=qr_code
    265     initrd /live/initrd.img
    266 }
    267 menuentry "Install Chamesle with a screen reader" --hotkey=s {
    268     linux /live/vmlinuz chamesle.install=1 chamesle.speech=1 quiet loglevel=3 drm.panic_screen=qr_code
    269     initrd /live/initrd.img
    270 }
    271 submenu "More options" {
    272     menuentry "Try Chamesle (safe graphics)" {
    273         linux /live/vmlinuz quiet loglevel=3 nomodeset drm.panic_screen=qr_code
    274         initrd /live/initrd.img
    275     }
    276     menuentry "Install Chamesle (safe graphics)" {
    277         linux /live/vmlinuz chamesle.install=1 quiet loglevel=3 nomodeset drm.panic_screen=qr_code
    278         initrd /live/initrd.img
    279     }
    280     menuentry "Try Chamesle (copy to RAM)" {
    281         linux /live/vmlinuz chamesle.toram=1 quiet splash loglevel=3 drm.panic_screen=qr_code
    282         initrd /live/initrd.img
    283     }
    284     menuentry "Try Chamesle (show boot messages)" {
    285         linux /live/vmlinuz loglevel=4 console=tty0 console=ttyS0,115200 drm.panic_screen=qr_code
    286         initrd /live/initrd.img
    287     }
    288 }
    289 EOF
    290 if [ "$NETINST" = yes ]; then
    291     # no live session to try: install, nothing else. no drivers that need firmware the iso hasn't got: the
    292     # firmware's own screen does for text
    293     sed -i '/^# two choices/,$d' "$ISO_DIR/boot/grub/grub.cfg"
    294     cat >> "$ISO_DIR/boot/grub/grub.cfg" <<'EOF'
    295 menuentry "Install Chamesle" {
    296     linux /live/vmlinuz chamesle.install=1 modprobe.blacklist=amdgpu,radeon,nouveau,xe quiet loglevel=3
    297     initrd /live/initrd.img
    298 }
    299 menuentry "Install Chamesle with a screen reader" --hotkey=s {
    300     linux /live/vmlinuz chamesle.install=1 chamesle.speech=1 modprobe.blacklist=amdgpu,radeon,nouveau,xe quiet loglevel=3
    301     initrd /live/initrd.img
    302 }
    303 menuentry "Install Chamesle (show boot messages)" {
    304     linux /live/vmlinuz chamesle.install=1 modprobe.blacklist=amdgpu,radeon,nouveau,xe loglevel=4 console=tty0 console=ttyS0,115200
    305     initrd /live/initrd.img
    306 }
    307 EOF
    308 fi
    309 "$GRUB_MKRESCUE" -o "$ISO" "$ISO_DIR" -volid CHAMESLE
    310 (cd "$OUT" && sha256sum "$(basename "$ISO")" > "$(basename "$ISO").sha256")
    311 ls -lh "$ISO"
    312 echo "SUCCESS: $ISO"