Skip to Content.
Sympa Menu

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

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 (5b6aa97f6f3f96683e78a8a9f03e0109dad13a5c)
  • Date: Mon, 29 Dec 2008 14:04:58 -0600

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

data/README.spells | 30 +
data/ispells.x86 | 82 +++++
data/ospells.x86 | 44 --
data/rspells.x86 | 21 -
iso/usr/share/doc/smgl.install/help/index | 1
iso/usr/share/doc/smgl.install/steps/boot-loader | 19 -
iso/usr/share/doc/smgl.install/steps/compile-kernel | 7
iso/usr/share/doc/smgl.install/steps/install | 23 +
iso/usr/share/doc/smgl.install/steps/iso-kernel | 13
iso/usr/share/doc/smgl.install/steps/kernel | 12
iso/usr/share/doc/smgl.install/steps/select-spells | 22 +
iso/usr/share/smgl.install/bashrc | 3
iso/usr/share/smgl.install/order | 16 -
iso/usr/share/smgl.install/steps | 10
scripts/add-sauce.sh | 4
scripts/cauldronchr.sh | 6
scripts/cleaniso.sh | 4
scripts/mkinitrd.sh | 4
scripts/mkiso.sh | 4
scripts/mkrelease.sh | 4
scripts/mksystem.sh | 4
scripts/purify.sh | 4
scripts/spellcaster.sh | 319
++++++++++++++------
23 files changed, 463 insertions(+), 193 deletions(-)

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

scripts/spellcaster.sh: swap options, priv_check

We need to do priv_check before parse_options because sudo will wipe out
the env vars set by parse_options.

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

scripts/spellcaster: del extra '\'

Had a leftover '\' to continue the rm line in clean_target.

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

scripts/spellcaster.sh: clean correct build script

Forgot to update which build scripts get removed by clean_target.

commit 4e69a2498e5584ebc9ec15a17bb10423261ed010
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

scripts/spellcaster.sh: reimplement chroot builds

Reimplemented the chroot building process. It is now cleaner, better
optimized, and more debug-friendly.

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

scripts/spellcaster.sh: drop source $config output

Don't output any messages from trying to source
$TARGET/etc/sorcery/local/config, just source it and use it if
available.

commit 1195526c60777629daa14951a06831b732c48112
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

scripts/spellcaster.sh: directory_check func

Moved the directory testing and creation code out to a function. This
makes the code cleaner and easier to read, and easier to add new
directories to test/create.

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

scripts/*: fix sudo evocation

The sudo call will now verifiably work.

commit 2743a8f11e8de54cf18420004ccbaaf567993899
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

scripts/cauldronchr.sh: fix description text

The usage description stated that the script defaulted to running
/bin/bash -l as the chroot command. This used to be the case, but was
changed a while ago, and the usage text wasn't updated accordingly. This
commit fixes the usage text to accurately describe the script behavior
(default to /bin/bash).

commit 80d8551b5311d3f2701df6467afb2c447ba04a9a
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

scripts/spellcaster.sh: shift by OPTIND

The argument shifting was previously happening internal to the
parse_options function, so it wasn't getting passed back up to the
caller. This corrects this by returning the number of arguments to shift
by and letting the caller do the shifting.

commit 177947b7ea59a88c779096a4b33f4b36f7891a96
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

scripts/spellcaster.sh: need $* for getopts

Needed to pass $* (or $@) as an argument to parse_options or getopts
wouldn't receive the original command-line.

commit 7576d80564d441d040a71aa828ebd1de9f98928c
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

scripts/spellcaster.sh: forgot ':' for options

The -i and -s flags take arguments, but I forgot the ':' following 'i'
and 's' in the getopts parse string.

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

scripts/spellcaster.sh: spell installed test

Test to see whether a spell was really installed before writing the
spell info to the listing file.

commit 67cd9b9019409163394d329feac26d3e3b29f010
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

scripts/spellcaster.sh: mkdir var/cache/sorcery

Ensure that the var/cache/sorcery path is available inside both ISODIR
and SYSDIR.

commit 3f6acdf71ad54ae76ddb880560d264197257f8e6
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

scripts/spellcaster.sh: fix parse options

Forgot to update the parse options from :cdh to :ish when the accepted
options were changed.

commit 422dce954c8760b5625503369ffda7645337e705
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

scripts/spellcaster.sh: forgot {} grouping

Added {} grouping for the tests so that they would behave as intended.

commit 68e977af80e9499336c0b48d8dc8f6e6c18c18c2
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

scripts/spellcaster.sh: typo, extraneous 'if'

Removed an extra 'if' that snuck in.

commit 0518c30fde8f4f46c516c3b7dd76ff5709582b0c
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

scripts/spellcaster.sh: echo error messages

Echo error messages before exiting the script if there are problems with
the target/iso/sys directories.

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

scripts/spellcaster.sh: fix cleanup procedure

The cleanup code wasn't referencing the TARGET directory for the kernel
config file to remove, but instead was based on $CWD. The code was
also failing to remove some files that it should have been removing.

commit 2b44e21be0f5062d5a3c78721c218e41908dd2bf
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

scripts/spellcaster.sh: remove trailing '/'

Remove the trailing '/' from directory variables if present. This may
not be essential, but is more correct.

commit 2ae80fb2b3ee94ba70f82850c8ac54e69c09ee76
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

scripts/spellcaster.sh: create missing dirs

If the ISO or SYS dirs don't exist, create them before attempting to do
anything with them. Also, exit with error if TARGET isn't a valid
directory.

commit 7a49eb16b18915165259fb1c705c429eca137bfe
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

scripts/spellcaster.sh: copy resolv.conf for wgets

Copy the host resolv.conf to the target so that sorcery can wget sources
for spell building inside the target.

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

scripts/spellcaster.sh: print newline after read

Print a newline after reading user input so that we don't clutter the
screen.

commit 2e286c9bd5ee05897950b63ca8f66978c2de3b0f
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

implemented optional spell installation steps

The steps for doing optional spell installation have been implemented.
The alchemy script for presenting a selection menu of the caches
available for installation is almost done, and the enchant script will
be implemented soon after.

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

Change jump {lilo,grub} to todo {lilo,grub}

Implemented argument parsing for the todo command so that it can print
the step info for arbitrary steps in addition to the current step. Also
modified the step listing files and boot-loader step information to make
use of this feature. This is cleaner than jumping to different steps.

commit 60d7e37a3b38a0ddfcf0da7958031fe0578eb72a
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

scripts/spellcaster.sh: fix var substitution

Accidentally had ${$VAR:-foo} instead of ${VAR:-foo} for $SYSDIR and
$ISODIR.

commit 2d242bec8829e67b794756294d091a7e30db965e
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

steps/compile-kernel: added missing 'step'

The 'step' keyword was missing in the title line. Also simplified the
language explaining the step.

commit 2515c56046a9f8fbda78dfe4d8898644923c68fd
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

data/{io}spells.x86: removed duplicates

Accidentally had some leftover duplicates from the change in the listing
scheme.

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

scripts/spellcaster.sh: fixes

Fixed script handling of sorcery config variables and return values/exit
code usage. Also added a missing chmod.

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

scripts/spellcaster.sh: big overhaul

This script got a big overhaul. Most of the functionality the script was
providing has put into proper functions. This makes the code more
separable and easier to read. The script also supports optional spell
installation methods. Also, the script will no longer attempt to set up
everything "in-house", but will rather create spell caches in the build
directory and then copy/unpack those caches to separate directories
(system and iso) accordingly. This is a much cleaner method of
generation.

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

data/tspells.x86 -> data/ospells.x86

Renamed tspells to ospells. I originally planned to use the tspells file
differently than it is being used, so I named it after "target". Now it
is named after "optional" because it makes more sense for how it's
actually used.

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

Properly separate spell listings

Updated the spell listing files to really be separate. This allows for
cleaner setups of the individual components. As a result, the only
interdependency is that tspells expects the caches of spells in ispells
to also be present, so the list of all available caches on a given ISO
will be caches(ispells) + caches(tspells).

commit 322d940b564c722c3f6394e0080cacc5ba338a66
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

data/README.spells: new, explains spell listings

Documents the contents of the different spell listing files and the
reasoning behind those contents.

commit 3389348cccb2e521757dd9350ee16db7726d9029
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

data/tspells.x86: new, spells only for opt install

This is a listing of those spells that are _only_ for optional install.
In other words, they should only exist as cache files on the ISO, and
not be installed either into system.tar.bz2 or onto the ISO runtime
filesystem.

commit 52d5fa4001b4510ef4b6efe28b077bfb4a9a3bf9
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

data/ispells.x86: updated for missing spells

Updated ispells.x86 to contain some useful/needed spells that were
missing.

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

data/rspells.x86: added glibc hard dependencies

Added libtool and libidn, which are hard dependencies for stable glibc
and therefore required for a functioning system.

commit 2e9a3d89220ecfdf305f31ce17ec3effe97fad71
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

data/ospells.x86: renamed to ispells.x86

The listing in ospells is really all of the spells that are in addition
to the system.tar.bz2 spells, and this includes what is needed for the
ISO to function as well as real "optional" spells. Therefore, this was
renamed to more accurately reflect the fact that these spells are needed
on the ISO as opposed to the system.

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

data/rspells.x86: cleaned out irrelevant spells

Removed any spells that didn't really belong in the list. This will be
used to build a bare minimal system.tar.bz2, so the list should be as
minimal as possible.

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

scripts/spellcaster.sh: formatting and comments

Reformmatted to fit better inside 80 chars and added comments to
describe what the script is doing.

commit 8e4af98a25d5aeccf43f4ce22a08e720fd59d407
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

scripts/spellcaster.sh: rm extra $()

Removed the $() from surrounding the grep call, as this was unnecessary
and spurious.

commit 1f467cb870d0f41f30b00187dd4a88f64f619804
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

scripts/spellcaster.sh: fix dispel path

Fixed typo dispel path /usr/bin/dispel -> /usr/sbin/dispel.

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/data/README.spells b/data/README.spells
new file mode 100644
index 0000000..55c9858
--- /dev/null
+++ b/data/README.spells
@@ -0,0 +1,30 @@
+spell listings:
+ rspells.* spells that should be in system.tar.bz2
+ ispells.* spells that are needed on the ISO or for optional install
+ ospells.* spells that should only exist as caches (not actually be
+ "installed" in either system.tar.bz2 or the ISO
runtime
+ environment)
+
+system.tar.bz2 consists entirely (and only) of those spells explicitly listed
+in rspells.*
+
+ system.tar.bz2 = rspells
+
+The ISO runtime environment/filesystem will consist of those spells listed in
+ispells.*, but with the spells in ospells.* dispelled so that only their
caches
+remain for installation.
+
+ ISO = ispells + ospells(caches)
+
+Anything which is meant _only_ for optional installation to the target system
+should be listed in ospells.*
+
+The listing in spells.x86 is the older leftover listing from before optional
+spells were re-implemented, and serves as a reference point for the newer
spell
+listing files. It contains some cruft due to some of the spells listed in it
+having been obsoleted, and a few were left over as unweeded dependencies.
These
+dependencies should have been weeded out in the newer listing files (i.e.,
+{rit}spells.x86), but it's possible there are still some "bugs" in this
+respect. This is why spells.x86 is being kept as a reference file, so that
any
+spell/dependency bugs that crop up can be compared with known working ISO
spell
+listings.
diff --git a/data/ispells.x86 b/data/ispells.x86
new file mode 100644
index 0000000..a28d7b2
--- /dev/null
+++ b/data/ispells.x86
@@ -0,0 +1,82 @@
+bash
+bzip2
+coreutils
+cpio
+device-mapper
+dhcpcd
+dialog
+e2fsprogs
+ed
+eject
+elvis
+file
+findutils
+g++
+gawk
+gcc
+gettext
+glibc
+gnupg
+gpm
+grep
+groff
+gzip
+hdparm
+iana-etc
+init.d
+ifupdown
+kbd
+jed
+jfsutils
+less
+libaal
+libidn
+libpcap
+libtool
+locale
+lsscsi
+lvm
+lynx
+madwifi
+man
+mdadm
+memtest86+
+module-init-tools
+nano
+ncurses
+net-tools
+ndiswrapper
+nfs-utils
+ntfsprogs
+openssl
+parted
+pciutils
+pcmciautils
+portmap
+ppp
+procps
+readline
+reiser4progs
+reiserfsprogs
+rp-pppoe
+rpmunpack
+run-parts
+sed
+shadow
+simpleinit-msb
+slang
+smgl-fhs
+sysfsutils
+tar
+tcp_wrappers
+texinfo
+udev
+unzip
+usbutils
+util-linux
+uudeview
+wget
+which
+wireless_tools
+xfsprogs
+zlib
diff --git a/data/ospells.x86 b/data/ospells.x86
index 01e9636..7e11cf2 100644
--- a/data/ospells.x86
+++ b/data/ospells.x86
@@ -1,39 +1,9 @@
-device-mapper
-dhcpcd
-e2fsprogs
-ed
-eject
-elvis
-g++
-gpm
+autoconf
+automake
+bin86
+bison
+flex
grub
-hdparm
-ifupdown
-jed
-jfsutils
-libaal
lilo
-lsscsi
-lvm
-lynx
-madwifi
-mdadm
-memtest86+
-ndiswrapper
-nfs-utils
-ntfsprogs
-openssl
-parted
-pciutils
-pcmciautils
-ppp
-reiser4progs
-reiserfsprogs
-rp-pppoe
-rpmunpack
-sysfsutils
-tcp_wrappers
-udev
-usbutils
-wireless_tools
-xfsprogs
+m4
+perl
diff --git a/data/rspells.x86 b/data/rspells.x86
index f39987d..07b8124 100644
--- a/data/rspells.x86
+++ b/data/rspells.x86
@@ -1,10 +1,5 @@
-autoconf
-automake
-basesystem
bash
-bin86
binutils
-bison
bzip2
coreutils
cpio
@@ -12,52 +7,38 @@ dialog
diffutils
file
findutils
-flex
gawk
gcc
gettext
glibc
gnupg
grep
-groff
gzip
iana-etc
init.d
+ifupdown
installwatch
kbd
-less
libidn
-libpcap
libtool
locale
-m4
make
-man
module-init-tools
nano
ncurses
net-tools
-netkit-base
-netkit-ping
patch
-perl
-popt
-portmap
procps
readline
run-parts
sed
shadow
simpleinit-msb
-slang
smgl-archspecs
smgl-fhs
sorcery-pubkeys
tar
-texinfo
unzip
util-linux
-uudeview
wget
-which
zlib
diff --git a/iso/usr/share/doc/smgl.install/help/index
b/iso/usr/share/doc/smgl.install/help/index
index da822ba..4beaa93 100644
--- a/iso/usr/share/doc/smgl.install/help/index
+++ b/iso/usr/share/doc/smgl.install/help/index
@@ -6,4 +6,5 @@ next go to the next step
prev return to the previous step in the list
steps print a listing of all possible steps
todo show what needs to be done for the current step
+todo <step> show what needs to be done for <step>
welcome show some help information (seen at the welcome
screen)
diff --git a/iso/usr/share/doc/smgl.install/steps/boot-loader
b/iso/usr/share/doc/smgl.install/steps/boot-loader
index 4112cb9..f6ee7f1 100644
--- a/iso/usr/share/doc/smgl.install/steps/boot-loader
+++ b/iso/usr/share/doc/smgl.install/steps/boot-loader
@@ -1,15 +1,18 @@
boot-loader step
-Now it is time to select a boot-loader. Since this is the x86 ISO, you can
-choose either grub or lilo. Both are included in the basesystem you copied
-over to /mnt/root in the copy-base step. Since grub seems to be more popular
-than lilo these days, the installer defaults to grub. Use whichever you
please,
-but only use one of them.
+Now it is time to set up a boot loader. Since this is the x86 ISO, you can
+set up either grub or lilo. Use whichever you please, but only use one of
them.
+It is assumed that whichever boot loader you will set up here was selected
and
+installed during the select-spells and install steps.

-Once you have decided which boot loader to use, you need to configure the
+Once you have decided which boot loader to set up, you need to configure the
boot loader. After you finish configuring your boot loader, you need to
"install" it. This involves running the boot loader, which will install
itself
to the location you specified in the config file.

-For lilo instructions, type jump lilo.
+For lilo instructions, type todo lilo.

-For grub instructions, just type next.
+For grub instructions, type todo grub.
+
+To see the instructions for this step again, just type todo.
+
+When you are finished, type next.
diff --git a/iso/usr/share/doc/smgl.install/steps/compile-kernel
b/iso/usr/share/doc/smgl.install/steps/compile-kernel
index 1fa08eb..008660f 100644
--- a/iso/usr/share/doc/smgl.install/steps/compile-kernel
+++ b/iso/usr/share/doc/smgl.install/steps/compile-kernel
@@ -1,7 +1,6 @@
-compile-kernel
-This step is optional but recommended. You may now set up a custom kernel for
-your installation. You can either do this by casting the spell or
-compiling and installing manually.
+compile-kernel step
+You may now set up a custom kernel for your installation by casting the linux
+spell or compiling and installing manually.

chroot into your system:
 smgl-chroot
diff --git a/iso/usr/share/doc/smgl.install/steps/install
b/iso/usr/share/doc/smgl.install/steps/install
new file mode 100644
index 0000000..4f2f895
--- /dev/null
+++ b/iso/usr/share/doc/smgl.install/steps/install
@@ -0,0 +1,23 @@
+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.
+
+manual method:
+ tar xjvf /system.tar.bz2 -C /mnt/root
+ cd /var/cache/sorcery
+ tar jxf SPELL -C /mnt/root 
+
+Remember to replace "SPELL" with the filename of the spell cache to install.
As
+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
+
+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
+directory, without the tedium of typing in the tar line as given in the
"manual
+method" section. See  enchant [-h|--help] for more information.
+
+When the step finishes type next.
diff --git a/iso/usr/share/doc/smgl.install/steps/iso-kernel
b/iso/usr/share/doc/smgl.install/steps/iso-kernel
new file mode 100644
index 0000000..823b773
--- /dev/null
+++ b/iso/usr/share/doc/smgl.install/steps/iso-kernel
@@ -0,0 +1,13 @@
+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.
+
+copy the kernel itself:
+ cp /boot/{config,System.map}* /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
+
+Type next to go to the next step.
diff --git a/iso/usr/share/doc/smgl.install/steps/kernel
b/iso/usr/share/doc/smgl.install/steps/kernel
new file mode 100644
index 0000000..895941f
--- /dev/null
+++ b/iso/usr/share/doc/smgl.install/steps/kernel
@@ -0,0 +1,12 @@
+kernel
+You can install the ISO kernel (fast and easy), set up a custom kernel
+(recommended), or both (best of both worlds). Whatever you choose, you must
+install at least one kernel.
+
+For instructions on how to install the ISO kernel, type todo
iso-kernel.
+
+For instructions on how to install a custom kernel, type todo
compile-kernel.
+
+To see the instructions for this step again, just type todo.
+
+When you are finished, type next.
diff --git a/iso/usr/share/doc/smgl.install/steps/select-spells
b/iso/usr/share/doc/smgl.install/steps/select-spells
new file mode 100644
index 0000000..b4486ed
--- /dev/null
+++ b/iso/usr/share/doc/smgl.install/steps/select-spells
@@ -0,0 +1,22 @@
+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.
+
+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
+
+manual:
+ $EDITOR /tmp/opt-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.
+
+When you are finished selecting your spells, type next.
diff --git a/iso/usr/share/smgl.install/bashrc
b/iso/usr/share/smgl.install/bashrc
index 87dde6e..9c28e18 100644
--- a/iso/usr/share/smgl.install/bashrc
+++ b/iso/usr/share/smgl.install/bashrc
@@ -20,8 +20,7 @@ function header() {
}

function todo() {
- local CURSTEP
- CURSTEP=$(cat $INSTALLER_STATUS)
+ local CURSTEP="${1:-$(cat $INSTALLER_STATUS)}"
header
cat $INSTALLER_DOCS/steps/$CURSTEP
}
diff --git a/iso/usr/share/smgl.install/order
b/iso/usr/share/smgl.install/order
index 34c09bb..2ea7405 100644
--- a/iso/usr/share/smgl.install/order
+++ b/iso/usr/share/smgl.install/order
@@ -1,16 +1,12 @@
init:disk-partition
disk-partition:disk-format
disk-format:disk-mount
-disk-mount:copy-base
-copy-base:edit-confs
-edit-confs:compile-kernel
-compile-kernel:boot-loader
-boot-loader:grub
-boot-loader:lilo
-grub:install-opt-spells
-lilo:install-opt-spells
-boot-loader:install-opt-spells
-install-opt-spells:user-setup
+disk-mount:select-spells
+select-spells:install
+install:edit-confs
+edit-confs:kernel
+kernel:boot-loader
+boot-loader:user-setup
user-setup:reboot
reboot:reboot
error:init
diff --git a/iso/usr/share/smgl.install/steps
b/iso/usr/share/smgl.install/steps
index 8c78064..44cb6f9 100644
--- a/iso/usr/share/smgl.install/steps
+++ b/iso/usr/share/smgl.install/steps
@@ -2,12 +2,10 @@ init - start of the install
disk-partition - creating partitions
disk-format - creating filesystems
disk-mount - mounting filesystems at appropriate mount-points
-copy-base - copying basesystem and basic /etc files
+select-spells - choose the spells to install
+install - install the spells and base system
edit-confs - editing the basic configuration files
-compile-kernel - compile a custom kernel
-boot-loader - installing and setting up a boot manager
-lilo - do this step to set up lilo
-grub - do this step to set up grub
-install-opt-spells - installing other spells you may need
+kernel - install ISO kernel and/or compile a custom kernel
+boot-loader - install and set up a boot manager
user-setup - set root password, create regular users
reboot - reboot into the new system
diff --git a/scripts/add-sauce.sh b/scripts/add-sauce.sh
index edfc35d..e8851eb 100755
--- a/scripts/add-sauce.sh
+++ b/scripts/add-sauce.sh
@@ -51,9 +51,9 @@ SELF="$0"

if [[ $UID -ne 0 ]]
then
- if [[ -x $(which sudo > /dev/null 2>&1) ]]
+ if [[ -x $(which sudo 2> /dev/null) ]]
then
- exec sudo "$SELF $*"
+ exec sudo -H $SELF $*
else
echo "Please enter the root password."
exec su -c "$SELF $*" root
diff --git a/scripts/cauldronchr.sh b/scripts/cauldronchr.sh
index 2280d5e..d08bf35 100755
--- a/scripts/cauldronchr.sh
+++ b/scripts/cauldronchr.sh
@@ -25,7 +25,7 @@ Options:
you must specify an absolute path or the command will not likely
be
found (a way around this would be to either set the path as part
of
the command to execute, or to set the command to be /bin/bash -l
- some_command_without_abs_path). Defaults to "/bin/bash -l".
+ some_command_without_abs_path). Defaults to "/bin/bash".
EndUsage
exit 1
} >&2
@@ -45,9 +45,9 @@ SELF=$0

if [[ $UID -ne 0 ]]
then
- if [[ -x $(which sudo > /dev/null 2>&1) ]]
+ if [[ -x $(which sudo 2> /dev/null) ]]
then
- exec sudo "$SELF $*"
+ exec sudo -H $SELF $*
else
echo "Please enter the root password."
exec su -c "$SELF $*" root
diff --git a/scripts/cleaniso.sh b/scripts/cleaniso.sh
index 9af772b..94f8995 100755
--- a/scripts/cleaniso.sh
+++ b/scripts/cleaniso.sh
@@ -38,9 +38,9 @@ SELF=$0

if [[ $UID -ne 0 ]]
then
- if [[ -x $(which sudo > /dev/null 2>&1) ]]
+ if [[ -x $(which sudo 2> /dev/null) ]]
then
- exec sudo "$SELF $*"
+ exec sudo -H $SELF $*
else
echo "Please enter the root password."
exec su -c "$SELF $*" root
diff --git a/scripts/mkinitrd.sh b/scripts/mkinitrd.sh
index 2137750..02e127e 100755
--- a/scripts/mkinitrd.sh
+++ b/scripts/mkinitrd.sh
@@ -44,9 +44,9 @@ SELF=$0

if [[ $UID -ne 0 ]]
then
- if [[ -x $(which sudo > /dev/null 2>&1) ]]
+ if [[ -x $(which sudo 2> /dev/null) ]]
then
- exec sudo "$SELF $*"
+ exec sudo -H $SELF $*
else
echo "Please enter the root password."
exec su -c "$SELF $*" root
diff --git a/scripts/mkiso.sh b/scripts/mkiso.sh
index ba736fa..2cd2467 100755
--- a/scripts/mkiso.sh
+++ b/scripts/mkiso.sh
@@ -48,9 +48,9 @@ SELF=$0

if [[ $UID -ne 0 ]]
then
- if [[ -x $(which sudo > /dev/null 2>&1) ]]
+ if [[ -x $(which sudo 2> /dev/null) ]]
then
- exec sudo "$SELF $*"
+ exec sudo -H $SELF $*
else
echo "Please enter the root password."
exec su -c "$SELF $*" root
diff --git a/scripts/mkrelease.sh b/scripts/mkrelease.sh
index c47975a..8a9cd2d 100755
--- a/scripts/mkrelease.sh
+++ b/scripts/mkrelease.sh
@@ -46,9 +46,9 @@ SELF=$0

if [[ $UID -ne 0 ]]
then
- if [[ -x $(which sudo > /dev/null 2>&1) ]]
+ if [[ -x $(which sudo 2> /dev/null) ]]
then
- exec sudo "$SELF $*"
+ exec sudo -H $SELF $*
else
echo "Please enter the root password."
exec su -c "$SELF $*" root
diff --git a/scripts/mksystem.sh b/scripts/mksystem.sh
index 6140159..9058875 100755
--- a/scripts/mksystem.sh
+++ b/scripts/mksystem.sh
@@ -35,9 +35,9 @@ SELF=$0

if [[ $UID -ne 0 ]]
then
- if [[ -x $(which sudo > /dev/null 2>&1) ]]
+ if [[ -x $(which sudo 2> /dev/null) ]]
then
- exec sudo "$SELF $*"
+ exec sudo -H $SELF $*
else
echo "Please enter the root password."
exec su -c "$SELF $*" root
diff --git a/scripts/purify.sh b/scripts/purify.sh
index f47e0e0..03a6276 100644
--- a/scripts/purify.sh
+++ b/scripts/purify.sh
@@ -43,9 +43,9 @@ SELF=$0

if [[ $UID -ne 0 ]]
then
- if [[ -x $(which sudo > /dev/null 2>&1) ]]
+ if [[ -x $(which sudo 2> /dev/null) ]]
then
- exec sudo "$SELF $*"
+ exec sudo -H $SELF $*
else
echo "Please enter the root password."
exec su -c "$SELF $*" root
diff --git a/scripts/spellcaster.sh b/scripts/spellcaster.sh
index 9dff958..3e8f480 100755
--- a/scripts/spellcaster.sh
+++ b/scripts/spellcaster.sh
@@ -4,42 +4,17 @@
# chroot, and also the casting and subsequent dispelling (with caches
enabled)
# of the optional spells.

-if [[ -n $CAULDRON_CHROOT && $# -eq 0 ]]
-then
- if [[ $CAULDRON_CAST = y ]]
- then
- # cast all spells
- /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")
- fi
-
- exit $?
-fi
-
MYDIR="$(dirname $0)"
CAULDRONDIR="$MYDIR"/../data

function usage() {
cat << EndUsage
-Usage: $(basename $0) [-h] -c | -d /path/to/target ARCHITECTURE
+Usage: $(basename $0) [-h] [-i ISO] [-s SYS] /path/to/target ARCHITECTURE

Casts the required and optional spells onto the ISO.
This script requires superuser privileges.

Required:
- -c
- Cast the required and optional spells in the target directory.
This
- is the default action.
-
- -d
- Dispel the optional spells only from the target directory.
-
/path/to/target
The location of the chroot directory you would like to have the
casting done in.
@@ -52,81 +27,247 @@ Required:

Options:
-h Shows this help information
+
+ -i Path to iso build directory (ISO). Defaults to /tmp/cauldron/iso.
+
+ -s Path to system build directory (SYS). Defaults to
+ /tmp/cauldron/system.
EndUsage
exit 1
} >&2

-export CAULDRON_CAST=y
-
-while getopts ":cdh" Option
-do
- case $Option in
- c ) export CAULDRON_DISPEL=n ; export CAULDRON_CAST=y ;;
- d ) export CAULDRON_CAST=n ; export CAULDRON_DISPEL=y ;;
- h ) usage ;;
- * ) echo "Unrecognized option." >&2 && usage ;;
- esac
-done
-shift $(($OPTIND - 1))
-
-SELF="$0"
-
-if [[ $UID -ne 0 ]]
-then
- if [[ -x $(which sudo > /dev/null 2>&1) ]]
- then
- exec sudo "$SELF $*"
- else
- echo "Please enter the root password."
- exec su -c "$SELF $*" root
- fi
-fi
+function parse_options() {
+ while getopts ":i:s:h" Option
+ do
+ case $Option in
+ i ) ISODIR="${OPTARG%/}" ;;
+ s ) SYSDIR="${OPTARG%/}" ;;
+ h ) usage ;;
+ * ) echo "Unrecognized option." >&2 && usage ;;
+ esac
+ done
+ return $(($OPTIND - 1))
+}

-[[ $# -lt 1 ]] && usage
-TARGET="$1"
-shift
+function priv_check() {
+ local SELF="$0"

-[[ $# -gt 0 ]] && TYPE="$1"
-TYPE="${TYPE:-x86}"
+ if [[ $UID -ne 0 ]]
+ then
+ if [[ -x $(which sudo 2> /dev/null) ]]
+ then
+ exec sudo -H $SELF $*
+ else
+ echo "Please enter the root password."
+ exec su -c "$SELF $*" root
+ fi
+ fi
+}

-export rspells="rspells.$TYPE"
-export ospells="ospells.$TYPE"
+function directory_check() {
+ if [[ ! -d $1 ]]
+ then
+ mkdir -p $1
+ fi
+}

# check to make sure that the chroot has sorcery set to do caches
-if [[ -e "$TARGET"/etc/sorcery/local/config ]]
-then
- CONFIG_ARCHIVE=$(grep 'ARCHIVE=' "$TARGET"/etc/sorcery/local/config |
cut -d = -f 2 | sed 's/"//g')
- if [[ -n $CONFIG_ARCHIVE && $CONFIG_ARCHIVE != "on" ]]
- then
- echo "Error! TARGET sorcery configured to not archive!" >&2
- echo -n "Set the TARGET sorcery to archive? [yn]" >&2
- read -n1 CHOICE
+function sanity_check() {
+ local config="$TARGET/etc/sorcery/local/config"
+ local arch=
+ local choice=
+
+ # Ensure that TARGET is a directory
+ [[ -d "$TARGET" ]] || {
+ echo "$TARGET does not exist!"
+ exit 3
+ }
+
+ # If ISODIR is not a directory, create it.
+ directory_check "$ISODIR"
+
+ # If ISODIR/var/cache/sorcery is not a directory, create it.
+ directory_check "$ISODIR/var/cache/sorcery"
+
+ # If ISODIR/var/spool/sorcery is not a directory, create it.
+ directory_check "$ISODIR/var/spool/sorcery"
+
+ # If SYSDIR is not a directory, create it.
+ directory_check "$SYSDIR"

- if [[ $CHOICE == 'y' ]]
+ # If SYSDIR/var/cache/sorcery is not a directory, create it.
+ directory_check "$SYSDIR/var/cache/sorcery"
+
+ # If SYSDIR/var/spool/sorcery is not a directory, create it.
+ directory_check "$SYSDIR/var/spool/sorcery"
+
+ if [[ -e "$config" ]]
+ then
+ arch="$(source "$config" &> /dev/null && echo $ARCHIVE)"
+ if [[ -n $arch && $arch != "on" ]]
then
- sed -i 's/ARCHIVE=.*/ARCHIVE="on"/'
"$TARGET"/etc/sorcery/local/config
- else
- exit 2
+ echo "Error! TARGET sorcery does not archive!" >&2
+ echo -n "Set TARGET sorcery to archive? [yn]" >&2
+ read -n1 choice
+ echo ""
+
+ if [[ $choice == 'y' ]]
+ then
+ . "$TARGET/var/lib/sorcery/modules/libstate"
+ modify_config $config ARCHIVE on
+ else
+ exit 2
+ fi
fi
fi
-fi
-
-# Copy necessary files to the target and chroot
-$(grep -q linux "$CAULDRONDIR/$rspells" "$CAULDRONDIR/$ospells" ) && cp
"$CAULDRONDIR/config-2.6" "$TARGET/etc/sorcery/local/kernel.config"
-[[ $CAULDRON_CAST = y ]] && cp "$CAULDRONDIR/$rspells" "$TARGET"/
-cp "$CAULDRONDIR/$ospells" "$TARGET"/
-cp "$0" "$TARGET"/
-"$MYDIR/cauldronchr.sh" -d "$TARGET" /"$(basename $0)"
-
-# Clean up the target
-[[ $CAULDRON_CAST = y ]] && rm "$TARGET/$rspells"
-rm "$TARGET/$ospells"
-[[ -e "$TARGET/etc/sorcery/local/kernel.config" ]] && rm
"$TARGET/etc/sorcery/local/kernel.config"
-rm "$TARGET/$(basename $0)"
-
-unset rspells
-unset ospells
-unset CAULDRON_CAST
-unset CAULDRON_DISPEL
+}
+
+function prepare_target() {
+ export rspells="rspells.$TYPE"
+ export ispells="ispells.$TYPE"
+ export ospells="ospells.$TYPE"
+
+ # Copy resolv.conf so spell sources can be downloaded inside the
TARGET
+ cp -f "$TARGET"/etc/resolv.conf "$TARGET"/tmp/resolv.conf &&
+ cp -f /etc/resolv.conf "$TARGET"/etc/resolv.conf
+
+ # If using the linux spell copy the kernel config to TARGET sorcery
+ 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
+ cp "$CAULDRONDIR/rspells.$TYPE" "$TARGET"/rspells
+ cp "$CAULDRONDIR/ispells.$TYPE" "$TARGET"/ispells
+ cp "$CAULDRONDIR/ospells.$TYPE" "$TARGET"/ospells
+
+ # generate basesystem casting script inside of TARGET
+ cat > "$TARGET"/build_spells.sh <<-'SPELLS'
+
+ if [[ -n $CAULDRON_CHROOT && $# -eq 0 ]]
+ then
+
+ # If console-tools is found in TARGET, get rid of it to make
+ # way for kbd
+ [[ $(gaze -q installed console-tools) != "not installed" ]] &&
+ dispel --orphan always console-tools
+
+ # push the needed spells into the install queue
+ cat rspells ispells ospells > /var/log/sorcery/queue/install
+
+ # cast all the spells using the install queue and save the
+ # return value to a log file
+ /usr/sbin/cast --queue 2> /build_spells.log
+ echo $? >> /build_spells.log
+
+ # make a list of the caches to unpack for system
+ for spell in $(</rspells)
+ do
+ gaze installed $spell &> /dev/null &&
+ echo $spell-$(gaze -q installed $spell)
+ done > /sys-list || exit 42
+
+ # make a list of the caches to unpack for iso
+ for spell in $(</ispells)
+ do
+ gaze installed $spell &> /dev/null &&
+ echo $spell-$(gaze -q installed $spell)
+ done > /iso-list || exit 42
+
+ # make a list of the optional caches to unpack for iso
+ for spell in $(</ospells)
+ do
+ gaze installed $spell &> /dev/null &&
+ echo $spell-$(gaze -q installed $spell)
+ done > /opt-list || exit 42
+ fi
+SPELLS
+
+ chmod a+x "$TARGET"/build_spells.sh
+}
+
+function setup_sys() {
+ local SPOOL="$TARGET/var/spool"
+ local SORCERY="sorcery-stable.tar.bz2"
+
+ # unpack the sys caches into SYSDIR
+ for cache in $(<"$TARGET"/sys-list)
+ do
+ tar xjf "$TARGET"/var/cache/sorcery/$cache*.tar.bz2 -C
"$SYSDIR"/
+ done
+
+ # download sorcery source
+ (
+ cd "$SPOOL"
+ wget http://download.sourcemage.org/sorcery/$SORCERY
+ )
+
+ # unpack and install sorcery into SYSDIR
+ tar jxf "$SPOOL"/$SORCERY -C "$TARGET/usr/src"
+ "$TARGET/usr/src/sorcery/install" "$SYSDIR"
+}
+
+function setup_iso() {
+ # copy the iso caches over and unpack their contents
+ for cache in $(<"$TARGET"/iso-list)
+ do
+ tar xjf "$TARGET"/var/cache/sorcery/$cache*.tar.bz2 -C
"$ISODIR"/
+ cp "$TARGET"/var/cache/sorcery/$cache*.tar.bz2
"$ISODIR"/var/cache/sorcery/
+ done
+
+ # copy (only!) the optional caches over
+ for cache in $(<"$TARGET"/opt-list)
+ do
+ cp "$TARGET"/var/cache/sorcery/$cache*.tar.bz2
"$ISODIR"/var/cache/sorcery/
+ done
+}
+
+function clean_target() {
+ local config="$TARGET/etc/sorcery/local/kernel.config"
+
+ # Restore resolv.conf, the first rm is needed in case something
+ # installs a hardlink (like ppp)
+ rm -f "$TARGET/etc/resolv.conf" &&
+ cp -f "$TARGET/tmp/resolv.conf" "$TARGET/etc/resolv.conf" &&
+ rm -f "$TARGET/tmp/resolv.conf"
+
+ # Clean up the target
+ rm -f "$TARGET/rspells" \
+ "$TARGET/ispells" \
+ "$TARGET/ospells" \
+ "$TARGET/$config" \
+ "$TARGET/build_spell.sh"
+}
+
+# main()
+priv_check $*
+
+parse_options $*
+shift $?
+
+[[ $# -lt 1 ]] && usage
+TARGET="${1%/}"
+shift
+
+[[ $# -gt 0 ]] && TYPE="$1"
+TYPE="${TYPE:-x86}"
+
+ISODIR="${ISODIR:-/tmp/cauldron/iso}"
+SYSDIR="${SYSDIR:-/tmp/cauldron/sys}"
+
+sanity_check
+
+prepare_target
+
+# chroot and build all of the spells inside the TARGET
+"$MYDIR/cauldronchr.sh" -d "$TARGET" /build_spells.sh
+
+# unpack sys caches and set up sorcery into SYSDIR
+setup_sys
+
+# unpack iso caches and copy iso and optional caches into ISODIR
+setup_iso
+
+# Keep a clean kitchen, wipes up the leftovers from the preparation step
+clean_target

exit 0



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

Archive powered by MHonArc 2.6.24.

Top of Page