Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to devel-flux cauldron by Justin Boffemmyer (65bc80ebdf25bfa2de1b5dd9944a484cf032f170)

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 devel-flux cauldron by Justin Boffemmyer (65bc80ebdf25bfa2de1b5dd9944a484cf032f170)
  • Date: Wed, 6 Feb 2008 15:33:04 -0600

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

src/etc/cauldron/config | 2
src/iso-spells.lst | 91 ++++++++++++++++++++++++++++++++
src/libcauldron | 134
+++++++++++++++++++++++++++++++++++++++++++-----
3 files changed, 214 insertions(+), 13 deletions(-)

New commits:
commit 65bc80ebdf25bfa2de1b5dd9944a484cf032f170
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

iso-spells.lst: new file, spells to cast on iso

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

libcauldron: beginning of cross-compile support

Added functions to handle transactions and modify the config file
(stolen from sorcery), functions for building the toolchain with
cross-compile awareness, and started a function for adding an
installer to the iso.

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

etc/cauldron/config: renamed CAULDRON_CAST_SPELL

Renamed CAULDRON_CAST_SPELL --> CAULDRON_CAST

diff --git a/src/etc/cauldron/config b/src/etc/cauldron/config
index 8a9a45c..ce65d2d 100644
--- a/src/etc/cauldron/config
+++ b/src/etc/cauldron/config
@@ -9,7 +9,7 @@
CACHE_EXTENSION=$(grep "EXTENSION=" ${HOST_SORCERY_CONFIG} | \
cut -d = -f 2)

- CAULDRON_CAST_SPELL="/usr/sbin/cast"
+ CAULDRON_CAST="/usr/sbin/cast"
CAULDRON_REBUILD="/usr/sbin/sorcery rebuild"
CAULDRON_BUILD=
SMGL_ISO=
diff --git a/src/iso-spells.lst b/src/iso-spells.lst
new file mode 100644
index 0000000..490d7dc
--- /dev/null
+++ b/src/iso-spells.lst
@@ -0,0 +1,91 @@
+autoconf
+automake
+basesystem
+bash
+bin86
+binutils
+bison
+bzip2
+coreutils
+cpio
+device-mapper
+dhcpcd
+dialog
+diffutils
+e2fsprogs
+ed
+eject
+elvis
+file
+findutils
+flex
+g++
+gawk
+gcc
+gettext
+glibc
+gnupg
+grep
+groff
+grub
+gzip
+hdparm
+iana-etc
+init.d
+installwatch
+jed
+jfsutils
+kbd
+less
+libaal
+libtool
+lilo
+linux
+locale
+lvm
+lynx
+m4
+make
+man
+mdadm
+mktemp
+module-init-tools
+nano
+ncurses
+net-tools
+netconf
+netkit-base
+netkit-ping
+nfs-utils
+openssl
+patch
+pciutils
+pcmciautils
+perl
+popt
+portmap
+procps
+raidtools
+readline
+reiser4progs
+reiserfsprogs
+rpmunpack
+sed
+shadow
+simpleinit-msb
+slang
+smgl-archspecs
+smgl-fhs
+sorcery-pubkeys
+sysfsutils
+tar
+tcp_wrappers
+texinfo
+udev
+unzip
+util-linux
+wget
+which
+wireless_tools
+xfsprogs
+zlib
diff --git a/src/libcauldron b/src/libcauldron
index cea8d59..8bf70c1 100755
--- a/src/libcauldron
+++ b/src/libcauldron
@@ -17,6 +17,71 @@

#---------------------------------------------------------------------
##
+## @param Filename
+##
+##
+##
+#---------------------------------------------------------------------
+function cauldron_lock_start_transaction() {
+}
+
+#---------------------------------------------------------------------
+##
+## @param Filename
+##
+##
+##
+#---------------------------------------------------------------------
+function cauldron_lock_commit_transaction() {
+}
+
+#---------------------------------------------------------------------
+##
+## @param Filename
+## @param Variable
+## @param Value
+##
+## Modifies the values assigned to variables present in a config file.
+## Filename is typically either cauldron/config or cauldron/local/config.
+## Variable is the name of the variable to modify/update, and Value is the
+## value to assign to it.
+##
+#---------------------------------------------------------------------
+function cauldron_modify_config() {
+ local FILE=$1
+ local VAR=$2
+ local VAL=$3
+ local COL=$((20-${#1}))
+ local tFILE=""
+ local TEMP=""
+
+ if [[ -f ${FILE} ]]
+ then
+ # Open tFILE for the transactions for FILE, to be committed back to
+ # FILE later.
+ tFILE=$(cauldron_lock_start_transaction ${FILE})
+
+ # Copy everything _except_ the var we want to change to tFILE
+ # This effectively deletes the previous reference to var (in tFILE)
+ $(grep -v "^[[:blank:]]*${1}=" ${FILE} > ${tFILE})
+
+ # Justify (center) the text in the file based on the length of the var
+ [[ COL -lt 0 ]] && COL=0
+ for (( ; COL>0 ; COL-- )) ;
+ do
+ TEMP="${TEMP} "
+ done
+
+ # Write out the new variable=value assignment, including justification
+ # whitespace, to tFILE
+ echo "${TEMP}${1}=\"${2}\"" >> ${tFILE}
+
+ # Commit the changes back out to the original FILE
+ cauldron_lock_commit_transaction ${FILE}
+}
+
+#---------------------------------------------------------------------
+##
## Prepares a chroot environment
##
#---------------------------------------------------------------------
@@ -83,10 +148,10 @@ function cauldron_create_base_toolchain() {
local SPELL_CACHE
local HOST_TRIPLE
local CACHE_EXTENSION
-
+
# set the value for 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}
@@ -94,12 +159,12 @@ function cauldron_create_base_toolchain() {
# grab the version for the spell from sorcery's state info
# on what's installed
VERSION=$(grep "^${SPELL}" ${HOST_PACKAGES} | cut -d : -f 4)
-
+
if [[ ${VERSION} ]]
then
# set SPELL_CACHE as shorthand for SPELL-VERSION-HOST_TRIPLE.tar.bz2
SPELL_CACHE="${SPELL}-${VERSION}-${HOST_TRIPLE}.tar${CACHE_EXTENSION}"
-
+
# 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,
@@ -117,25 +182,46 @@ function cauldron_create_base_toolchain() {
# 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}/
- # the spell is not present on the HOST system, so it must be cast inside
- # a chroot
else
+ # the spell is not present on the HOST system, so it must be cast
+ # inside a chroot
cauldron_enter_chroot
- chroot ${CAULDRON_BUILD} ${CAULDRON_CAST_SPELL} ${SPELL}
+ chroot ${CAULDRON_BUILD} ${CAULDRON_CAST} ${SPELL}
cauldron_exit_chroot
fi
done
}

#---------------------------------------------------------------------
-## @param XXX
+## @param stage
##
## Configures the toolchain for building on the TARGET system. In other
## words, this sets the options/variables necessary to build a
-## cross-compiler system to generate binaries for the target system.
+## cross-compiler system to generate binaries for the target system. The
+## parameter "stage" is an int and sets the variables for stage1 and stage2
of
+## the cross-compile. Stage1 is the building of the initial tools. Stage2 is
for
+## the building of glibc, because it's a little bit special. Stage3 is
+## the cross-compilation of the basesystem via sorcery rebuild using the
+## cross-compiler.
##
#---------------------------------------------------------------------
function cauldron_configure_toolchain() {
+ local STAGE=$1
+
+ case ${STAGE} in
+ 1)
+ cauldron_modify_config ${TARGET_LOCAL_CFG} CUSTOM_CFLAGS \
+ "--host=${HOST} --target=${TARGET}"
+ ;;
+ 2)
+ cauldron_modify_config ${TARGET_LOCAL_CFG} CUSTOM_CFLAGS \
+ "--build=${HOST} --host=${TARGET}"
+ ;;
+ 3)
+ cauldron_modify_config ${TARGET_LOCAL_CFG} CUSTOM_CFLAGS \
+ "--build=${HOST} --host=${TARGET} --target=${TARGET}"
+ ;;
+ esac
}

#---------------------------------------------------------------------
@@ -145,12 +231,32 @@ function cauldron_configure_toolchain() {
##
#---------------------------------------------------------------------
function cauldron_create_target_toolchain() {
- # set sorcery options, etc. for cross-compile
- cauldron_configure_toolchain
+ # build the stage 1 tools
+ cauldron_configure_toolchain 1
+ cauldron_enter_chroot
+ chroot ${CAULDRON_BUILD} ${CAULDRON_CAST} binutils
+ chroot ${CAULDRON_BUILD} ${CAULDRON_CAST} gcc
+ cauldron_exit_chroot
+
+ # build glibc (stage 2)
+ cauldron_configure_toolchain 2
+ cauldron_enter_chroot
+ chroot ${CAULDRON_BUILD} ${CAULDRON_CAST} glibc
+ cauldron_exit_chroot
+
+ # rebuild gcc (still stage 1, but this time linked against the
+ # cross-glibc
+ cauldron_configure_toolchain 1
+ cauldron_enter_chroot
+ chroot ${CAULDRON_BUILD} ${CAULDRON_CAST} gcc
+ cauldron_exit_chroot

# do a sorcery rebuild inside the BUILD dir to
- # generate the cross-compile tool-chain
+ # generate the cross-compile tool-chain (stage 3)
+ cauldron_configure_toolchain 3
+ cauldron_enter_chroot
chroot ${CAULDRON_BUILD} ${CAULDRON_REBUILD}
+ cauldron_exit_chroot
}

#---------------------------------------------------------------------
@@ -182,6 +288,10 @@ function cauldron_iso_init() {
##
#---------------------------------------------------------------------
function cauldron_add_installer() {
+ local MODULE=$1
+
+ cp ${} ${CAULDRON_BUILD}/${CAULDRON_MODULEDIR}
+ ln -sf ${CAULDRON_BUILD}/${CAULDRON_MODULEDIR} /sbin/
}

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



  • [SM-Commit] GIT changes to devel-flux cauldron by Justin Boffemmyer (65bc80ebdf25bfa2de1b5dd9944a484cf032f170), Justin Boffemmyer, 02/06/2008

Archive powered by MHonArc 2.6.24.

Top of Page