Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to devel-andrew cauldron by Andrew Stitt (c4c9f194d735bf696f6cbd15372bac388d09a7d4)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Andrew Stitt <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to devel-andrew cauldron by Andrew Stitt (c4c9f194d735bf696f6cbd15372bac388d09a7d4)
  • Date: Wed, 31 Dec 2008 17:31:53 -0600

GIT changes to devel-andrew cauldron by Andrew Stitt <acedit AT armory.com>:

scripts/spellcaster.sh | 72
+++++++++++++++++++++++++++++++----------
scripts/twelve-step-program.sh | 2 -
2 files changed, 57 insertions(+), 17 deletions(-)

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

scripts/spellcaster.sh: install_kernel

This is the non-WIP version of the install_kernel function which should
actually work. However, the function needs to be verified via testing.

commit 3670ab21867b7b90f5a0e3e093ce4ccea086d242
Author: Andrew Stitt <acedit AT armory.com>
Commit: Andrew Stitt <acedit AT armory.com>

fix stuff

diff --git a/scripts/spellcaster.sh b/scripts/spellcaster.sh
index 9a99a87..c128fd7 100755
--- a/scripts/spellcaster.sh
+++ b/scripts/spellcaster.sh
@@ -197,34 +197,72 @@ function install_kernel() {
local version=
local kernel=

+ # Exit if DST undefined, otherwise we could damage the host system
+ [[ -z $DST ]] && exit 12
+
+ if grep -q '^linux:' "$SRC"/var/state/sorcery/packages
+ then
+ version=$(grep '^linux:' "$SRC"/var/state/sorcery/packages)
+ version=${version##*:}
+ kernel="$SRC"/boot/vmlinuz
+ ${kconfig:="$SRC"/etc/sorcery/local/kernel.config}
+ fi
+
# Try to autodetect the location of the kernel config based on whether
# the linux spell was used or not.
if [[ -z $kconfig ]]
then
+ if [[ -f "$SRC"/usr/src/linux/.config ]]
+ then
+ kconfig="$SRC/usr/src/linux/.config"
+ elif [[ -f "$SRC"/boot/config ]]
+ then
+ kconfig="$SRC/boot/config"
+ fi
fi
+ [[ -z $kconfig ]] && exit 13

- if gaze -q installed linux &> /dev/null
- then
- version=$(gaze -q installed linux)
- kernel=/boot/vmlinuz
-
- # Try to autodetect the linux kernel version using spell version or
+ # Try to autodetect the linux kernel version using kernel directory or
# kernel config
if [[ -z $version ]]
then
- version="$(zgrep 'Linux kernel version:')"
- version="${version#*version: }"
+ if [[ -h "$SRC"/usr/src/linux ]]
+ then
+ if readlink "$SRC"/usr/src/linux
+ then
+ version="$(readlink "$SRC"/usr/src/linux)"
+ version="${version#linux-}"
+ fi
+ else
+ version=$(grep 'version:' "$kconfig")
+ version="${version##*version: }"
+ fi
fi
+ [[ -z $version ]] && exit 14

# Try to guess the location of the kernel itself
- kernel=
-
- cp "$kconfig" "$DST"/boot/config-$version
- cp "$SRC"/ "$DST"/
- cp "$SRC"/ "$DST"/
- cp "$SRC"/ "$DST"/
- cp "$SRC"/ "$DST"/
- cp "$SRC"/ "$DST"/
+ if [[ -z $kernel ]]
+ then
+ if [[ -e "$SRC"/boot/vmlinuz ]]
+ then
+ kernel="$SRC/boot/vmlinuz"
+ elif [[ -e "$SRC"/usr/src/linux/arch/i386/boot/bzImage ]]
+ then
+ kernel="$SRC/usr/src/linux/arch/i386/boot/bzImage"
+ fi
+ fi
+ [[ -z $kernel ]] && exit 15
+
+ # Copy the kernel config and symlink
+ cp -f "$kconfig" "$DST"/boot/config-$version
+ ln -sf /boot/config-$version "$DST"/boot/config
+
+ # Copy the kernel image
+ cp -f "$kernel" "$DST"/boot/linux
+
+ # Copy all kernel modules
+ [[ -d "$DST"/lib/modules ]] || mkdir -p "$DST"/lib/modules
+ cp -fr "$SRC"/lib/modules/$version "$DST"/lib/modules/
}

function setup_sys() {
@@ -293,6 +331,8 @@ function setup_iso() {
do
cp "$TARGET"/var/cache/sorcery/$cache*.tar.bz2
"$ISODIR"/var/cache/sorcery/
done
+
+ install_kernel "$TARGET" "$ISODIR"
}

function clean_target() {
diff --git a/scripts/twelve-step-program.sh b/scripts/twelve-step-program.sh
index 5699e1d..2580cdc 100755
--- a/scripts/twelve-step-program.sh
+++ b/scripts/twelve-step-program.sh
@@ -41,7 +41,7 @@
bash /root/cauldron/scripts/spellcaster.sh /root/build x86 ||
echo 'step 3 failed' >> /var/log/sorcery/activity

- step 3.5 copy kernel sources to iso and sys tree
+ echo step 3.5 copy kernel sources to iso and sys tree
# may be handled by step 3 later on
cp -fav /lib/modules/2.6.24-SMGL-iso /tmp/cauldron/iso/lib/modules &&
cp -fav /usr/src/linux-2.6.24 /tmp/cauldron/iso/usr/src ||



  • [SM-Commit] GIT changes to devel-andrew cauldron by Andrew Stitt (c4c9f194d735bf696f6cbd15372bac388d09a7d4), Andrew Stitt, 12/31/2008

Archive powered by MHonArc 2.6.24.

Top of Page