API definitions

All cauldron API functions are to be prefixed with cauldron_

All cauldron API variables are to be prefixed with CAULDRON_

cauldron_enter_chroot()

handles the entering of chroot environments. Essentially this will just call mount --bind for various directories (/{dev,dev/pts,proc} $CAULDRON_BUILD/{dev,dev/pts,proc}) <followed by the chroot command?>. Will also set $CAULDRON_BUILD="/" after entering the chroot?

cauldron_exit_chroot()

called upon exit from chroot, and will unmount those directories mounted with mount --bind by a call to cauldron_enter_chroot(). For every cauldron_enter_chroot() call, there must be a matching cauldron_exit_chroot() call.

cauldron_create_base_toolchain()

optionally generates and then unpacks a basic tool-chain into the dir designated for the iso build chroot. Generation of the tool-chain will be necessary if the relevant cache tarballs cannot be found in the user's sorcery cache dir (/var/cache/sorcery/). Tools to generate/unpack will be taken from a file, one tool per line. Necessary tools include things like gcc, make, glibc, sorcery, and their dependencies.

cauldron_create_target_toolchain()

this uses the base tool-chain provided by cauldron_create_base_toolchain() to generate a new tool-chain geared for the target system. In essence, this step uses the host tool-chain to cross-compile a tool-chain for the target system. This can be accomplished by setting appropriate options for sorcery and doing a sorcery rebuild inside the chroot.

cauldron_build_iso_system()

uses the tool-chain supplied by cauldron_create_toolchain() to pull in and cast all the spells needed for the iso. This will include spells such as lvm, reiserfstools, reiser4tools, linux, etc.

cauldron_iso_init()

handles configuration and installation of the init system for the bootable iso. This includes configuring isolinux/isolinux.cfg, etc/inittab and friends, etc., as well as setting up the initrd/initramfs

cauldron_add_installer()

responsible for adding in and setting up the installer system. Eventually, there will be functionality to add multiple installer systems onto a single iso (cli-based, dialog-based, perhaps someday in the distant future an X-based?)

cauldron_clean_iso_system()

removes any spells unnecessary for actually booting and running the iso. This includes spells related to compiling (gcc and friends). The list of spells to remove will be pulled from a file, one spell per line.

cauldron_mkisofs()

creates the iso filesystem using the chroot build dir.

cauldron_build_iso()

wrapper function which calls various above functions to build the iso system. Mostly a convenience function, but also does some minor things on its own (like copying resolv.conf)

cauldron_build_iso() {

  • # set up basic tool-chain in order to cross-compile for target later cauldron_create_toolchain(); # copy the host's resolv.conf in order to dl packages from net cp /etc/resolv.conf ${CAULDRON_BUILD}/ # begin chroot cauldron_enter_chroot(${CAULDRON_BUILD}); # build the cross-compile tool-chain targeted for the target sys cauldron_create_target_toolchain(); # use the cross-compile tool-chain to cast all spells needed for # the iso system cauldron_build_iso_system(); # configure the iso init system, initrd/initramfs, etc. cauldron_iso_init(); # build/create/copy/whatever installer system/data into the iso cauldron_add_installer(); # remove unnecessary files from iso and free up space cauldron_clean_iso_system(); # finished with iso building, exit chroot cauldron_exit_chroot(); # create the iso fs from the build dir cauldron_mkisofs(${CAULDRON_BUILD});

}

cauldron_install_copy_linux() {

  • cp ${ISO}/boot/linux ${TARGET_SYSTEM}; cp --parents -r ${ISO}/lib/modules/${LINUX_VER}/* ${TARGET_SYSTEM}; cauldron_enter_chroot(${TARGET_SYSTEM}); depmod -a ${LINUX_VER};

}

Cauldron/Devel/API (last edited 2010-02-24 07:55:33 by flux)