Live Helper:lh build
Un article de Athena.
Sommaire |
lh_build 0
Après installation de live-helper, la manip la plus simple pour tester le fonctionnement de live-helper est la suite de commande :
lh_config lh_build --debug --verbose
Doit produire, après un certain temps, un fichier binary.iso (un peu moins de 150Mo) contenant une distribution Debian (live pour CD) très basique bootable.
On peut tester 'in situ' (sans graver)
qemu -cdrom binary.iso
lh_build
Les différentes étapes de construction, d'après le source lh_build
# Checking defaults
Check_defaults
# Bootstrapping system
lh_bootstrap ${*}
# Customizing chroot
lh_chroot ${*}
# Building binary images
lh_binary ${*}
# Building source images
lh_source ${*}
Par défaut, les différentes options de configuration sont prises dans le répertoire config/ .
lh_bootstrap
Construction du chroot dans lequel nous allons élaborer la distribution
lh_chroot
Personnalisation du chroot dans lequel nous allons élaborer la distribution
lh_binary
Construction binaire de l'image.
# Preparing root filesystem
lh_binary_chroot ${*}
if [ "${LH_CHROOT_BUILD}" = "enabled" ]
# Configuring chroot
lh_chroot_devpts install ${*}
lh_chroot_proc install ${*}
lh_chroot_selinuxfs install ${*}
lh_chroot_sysfs install ${*}
lh_chroot_hosts install ${*}
lh_chroot_resolv install ${*}
Création de /etc/resolv.conf . S'il existe dans le chroot, on le sauvegarde. Copie du resolv.conf global. Comprends pas (??) la version locale n'est utilisée qu'en option 'remove'
lh_chroot_hostname install ${*}
Création de l'identité hostname (localhost.localdomain)
lh_chroot_apt install-binary ${*}
lh_chroot_sources install ${*}
fi
lh_binary_rootfs ${*}
lh_binary_manifest ${*}
lh_binary_encryption ${*}
# Prepare images
lh_binary_local-packageslists ${*}
lh_binary_linux-image ${*}
lh_binary_debian-installer ${*}
lh_binary_memtest ${*}
lh_binary_grub ${*}
lh_binary_syslinux ${*}
lh_binary_yaboot ${*}
lh_binary_silo ${*}
lh_binary_disk ${*}
lh_binary_includes ${*}
lh_binary_local-includes ${*}
lh_binary_local-hooks ${*}
lh_binary_md5sum ${*}
if [ "${LH_CHROOT_BUILD}" != "enabled" ]
then
lh_chroot_devpts install ${*}
lh_chroot_proc install ${*}
lh_chroot_selinuxfs install ${*}
lh_chroot_sysfs install ${*}
fi
# Building images
lh_binary_iso ${*}
lh_binary_net ${*}
lh_binary_tar ${*}
lh_binary_usb-hdd ${*}
if [ "${LH_CHROOT_BUILD}" = "enabled" ]
then
# Deconfiguring chroot
rm -f .stage/chroot_sources
lh_chroot_hostname remove ${*}
lh_chroot_resolv remove ${*}
lh_chroot_hosts remove ${*}
fi
lh_chroot_sysfs remove ${*}
lh_chroot_selinuxfs remove ${*}
lh_chroot_proc remove ${*}
lh_chroot_devpts remove ${*}
lh_source
Quelques notes
/usr/bin/lh_chroot_packages
- le fichier chroot/root/chroot_packages est augmenté (par '>>'). En cas de reprise de la construction, les infos s'accumulent...
- Remplacer par > ?
- Create_stagefile .stage/chroot_packages La création des fichiers de stage/phases donne la localisation. Pas bon. Cela devrait pouvoir être configurable. Et possibilité de numéroter les stages ... (00 .... 99) pour suivre plus facilement la progression
- La forme
# Requiring stage file Require_stagefile .stage/config .stage/bootstrap
indique bien qu'un Makefile serait plus adapté ! ;)
