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

Andrew Stitt scm at sourcemage.org
Sun Jan 4 14:40:34 EST 2009


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

 data/rspells.x86                                   |    1 
 initrd/sbin/smgl.init                              |   22 ++
 iso/usr/sbin/smgl-enchant                          |    1 
 iso/usr/sbin/smgl-kernel                           |    1 
 iso/usr/sbin/smgl-spells                           |    1 
 iso/usr/share/doc/smgl.install/steps/install       |    6 
 iso/usr/share/doc/smgl.install/steps/iso-kernel    |   14 +
 iso/usr/share/doc/smgl.install/steps/select-spells |   19 --
 iso/usr/share/doc/smgl.install/steps/user-setup    |   12 -
 iso/usr/share/smgl.install/bashrc                  |    4 
 iso/usr/share/smgl.install/smgl-chroot             |    4 
 iso/usr/share/smgl.install/smgl-enchant            |   51 ++++--
 iso/usr/share/smgl.install/smgl-kernel             |    7 
 iso/usr/share/smgl.install/smgl-spellcaster        |  140 ----------------
 iso/usr/share/smgl.install/smgl-spells             |  178 +++++++++++++++++++++
 iso/usr/share/smgl.install/spells                  |   26 +++
 scripts/cleaniso.sh                                |   16 +
 scripts/mkrelease.sh                               |   13 +
 scripts/spellcaster.sh                             |    8 
 19 files changed, 331 insertions(+), 193 deletions(-)

New commits:
commit bef9fae0d2cebad41240f06362559108ded65e9d
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    scripts/mkrelease.sh: split VERSION for sed
    
    Running "0.27-0" via variable through sed caused errors. For some
    reason, it didn't like the "-". Therefore, the version information was
    split into two variables using cut, and then processed in sed as
    $half1-$half2 instead.

commit e7223d08ca10cf808a04003692977e1437bddb38
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    scripts/mkrelease.sh: set the MYDIR variable
    
    Set the MYDIR variable used when calling other scripts.

commit b6e6f37b2a6c8db1d5bc2c2ad84330ec805d8fdd
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    scripts/cleaniso.sh: more cleaning, abs. cmd paths
    
    Added more directories to clean out from the ISO, and changed the chroot
    commands to use absolute command paths to rm and rmdir.

commit ed956dbb3e9548b67c91a0a8a9c607dcbde77149
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    scrips/mkrelease.sh: fix handling of CHOWN
    
    Needed to branch the CHOWN stuff since chown would complain if the
    variables were empty. Now the chown run is completely avoided unless
    specifically passed in.

commit f5181a2fdbd7745c91c2b34805bbcaea8382c5cf
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    scripts/spellcaster.sh: scribe reindex uniq tablet
    
    Add scribe info and then run scribe reindex so that SYSDIR has access to
    the spells. Ensure that we don't have duplicate entries in the tablet
    files we create.

commit 033970cd95d04b1c9ec31c524521772708850117
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    smgl.install/smgl-enchant: fix tablet rebuilding
    
    Corrected the tablet reconstruction implementation.

commit 4712da2d59c6248d9a0e48c0dcc4656dba16c245
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    data/rspells.x86: make e2fsprogs required
    
    Really necessary for a functioning system because it provides both fsck
    and libblkid (a library which many filesystems rely on to function).

commit a9ed9bc77bf831bf601f2462d6e5897bc0340a81
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    steps/user-setup: update for recent shadow
    
    Recent shadow is not as deficient as it was in the version on test4.
    Kudos!

commit 33442d10ab88ed568c2157abe59f51288c139b5d
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    steps/iso-kernel: add modprobe blacklist
    
    Add the modprobe.d blacklist file when adding the ISO kernel.

commit bbf58723bfb791acb9714dd7c5b027fbc474ab37
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    steps/install: corrected enchant name
    
    Fixed enchant -> smgl-enchant

commit 239c84d667eed2ea8c3755fd0a16fa41fdec7558
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    smgl.install/smgl-kernel: copy module blacklist
    
    Install the modprobe.d blacklist file to blacklist modules if installing
    the ISO kernel.

commit 48e739f4a429b18d07015f9d7b2b53752777ab26
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    smgl.install/bashrc: set up default opt. spells
    
    Set up the default list of optional spells in /tmp/spells on startup.

commit 901300de18997ffcd87bdc64de6353dd469f0c38
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    smgl.install/spells: suggested optional spells
    
    List of optional spells provided on the ISO that are suggested for
    installation.

commit b30a9127078fc2ec1d98a212b7c6978f02119f71
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    smgl.install/smgl-enchant: silence sorcery conf
    
    When sourcing the sorcery config, ignore any output it generates. It
    only matters if it is sourced successfully at all (the file itself), not
    whether all of it's internal sourcings are ok (for now).

commit ecc928f582a678b35d10995db3fb807adc71dfd9
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    smgl.install/smgl-kernel: fix ISO kernel ref
    
    Referenced the ISO kernel wrong. Isolinux doesn't handle symlinks, so
    the ISO kernel is fixed to /boot/linux.

commit a8617ed234951bd3b686eca02bce0171bfbf4ded
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    rename smgl-spellcaster -> smgl-spells

commit f4503b5d881b6bee8ef1611e54125fd21044852b
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    smgl.install/smgl-spellcaster: update info message
    
    Updated the info message displayed at startup to match the current
    implementation.

commit e7064a0ef1a7e9663e5ef8caefcf8045c57ca2cf
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    smgl.install/smgl-spellcaster: reimplement
    
    Reimplemented the major functions (parsing and processing the input).
    The script is now much more correct/accurate, and allows for more
    features at the same time.

commit 773a2440f9aae204c6071f14675c521e8a0493e6
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    smgl.install/smgl-spellcaster: better uniqing
    
    sort can handle uniq'ing itself, and since we are running sort anyway,
    we should kill 2 birds with 1 stone. Also, sort can safely output to the
    same file it reads from, whereas the I/O redirection here before would
    cause there to be an empty file. Additionally, test to make sure the
    file exists before trying to operate on it.

commit 6a41270e8914a037c91b2b8f05d1c517e72388d1
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    smgl.install/smgl-spellcaster: don't cast anything
    
    This script should only build the list of the spells the user wants to
    have. It shouldn't operate on any of them. smgl-enchant is for that.

commit b52a2b60d3be41b16baddb375d6c018aaab3d98a
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    smgl.install/smgl-spellcaster: less > more
    
    Use less instead of more, because more was causing runtime bugs due to
    its own faults.

commit cded4720f74e66f77a6a94221a8e270c74fe78a2
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    smgl.install/smgl-spellcaster: test file exists
    
    Check to see if /tmp/spells exists before trying to read it on startup.

commit ea749fd2579975c964c5eff0e44724c7a7674868
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    smgl.install/smgl-spellcaster: use cache file
    
    Create and make use of a cache file that stores the results of scanning
    /var/cache/sorcery to speed up the script. Unfortunately the big speed
    hit at script startup is with reading /tmp/spells to load saved
    settings.

commit 5d3edc0f648cf6bf9b2078941fe6034126d77adb
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    steps/select-spells: smgl-spells, /tmp/spells
    
    Changed opt-spells to spells, and changed the info to match smgl-spells.

commit 0578a29de9e6d9c3235fd4c2e089c1cd7f40f5ad
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    smgl.install/smgl-chroot: fix quoting, rc handling
    
    Fixed the quoting with setting the target dir, and removed the forced
    exit $? usage.

commit 4eeb6340ff3c1a96840511559775cb9aec149727
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    smgl.install/smgl-enchant: install system.tar.bz2
    
    By default, install system.tar.bz2, as it's kind of required in order to
    be able to source the proper sorcery routines. Added an option to
    operate on caches only, with the assumption that system.tar.bz2 would
    already be installed.

commit 625e63f78d8c5f833c6ea9806cbe591e009d3698
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    steps/iso-kernel: updated for smgl-kernel
    
    Updated the instructions to include smgl-kernel, and improved the
    instructions for manual copying a bit.

commit 3e6b241097e5c3269d4c760d25ebe24306953504
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    iso/etc/interfaces: add empty interfaces file
    
    Prevent ISO init errors by having an empty interfaces file.

commit 0d3a5f3298ee149209abb6d8a729f8e4d7a2d141
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    Added symlinks for the installer end-user scripts
    
    Added symlinks for smgl-enchant, smgl-kernel, and smgl-spellcaster so
    that they can be accessed by the end-user.

commit ee8210cf548ea68c1b531ac02ed1ec96c007b9ad
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    initrd/sbin/smgl.init: kill udev better
    
    Improved the method in which udevd gets killed before handing off to the
    ISO init. It now happens more properly, and has a failsafe in case there
    is a problem.

commit 0aaeee2adc22eda6f94b6c82af958e5fbd1703a7
Author: Justin Boffemmyer <flux at sourcemage.org>
Commit: Justin Boffemmyer <flux at sourcemage.org>

    smgl.install/bashrc: properly restrict grep
    
    Restricted the grep in num_current to anchor on BOL, or it would find
    false positives.

diff --git a/data/rspells.x86 b/data/rspells.x86
index 07b8124..e2d99d3 100644
--- a/data/rspells.x86
+++ b/data/rspells.x86
@@ -5,6 +5,7 @@ coreutils
 cpio
 dialog
 diffutils
+e2fsprogs
 file
 findutils
 gawk
diff --git a/initrd/sbin/smgl.init b/initrd/sbin/smgl.init
index d213658..4c581ad 100755
--- a/initrd/sbin/smgl.init
+++ b/initrd/sbin/smgl.init
@@ -111,13 +111,27 @@ main()  {
       continue
     fi
 
-    umount -n /dev
+
+    UDEVPID="$(pidof udevd)"
+    if [[ -n $UDEVPID ]]
+    then
+      echo "Killing initrd udev ..."
+      if ! kill $UDEVPID
+      then
+        echo "Error killing udevd!"
+	echo -n "[a]bort or [c]ontinue? [ac]"
+	read choice
+	if [[ $choice == "a" ]]
+	then
+          shell
+        fi
+      fi
+    fi
+
     umount -n /sys
+    umount -n /dev
     umount -n /proc
 
-    echo "Killing initrd udev..."
-    kill $(pidof udevd)
-
     cd $MOUNT
 
     if  [  -d  initrd  ];  then
diff --git a/iso/etc/interfaces b/iso/etc/interfaces
new file mode 100644
index 0000000..e69de29
diff --git a/iso/usr/sbin/smgl-enchant b/iso/usr/sbin/smgl-enchant
new file mode 120000
index 0000000..cad0b88
--- /dev/null
+++ b/iso/usr/sbin/smgl-enchant
@@ -0,0 +1 @@
+/usr/share/smgl.install/smgl-enchant
\ No newline at end of file
diff --git a/iso/usr/sbin/smgl-kernel b/iso/usr/sbin/smgl-kernel
new file mode 120000
index 0000000..7c7b579
--- /dev/null
+++ b/iso/usr/sbin/smgl-kernel
@@ -0,0 +1 @@
+/usr/share/smgl.install/smgl-kernel
\ No newline at end of file
diff --git a/iso/usr/sbin/smgl-spells b/iso/usr/sbin/smgl-spells
new file mode 120000
index 0000000..36945df
--- /dev/null
+++ b/iso/usr/sbin/smgl-spells
@@ -0,0 +1 @@
+/usr/share/smgl.install/smgl-spells
\ No newline at end of file
diff --git a/iso/usr/share/doc/smgl.install/steps/install b/iso/usr/share/doc/smgl.install/steps/install
index 4f2f895..35f04fd 100644
--- a/iso/usr/share/doc/smgl.install/steps/install
+++ b/iso/usr/share/doc/smgl.install/steps/install
@@ -1,7 +1,7 @@
 install step
 It is time to install all of the spells to your system. There are two ways that
-you can do this: manually, and using the enchant script. Note that
-system.tar.bz2 is required.
+you can do this: manually, and using the smgl-enchant script. Note
+that system.tar.bz2 is required.
 
 manual method:
  tar xjvf /system.tar.bz2 -C /mnt/root
@@ -13,7 +13,7 @@ an example, to install lilo:
  tar jxf lilo-22.8-i486-pc-linux-gnu.tar.bz2 -C /mnt/root
 
 enchant method (uses /tmp/opt-spells):
- enchant
+ smgl-enchant
 
 Enchant can also take a command-line argument to a cache file with a specified
 path. This enables you to run enchant on any cache file you choose, from any
diff --git a/iso/usr/share/doc/smgl.install/steps/iso-kernel b/iso/usr/share/doc/smgl.install/steps/iso-kernel
index 823b773..ef6c1a6 100644
--- a/iso/usr/share/doc/smgl.install/steps/iso-kernel
+++ b/iso/usr/share/doc/smgl.install/steps/iso-kernel
@@ -1,13 +1,21 @@
 iso-kernel step
 Installing the ISO kernel is easy, and it should work well (it's working on
 your computer right now). To install the ISO kernel, all you need to do is copy
-the kernel and kernel modules over to your new system.
+the kernel and kernel modules over to your new system. You can do this with a
+script we provide, or manually.
 
+using smgl-kernel:
+ smgl-kernel
+
+manually:
 copy the kernel itself:
- cp /boot/{config,System.map}* /mnt/root/boot/
+ cp /boot/config-$(uname -r) /mnt/root/boot/
  cp /boot/linux /mnt/root/boot/vmlinuz-$(uname -r)
 
 copy all the kernel modules:
- cp -a /lib/modules/$(uname -r) /mnt/root/lib/modules
+ cp -a /lib/modules/$(uname -r) /mnt/root/lib/modules/
+
+you'll probably also want the modprobe blacklist:
+ cp /etc/modprobe.d/blacklist /mnt/root/etc/modprobe.d/blacklist
 
 Type next to go to the next step.
diff --git a/iso/usr/share/doc/smgl.install/steps/select-spells b/iso/usr/share/doc/smgl.install/steps/select-spells
index b4486ed..5c52163 100644
--- a/iso/usr/share/doc/smgl.install/steps/select-spells
+++ b/iso/usr/share/doc/smgl.install/steps/select-spells
@@ -1,22 +1,19 @@
 select-spells step
 You may now select the spells you would like that are provided on the ISO.
 There are currently two ways that you can accomplish this. Both methods make
-use of /tmp/opt-spells. Note that it is crucial to install some spells (such as
-a bootloader) or your system may not function, so some of these have been
-included as defaults in /tmp/opt-spells.
+use of /tmp/spells. Note that it is crucial to install some spells (such as a
+bootloader) or your system may not function, so some of these have been
+included as defaults in /tmp/spells.
 
-The menu will present a list of the spells available on the ISO, as well as
-mark which ones are selected for install. The menu is accessed as follows.
-
-menu:
- alchemy
+text menu:
+ smgl-spells
 
 manual:
- $EDITOR /tmp/opt-spells
+ $EDITOR /tmp/spells
 
 You can of course use any editor you like, in case you haven't set $EDITOR.
 
-You can re-edit /tmp/opt-spells any time during the install session and it will
-remember your changes each time. Likewise, you may re-run alchemy.
+You can re-edit /tmp/spells any time during the install session and it will
+remember your changes each time. Likewise, you may re-run smgl-spells.
 
 When you are finished selecting your spells, type next.
diff --git a/iso/usr/share/doc/smgl.install/steps/user-setup b/iso/usr/share/doc/smgl.install/steps/user-setup
index ef9e378..efaf7ea 100644
--- a/iso/usr/share/doc/smgl.install/steps/user-setup
+++ b/iso/usr/share/doc/smgl.install/steps/user-setup
@@ -7,17 +7,11 @@ and bear in mind that it can be bypassed with a screwdriver):
  passwd root
 
 Recommended: add at least one regular user for daily use:
- useradd -d /home/mbolton -m -g users mbolton
+ useradd -m -g users mbolton
  passwd mbolton
 
-Replace mbolton with whatever login you want. Don't forget to change
-/home/mbolton accordingly. You may also change the group (-g users).
-
-WARNING: The default /etc/login.defs from the shadow spell makes use of
-/etc/securetty to determine which devices root is allowed to login on, but does
-not provide /etc/securetty by default. To login as root on consoles, either
-turn this feature off in /etc/login.defs, or create /etc/securetty and list the
-devices you want (e.g. /dev/tty1).
+Replace mbolton with whatever login you want.
+You may also change the group (-g users).
 
 Finally, exit the chroot to return to the installer:
  exit
diff --git a/iso/usr/share/smgl.install/bashrc b/iso/usr/share/smgl.install/bashrc
index 9c28e18..492e891 100644
--- a/iso/usr/share/smgl.install/bashrc
+++ b/iso/usr/share/smgl.install/bashrc
@@ -8,10 +8,12 @@ INSTALLER_TMP=/tmp/smgl.install
 INSTALLER_STATUS=$INSTALLER_TMP/status
 INSTALLER_DATA=/usr/share/smgl.install
 INSTALLER_DOCS=/usr/share/doc/smgl.install
+OPT_SPELLS=/tmp/spells
 
 # This will race on startup, but it shouldn't harm anyone. I hope.
 mkdir -p $INSTALLER_TMP
 [[ -e $INSTALLER_STATUS ]] || echo 'init' >$INSTALLER_STATUS
+[[ -e $OPT_SPELLS ]] || cat $INSTALLER_DATA/spells > $OPT_SPELLS
 
 function header() {
   echo ""
@@ -69,7 +71,7 @@ function prev() {
 function num_current() {
   local CURSTEP
   CURSTEP=$(cat $INSTALLER_STATUS)
-  grep -n "$CURSTEP" $INSTALLER_DATA/steps | cut -d: -f1
+  grep -n "^$CURSTEP" $INSTALLER_DATA/steps | cut -d: -f1
 }
 
 function num_steps() {
diff --git a/iso/usr/share/smgl.install/smgl-chroot b/iso/usr/share/smgl.install/smgl-chroot
index 6744361..8639e79 100755
--- a/iso/usr/share/smgl.install/smgl-chroot
+++ b/iso/usr/share/smgl.install/smgl-chroot
@@ -2,7 +2,7 @@
 
 # Check if called with optional argument,
 # If yes then R00T=$1, else ROOT=/mnt/root
-ROOT=${"$1":-/mnt/root}
+ROOT="${1:-/mnt/root}"
 
 # Note: don't use --rbind: It creates several mounts, and we wouldn't be able
 # to figure out easily what to umount.
@@ -14,13 +14,11 @@ mount --bind /proc "$ROOT"/proc       &&
 export PS1="[inside chroot, type exit to return to installer]\n\u \w\$ " &&
 
 chroot "$ROOT" "$@"
-rc=$?
 
 # clean up the chroot mounts
 umount "$ROOT"/proc
 umount "$ROOT"/dev/pts
 umount "$ROOT"/dev
 
-exit $rc
 
 # vim:sw=2:ts=2:softtabstop=2:expandtab:ai
diff --git a/iso/usr/share/smgl.install/smgl-enchant b/iso/usr/share/smgl.install/smgl-enchant
index 5450100..f728aa5 100755
--- a/iso/usr/share/smgl.install/smgl-enchant
+++ b/iso/usr/share/smgl.install/smgl-enchant
@@ -12,6 +12,8 @@ command-line, you must give the full cache filename, and caches with
 an extension of .tar.bz2 are expected.
 
 Options:
+  -c  If specified, system.tar.bz2 will not be installed (cache only).
+
   -d  Path to target directory. Defaults to /mnt/root.
 
 	-h  Shows this help information
@@ -26,8 +28,6 @@ function die() {
 
 function generate_state() {
   local spell="$1"
-	local packages="$TARGET/var/state/sorcery/packages"
-	local depends="$TARGET/var/state/sorcery/depends"
 
   spell=${spell%-*}
   while ! grep -q $spell $TABLETS
@@ -49,9 +49,10 @@ function generate_state() {
   done
 }
 
-while getopts ":d:h" Option
+while getopts ":cd:h" Option
 do
   case $Option in
+    c ) NOSYS="yes" ;;
     d ) TARGET="$OPTARG" ;;
     h ) usage ;;
     * ) echo "Unrecognized option." >&2 && usage ;;
@@ -64,17 +65,25 @@ CACHE_LIST="${CACHE_LIST:-/tmp/spells}"
 TABLETS="${TABLETS:-/tmp/tablets}"
 TARGET="${TARGET:-/mnt/root}"
 
-. "$TARGET"/etc/sorcery/config ||
-  die "Couldn't source $TARGET/etc/sorcery/config"
-
-# generate a listing of all tablet directories if needed
-tablet="${tablet:-$TARGET/var/state/sorcery/tablet}"
-if [[ ! -f $TABLETS ]]
+if [[ ! $NOSYS == "yes" ]]
 then
-  echo "Gathering tablet information..."
-  find $tablet -maxdepth 1 -type d | sed 's#^.*/##' > $TABLETS
+  tar xjvf /system.tar.bz2 -C "$TARGET"
 fi
 
+. "$TARGET"/etc/sorcery/config &> /dev/null ||
+  die "Couldn't source $TARGET/etc/sorcery/config"
+
+. "$TARGET"/var/lib/sorcery/modules/libapi &> /dev/null ||
+  die "Couldn't source libapi"
+
+. "$TARGET"/var/lib/sorcery/modules/libmisc &> /dev/null ||
+  die "Couldn't source libmisc"
+
+. "$TARGET"/var/lib/sorcery/modules/libtablet &> /dev/null ||
+  die "Couldn't source libtablet"
+
+rm -f /tmp/smgl.install/enchant
+
 if [[ $# -ge 1 ]]
 then
   # for each cache file specified on the command line, process them one at a
@@ -85,8 +94,8 @@ then
     CACHE="$1"
     echo "Installing ${CACHE##*/} ..."
     tar jxf "$CACHE" -C "$TARGET"/ &&
-    generate_state "${CACHE##*/}" &&
     echo "${CACHE##*/} installed."
+    echo "${CACHE##*/}" >> /tmp/smgl.install/enchant
     shift
   done
 else
@@ -98,11 +107,27 @@ else
   do
     echo "Installing $cache ..."
     tar jxf $CACHE_DIR/$cache*.tar.bz2 -C "$TARGET"/ &&
-    generate_state $cache &&
     echo "$cache installed."
+    echo "${cache}" >> /tmp/smgl.install/enchant
   done
 fi
 
+sort -u -o /tmp/smgl.install/enchant /tmp/smgl.install/enchant
+
+# generate a listing of all tablet directories if needed
+tablet="${tablet:-$TARGET/var/state/sorcery/tablet}"
+packages="${packages:-$TARGET/var/state/sorcery/packages}"
+depends="${depends:-$TARGET/var/state/sorcery/depends}"
+echo "Gathering tablet information..."
+find $tablet -maxdepth 1 -type d | sed 's#^.*/##' > $TABLETS
+for spell in $(</tmp/smgl.install/enchant)
+do
+  spell=${spell##*/}
+  generate_state "$spell"
+done
+sort -u -o "$depends"
+sort -u -o "$packages"
+
 
 
 # vim:tabstop=2:softtabstop=2:shiftwidth=2:expandtab:ai
diff --git a/iso/usr/share/smgl.install/smgl-kernel b/iso/usr/share/smgl.install/smgl-kernel
index 7e85889..0ae360c 100755
--- a/iso/usr/share/smgl.install/smgl-kernel
+++ b/iso/usr/share/smgl.install/smgl-kernel
@@ -26,14 +26,17 @@ shift $(($OPTIND - 1))
 TARGET="${TARGET:-/mnt/root}"
 
 # Copy the kernel config
-cp -f /boot/config-$(uname -r) "$TARGET"/boot/config-$(uname -r)-SMGL-iso
+cp -f /boot/config-$(uname -r) "$TARGET"/boot/config-$(uname -r)
 
 # Copy the kernel image
-cp -f /boot/linux-$(uname -r) "$TARGET"/boot/vmlinuz-$(uname -r)-SMGL-iso
+cp -f /boot/linux "$TARGET"/boot/vmlinuz-$(uname -r)
 
 # Copy all kernel modules
 [[ -d "$TARGET"/lib/modules ]] || mkdir -p "$TARGET"/lib/modules
 cp -fr /lib/modules/$(uname -r) "$TARGET"/lib/modules/
 
+[[ ! -d "$TARGET"/etc/modprobe.d ]] && mkdir -p "$TARGET"/etc/modrobe.d
+cp -f /etc/modprobe.d/blacklist "$TARGET"/etc/modprobe.d/blacklist
+
 
 # vim:tabstop=2:softtabstop=2:shiftwidth=2:expandtab:ai
diff --git a/iso/usr/share/smgl.install/smgl-spellcaster b/iso/usr/share/smgl.install/smgl-spellcaster
deleted file mode 100755
index 6c8c726..0000000
--- a/iso/usr/share/smgl.install/smgl-spellcaster
+++ /dev/null
@@ -1,140 +0,0 @@
-#!/bin/bash
-
-PREFIX=/var/cache/sorcery
-EXTENSION="*.tar.bz2"
-CACHES=
-SELECTED=
-NUM_CACHES=
-
-function usage() {
-  cat <<USAGE
-$(basename $0)
-Generates a listing of cache files available to install.
-
-USAGE
-}
-
-function prompt() {
-  local input=
-
-  echo ""
-  printf "\tPlease enter a number (0 when finished):  "
-  while [[ -z $input ]]
-  do
-    read input
-    if [[ -n $input ]]
-    then
-      # fancy way to make sure that we have the correct input
-      # if the user passes 1-12, that will be evaluated mathematically fist,
-      # yielding -11, which fals outside the range of allowable input
-      # this may be changed later, but currently we only support entering one
-      # value at a time
-      if [[ $(echo $((input)) ) -lt 0 || $(echo $((input)) ) -gt $NUM_CACHES ]]
-      then
-        echo "Error: You must enter a number corresponding to one"
-        echo "of the choices in the list."
-        input=
-      fi
-    fi
-  done
-  return $input
-}
-
-function make_list {
-  # get a list of all the caches available and get the spell names from them,
-  # sorted and uniq'ed
-  CACHES=( $(find $PREFIX/ -maxdepth 1 -type f -name "$EXTENSION" | sed 's#.*/##' | sed 's/-[0-9].*//' | sort | uniq) )
-  NUM_CACHES=${#CACHES[*]}
-
-  # for each cache available, check to see if it was already selected before
-  # and mark it as selected if found
-  for ((i=0; i < $NUM_CACHES; i++))
-  do
-    grep -s -q "^${CACHES[i]}$" /tmp/spells && SELECTED[i]="*"
-  done
-}
-
-function print_list {
-  echo ""
-  for ((i=0; i < $NUM_CACHES; i++))
-  do
-    printf "[%2d] %s %s\n" "$(($i + 1))" "${SELECTED[i]:- }" "${CACHES[i]}"
-  done | column | more
-}
-
-function main {
-  local choice=-1
-
-  # generate the list of spells to choose from by scanning the contents of
-  # /var/caches/sorcery on the ISO
-  echo "Generating cache list, please be patient..."
-  make_list
-
-  # present the menu and prompt for user input, until the user enters 0 to
-  # finish
-  while [[ $choice -ne 0 ]]
-  do
-    print_list
-    prompt
-    choice="$?"
-    [[ $choice -gt 0 ]] && SELECTED[$((choice-1))]="*"
-  done
-
-  # for each selected spell, output it to the spell listing file
-  for (( i=0; i < $NUM_CACHES; i++ ))
-  do
-    if [[ ${SELECTED[i]} = '*' ]]
-    then
-      echo ${CACHES[i]} >> /tmp/spells
-    fi
-  done
-
-  # make sure we don't have duplicates
-  sort /tmp/spells | uniq > /tmp/spells
-
-  # copy the selected list so that it's available inside the chroot
-  cp -f /tmp/spells "$TARGET"/spells
-
-  # mount bind to get to the caches from inside the chroot
-  # this is cheaper than copying, plus the user doesn't have a bunch of
-  # "useless" cache files on their system since presumably they will be
-  # changing both compile options (like arch) and spell version when they
-  # update their grimoires
-  mount --bind /var/cache/sorcery "$TARGET"/var/cache/sorcery
-
-  # cast inside the chroot using the selected list and ISO caches
-  chroot "$TARGET" /usr/sbin/cast $(< /spells)
-
-  # clean up
-  umount "$TARGET"/var/cache/sorcery
-  rm "$TARGET"/spells
-}
-
-function message() {
-  echo ""
-  cat <<-Message
-    Spell selection menu.
-    You may select any number of the following spells to install. Some of them may
-    be necessary, depending on how you have set up your installation. For example,
-    if you formatted your disk with xfs, then you will need xfsprogs. Also, you
-    will need at least one bootloader installed (e.g. lilo, grub, etc.).
-
-    When you are satisfied with your selections, enter 0 (zero) and the list of
-    spells to cast will be compiled. Sorcery will then ask you if the list of
-    spells is correct and if you would like to cast them, as it normally does when
-    casting.
-
-Message
-}
-
-[[ $# -lt 1 ]] && TARGET="/mnt/root"
-TARGET=$1
-
-message
-
-main
-#clear
-
-
-
-# vim:tabstop=2:softtabstop=2:shiftwidth=2:expandtab:ai
diff --git a/iso/usr/share/smgl.install/smgl-spells b/iso/usr/share/smgl.install/smgl-spells
new file mode 100755
index 0000000..c11017a
--- /dev/null
+++ b/iso/usr/share/smgl.install/smgl-spells
@@ -0,0 +1,178 @@
+#!/bin/bash
+
+PREFIX=/var/cache/sorcery
+EXTENSION="*.tar.bz2"
+CACHES=
+SELECTED=
+NUM_CACHES=
+
+function usage() {
+  cat <<USAGE
+$(basename $0)
+Generates a listing of cache files available to install.
+
+USAGE
+}
+
+function make_list {
+  # get a list of all the caches available and get the spell names from them,
+  # sorted and uniq'ed
+  if [[ ! -e /tmp/caches ]]
+  then
+    find $PREFIX/ -maxdepth 1 -type f -name "$EXTENSION" |
+    sed 's#.*/##' |
+    sed 's#-[0-9].*$##' |
+    sort |
+    uniq > /tmp/caches
+  fi
+  CACHES=( $(</tmp/caches) )
+  NUM_CACHES=${#CACHES[*]}
+
+  # for each cache available, check to see if it was already selected before
+  # and mark it as selected if found
+  if [[ -e /tmp/spells ]]
+  then
+    for ((i=0; i < $NUM_CACHES; i++))
+    do
+      grep -s -q "^${CACHES[i]}$" /tmp/spells &&
+      SELECTED[i]="*"
+    done
+  fi
+}
+
+function print_list {
+  echo ""
+  for ((i=0; i < $NUM_CACHES; i++))
+  do
+    printf "[%2d] %s %s\n" "$(($i + 1))" "${SELECTED[i]:- }" "${CACHES[i]}"
+  done | column | less -F -J
+}
+
+function toggle_choice {
+  local choice="$1"
+  if [[ $choice -gt 0 ]]
+  then
+    choice=$((choice-1))
+    # if the choice was not previously selected, select it, otherwise
+    # deselect it (toggle)
+    if [[ SELECTED[choice] == '*' ]]
+    then
+      SELECTED[choice]=
+    else
+      SELECTED[choice]="*"
+    fi
+  fi
+}
+
+function prompt() {
+  local choice=
+  local input=
+
+  echo ""
+  echo -n "Please make a selection (a for all, n for none, 0 when finished):  "
+  read input
+  if $(echo "$input" | grep -q '\*')
+  then
+    echo "$input" >&2
+    input=$(echo "$input" | sed 's/\*//g')
+    echo "New:" >&2
+    echo "$input" >&2
+  fi
+  for choice in $input
+  do
+    # if the user entered 0, we're done here
+    [[ $choice == "0" ]] && break 2
+
+    # if 'a', we want everything
+    if [[ $choice == "a" ]]
+    then
+      for ((i=0; i < $NUM_CACHES; i++))
+      do
+        SELECTED[$i]="*"
+      done
+      continue
+    fi
+
+    # if 'n', we want none
+    if [[ $choice == "n" ]]
+    then
+      echo "none" >&2
+      for ((i=0; i < $NUM_CACHES; i++))
+      do
+        SELECTED[i]=
+      done
+      continue
+    fi
+
+    # ignore anything that doesn't consist of numbers or '-'
+    if $(echo $choice | grep -q -v '^\([0-9]\+-\?[0-9]*\)\|[*]$')
+    then
+      echo "Error: You must enter only numbers or ranges like 4-8, or "all"" >&2
+      continue
+    fi
+
+    # if the user passed something like 5-12, process the sequence
+    if $(echo $choice | grep -q '-')
+    then
+      for num in $(seq $(echo $choice | cut -d- -f1-2 --output-delimiter=' '))
+      do
+        toggle_choice $num
+      done
+    else
+      toggle_choice $choice
+    fi
+  done
+}
+
+function main {
+  # generate the list of spells to choose from by scanning the contents of
+  # /var/caches/sorcery on the ISO
+  echo "Populating internal cache list, please be patient..."
+  make_list
+
+  # present the menu and prompt for user input, until the user enters 0 to
+  # finish
+  while true
+  do
+    print_list
+    prompt
+  done
+
+  # for each selected spell, output it to the spell listing file
+  for (( i=0; i < $NUM_CACHES; i++ ))
+  do
+    if [[ ${SELECTED[i]} = "*" ]]
+    then
+      echo ${CACHES[i]} >> /tmp/spells
+    fi
+  done
+
+  # make sure we don't have duplicates
+  [[ -e /tmp/spells ]] && sort -u -o /tmp/spells /tmp/spells
+}
+
+function message() {
+  echo ""
+  cat <<-"Message"
+    Spell selection menu.
+    You may select any number of the following spells to install. Some of them
+    may be necessary, depending on how you have set up your installation. For
+    example, if you formatted your disk with xfs, then you will need xfsprogs.
+    Also, you will need at least one bootloader installed (e.g. lilo, grub,
+    etc.).
+
+    The output is piped through less, so if there are too many caches to
+    fit on one screen you will be able to scroll. When you are satisfied with
+    your selections, enter 0 (zero) and the list of spells to cast will be
+    installed.
+Message
+}
+
+message
+
+main
+#clear
+
+
+
+# vim:tabstop=2:softtabstop=2:shiftwidth=2:expandtab:ai
diff --git a/iso/usr/share/smgl.install/spells b/iso/usr/share/smgl.install/spells
new file mode 100644
index 0000000..22cc2ba
--- /dev/null
+++ b/iso/usr/share/smgl.install/spells
@@ -0,0 +1,26 @@
+autoconf
+automake
+bin86
+bison
+dhcpcd
+e2fsprogs
+elvis
+flex
+g++
+groff
+hdparm
+less
+lilo
+lynx
+m4
+man
+openssl
+pciutils
+perl
+slang
+sysfsutils
+tcp_wrappers
+texinfo
+which
+usbutils
+udev
diff --git a/scripts/cleaniso.sh b/scripts/cleaniso.sh
index 769ee27..0ec4b53 100755
--- a/scripts/cleaniso.sh
+++ b/scripts/cleaniso.sh
@@ -100,13 +100,25 @@ do
 			then
 				# chroot and clean a directory using rmdir
 				echo "Attempting to remove directory $ISOCHROOT/$DIRT"
-				chroot "$ISOCHROOT" rmdir --ignore-fail-on-non-empty "$DIRT"
+				chroot "$ISOCHROOT" /bin/rmdir --ignore-fail-on-non-empty "$DIRT"
 			else
 				# chroot and clean an individual file
 				echo "Attempting to delete $ISOCHROOT/$DIRT"
-				chroot "$ISOCHROOT" rm -f "$DIRT"
+				chroot "$ISOCHROOT" /bin/rm -f "$DIRT"
 			fi
 		fi
 	done
 done
 
+echo "Removing $ISOCHROOT/usr/include"
+chroot /bin/rm -fr "$ISOCHROOT/usr/include"
+
+echo "Removing $ISOCHROOT/usr/share/doc"
+chroot /bin/rm -fr "$ISOCHROOT/usr/share/doc"
+
+echo "Removing $ISOCHROOT/var/log/sorcery"
+chroot /bin/rm -fr "$ISOCHROOT/var/log/sorcery"
+
+echo "Removing $ISOCHROOT/var/state/sorcery"
+chroot /bin/rm -fr "$ISOCHROOT/var/state/sorcery"
+
diff --git a/scripts/mkrelease.sh b/scripts/mkrelease.sh
index be14c01..1671c29 100755
--- a/scripts/mkrelease.sh
+++ b/scripts/mkrelease.sh
@@ -1,5 +1,7 @@
 #!/bin/bash
 
+MYDIR="$(dirname $0)"
+
 TARGET=$1
 VERSION=$2
 
@@ -72,8 +74,15 @@ do
 done
 
 # Replace the GRIMOIRE_VERSION placeholder (currently only in isolinux.msg).
-sed -i "s/@GRIMOIRE_VERSION@/$GRIMOIRE_VER/" "$TARGET"/isolinux/isolinux.msg
+half1=$(echo $GRIMOIRE_VER | cut -d- -f1)
+half2=$(echo $GRIMOIRE_VER | cut -d- -f2)
+sed -i "s/@GRIMOIRE_VERSION@/${half1}-${half2}/" "$TARGET"/isolinux/isolinux.msg
 
 # Generate the release ISO. Currently we force KEEP and COMPRESSION.
-$(dirname $0)/mkiso.sh "$ISOCHOWN $CHOWNSTR" -kz "$TARGET" "smgl-$VERSION"
+if [[ -n $ISOCHOWN ]]
+then
+	"$MYDIR"/mkiso.sh "$ISOCHOWN $CHOWNSTR" -kz "$TARGET" "smgl-$VERSION"
+else
+	"$MYDIR"/mkiso.sh -kz "$TARGET" "smgl-$VERSION"
+fi
 
diff --git a/scripts/spellcaster.sh b/scripts/spellcaster.sh
index eb962ee..092552b 100755
--- a/scripts/spellcaster.sh
+++ b/scripts/spellcaster.sh
@@ -276,9 +276,13 @@ function setup_sys() {
 	local SPOOL="$TARGET/tmp"
 	local SORCERY="sorcery-stable.tar.bz2"
 	local SORCERYDIR="$TARGET/usr/src/sorcery"
+
 	local gvers=$(head -n1 "$TARGET"/var/lib/sorcery/codex/stable/VERSION)
 	local stable="stable-${gvers%-*}.tar.bz2"
 	local syscodex="$SYSDIR/var/lib/sorcery/codex"
+	local grimoire='GRIMOIRE_DIR[0]=/var/lib/sorcery/codex/stable'
+	local index="$SYSDIR/etc/sorcery/local/grimoire"
+
 	local tablet="$SYSDIR/var/state/sorcery/tablet"
 	local packages="$SYSDIR/var/state/sorcery/packages"
 	local depends="$SYSDIR/var/state/sorcery/depends"
@@ -310,6 +314,8 @@ function setup_sys() {
 	[[ -d "$syscodex" ]] || mkdir -p $syscodex &&
 	tar jxf "$SPOOL"/$stable -C "$syscodex"/ &&
 	mv "$syscodex"/${stable%.tar.bz2} "$syscodex"/stable
+	echo "$grimoire" > "$index"
+	"$MYDIR"/cauldronchr.sh -d "$SYSDIR" /usr/sbin/scribe reindex
 
 	# generate the depends and packages info for sorcery to use
 	rm -f "$depends" "$packages"
@@ -324,6 +330,8 @@ function setup_sys() {
 			echo "${spell##*/}:${date##*/}:$stat:$ver" >> "$packages"
 			cat "$dep" >> "$depends"
 		done
+		sort -u -o "$depends" "$depends"
+		sort -u -o "$packages" "$packages"
 	done
 
 	# populate /dev with static device nodes



More information about the SM-Commit mailing list