====== Debian Max Disc ======
{{tag>project UEBLES_GEMURKSE software computing howto}}
----
Sinn dieses Wahnsinns ist es, am Ende ein ISO zu haben dass man je nach Größe und Bedarf auf einen USB-Stick/Festplatte/CD/DVD/BD(-XL) werfen kann, in dem dann **alle** Pakete des jeweiligen Releases enthalten sind.\\
**ALLE!**\\
===== Voraussetzungen =====
* Am besten Debian oder eines der Derivate in halbwegs aktueller Fassung
* ~200GB freien Platz auf $Platte
* zu viel Zeit + ein paar Nerven
* eine sinnvolle Anwendung für das Ergebnis
===== Pakete beschaffen =====
siehe [[https://www.debian.org/CD/jigdo-cd/index.de.html]]\\
siehe [[https://wiki.debian.org/DebianInstaller/Modify/CD]]\\
siehe [[https://www.gnu.org/software/xorriso/man_1_xorriso.html]]\\
siehe [[http://cdimage.debian.org/cdimage/weekly-builds/i386/log/success/B_i386_netinst.log]]\\
Debian-Programme die benötigt werden:
* ''screen''
* ''jigdo-file''
* ''bsdtar''
* ''debian-cd''
* ''xorriso''
* ''isolinux''
Los gehts:
* Das Beispiel verwendet Debian 11.0 (bullseye) für amd64
* einen ''screen'' starten
* ''screen -S debmax''
* Am einfachsten geht das aktuell mit den BD-Installationsimages von Debian, diese gibt es jedoch nicht direkt per HTTP zum Download, sondern man muss sie wie folgt mit jigdo erstellen
* Links zu Jigdo-Dateien gibts unter [[https://www.debian.org/CD/jigdo-cd/index.de.html]]
* ''jigdo-lite [[http://ftp.de.debian.org/debian-cd/11.0.0/amd64/jigdo-bd/debian-11.0.0-amd64-BD-1.jigdo]] [[http://ftp.de.debian.org/debian-cd/11.0.0/amd64/jigdo-bd/debian-11.0.0-amd64-BD-2.jigdo]] [[http://ftp.de.debian.org/debian-cd/11.0.0/amd64/jigdo-bd/debian-11.0.0-amd64-BD-3.jigdo]] [[http://ftp.de.debian.org/debian-cd/11.0.0/amd64/jigdo-bd/debian-11.0.0-amd64-BD-4.jigdo]]''
* Sollte jigdo nach Mirrors fragen, bei aktueller Version [[http://ftp.de.debian.org/debian/]] oder was anderes in der Nähe angeben, den Non-US-Mirror einfach mit Enter bestätigen (nicht denselben angeben!)
* Sollte man das für eine ältere Distribution machen wollen, ggf. [[http://ftp.de.debian.org/debian-archive/debian/]] und [[http://ftp.de.debian.org/debian-archive/debian-non-US/]] angeben
* abwarten und schauen, dass einem die Platte nicht vollläuft
* Für die, dies ganz genau meinen, außerdem noch eine CD mit non-free Firmware besorgen von [[https://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/]]
* ''wget [[https://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/11.0.0+nonfree/amd64/iso-cd/firmware-11.0.0-amd64-netinst.iso]]''
* Dann cd1 entpacken
* Pools restlicher CDs in entpackte CD1 kopieren\\ mkdir -pv cd{,2,3,4,5}
bsdtar -C cd/ -xf debian-11.0.0-amd64-BD-1.iso
chmod -R +w cd
mount -o loop debian-11.0.0-amd64-BD-2.iso cd2
mount -o loop debian-11.0.0-amd64-BD-3.iso cd3
mount -o loop debian-11.0.0-amd64-BD-4.iso cd4
mount -o loop firmware-11.0.0-amd64-netinst.iso cd5
for i in 2 3 4
do
cp -rv cd$i/pool/* cd/pool/
done
cp -rv cd5/pool/non-free cd/pool/
cp -rv cd5/firmware cd/
cp -rv cd5/dists/bullseye/non-free cd/dists/bullseye/
* Leider gibt es von ''non-free'' keine komplette CD.. daher muss das ganze Repo heruntergeladen werden
* Erstmal ne Liste aller non-free Pakete für den arch runterladen: ''wget [[http://ftp.de.debian.org/debian/dists/Debian11.0/non-free/binary-amd64/Packages.gz]]''
* .deb-URLs aus dem Index holen
* zcat Packages.gz | grep "Filename: " | sed -e 's/: /ftp.de.debian.org\/debian\//' > packages
* .debs runterladen
* ''wget -cm -nv --show-progress -i packages''
* non-free Kram zur CD hinzufügen
* ''cp -rv ftp.de.debian.org/debian/pool/non-free cd/pool/''
* Dann braucht man noch die Overrides von [[http://deb.debian.org/debian/indices/]]
* ''mkdir -pv cd/indices''
* ''cd cd/indices''
* ''wget [[http://deb.debian.org/debian/indices/override.bullseye.main.gz]] [[http://deb.debian.org/debian/indices/override.bullseye.contrib.gz]] [[http://deb.debian.org/debian/indices/override.bullseye.non-free.gz]] [[http://deb.debian.org/debian/indices/override.bullseye.main.debian-installer.gz]]''
* ''for file in *gz; do gzip -d $file; done''
* ''cd ../..''
* Dann muss eine Konfigurationsdatei für ''apt-ftparchive'' angelegt werden\\ cat > config-deb <<< EOF
# A config-deb file.
# Points to where the unpacked DVD-1 is.
Dir {
ArchiveDir "cd";
OverrideDir "cd/indices";
CacheDir "cd/indices";
};
# Sets the top of the .deb directory tree.
TreeDefault {
Directory "pool/";
};
# The location for a Packages file.
BinDirectory "pool/non-free" {
Packages "dists/bullseye/non-free/binary-amd64/Packages";
BinOverride "override.bullseye.non-free";
};
BinDirectory "pool/contrib" {
Packages "dists/bullseye/contrib/binary-amd64/Packages";
BinOverride "override.bullseye.contrib";
};
BinDirectory "pool/main" {
Packages "dists/bullseye/main/binary-amd64/Packages";
BinOverride "override.bullseye.main";
};
# We are only interested in .deb files (.udeb for udeb files).
Default {
Packages {
Extensions ".deb";
};
};
EOF
* ''apt-ftparchive'' starten
* ''apt-ftparchive generate config-deb''
* Ergibt:\\ pool/non-free: New 1,238 kB 664 files 6,493 MB 2min 22s
pool/contrib: 225 files 135 MB 2s
pool/main: 58590 files 81.2 GB 1h 1min 26s
Packages done, Starting contents.
Done. 87.8 GB in 59479 archives. Took 1h 3min 51s
* Noch die udeb-Installerpakete aktualisieren, dafür braucht es eine eigenen config\\ cat > config-udeb <<< EOF
# A config-deb file.
# Points to where the unpacked DVD-1 is.
Dir {
ArchiveDir "cd";
OverrideDir "cd/indices";
CacheDir "cd/indices";
};
# Sets the top of the .deb directory tree.
TreeDefault {
Directory "pool/";
};
BinDirectory "pool/main" {
Packages "dists/bullseye/main/debian-installer/binary-amd64/Packages";
BinOverride "override.bullseye.main.debian-installer";
};
# We are only interested in .deb files (.udeb for udeb files).
Default {
Packages {
Extensions ".udeb";
};
};
EOF
* ''apt-ftparchive generate config-udeb''
* Ergibt\\ pool/main: 260 files 60.2 MB 1min 59s
Packages done, Starting contents.
Done. 60.2 MB in 260 archives. Took 1min 59s
* Dann die MD5-Hashes aus der Release-Datei entfernen:
* ''sed -i '/MD5Sum:/,$d' cd/dists/bullseye/Release''
* Release-Datei neu generieren
* ''apt-ftparchive release cd/dists/bullseye >> cd/dists/bullseye/Release''
* non-free zum Release hinzufügen
* ''sed -i 's/main contrib/main contrib non-free/' cd/dists/bullseye/Release''
* Da der Stack im Folgenden bei der Menge an Dateien zu klein wäre und es nur ein unwirsches ''-bash: /usr/bin/md5sum: Argument list too long'' gäbe, Stack vergrößern
* ''ulimit -s 65536''
* MD5-Summen berechnen:
* ''cd cd; md5sum `find ! -name "md5sum.txt" ! -path "./isolinux/*" -follow -type f` > md5sum.txt; cd ..''
* Wer möchte kann mit Strg-A; d den screen detachen und dem Fortschritt bei md5sum begutachten
* ''tail -f cd/md5sum.txt''
* ggf. zurück in den screen
* ''screen -x debmax''
* Bootblock sichern
* ''dd if=debian-11.0.0-amd64-BD-1.iso bs=1 count=432 of=isohdpfx.bin''
* Checksums für Jigdo/xorriso extrahieren
* ''BASEDIR=/usr/share/debian-cd/ /usr/share/debian-cd/tools/grab_md5 cd amd64 bullseye stable checksum-check''
* Versteckte Info-Dateien anpassen
* ''echo "Debian GNU/Linux 11.0.0 "Bullseye" - Official amd64 BD Binary Max 20210814-10:04" > cd/.disk/info''
* ''echo "xorriso -report_about UPDATE -follow on -as mkisofs -r -checksum_algorithm_iso sha256,sha512 -V 'Debian 11.0.0 amd64 max' -o debian-11.0.0-amd64-BD-max.iso -md5-list checksum-check -jigdo-force-md5 /pool/ -jigdo-min-file-size 1024 -jigdo-exclude 'README*' -jigdo-exclude /doc/ -jigdo-exclude /md5sum.txt -jigdo-exclude /.disk/ -jigdo-exclude /pics/ -jigdo-exclude 'Release*' -jigdo-exclude 'Packages*' -jigdo-exclude 'Sources*' -jigdo-jigdo debian-11.0.0-amd64-BD-max.jigdo -jigdo-template debian-11.0.0-amd64-BD-max.template -jigdo-map Debian=cd/debian/ -J -joliet-long -isohybrid-mbr isohdpfx.bin -b isolinux/isolinux.bin -c isolinux/boot.cat -boot-load-size 4 -boot-info-table -no-emul-boot -eltorito-alt-boot -e boot/grub/efi.img -no-emul-boot -isohybrid-gpt-basdat -isohybrid-apm-hfsplus cd" > cd/.disk/mkisofs''
* MD5-Summen anpassen
* ''cat cd/md5sum.txt | grep -v ./.disk/ > md5sum.tmp''
* ''cd cd; md5sum ./.disk/* >> ../md5sum.tmp; cd ..; mv md5sum.tmp cd/md5sum.txt''
* Schließlich und endlich, ISO erstellen mit ''xorriso''\\ xorriso \
-report_about UPDATE \
-follow on \
-as mkisofs \
-r \
-checksum_algorithm_iso sha256,sha512 \
-V 'Debian 11.0.0 amd64 max' \
-o debian-11.0.0-amd64-BD-max.iso \
-md5-list checksum-check \
-jigdo-force-md5 /pool/ \
-jigdo-min-file-size 1024 \
-jigdo-exclude 'README*' \
-jigdo-exclude /doc/ \
-jigdo-exclude /md5sum.txt \
-jigdo-exclude /.disk/ \
-jigdo-exclude /pics/ \
-jigdo-exclude 'Release*' \
-jigdo-exclude 'Packages*' \
-jigdo-exclude 'Sources*' \
-jigdo-jigdo debian-11.0.0-amd64-BD-max.jigdo \
-jigdo-template debian-11.0.0-amd64-BD-max.template \
-jigdo-map Debian=cd/debian/ \
-J \
-joliet-long \
-isohybrid-mbr isohdpfx.bin \
-b isolinux/isolinux.bin \
-c isolinux/boot.cat \
-boot-load-size 4 \
-boot-info-table \
-no-emul-boot \
-eltorito-alt-boot \
-e boot/grub/efi.img \
-no-emul-boot \
-isohybrid-gpt-basdat \
-isohybrid-apm-hfsplus \
cd
* Wenn alles geklappt hat:\\ xorriso : UPDATE : 99.96% done
xorriso : UPDATE : 99.99% done
xorriso : UPDATE : Thank you for being patient. Working since 4799 seconds.
xorriso : UPDATE : Thank you for being patient. Working since 4800 seconds.
xorriso : UPDATE : Thank you for being patient. Working since 4801 seconds.
xorriso : UPDATE : Thank you for being patient. Working since 4802 seconds.
ISO image produced: 43188789 sectors
Written to medium : 43188789 sectors at LBA 0
Writing to 'stdio:debian-11.0.0-amd64-BD-max.iso' completed successfully.
real 82m1.203s
user 78m23.269s
sys 17m31.109s
* ''ls -lh debian*max.*''\\ -rw-r--r-- 1 user user 83G Sep 3 21:55 debian-11.0.0-amd64-BD-max.iso
-rw-r--r-- 1 user user 5.1M Sep 3 21:55 debian-11.0.0-amd64-BD-max.jigdo
-rw-r--r-- 1 user user 161M Sep 3 21:55 debian-11.0.0-amd64-BD-max.template
* ''file -k debian*max.iso''\\ debian-11.0.0-amd64-BD-max.iso: DOS/MBR boot sector; partition 2 : ID=0xef, start-CHS (0x3ff,254,63), end-CHS (0x3ff,254,63), startsector 548604, 5184 sectors ISO 9660 CD-ROM filesystem data (DOS/MBR boot sector) 'Debian 11.0.0 amd64 max' (bootable) DOS/MBR boot sector Apple Driver Map, blocksize 2048, blockcount 37008, devtype 0, devid 0, driver count 0, contains[@0x200]:, contains[@0x400]:, contains[@0x600]:, contains[@0x800]: Apple Partition Map, map block count 2, start block 1, block count 2, name Apple, type Apple_partition_map, valid, allocated, contains[@0xA00]:, contains[@0xC00]:, contains[@0xE00]:, contains[@0x1000]: Apple Partition Map, map block count 2, start block 137151, block count 1296, name EFI, type Apple_HFS, valid, allocated, readable, mount at startup FoxPro FPT, blocks size 37008, next free block index 1163003904 (Lepton 3.x), scale 0-0, spot sensor temperature 0.000000, unit celsius, color scheme 0, calibration: offset 0.000000, slope 0.000000 (Lepton 2.x), scale 0-0, spot sensor temperature 0.000000, unit celsius, color scheme 0, calibration: offset 0.000000, slope 0.000000\012- data
* (hoffentlich) Fertig!