Future ISO generation scheme (in development)
In order to get rid of basesystem dependence, we need a way to automatically set up a basic toolchain. The basic toolchain can then be used to build everything else that will go both on the iso and into the installed system.
The basic toolchain can/should be gotten from the running host system. This can be accomplished by using binary caches from /var/cache/sorcery. If the cache file for a given toolchain spell does not exist, it should NOT be taken from a repository somewhere! Nor should the iso builder have to re-cast one of the tool-chain components in order to generate the cache file for use. Rather, it should be taken from the already existing installed files on the system. This will require sorcery to generate binary tarballs of installed spells. If it doesn't do this already, a solution can be had by grabbing files from the installwatch logs (/var/state/sorcery?). If one of the required components is not available on the host system at all (not installed, and no cache files), only then should the source be downloaded from the net. However, I'm not sure even this case will warrant download from the net since a missing tool-chain component may mean that building the missing component from source will be impossible on that system.
Once the basic tool-chain component tarballs are generated/found/copied, it can be unpacked inside of the iso build dir. This, along with a copy of sorcery, should provide everything needed to generate the iso (aside from the spell packages themselves which should be gotten over the net or copied in manually from pre-downloaded files. For grabbing over the net, resolv.conf will be needed inside the iso build chroot).
The settings for sorcery should be set for the target system (target cpu, etc.). For optimizations, strip should be used. The question of whether -Os should be used or not depends on how stable the resulting builds will be for the minimal architecture to be supported by the iso being built (e.g. i486, x86_64). If -Os will cause problems for some machines to boot the iso which the iso was intended to boot on, then it obviously should not be used. If -Os can be used without causing any problems for the booting of the iso on the target systems, -Os should be used in addition to --strip in order to reduce the size of the iso.
Afterwards, a basic system can be built inside the iso build chroot using sorcery and the configured tool-chain. This basic system should be absolutely minimal, as it will be what is installed onto the target system. After the base system is generated/built, the chroot should be exited, and a copy should be made into a bzipped tarball. Don't forget to clean out unnecessary files from the COPY, _not_ the original, before making the bzipped tarball. [system.tar.bz2] (unnecessary files will include the host cross-compile tool-chain used to build the base system, as well as [possibly] sorcery files in /var, anything in /usr/src, etc.)
Chroot back into the main iso build dir (i.e. not the system install copy). Build the iso system by casting additional spells on top of the base system generated in the previous step. This includes a kernel (config for the kernel SHOULD be something downloaded from a repository), filesystem tools (reiserfstools, xfstools, e2fstools, etc.), and anything else required not only to boot the target system but manipulate and install onto it. This means that all features desired in the installer must be present or provided for through the spells cast in this step or the previous step (though very little should come from the previous step, as the previous step should really only provide an absolute minimal tool-chain generated for the target system).
Configure the boot/init process for the iso. This includes modifying isolinux/isolinux.cfg, as well as various scripts/configs in etc. Pay particular attention to the init system (including what will happen "before init"). (Is isolinux necessary? Can other bootloaders, such as lilo or grub, be used instead? Should they?) Exit the iso build chroot. Make a new copy of the iso build dir. This new copy will become the iso itself. Remove any unnecessary files/packages/etc. from the iso. Copy in the bzipped tarball of the system install (system.tar.bz2). Generate a bootable iso using mkisofs. Compress the iso using bzip2. [smgl-devel.iso.bz2]
