commit 92290e255c9beeab8be52082ac47c736eaee2a4e
Author: Andrew Stitt <acedit AT armory.com>
Commit: Justin Boffemmyer <flux AT sourcemage.org>
scripts/spellcast.sh: bug fixes
fix path to cast command
fix kernel config file copy command
fix parameter comparison syntax
copy script to chroot
(cherry picked from commit 0015aa75a2d28cb3e0fc70a1fb198903705e1cfb)
diff --git a/scripts/spellcaster.sh b/scripts/spellcaster.sh
index dda6c18..062d3b0 100755
--- a/scripts/spellcaster.sh
+++ b/scripts/spellcaster.sh
@@ -9,14 +9,14 @@ then
if [[ $CAULDRON_CAST = y ]]
then
# cast all spells
- /usr/bin/cast $(tr '\n' ' ' </"$rspells") &&
- /usr/bin/cast $(tr '\n' ' ' </"$ospells")
+ /usr/sbin/cast $(tr '\n' ' ' </"$rspells") &&
+ /usr/sbin/cast $(tr '\n' ' ' </"$ospells")
elif [[ $CAULDRON_DISPEL = y ]]
then
# dispel the optional spells, so that we have only their
cache files
# available
- /usr/bin/dispel $(tr '\n' ' ' </"$ospells")
+ /usr/sbin/dispel $(tr '\n' ' ' </"$ospells")
fi
exit $?
@@ -112,15 +112,26 @@ then
fi
# Copy necessary files to the target and chroot
-$(grep -q linux "$CAULDRONDIR/{$rspells,$ospells}") && cp
"$CAULDRONDIR/config.$TYPE" "$TARGET/etc/sorcery/local/kernel.config"
-[[ CAULDRON_CAST = y ]] && cp "$CAULDRONDIR/$rspells" "$TARGET"/
+grep -q '^linux$' "$CAULDRONDIR/$rspells" "$CAULDRONDIR/$ospells" &&
+ cp "$CAULDRONDIR/config-2.6" "$TARGET/etc/sorcery/local/kernel.config"
+
+# Copy the list of spells needed for casting into the TARGET if casting
+[[ $CAULDRON_CAST = y ]] && cp "$CAULDRONDIR/$rspells" "$TARGET"/
+
+# ospells needs to be there whether casting or dispelling
cp "$CAULDRONDIR/$ospells" "$TARGET"/
+
+# copy the script into the TARGET so it can do the casting/dispelling
+cp "$0" "$TARGET"/
+
+# chroot and run the script inside the TARGET
"$MYDIR/cauldronchr.sh" -d "$TARGET" /"$(basename $0)"