O Netinstall

A imagem mínima (~41 MB) com debian-installer + preseed.

Visão geral

O netinstall é uma ISO mínima contendo apenas o kernel e o initramfs do debian-installer, mais um arquivo preseed.cfg. Ele delega o download dos pacotes ao espelho próprio durante a instalação.

A imagem é montada assim (script gnucego-build-netinstall.sh):

mkdir -p isolinux
cp linux initrd.gz preseed.cfg isolinux/
cp isolinux.bin ldlinux.c32 isolinux/
xorriso -as mkisofs -o gnucego-install-amd64.iso \
  -isohybrid-mbr isohdpfx.bin -c isolinux/boot.cat \
  -b isolinux/isolinux.bin -no-emul-boot \
  -boot-load-size 4 -boot-info-table -J -R .

O isolinux.cfg define a linha de boot:

default auto
timeout 60
menu title GNUcego 2026.2 — Instalacao (GNU/Linux-libre)
label auto
  menu label ^Instalar GNUcego (particionar e escolher interface)
  kernel /linux
  append vga=788 initrd=/initrd.gz auto=true priority=high \
         preseed/file=/preseed.cfg firmware=never
O parâmetro firmware=never impede o instalador de tentar baixar firmware não-livre — essencial para uma instalação FSDG. E priority=high (não critical) mantém o tasksel interativo para a escolha da interface gráfica.

O segredo: o initrd patcheado

O initrd.gz do netinstall não é o original do Debian. Ele foi aberto, patcheado com hooks próprios e recompactado. Esses hooks são o coração da personalização:

Hook 07gnucego-keyring (completo)

#!/bin/sh
# Hook executado no post-base-installer.d, DEPOIS do install_kernel e ANTES
# do grub-installer. Prepara o TARGET:
# 1. instala a chave GNUcego + repo 'gnu'
# 2. apt-get update (para o pick_kernel achar o linux-image-7.3.1-gnu)
# 3. garante initramfs-tools e GERA o initramfs do kernel linux-libre
#    (sem o initrd, o grub-installer falha com "um passo falhou").

SRC=/usr/share/keyrings/gnucego-keyring.gpg

if [ ! -f "$SRC" ] || [ ! -d /target ]; then
    exit 0
fi

# 1) chave GNUcego no target
mkdir -p /target/etc/apt/trusted.gpg.d /target/usr/share/keyrings 2>/dev/null
cp "$SRC" /target/etc/apt/trusted.gpg.d/gnucego.gpg 2>/dev/null
cp "$SRC" /target/usr/share/keyrings/gnucego-keyring.gpg 2>/dev/null

# 2) repo 'gnu' (http)
if [ -f /target/etc/apt/sources.list ]; then
    grep -q "repo.gnucego.com.br gnu" /target/etc/apt/sources.list 2>/dev/null || \
        echo "deb http://repo.gnucego.com.br gnu main" >> /target/etc/apt/sources.list
else
    echo "deb http://repo.gnucego.com.br trixie main" > /target/etc/apt/sources.list 2>/dev/null
    echo "deb http://repo.gnucego.com.br gnu main" >> /target/etc/apt/sources.list 2>/dev/null
fi

# 3) apt-get update no target
if [ -x /target/usr/bin/apt-get ]; then
    [ -s /target/etc/resolv.conf ] || cp /etc/resolv.conf /target/etc/resolv.conf 2>/dev/null
    chroot /target apt-get update 2>/dev/null || true
fi

# 4) garantir initramfs-tools e gerar o initramfs do kernel linux-libre
if [ -x /target/usr/sbin/update-initramfs ]; then
    KVER=$(ls /target/boot/vmlinuz-* 2>/dev/null | head -1 | sed 's/.*vmlinuz-//')
    [ -n "$KVER" ] && chroot /target update-initramfs -u -k "$KVER" 2>/dev/null || true
else
    if [ -x /target/usr/bin/apt-get ]; then
        chroot /target apt-get install -y initramfs-tools 2>/dev/null || true
        KVER=$(ls /target/boot/vmlinuz-* 2>/dev/null | head -1 | sed 's/.*vmlinuz-//')
        [ -n "$KVER" ] && chroot /target update-initramfs -u -k "$KVER" 2>/dev/null || true
    fi
fi
exit 0

Hook 90gnucego-i3wm (completo)

#!/bin/sh
# Roda ANTES do tasksel (dentro do pkgsel), no INSTALADOR.
# 1. injeta o .desc do i3wm no target (para o tasksel mostrar a task)
# 2. garante a chave GNUcego e o repo 'gnu' no target
# 3. roda apt-get update

DESC=/gnucego-tasks.desc
DEST=/target/usr/local/share/tasksel/descs
KEYRING=/usr/share/keyrings/gnucego-keyring.gpg

if [ -f "$DESC" ] && [ -d /target ]; then
    mkdir -p "$DEST" 2>/dev/null
    cp "$DESC" "$DEST/gnucego-tasks.desc" 2>/dev/null
fi

if [ -f "$KEYRING" ] && [ -d /target ]; then
    mkdir -p /target/etc/apt/trusted.gpg.d /target/usr/share/keyrings 2>/dev/null
    cp "$KEYRING" /target/etc/apt/trusted.gpg.d/gnucego.gpg 2>/dev/null
    cp "$KEYRING" /target/usr/share/keyrings/gnucego-keyring.gpg 2>/dev/null
fi

if [ -f /target/etc/apt/sources.list ]; then
    grep -q "repo.gnucego.com.br gnu" /target/etc/apt/sources.list 2>/dev/null || \
        echo "deb http://repo.gnucego.com.br gnu main" >> /target/etc/apt/sources.list
fi

if [ -x /target/usr/bin/apt-get ]; then
    [ -s /target/etc/resolv.conf ] || cp /etc/resolv.conf /target/etc/resolv.conf 2>/dev/null
    chroot /target apt-get update 2>/dev/null || true
fi
exit 0
Por que gerar o initramfs antes do grub? O kernel Linux-libre do Freesh não gera o initrd sozinho sem o initramfs-tools. Sem esse passo, o grub-installer falha com o temido "um passo falhou". É por isso que o hook 07 garante o initramfs-tools e gera o initrd explicitamente.

O preseed.cfg

# GNUcego netinstall - preseed (sistema base + GNU Linux-libre + escolha de DE)
d-i debian-installer/locale string pt_BR
d-i debian-installer/language string pt_BR
d-i debian-installer/country string BR
d-i keyboard-configuration/xkb-keymap select br
d-i time/zone string America/Sao_Paulo

# TEMA escuro (fundo preto) para o instalador
d-i debian-installer/theme string dark

d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string gnucego
d-i netcfg/get_domain string unassigned-domain

d-i mirror/country string manual
d-i mirror/protocol string http
d-i mirror/http/hostname string repo.gnucego.com.br
d-i mirror/http/directory string /
d-i mirror/http/proxy string

d-i apt-setup/use_mirror boolean true
d-i apt-setup/enable-source-repositories boolean false
d-i apt-setup/cdrom/set-first boolean false
d-i apt-setup/multiarch string amd64

d-i passwd/root-login boolean false
d-i passwd/make-user boolean true

# PARTICIONADOR MANUAL: o usuario escolhe livremente.
d-i partman/choose_partition select finish

popularity-contest popularity-contest/participate boolean false

# TASKSEL INTERATIVO: escolha da interface grafica ou NENHUMA.
d-i pkgsel/include string openssh-server,icecat,emacs-gtk,linux-headers-7.3.1-gnu,fastfetch

# late_command: pos-instalacao (identidade, linux-libre, fastfetch, locale)
d-i preseed/late_command string wget -O /target/tmp/gnucego-postinstall.sh \
  http://repo.gnucego.com.br/gnucego/gnucego-postinstall.sh || \
  wget --no-check-certificate -O /target/tmp/gnucego-postinstall.sh \
  https://repo.gnucego.com.br/gnucego/gnucego-postinstall.sh; \
  wget -O /target/tmp/gnucego-keyring.deb \
  http://repo.gnucego.com.br/gnucego-keyring.deb || \
  wget --no-check-certificate -O /target/tmp/gnucego-keyring.deb \
  https://repo.gnucego.com.br/gnucego-keyring.deb; \
  chroot /target sh /tmp/gnucego-postinstall.sh

d-i finish-install/reboot_in_progress boolean true
d-i debconf/priority select high
Pontos importantes do preseed:

O postinstall.sh

É o script que roda no final (via late_command), dentro de /target. Ele aplica toda a identidade GNUcego. O código completo está na página Scripts. As seções principais são:

SeçãoO que faz
sources.listEscreve deb … exu main + exu-security + exu-updates (HTTP).
chave GNUcegoInstala o gnucego-keyring.deb + adiciona o repo gnu.
IdentidadeReescreve /etc/os-release, lsb-release, issue como "GNUcego GNU/Linux-libre".
GRUBCores vermelho/preto + fundo do morcego + 09_gnucego_colors.
localeAtiva pt_BR.UTF-8.
fastfetchBaixa o logo do morcego + config.
wallpaperBaixa o wallpaper e aplica em GRUB/GDM/LightDM/SDDM/desktop.
i3wmConfig global do i3 + terminator + wallpaper via feh.
finalupdate-initramfs -k 7.3.1-gnu + update-grub + clean.

Netinstall Testing

Existe uma variante testing (gnucego-testing-install-amd64.iso) cuja única diferença é o preseed apontando para mirror/http/directory /testing e um postinstall que usa o codinome ogum em vez de exu. Todo o resto (initrd, hooks, kernel) é idêntico.

→ Próximo: como a live MATE é construída