Skip to Content.
Sympa Menu

sm-commit - Re: [SM-Commit] GIT changes to devel-flux cauldron by Justin Boffemmyer (1097eb5eb63b11b67a2f2f9f6c2e6ea89a13bed7)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Jaka Kranjc <lynx AT mages.ath.cx>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: Re: [SM-Commit] GIT changes to devel-flux cauldron by Justin Boffemmyer (1097eb5eb63b11b67a2f2f9f6c2e6ea89a13bed7)
  • Date: Mon, 3 Dec 2007 10:27:30 +0100

On Monday 03 of December 2007 01:18:30 Justin Boffemmyer wrote:
> +function cauldron_get_host_triple() {
> + local HOST_ARCH
> + local ARCH_SPEC
> + local HOST_TRIPLE
> +
> + # get the value for the HOST triplet from sorcery archspecs
> + HOST_ARCH=$(grep "ARCHITECTURE=" ${HOST_SORCERY_CONFIG} | cut -d = -f 2)
make sure HOST_SORCERY_CONFIG is the local one in this case. And if you will
source it somewhere (likely), you could just do HOST_ARCH=$ARCHITECTURE here.

> + ARCH_SPEC=$(find ${} -name ${HOST_ARCH})
find $HOST_ARCH_PATH

You may also check set_architecture in libmisc. It sources the archspec and
sets some useful vars like SMGL_COMPAT_ARCHS. You could then just
HOST_TRIPLE=$HOST and wouldn't need ARCH_SPEC.
> + HOST_TRIPLE=$(grep "HOST=" ${ARCH_SPEC} | cut -d = -f 2)
> +
> + return ${HOST_TRIPLE}
Bash can only return integers in the range to 255, so use echo instead. Or
make it a global var if you'll need it often.

> +function cauldron_create_base_toolchain() {
> + local SPELL
> + local VERSION
> + local SPELL_CACHE
> + local HOST_TRIPLE
> +
> + # set the value for HOST_TRIPLE
> + cauldron_get_host_triple
> + HOST_TRIPLE="$?"
HOST_TRIPLE=$(cauldron_get_host_triple)

> + # grab the list of spells needed as the base tool-chain which will be
> + # used to create the cross-compile tool-chain
> + for SPELL in ${HOST_TOOLCHAIN}
> + do
> + # grab the version for the spell from sorcery's state info
> + # on what's installed
> + VERSION=$(grep "^${SPELL}" ${HOST_PACKAGES} | cut -d : -f 4)
You can use:
installed_version $SPELL

> + # set SPELL_CACHE as shorthand for SPELL-VERSION-HOST_TRIPLE.tar.bz2
> + SPELL_CACHE="${SPELL}-${VERSION}-${HOST_TRIPLE}.tar.bz2"
Caches can also be gzipped or uncompressed. The suffix is stored in the
global
$EXTENSION.

Check the can_resurrect function.
> + # check to see if there is already a cache file from sorcery
> + # this check could be based on spell-{names,versions} reported by
> + # gaze/sorcery/dispel. Mirroring code in dispel might be the best bet,
> + # since that has to find the version currently installed anyway.
> + if [[ -f ${HOST_SORCERY_SPOOL}/${SPELL_CACHE} ]]
Caches are stored in INSTALL_CACHE, not SOURCE_CACHE (spool).

> + then
> + # found a cache file, copy it to the BUILD dir
> + cp ${HOST_SORCERY_SPOOL}/${SPELL_CACHE} ${CAULDRON_BUILD}
> + else
> + # couldn't find a cache file, so we'll need to build one
> + cauldron_build_cache_file ${SPELL}
> + fi
> + done
> +
> + # unpack the cache file, effectively installing
> + # the spell into the BUILD dir
> + # the unpacking is done against the BUILD dir as the root dir, so
> + # this should not touch the HOST filesystem at all
> + tar xjf ${CAULDRON_BUILD}/${SPELL_CACHE} -C ${CAULDRON_BUILD}/
Shouldn't this last block be inside the loop? Now only one/last of the caches
is installed. Also the j will be problematic if you will take EXTENSION into
consideration.

> + # TODO find a better way to copy resolv.conf, since it may be a symlink
> + # copy the host's resolv.conf in order to dl packages from net
> + cp /etc/resolv.conf ${CAULDRON_BUILD}/
I think cp -L would do the trick.

> +++ b/src/etc/cauldron/config
> + HOST_ARCH_PATH=/var/lib/sorcery/archspecs
The correct path is /usr/share/archspecs , as they were removed from sorcery
and are now maintained outside.

> -cauldron_install_copy_kernel() {
> +function cauldron_install_copy_kernel() {
> 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};
> + depmod -a -b ${ISO}/lib/modules/${LINUX_VER} ${LINUX_VER};
With the chroot gone, isn't the list now stored on the host?

--
We cannot command nature except by obeying her. --Sir Francis Bacon
Have a sourcerous day! www.sourcemage.org

Attachment: signature.asc
Description: This is a digitally signed message part.




Archive powered by MHonArc 2.6.24.

Top of Page