Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master cauldron by Justin Boffemmyer (9aba261265e4647a7fe7b22ba69498afff8c43ed)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Justin Boffemmyer <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master cauldron by Justin Boffemmyer (9aba261265e4647a7fe7b22ba69498afff8c43ed)
  • Date: Sun, 17 Oct 2010 10:19:32 -0500

GIT changes to master cauldron by Justin Boffemmyer <flux AT sourcemage.org>:

cauldron/errorcodes | 2
cauldron/etc/config | 65 ++++++++++---
cauldron/lib.chroot | 172 ++++++++++++++++++++++++++++------
cauldron/lib.init | 241
+++++++++++++++++++++++++++++++++++++------------
cauldron/lib.sorcerous | 80 +++++++---------
cauldron/lib.toolchain | 167 +++++++++++++++++++++++----------
cauldron/libcauldron | 26 ++---
7 files changed, 540 insertions(+), 213 deletions(-)

New commits:
commit 9aba261265e4647a7fe7b22ba69498afff8c43ed
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

cauldron: match base path to install of spell

Make the default script location in the config match the default install
location of the cauldron spell (i.e., /usr/share/smgl/cauldron).

commit 45a5824efe30726031b55b8ad39302f9d1e88917
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

cauldron: config variable for user to run under

Although not currently implemented in the actual libraries or front-end
yet, the intention is for this variable to determine which user to "drop
privileges" to when possible (or, if this can't be done reasonably, it
will be used to determine the user with sufficient privileges to run
as).

commit 140e09c3479475d4219b040924bb2b04907c0fa6
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

cauldron: config variable for controlling builds

Add a new config variable for controlling whether aggressive attempts at
generating cache files should be attempted. This is used by
lib.toolchain when generating the initial toolchain.

commit 9f5cca9fff4941fdcca647becaf3dea0e23b0fac
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

cauldron: update spell file paths in config

Make the spell listings more fine-grained by having separate lists for
iso spells and sys spells. Also, add variables for the busybox and linux
kernel configs to be used when building those spells.

commit ef1e946ee26643dd53de4b63aea9ec9ee4b6a78a
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

cauldron: adjust basic build paths in config

Make CAULDRON_BUILD its own specialized directory specific to building,
rather than the general cauldron work directory, and have CAULDRON_TMP
be the general work directory. Thus, order CAULDRON_BUILD after
CAULDRON_TMP so it can depend on it. Add two new variables to hold the
paths for iso and sys generation, respectively.

commit ba7ec6b1c7450ccdfe612a21ed6fdcc0f0067256
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

cauldron: fix typo in config

Correct a typo from '{$' to '${'.

commit fea07bda8da674a652e8a2e84b79463111bdfe9c
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

cauldron: comment out menu in config

For now comment out the menu installer in the variable
CAULDRON_INSTALLERS. Until it becomes a default (it's stable and
everyone wants it on the official ISO releases) it should remain
commented so that users know it's available but only used if a user
intentionally wants it.

commit 2102420400bdbddaa90b20e12b363e6c06547a35
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

cauldron: fix typo on vars in lib.chroot

Fix some errors in variable usage in lib.chroot (specifically, the
variable names weren't prefixed with '$', so they wouldn't be used as
variables at all).

commit c6ac054b9dcaac328a8f7bcc70a6e483c77a267b
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

cauldron: lib.chroot learns casting/dispelling

Added functions to lib.chroot for automating chrooted casts and dispels,
including handling of large lists. However, the
cauldron_chroot_cast_clean function needs additional logic later to
ensure that any dependencies that were cast are also properly dispelled.
Currently it is dumb and only dispels the immediate list of spells
without checking for dependencies.

commit 2bea5004a41413745a21a30f2040b08e23fb4bb3
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

cauldron: clean up some function headers

Correct the contents of some function headers in the various library
files, and reformat as necessary. Make sure the functions have correct
corresponding parameters listed (if any).

commit 8a0d761363ce1b55c17179e77628e5774f9305fc
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

cauldron: implementation lib.init

Filled in the skeleton of lib.init. The necessary functions should now
all be there for generating initramfs/initrd images and dropping them
into the iso directory. The listing files that the functions in lib.init
still need to be added, however.

commit 630159d263aaf1e37336184fcd8ecb8994851a9b
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

cauldron: load all libs in libcauldron

Enable (via uncommenting) the loading of lib.toolchain and lib.sorcerous
in libcauldron, now that they are implemented.

commit 64ed2b7cfba55771c5df75f3daf00e6c5b7681cd
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

cauldron: improve lib.toolchain cache functions

Separate the cache functions better, and split out low-level
functionality into separate functions. The separation allows for new
cache generators to be implemented more easily. Also ensure that caches
can be generated in any way feasible.

commit b54b93e95e0015ca5dfd17c9e29198ab1f8683c7
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

cauldron: more logical functions in lib.sorcerous

The install function in lib.sorcerous previous did a lot more work than
it should have been doing (including download functions), while the
download function did almost nothing on its own.

This commit separates the functionality better, so that the install
function handles all and only install functionality, and the same goes
for the download function. It also moves some of the definitions out to
the config file so that there is better flexibility in how the
download and install are performed.

commit 0469089848f4ea5f61717519e1d128df808cdc8d
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

cauldron: correct chroot command

The chroot command environment variable was not defined correctly,
because it couldn't execute correctly. Defined and executed as an array,
it doesn't have any problems.

commit 2aa94237dddbfa54b609dc2eab98dd6b75188a52
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

cauldron: explicitly deny chroot nesting

Force a return with error code if we are already in a chroot and
cauldron_chroot_init is called so that we avoid the mess of dealing with
nested chroots.

Nested chroots in and of themselves aren't bad, but we would have to
guarantee that we don't mount --bind multiple times to the same chroot
or cleaning up will get quite difficult. Tracking that would require at
least a stack for the chroots and their order, and some kind of testing
to ensure that the duplicates cannot occur. This may be implemented at
a later date, but for now it's better to keep the implementation simple.

diff --git a/cauldron/errorcodes b/cauldron/errorcodes
index 8962d12..fe768c5 100644
--- a/cauldron/errorcodes
+++ b/cauldron/errorcodes
@@ -63,6 +63,7 @@ ERR_CHROOT_EXEC=64 # could not execute chroot command
ERR_CHROOT_CAST=65 # chroot cast failed
ERR_CHROOT_DISPEL=66 # chroot dispel failed
ERR_CHROOT_REBUILD=67 # chroot rebuild failed
+ERR_CHROOT_NEST=68 # chroot already defined -- nesting not allowed

# lib.init
ERR_INSTALL_RAMFS=70 # problem installing built initramfs into ISO fs
@@ -135,6 +136,7 @@ ERR_MSGS=(
"chroot cast failed" # ERR_CHROOT_CAST
"chroot dispel failed" #
ERR_CHROOT_DISPEL
"chroot rebuild failed" #
ERR_CHROOT_REBUILD
+ "chroot already defined -- nesting not allowed" # ERR_CHROOT_NEST

# lib.init
"problem installing built initramfs into ISO fs" #
ERR_INSTALL_RAMFS
diff --git a/cauldron/etc/config b/cauldron/etc/config
index f9e18ed..44d2ab1 100644
--- a/cauldron/etc/config
+++ b/cauldron/etc/config
@@ -1,4 +1,9 @@
#!/bin/bash
+ # the user cauldron should run as
+ # make sure the user you choose has proper permissions
+ # (especially for chrooting)
+ CAULDRON_USER="${CAULDRON_USER:-root}"
+
# the arch to generate the .iso for
CAULDRON_ARCH="${CAULDRON_ARCH:-x86}"

@@ -20,39 +25,69 @@

# branch of sorcery to use in the ISO
CAULDRON_SORCERY_BRANCH="${CAULDRON_SORCERY_BRANCH:-stable}"
+ # branch of sorcery to use in the ISO
+
CAULDRON_SORCERY_PKG="${CAULDRON_SORCERY_PACKAGE:-sorcery-${CAULDRON_SORCERY_BRANCH}.tar.bz2}"
+ # URL to download sorcery from
+
CAULDRON_SORCERY_URL="${CAULDRON_SORCERY_URL:-http://download.sourcemage.org/sorcery/}";

- # list of installers to include in the ISO
+ # list of installers to include in the ISO
CAULDRON_INSTALLERS=(
"shell"
- "menu"
+ # "menu"
)

+ # whether cauldron should try it's hardest to generate needed spell
+ # caches, even if that means casting and dispelling extra spells in a
+ # chroot (only used when generating the base toolchain)
+ CAULDRON_AGGRESSIVE="${CAULDRON_AGGRESSIVE:-yes}"
+

# path to the host system (null for normal use)
CAULDRON_HOST="${CAULDRON_HOST:-}"
# path to the host base library modules
-
CAULDRON_BASE="${CAULDRON_BASE:-$CAULDRON_HOST/var/lib/cauldron}"
+ CAULDRON_BASE="${CAULDRON_BASE:-$CAULDRON_HOST/usr/share/smgl}"
# path to the host cauldron library modules
CAULDRON_LIBS="${CAULDRON_LIBS:-$CAULDRON_BASE/cauldron}"
# path to the host cauldron configs
- CAULDRON_DATA="{$CAULDRON_DATA:-$CAULDRON_HOST/etc/cauldron}"
+ CAULDRON_DATA="${CAULDRON_DATA:-$CAULDRON_HOST/etc/cauldron}"

- # path to the ISO build chroot
- CAULDRON_BUILD="${CAULDRON_BUILD:-$CAULDRON_HOST/tmp/cauldron}"
- # temporary files generated while cauldron does its work
- CAULDRON_TMP="${CAULDRON_TMP:-$CAULDRON_BUILD/tmp}"
+ # temporary files generated while cauldron does its work
+ CAULDRON_TMP="${CAULDRON_TMP:-$CAULDRON_HOST/tmp/cauldron}"
+ # path to the ISO build chroots
+ CAULDRON_BUILD="${CAULDRON_BUILD:-$CAULDRON_TMP/build}"
+ # path where the final ISO product is generated
+ CAULDRON_ISO="${CAULDRON_ISO:-$CAULDRON_TMP/iso}"
+ # path where the installable system chroot is generated
+ CAULDRON_SYS="${CAULDRON_SYS:-$CAULDRON_TMP/sys}"

# file listing all the spells needed for the build toolchain

CAULDRON_TOOLCHAIN="${CAULDRON_TOOLCHAIN:-$CAULDRON_DATA/$CAULDRON_ARCH/toolchain}"
- # file listing all the spells needed for the ISO runtime
-
CAULDRON_SPELLS="${CAULDRON_SPELLS:-$CAULDRON_DATA/$CAULDRON_ARCH/spells}"
- # file listing all the sources needed on the ISO runtime
-
CAULDRON_SOURCES="${CAULDRON_SOURCES:-$CAULDRON_DATA/$CAULDRON_ARCH/sources}"
- # file listing all the spell caches needed on the ISO runtime
-
CAULDRON_CACHES="${CAULDRON_CACHES:-$CAULDRON_DATA/$CAULDRON_ARCH/caches}"
+
+ # kernel config used to build the kernel for the ISO
+
CAULDRON_KERN_CONF="${CAULDRON_KERN_CONF:-$CAULDRON_DATA/$CAULDRON_ARCH/kernel}"
+
+ # busybox config used to build busybox for the initrd/initramfs in
the ISO
+
CAULDRON_BBOX_CONF="${CAULDRON_BBOX_CONF:-$CAULDRON_DATA/$CAULDRON_ARCH/initfs/busybox}"
+
+ # file listing all the spells to compose the ISO runtime
+
CAULDRON_ISO_SPELLS="${CAULDRON_ISO_SPELLS:-$CAULDRON_DATA/$CAULDRON_ARCH/iso.spells}"
+ # file listing all the sources to supply in the ISO runtime
+
CAULDRON_ISO_SOURCES="${CAULDRON_ISO_SOURCES:-$CAULDRON_DATA/$CAULDRON_ARCH/iso.sources}"
+ # file listing all the spell caches to supply in the ISO runtime
+
CAULDRON_ISO_CACHES="${CAULDRON_ISO_CACHES:-$CAULDRON_DATA/$CAULDRON_ARCH/iso.caches}"
+
+ # file listing all the spells to compose the SYS runtime
+
CAULDRON_SYS_SPELLS="${CAULDRON_SYS_SPELLS:-$CAULDRON_DATA/$CAULDRON_ARCH/sys.spells}"
+ # file listing all the sources to supply in the SYS runtime
+
CAULDRON_SYS_SOURCES="${CAULDRON_SYS_SOURCES:-$CAULDRON_DATA/$CAULDRON_ARCH/sys.sources}"
+ # file listing all the spell caches to supply in the SYS runtime
+
CAULDRON_SYS_CACHES="${CAULDRON_SYS_CACHES:-$CAULDRON_DATA/$CAULDRON_ARCH/sys.caches}"

# command to enter a chroot
- CAULDRON_CHROOT_CMD="${CAULDRON_CHROOT_CMD:-chroot}"
+ CAULDRON_CHROOT_CMD=( "${CAULDRON_CHROOT_CMD[@]:-chroot}" )
+
+ # command to download a url from the internet
+ CAULDRON_URL_DL_CMD=( "${CAULDRON_URL_DL_CMD[@]:-wget}" )

# sorcery cast/dispel/rebuild commands

CAULDRON_SORCERY_PATH="${CAULDRON_SORCERY_PATH:-$CAULDRON_HOST/usr/sbin}"
diff --git a/cauldron/lib.chroot b/cauldron/lib.chroot
index d28ed93..a7849f5 100644
--- a/cauldron/lib.chroot
+++ b/cauldron/lib.chroot
@@ -16,7 +16,7 @@

#-------------------------------------------------------------------------------


#-------------------------------------------------------------------------------
-## @param target dir to chroot into
+## @param target dir to chroot into (optional)
##
## Prepares a chroot environment and exports necessary variables. For every
## target dir to chroot into, there should be one
@@ -24,44 +24,44 @@
##

#-------------------------------------------------------------------------------
function cauldron_chroot_init() {
- if [[ "$CAULDRON_CHROOTINIT" -ne 1 ]]
- then
- local target="${1:-$CAULDRON_BUILD}"
+ local target="${1:-$CAULDRON_BUILD}"

- # if target is somehow null, return an error
- if [[ -z "$target" ]]
- then
- return $ERR_CHROOT_UNDEF
- fi
+ [[ "$CAULDRON_CHROOTINIT" -eq 1 ]] && return $ERR_CHROOT_NEST

- # bind the needed mounts
- mount --bind "$CAULDRON_HOST/dev" "$target/dev" ||
- return $ERR_CHROOT_INIT
- mount --bind "$CAULDRON_HOST/dev/pts" "$target/dev/pts" ||
- return $ERR_CHROOT_INIT
- mount --bind "$CAULDRON_HOST/proc" "$target/proc" ||
- return $ERR_CHROOT_INIT
-
- # make sure the sorcerous library is loaded
- # which provides cauldron_source_sorcery
- if [[ -z cauldron_source_sorcery ]]
- then
- cauldron_load_library lib.sorcerous
- fi
- # source the target sorcery, so we have access to its functions
- cauldron_sorcerous_load "$target" || return $ERR_SORCEROUS_TARGET_SORCERY
+ # if target is somehow null, return an error
+ if [[ -z "$target" ]]
+ then
+ return $ERR_CHROOT_UNDEF
+ fi
+
+ # bind the needed mounts
+ mount --bind "$CAULDRON_HOST/dev" "$target/dev" ||
+ return $ERR_CHROOT_INIT
+ mount --bind "$CAULDRON_HOST/dev/pts" "$target/dev/pts" ||
+ return $ERR_CHROOT_INIT
+ mount --bind "$CAULDRON_HOST/proc" "$target/proc" ||
+ return $ERR_CHROOT_INIT

- # everything went OK, so export the chroot definitions
- export CAULDRON_CHROOTINIT=1
- export CAULDRON_CHROOT="$CAULDRON_CHROOT_CMD \"$target\""
+ # make sure the sorcerous library is loaded
+ # which provides cauldron_source_sorcery
+ if [[ -z cauldron_source_sorcery ]]
+ then
+ cauldron_load_library lib.sorcerous
fi
+ # source the target sorcery, so we have access to its functions
+ cauldron_sorcerous_load "$target" || return $ERR_SORCEROUS_TARGET_SORCERY
+
+ # everything went OK, so export the chroot definitions
+ export CAULDRON_CHROOTINIT=1
+ export CAULDRON_CHROOT=( "${CAULDRON_CHROOT_CMD[@]}" "$target" )

return $ERR_OK
}


#-------------------------------------------------------------------------------
+## @param target dir to chroot into
##
-## Cleans up the chroot environment after it is no longer needed
+## Cleans up the chroot environment after it is no longer needed.
##

#-------------------------------------------------------------------------------
function cauldron_chroot_done() {
@@ -76,9 +76,9 @@ function cauldron_chroot_done() {
fi

# unmount the bind mounts
- umount "target"/proc || return $ERR_CHROOT_DONE
- umount "target"/dev/pts || return $ERR_CHROOT_DONE
- umount "target"/dev || return $ERR_CHROOT_DONE
+ umount "$target/proc" || return $ERR_CHROOT_DONE
+ umount "$target/dev/pts" || return $ERR_CHROOT_DONE
+ umount "$target/dev" || return $ERR_CHROOT_DONE

# clear the chroot definitions
unset CAULDRON_CHROOTINIT
@@ -98,7 +98,7 @@ function cauldron_chroot_done() {
function cauldron_chroot() {
if [[ "$CAULDRON_CHROOTINIT" -eq 1 ]]
then
- "$CAULDRON_CHROOT" $* || return $ERR_CHROOT_EXEC
+ "${CAULDRON_CHROOT[@]}" $* || return $ERR_CHROOT_EXEC
else
return $ERR_CHROOT_NOT_INIT
fi
@@ -107,6 +107,112 @@ function cauldron_chroot() {
}


#-------------------------------------------------------------------------------
+## @param target_spells
+##
+## Performs cast on the list of spells needed for installation to the target
+## system. "target_spells" can either be a list of spells passed as
arguments or
+## a file which contains such a list. The members of the spell list can be
+## separated by anything IFS will recognize (typically any whitespace).
+##
+#-------------------------------------------------------------------------------
+function cauldron_chroot_cast() {
+ local target_spells=( "$@" )
+ local spell=""
+
+ # if a file that lists spells to cast is passed in, get the list of spells
+ # from the file
+ [[ -f "$target_spells" ]] && target_spells=( $(< "$target_spells") )
+
+ # make sure we have a valid chroot of where we will cast
+ [[ -z "$CAULDRON_CHROOT" ]] && return $ERR_CHROOT_INIT
+
+ # cast all the spells in the list in one shot for better efficiency
+ cauldron_chroot "$CAULDRON_CAST" "${target_spells[@]}" ||
+ return $ERR_CHROOT_CAST
+
+ return $ERR_OK
+}
+
+#-------------------------------------------------------------------------------
+## @param target_spells
+##
+## Performs dispel on the list of spells needed for installation to the
target
+## system. "target_spells" can either be a list of spells passed as
arguments or
+## a file which contains such a list. The members of the spell list can be
+## separated by anything IFS will recognize (typically any whitespace).
+##
+#-------------------------------------------------------------------------------
+function cauldron_chroot_dispel() {
+ local target_spells=( "$@" )
+ local spell=""
+
+ # if a file that lists spells to cast is passed in, get the list of spells
+ # from the file
+ [[ -f "$target_spells" ]] && target_spells=( $(< "$target_spells") )
+
+ # make sure we have a valid chroot of where we will cast
+ [[ -z "$CAULDRON_CHROOT" ]] && return $ERR_CHROOT_INIT
+
+ # dispel all the spells in the list in one shot for better efficiency
+ cauldron_chroot "$CAULDRON_DISPEL" "${target_spells[@]}" ||
+ return $ERR_CHROOT_DISPEL
+
+ return $ERR_OK
+}
+
+#-------------------------------------------------------------------------------
+## @param target_spells
+##
+## Performs cast and immediate dispel on the each spell in the list of spells
+## to ensure that each spell is cast "cleanly" (meaning that no idle
+## dependencies are laying about in the build tree to get inadvertently
picked
+## up by arguably broken spell builds). "target_spells" can either be a list
of
+## spells passed as arguments or a file which contains such a list. The
members
+## of the spell list can be separated by anything IFS will recognize
(typically
+## any whitespace).
+##
+#-------------------------------------------------------------------------------
+function cauldron_chroot_cast_clean() {
+ local target_spells=( "$@" )
+ local spell=""
+
+ # if a file that lists spells to cast is passed in, get the list of spells
+ # from the file
+ [[ -f "$target_spells" ]] && target_spells=( $(< "$target_spells") )
+
+ # Since we will be installing from the running ISO system instead of a
giant
+ # tarball, for each spell we only need to make sure that the cache file is
+ # available. This will require that the ISO sorcery has caching enabled.
The
+ # caching should really be turned on from the very beginning though...
+ if [[ -z "$ARCHIVE" ]]
+ then
+ cauldron_sorcerous_load || return $ERR_TARGET_SORCERY
+ fi
+ [[ "$ARCHIVE" == "off" ]] && return $ERR_ARCHIVE
+
+ # make sure we have a valid chroot of where we will cast
+ [[ -z "$CAULDRON_CHROOT" ]] && return $ERR_CHROOT_INIT
+
+ for spell in "${target_spells[@]}"
+ do
+ # cast the spell to generate the cache, and then dispel it from the
system
+ # so that it isn't wasting space in the build filesystem (and so it
doesn't
+ # interfere with later casts for spells that, wrongly, pull in
dependencies
+ # that are present but not wanted)
+ #
+ # TODO: to be able to ensure that dependencies that get pulled in are
also
+ # dispelled we'll have to get the list of everything that was cast during
+ # the cast round from sorcery, which at present will require modifying
cast
+ # itself to export the list (otherwise we'll have to trap the output and
+ # parse it, which is far less machine-readable)
+ cauldron_chroot "$CAULDRON_CAST" "$spell" || return $ERR_CHROOT_CAST
+ cauldron_chroot "$CAULDRON_DISPEL" "$spell" || return $ERR_CHROOT_DISPEL
+ done
+
+ return $ERR_OK
+}
+
+#-------------------------------------------------------------------------------
##
## This software is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
diff --git a/cauldron/lib.init b/cauldron/lib.init
index 8d45ae4..029091a 100755
--- a/cauldron/lib.init
+++ b/cauldron/lib.init
@@ -18,141 +18,270 @@

#-------------------------------------------------------------------------------


#-------------------------------------------------------------------------------
-## @param XXX
##
## Handles setting up the init process on the ISO. The ISO init is
## responsible for detecting hardware, loading device drivers, setting
## console fonts, etc.
##

#-------------------------------------------------------------------------------
-function cauldron_iso_init() {
- cp "$CAULDRON_DATA/inittab" "$CAULDRON_BUILD/etc/inittab"
+function cauldron_init_setup() {
+ mkdir -p "$CAULDRON_ISO/etc" || return $ERR_MK_DIR
+
+ cp "$CAULDRON_DATA/$CAULDRON_ARCH/inittab" "$CAULDRON_ISO/etc/inittab" ||
+ return $ERR_CP_FILE
+
+ return $ERR_OK
+}
+
+#-------------------------------------------------------------------------------
+## @param init ramdisk/ramfs image (required)
+##
+## Copies the image passed as first parameter into the ISO run-time
filesystem
+## for use during the ISO boot process.
+##
+#-------------------------------------------------------------------------------
+function cauldron_init_img_install() {
+ local img="$1"
+
+ mkdir -p "$CAULDRON_ISO/boot" || return $ERR_MK_DIR
+
+ cp "$img" "$CAULDRON_ISO/boot/$img" || return $ERR_CP_FILE
+
+ return $ERR_OK
}


#-------------------------------------------------------------------------------
-## @param XXX
##
## Makes the initrd to be used by the ISO on booting.
##

#-------------------------------------------------------------------------------
-function cauldron_ramdisk() {
+function cauldron_init_make_ramdisk() {
local initrd="$CAULDRON_TMP/initrd"
local initmnt="$CAULDRON_TMP/initrd_mount"

- mkdir -p "$initmnt"
- dd '-if' /dev/null '-of' "$initrd"
- mke2fs "$initrd"
- mount -o loop "$initrd" "$initmnt"
- cauldron_initfs "$initmnt"
- umount "$initmnt"
- gzip -9 "$initrd"
+ mkdir -p "$initmnt" || return $ERR_MK_DIR
+
+ dd '-if' /dev/null '-of' "$initrd" || return $ERR_INIT_MAKE_RD
+ mke2fs "$initrd" || return $ERR_INIT_MAKE_RD
+ mount -o loop "$initrd" "$initmnt" || return $ERR_INIT_MAKE_RD
+ cauldron_init_fs_make "$initmnt" || return $ERR_INIT_MAKE_RD
+ umount "$initmnt" || return $ERR_INIT_MAKE_RD
+ gzip -9 "$initrd" || return $ERR_INIT_MAKE_RD
+
+ return $ERR_OK
+}
+
+#-------------------------------------------------------------------------------
+##
+## Installs the init ramdisk to be used by the ISO on booting.
+##
+#-------------------------------------------------------------------------------
+function cauldron_init_install_ramdisk() {
+ local ramdisk="$CAULDRON_TMP/initrd.gz"
+
+ cauldron_init_img_install "$ramdisk" || return $ERR_INIT_INSTALL_RD
+
+ return $ERR_OK
}


#-------------------------------------------------------------------------------
-## @param XXX
##
## Makes the initramfs be used by the ISO on booting.
##

#-------------------------------------------------------------------------------
-function cauldron_ramfs() {
+function cauldron_init_make_ramfs() {
local ramdir="$CAULDRON_TMP/initram"
- local ramfs="$CAULDRON_TMP/initram.cpio"
+ local ramfs="$CAULDRON_TMP/initram.cpio.gz"
+
+ mkdir -p "$ramdir" || return $ERR_MK_DIR
+
+ cauldron_init_fs_make "$ramdir" || return $ERR_INIT_FS_MAKE

- mkdir -p "$ramdir"
- cauldron_initfs "$ramdir"
(
cd "$ramdir"
- find . -print -depth | cpio -o > "$ramfs"
- gzip -9 "$ramfs"
- )
+ find * -depth -print | cpio -H newc -o | gzip -9c > "$ramfs"
+ ) ||
+ return $ERR_INIT_MAKE_RAMFS
+
+ return $ERR_OK
}


#-------------------------------------------------------------------------------
-## @param path_to_initfs
+##
+## Installs the init ramfs to be used by the ISO on booting.
+##
+#-------------------------------------------------------------------------------
+function cauldron_init_install_ramfs() {
+ local ramfs="$CAULDRON_TMP/initram.cpio.gz"
+
+ cauldron_init_img_install "$ramfs" || return $ERR_INIT_INSTALL_RAMFS
+
+ return $ERR_OK
+}
+
+#-------------------------------------------------------------------------------
+## @param path_to_initfs (required)
##
## Sets up the basic directories that will be needed on the initfs
##

#-------------------------------------------------------------------------------
-function cauldron_initfs_dirs() {
+function cauldron_init_fs_dirs() {
local initfs="$1"
+ local list="$CAULDRON_DATA/$CAULDRON_ARCH/initfs/dirs"
+
+ if [[ -f "$list" ]]
+ for dir in $(cat "$list")
+ do
+ mkdir -p "$initfs/$dir" || return $ERR_MK_DIR
+ done
+ fi

- for dir in $(cat "$CAULDRON_DATA/initfs.dirs")
- do
- mkdir -p "$initfs/$dir"
- done
+ return $ERR_OK
}


#-------------------------------------------------------------------------------
-## @param path_to_initfs
+## @param path_to_initfs (required)
##
## Gathers and copies the necessary binaries into the initfs
##

#-------------------------------------------------------------------------------
-function cauldron_initfs_bins() {
+function cauldron_init_fs_bins() {
local initfs="$1"
+ local list="$CAULDRON_DATA/$CAULDRON_ARCH/initfs/binaries"

- for bin in $(cat "$CAULDRON_DATA/initfs.binaries")
- do
- cp "$bin" "$initfs/bin"
- done
+ if [[ -f "$list" ]]
+ for bin in $(cat "$CAULDRON_DATA/$CAULDRON_ARCH/initfs/binaries")
+ do
+ cp "$bin" "$initfs/bin" || return $ERR_CP_FILE
+ done
+ fi
+
+ return $ERR_OK
}


#-------------------------------------------------------------------------------
-## @param path_to_initfs
+## @param path_to_initfs (required)
##
## Gathers and copies the necessary libraries into the initfs
##

#-------------------------------------------------------------------------------
-function cauldron_initfs_libs() {
+function cauldron_init_fs_libs() {
local initfs="$1"
+ local list="$CAULDRON_DATA/$CAULDRON_ARCH/initfs/libs"
+
+ if [[ -f "$list" ]]
+ for lib in $(cat "$CAULDRON_DATA/$CAULDRON_ARCH/initfs/libs")
+ do
+ cp "$lib" "$initfs/lib/" || return $ERR_CP_FILE
+ done
+ fi

- for lib in $(cat "$CAULDRON_DATA/initfs.libs")
- do
- cp "$lib" "$initfs/lib/"
- done
+ return $ERR_OK
}


#-------------------------------------------------------------------------------
-## @param path_to_initfs
+## @param path_to_initfs (required)
##
## Copies over any required kernel modules into the initfs
##

#-------------------------------------------------------------------------------
-function cauldron_initfs_mods() {
+function cauldron_init_fs_mods() {
+ local initfs="$1"
+ local list="$CAULDRON_DATA/$CAULDRON_ARCH/initfs/modules"
+
+ if [[ -f "$list" ]]
+ for module in $(cat "$CAULDRON_DATA/$CAULDRON_ARCH/initfs/modules")
+ do
+ cp "$module" "$initfs/lib/modules/$CAULDRON_KVERS" || return
$ERR_CP_FILE
+ done
+ fi
+
+ return $ERR_OK
+}
+
+#-------------------------------------------------------------------------------
+## @param path_to_initfs (required)
+##
+## Sets up the "init" in the initfs (AKA linuxrc in ramdisks)
+##
+#-------------------------------------------------------------------------------
+function cauldron_init_fs_init() {
local initfs="$1"
+ local init_script="$CAULDRON_DATA/$CAULDRON_ARCH/initfs/init"
+
+ # copy the init script to /init in the init filesystem, because /init is
+ # *requried* by init ramfs and an init ramdisk can be configured to use
+ # anything we want via the init= boot parameter, and we can also symlink
for
+ # ramdisks if we want to.
+ cp "$init_script" "$initfs/init" || return $ERR_CP_FILE

- for module in $(cat "$CAULDRON_DATA/initfs.modules")
- do
- cp "$module" "$initfs/lib/modules/$CAULDRON_KVERS"
- done
+ # make sure the init script is executable
+ chmod 0755 "$initfs/init" || return $ERR_CHMOD_FILE
+
+ return $ERR_OK
}


#-------------------------------------------------------------------------------
-## @param path_to_initfs
+## @param path_to_initfs (required)
+## @param path to build directory (optional)
##
-## Sets up the "init" in the initfs (AKA linuxrc)
+## Builds busybox for use in the initramfs using a preconfigured config file
for
+## the build. It builds by casting in the build chroot, copies the resulting
+## busybox binary, and then dispels the busybox spell in the chroot to clean
up.
##

#-------------------------------------------------------------------------------
-function cauldron_initfs_init() {
+function cauldron_init_fs_busybox() {
local initfs="$1"
+ local build="${2:-$CAULDRON_BUILD}"
+ local bbconf="$CAULDRON_DATA/$CAULDRON_ARCH/initfs/busybox.config"
+
+ if [[ ! -d "$build" ]]
+ then
+ mkdir -p "$build" || return $ERR_MK_DIR
+ fi
+
+ mkdir -p "$build/etc/sorcery/local" || return $ERR_MK_DIR
+
+ cp -f "$bbconf" "$build/etc/sorcery/local/busybox.config" ||
+ return $ERR_CP_FILE
+
+ cauldron_chroot_init "$build"
+ [[ $? -eq 0 || $? -eq $ERR_CHROOT_NEST ]] || return $ERR_CHROOT_INIT

- cp "$CAULDRON_DATA/initfs.init" "$initfs/linuxrc"
+ cauldron_chroot_cast "busybox" || return $ERR_CHROOT_CAST
+
+ cp "$build/sbin/busybox" "$initfs/sbin/busybox" ||
+ return $ERR_CP_FILE
+
+ cauldron_chroot_dispel "busybox" || return $ERR_CHROOT_DISPEL
+
+ cauldorn_chroot_done "$build" || return $ERR_CHROOT_DONE
+
+ return $ERR_OK
}


#-------------------------------------------------------------------------------
-## @param path_to_initfs
+## @param path_to_initfs (required)
##
-## Builds a "filesystem" to be used in an initrd or initramfs
+## Higher-level function that builds a "filesystem" to be used in an initrd
or
+## initramfs by calling the appropriate low-level functions in turn.
##

#-------------------------------------------------------------------------------
-function cauldron_initfs() {
+function cauldron_init_fs_make() {
local initfs="$1"

- cauldron_initfs_dirs "$initfs"
- cauldron_initfs_bins "$initfs"
- cauldron_initfs_libs "$initfs"
- cauldron_initfs_mods "$initfs"
- cauldron_initfs_init "$initfs"
+ [[ -d "$initfs" ]] || return $ERR_DIR_NOT_FOUND
+
+ cauldron_init_fs_busybox "$initfs" &&
+ cauldron_init_fs_dirs "$initfs" &&
+ cauldron_init_fs_bins "$initfs" &&
+ cauldron_init_fs_libs "$initfs" &&
+ cauldron_init_fs_mods "$initfs" &&
+ cauldron_init_fs_init "$initfs"
+
+ [[ "$?" -gt 0 ]] && return $ERR_INIT_FS_MAKE
+
+ return $ERR_OK
}


#-------------------------------------------------------------------------------
diff --git a/cauldron/lib.sorcerous b/cauldron/lib.sorcerous
index bd6938f..02d6f39 100644
--- a/cauldron/lib.sorcerous
+++ b/cauldron/lib.sorcerous
@@ -16,6 +16,7 @@

#-------------------------------------------------------------------------------


#-------------------------------------------------------------------------------
+## @param path to the sorcery config to load
##
## Sources the sorcery config files. Mainly called by cauldron_chroot_init.
##
@@ -88,66 +89,55 @@ function cauldron_sorcerous_cross_configure() {
}


#-------------------------------------------------------------------------------
-## @param sorcery_branch
-## @param download_path
+## @param spool_path
##
-## Downloads a fresh sorcery source tarball from the net, and places it in
-## download_path.
+## Downloads a sorcery source tarball from the net if we don't already have
one
+## or are forcing a download, and places it in spool_path (optional), or in
+## the CAULDRON_BUILD/var/spool/sorcery directory.
##

#-------------------------------------------------------------------------------
function cauldron_sorcerous_download() {
- local branch=$1
- local spool=$2
- local sorcery="sorcery-$branch.tar.bz2"
- local sorcery_url="http://download.sourcemage.org/sorcery";
-
- # run in a subshell as an easy way of not messing with the working
directory
- (
- cd ${spool}
- wget "$sorcery_url/$sorcery" ||
- return $ERR_SORCEROUS_DOWNLOAD
- )
+ local spool="${1:-$CAULDRON_BUILD/var/spool/sorcery}"
+ local sorcery_url="${CAULDRON_SORCERY_URL%/}"
+ local sorcery="$CAULDRON_SORCERY_PKG"
+ local url_get=( "${CAULDRON_URL_DL_CMD[@]}" )
+
+ # ensure the spool dir exists for getting spell sources
+ mkdir -p "$spool" || return $ERR_BUILD_SPOOL
+
+ # check to see if we will copy or download the sorcery source tarball
+ # then get the source tarball and place it in CAULDRON_BUILD
+ if [[ ! -e "$spool/$sorcery" || "$CAULDRON_FORCE_DOWNLOAD" == "yes" ]]
+ then
+ # run in a subshell as an easy way of not messing with the working
directory
+ (
+ cd "$spool"
+ "${url_get[@]}" "$sorcery_url/$sorcery" ||
+ return $ERR_SORCEROUS_DOWNLOAD
+ )
+ fi &&

return $ERR_OK
}


#-------------------------------------------------------------------------------
-## @param force_download
+## @param spool_path
##
-## Installs sorcery into the ISO system. If force_download is "yes", it will
-## download a fresh copy from the net. Otherwise, it will check to see if the
-## sorcery sources are present in the host system, and copy those first, but
if
-## they cannot be found it will resort to downloading them. It shouldn't
matter
-## if the version of sorcery is a little old, since a system update can be
-## performed inside $CAULDRON_BUILD after the base toolchain is set up. The
-## branch should be one of {stable, test, devel}, and is set in the cauldron
-## config file.
+## Installs sorcery into the build directory. The download_path parameter
+## (optional) indicates where the sorcery source tarball to install from is
+## stored. If spool_path is not supplied, the tarball is assumed to be in
+## the CAULDRON_BUILD/var/spool/sorcery directory.
##

#-------------------------------------------------------------------------------
function cauldron_sorcerous_install() {
- local force_download=$1
- local branch="$CAULDRON_SORCERY_BRANCH"
- local spool="$CAULDRON_BUILD/var/spool/sorcery"
-
- # ensure the spool dir exists for getting spell sources
- mkdir -p "$spool" || return $ERR_BUILD_SPOOL
-
- # check to see if we will copy or download the sorcery source tarball
- # then get the source tarball and place it in CAULDRON_BUILD
- if [[ -e "$CAULDRON_HSORCERY_SPOOL"/sorcery-${branch}.tar.bz2 ]]
- then
- if [[ "$force_download" == "yes" ]]
- then
- cauldron_sorcerous_download $branch "$spool"
- else
- cp "$CAULDRON_HSORCERY_SPOOL"/sorcery-${branch}.tar.bz2 "$spool"
- fi
- else
- cauldron_sorcerous_download ${branch} "$spool"
- fi
+ local spool="${1:-$CAULDRON_BUILD/var/spool/sorcery}"
+ local sorcery="$CAULDRON_SORCERY_PKG"

# unpack the source tarball
- tar -C "$CAULDRON_BUILD/usr/src" -jxf "$spool/sorcery-${branch}.tar.bz2" ||
+ tar -C "$CAULDRON_BUILD/usr/src" -jxf "$spool/$sorcery" ||
+ return $ERR_SORCEROUS_UNPACK
+
+ [[ -x "$CAULDRON_BUILD/usr/src/sorcery/install" ]] ||
return $ERR_SORCEROUS_UNPACK

# make sure the chroot library is loaded so cauldron_chroot is available
diff --git a/cauldron/lib.toolchain b/cauldron/lib.toolchain
index c37e7a2..f9567d8 100644
--- a/cauldron/lib.toolchain
+++ b/cauldron/lib.toolchain
@@ -19,15 +19,16 @@


#-------------------------------------------------------------------------------
## @param spell
+## @param install_log_path
##
## Builds a cache file from the information provided by the install log for
the
## spell passed as an argument. It expects the provided spell to include the
## version as a suffix (i.e. bash-3.2).
##

#-------------------------------------------------------------------------------
-function cauldron_create_host_cache() {
+function cauldron_toolchain_cache_resurrect() {
local spell="$1"
- local install_log="$CAULDRON_HOST/var/log/sorcery/install/$spell"
+ local install_logs="${2:-$CAULDRON_HOST/var/log/sorcery/install}"
local cache="$CAULDRON_CACHES/$spell.tar"

if [[ -z create_cache_archive ]]
@@ -36,79 +37,147 @@ function cauldron_create_host_cache() {
liberror_die $ERR_SORCEROUS_HOST_SORCERY
fi

- create_cache_archive "$install_log" "$cache" "${cache}${EXTENSION}" ||
+ # generate the missing cache file using sorcery
+ create_cache_archive "$install_logs/$spell" "$cache"
"${cache}${EXTENSION}" ||
return $ERR_TOOLCHAIN_RESURRECT

return $ERR_OK
}


#-------------------------------------------------------------------------------
+## @param spell_name
+## @param spell_version
+## @param install_log_path
+##
+## Generates a spell cache by manually copying files from the spell's install
+## log and packaging them. Assumes that the spell's install log exists and is
+## intact.
+##
+#-------------------------------------------------------------------------------
+function cauldron_toolchain_cache_gather() {
+ local spell="$1"
+ local version="$2"
+ local install_logs="${3:-$CAULDRON_HOST/var/log/sorcery/install}"
+ local gather="$CAULDRON_TMP/gather"
+
+ [[ -d "$install_logs" ]] || return $ERR_TOOLCHAIN_GATHER
+
+ [[ -z "$spell" ]] && return $ERR_TOOLCHAIN_GATHER
+ [[ -z "$version" ]] && return $ERR_TOOLCHAIN_GATHER
+
+ # make sure the gather path is clean
+ # completely wipe it out and recreate it
+ rm -fr "$gather" || return $ERR_RM_FILES
+ mkdir -p "$gather" || return $ERR_MK_DIR
+
+ # find all the files installed by the given spell
+ for file in "$install_logs/${spell}-${version}"/*
+ do
+ # copy all files from the sorcery install log
+ cp -a --parents "$file" "$gather/" || return $ERR_TOOLCHAIN_GATHER
+ done
+
+ # package the collection of files from the install log as a cache file
+ tar jcf "${spell}-${version}.tar.bz2" \
+ --transform "s#$gather/##" \
+ "$gather"/* ||
+ return $ERR_TOOLCHAIN_GATHER
+
+ # if the packaging was successful, wipe out the gather dir
+ rm -fr "$gather"
+
+ return $ERR_OK
+}
+
+#-------------------------------------------------------------------------------
+## @param spell
+##
+## Generates a spell cache by casting the spell and then dispelling it.
+##
+#-------------------------------------------------------------------------------
+function cauldron_toolchain_cache_cast() {
+ local spells="$CAULDRON_SYS_SPELLS"
+
+ [[ -f "$spells" ]] || return $ERR_TOOLCHAIN_CAST
+
+ # make sure we have a chroot accessible
+ # default to $CAULDRON_BUILD, unless one is already defined
+ cauldron_chroot_init
+ [[ $? -eq $ERR_OK || $? -eq $ERR_CHROOT_NEST ]] || return $ERR_CHROOT_INIT
+
+ # generate the caches for the needed spells
+ cauldron_chroot_cast_clean "$spells" || return $ERR_TOOLCHAIN_CAST
+
+ # clean up the chroot
+ cauldron_chroot_done || return $ERR_CHROOT_DONE
+
+ return $ERR_OK
+}
+
+#-------------------------------------------------------------------------------
## @param spell
-## @param aggressive
##
## Generates a cache file for the given spell. It will try to use information
## from an already installed/cast spell (in the case of the host system
having
-## sorcery configured to not generate the caches), and, failing that, will
cast the
-## spell and then dispel it (the second step only being performed if
aggressive
-## is true).
+## sorcery configured to not generate the caches), and, failing that, will
cast
+## the spell and then dispel it (the second step only being performed if
+## aggressive is true).
##

#-------------------------------------------------------------------------------
-function cauldron_build_host_cache_file() {
+function cauldron_toolchain_cache_make() {
local spell="$1"
- local aggressive="$2"
+ local config="$CAULDRON_ISORCERY_CONFIG"
+ local lconfig="$CAULDRON_ISORCERY_LCONFIG"
local install_logs="$CAULDRON_HOST/var/log/sorcery/install"
local version=""

# First check to see if the spell was installed, but no cache exists.
- if gaze -q installed "$spell"
+ if gaze -q installed "$spell" > $CAULDRON_NULL
then
- # Spell is installed, generate a cache file using the install log?
+ # use sorcery to generate a cache file using the install log
+ # this is the least intensive of the three options
version="$(grep ^$spell $CAULDRON_HSORCERY_PACKAGES | cut -d: -f4)"
- cauldron_create_host_cache "${spell}-${version}"
- else
- # Only do this part if the caller wants us to be aggressive in building
the
- # cache.
- if [[ "$aggressive" == yes || "$aggressive" == 1 ]]
- then
- # Do some trickery to get a cache file. Make sure that sorcery is set
to
- # generate a cache file, and if not then either set sorcery to do so or
- # build the cache file afterwards by being recursive? This should be
done
- # in a build chroot so that the user's host filesystem is not polluted.
- local aggr_build="$CAULDRON_BUILD/tmp/cauldron_aggressive_cache"

- if [[ -e "$install_logs/${spell}-${version}" ]]
+ if ! cauldron_toolchain_cache_resurrect "${spell}-${version}"
+ then
+ # Only do this part if the caller wants us to be aggressive in
building the
+ # cache.
+ if [[ "$CAULDRON_AGGRESSIVE" == yes ]]
then
- # make sure the $aggr_build path is clean
- # completely wipe it out and recreate it
- rm -fr "$aggr_build"
- mkdir -p "$aggr_build"
-
- # find all the files installed by the given spell
- for file in "$install_logs/${spell}-${version}"/*
- do
- # copy all files from the sorcery install log into $aggr_build
- cp -a --parents "$file" "$aggr_build/"
- done
-
- # package the collection of files from the install log as a cache
file
- tar jcf "${spell}-${version}.tar.bz2" \
- --transform "s#$aggr_build/##" "$aggr_build"/*
-
- # if the packaging was successful, wipe out the $aggr_build dir
- [[ $? -eq 0 ]] && rm -fr "$aggr_build"
- else
- if [[ -e "$CAULDRON_BUILD/etc/sorcery/local/config" ]]
+ if [[ -e "$install_logs/${spell}-${version}" ]]
then
- local config="$CAULDRON_BUILD/etc/sorcery/local/config"
- local archive=$(grep "ARCHIVE=" "$config" | cut -d= -f2)
- [[ $archive != "on" ]] &&
- sed -i 's/ARCHIVE=.*/ARCHIVE="on"/' "$config"
+ # try making a cache from the install logs manually
+ cauldron_toolchain_cache_gather "$install_logs" "$spell" "$version"
fi
- cauldron_chroot "$CAULDRON_CAST" "$spell"
- cauldron_chroot "$CAULDRON_DISPEL" "$spell"
fi
fi
+
+ # otherwise, there's no install logs so we will need to cast the spell
+ elif [[ "$CAULDRON_AGGRESSIVE" == "yes" ]]
+ then
+ # make sure sorcery is in the build chroot
+ [[ -f "$config" ]] || return $ERR_TOOLCHAIN_SORCERY
+
+ # sorcery defaults to archiving, but can be overridden in a local config
+ # check for the local config
+ if [[ -f "$lconfig" ]]
+ then
+ archive=$(grep '[^#]*ARCHIVE=' "$config" | cut -d= -f2)
+
+ # if archiving is off in the local config, turn it on
+ if [[ "$archive" != "on" ]]
+ then
+ sed -i 's/ARCHIVE=.*/ARCHIVE="on"/' "$config" ||
+ return $ERR_SORCEROUS_ARCHIVE
+ fi
+ fi
+
+ # get the cache by manually casting/dispelling
+ # this is the most resource intensive of the three options
+ cauldron_toolchain_cache_cast "$spell" || return $ERR_TOOLCHAIN_CAST
fi
+
+ return $ERR_OK
}


#-------------------------------------------------------------------------------
diff --git a/cauldron/libcauldron b/cauldron/libcauldron
index ce5b73a..685e369 100755
--- a/cauldron/libcauldron
+++ b/cauldron/libcauldron
@@ -69,21 +69,17 @@ function cauldron_load_library() {

#-------------------------------------------------------------------------------
# cauldron includes

#-------------------------------------------------------------------------------
-#cauldron_load_library "lib.sorcerous"
-
+cauldron_load_library "lib.sorcerous"
cauldron_load_library "lib.chroot"
-
cauldron_load_library "lib.init"
-
-#cauldron_load_library "lib.toolchain"
+cauldron_load_library "lib.toolchain"


#-------------------------------------------------------------------------------
##
-## Scans the sorcery archspec files to find the host triplet
+## Scans the sorcery archspec files to find the host triplet.
##
## Later, this will be used to set the value of HOST_TRIPLE in
-## /etc/cauldron/config after the code to write the config file is in
-## place
+## /etc/cauldron/config after the code to write the config file is in place.
##

#-------------------------------------------------------------------------------
function cauldron_get_host_triple() {
@@ -337,14 +333,14 @@ function cauldron_source_enchantment() {
}


#-------------------------------------------------------------------------------
-## @param INSTALLER_MODULE
##
-## Adds the given installer to the ISO system. The user can then choose this
-## installer either at boot-time or run-time, depending on the installer.
-## INSTALLER_MODULE is currently one of shell or menu (future: X?). In
theory it
-## should support any installer, as long as it's packaged in its own
directory and
-## the name of that dir is passed as the arg. This behavior may change in the
-## future though.
+## Adds the given installer(s) listed in $CAULDRON_INSTALLERS to the ISO
system.
+## The user can then choose the installer either at boot-time or run-time.
+##
+## The installer(s) can currently be shell or menu (future: X?). In theory it
+## should support any installer, as long as it's packaged in its own
directory
+## and the name of that dir is passed as the arg. This behavior may change in
+## the future though.
##

#-------------------------------------------------------------------------------
function cauldron_add_installers() {



  • [SM-Commit] GIT changes to master cauldron by Justin Boffemmyer (9aba261265e4647a7fe7b22ba69498afff8c43ed), Justin Boffemmyer, 10/17/2010

Archive powered by MHonArc 2.6.24.

Top of Page