Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master cauldron by Karsten Behrmann (392648f5774c1d8f9ebc85b62c1f7ba7729c97e5)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Karsten Behrmann <scm AT mail.sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master cauldron by Karsten Behrmann (392648f5774c1d8f9ebc85b62c1f7ba7729c97e5)
  • Date: Mon, 5 Mar 2007 20:28:29 -0600

GIT changes to master cauldron by Karsten Behrmann
<BearPerson AT sourcemage.org>:

iso/data/iso.packages | 1
iso/generation-scripts/README | 9
iso/generation-scripts/autoupdate.sh | 13
iso/generation-scripts/caster | 144
----------
iso/generation-scripts/lint-packages.sh | 11
iso/generation-scripts/nightlybuild.sh | 29 --
iso/skeleton/bin/main-shell.sh | 3
iso/skeleton/etc/inittab | 6
iso/skeleton/etc/profile.d/smgl-install.sh | 4
iso/skeleton/etc/shutdown.conf | 2
iso/skeleton/usr/share/doc/smgl.install/steps/init | 1
iso/skeleton/usr/share/doc/smgl.install/welcome | 21 +
iso/skeleton/usr/share/smgl.install/bashrc | 53 +++
iso/skeleton/usr/share/smgl.install/default_debug | 1
iso/skeleton/usr/share/smgl.install/default_debug_spellinstall | 1
iso/skeleton/usr/share/smgl.install/deps-optional | 7
iso/skeleton/usr/share/smgl.install/deps-required | 6
iso/skeleton/usr/share/smgl.install/order | 10
iso/skeleton/usr/share/smgl.install/steps | 7
iso/skeleton/usr/share/smgl.install/symlinks | 2
20 files changed, 105 insertions(+), 226 deletions(-)

New commits:
commit 392648f5774c1d8f9ebc85b62c1f7ba7729c97e5
Author: Karsten Behrmann <BearPerson AT sourcemage.org>
Commit: Karsten Behrmann <BearPerson AT sourcemage.org>

Start massive revampage/simplification of installer.
Core points to look at for how I plan things:

iso/skeleton/usr/share/smgl.install/{bashrc,order,steps}
iso/skeleton/usr/share/doc/smgl.install/

diff --git a/iso/data/iso.packages b/iso/data/iso.packages
index c7cc29d..7368f63 100644
--- a/iso/data/iso.packages
+++ b/iso/data/iso.packages
@@ -48,7 +48,6 @@ __SMGL_TEMPLATE_ONLY_ppc__unpack hfsutil
unpack iana-etc
begin_unpack init.d
iso_include '/etc/init.d' # overriding the default
- iso_exclude /etc/shutdown.conf
end_unpack
unpack jed
unpack jfsutils
diff --git a/iso/generation-scripts/README b/iso/generation-scripts/README
index cd74519..ace899b 100644
--- a/iso/generation-scripts/README
+++ b/iso/generation-scripts/README
@@ -16,12 +16,3 @@ To be used inside the chroot:
(usually called via mk-smgl-iso)
- mkiso: create a .iso from existing tarballs and initrd image
(usually called via mk-smgl-iso)
-
-
-Old cruft, not to be used at all:
-- autoupdate.sh: attempt to update the spells inside the chroot and generate
a
- new .iso - probably not working too well
-- lint-packages.sh: run inside the chroot to try and find unsatisfied
- dependencies from spells unpacked to the iso. Might come
in
- useful every once in a while, but not part of the regular
- procedure. Should actually work.
diff --git a/iso/generation-scripts/autoupdate.sh
b/iso/generation-scripts/autoupdate.sh
deleted file mode 100755
index 61eb6c2..0000000
--- a/iso/generation-scripts/autoupdate.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-# Script to automatically update the chroot and generate a new ISO
-# This part to be ran inside the chroot
-sorcery system-update
-[[ -e caster ]] ||
- cd ${0%/*}
-./caster -c basesystem # to get all cruft dispelled
-./caster $(cat ../data/list.{reqd,all})
-if [[ $ISOGEN_LOGFILE ]] ;then
- ./mk-smgl-iso &>$ISOGEN_LOGFILE
-else
- ./mk-smgl-iso
-fi
diff --git a/iso/generation-scripts/caster b/iso/generation-scripts/caster
index 84ab4d0..1b4ef15 100755
--- a/iso/generation-scripts/caster
+++ b/iso/generation-scripts/caster
@@ -10,21 +10,7 @@
function pre_workaround()
{

-# this used to be a hack to ensure /etc was clean. This technique was
-# neccessary so spells installed their /etc files properly, as otherwise
-# many refused to overwrite existing files, resulting in those files not
-# getting tracked and not getting included in the binary tarball.
-# rm $(find /etc -not -type d | grep -v -f ~/etcexcluded)
-
case $1 in
-
- # autoconf fails to find a C++ compiler, even if those spells don't
- # actually need one. So, we install g++ so they're happy.
- # TODO: audit this list
- "irssi"|"grub"|"lshw"|"parted"|"syslinux"|"syslog-ng"|"uptimed")
- cast g++
- ;;
-
# this attempts to make the linux build use the settings we want
# for the ISO kernel.
"linux")
@@ -50,82 +36,6 @@ function post_workaround()
true
}

-# This function is part of our spell tracking procedures. It attempts to
-# produce an install log for the given spell on stdout, so that we can
-# notice changes in the files a spell installs (usually bad, unless we're
-# updating)
-# Needs the sorcery environment and codex_set_current_spell done before it
-function try_get_install_log() {
- local rclog=/tmp/install_log_rc.$$
- local rc
- {
- # First, get from sorcery, if the spell is currently installed
- gaze install $SPELL ||
- # Next, try finding it in the tarball
- tar -xjOf ${INSTALL_CACHE}/${SPELL}-${VERSION}-${HOST}.tar${EXTENSION} \
- --occurrence ${INSTALL_LOGS#/}/$SPELL-$VERSION ||
- # try again with a leading /, for some reason the file sometimes has it
- tar -xjOf ${INSTALL_CACHE}/${SPELL}-${VERSION}-${HOST}.tar${EXTENSION} \
- --occurrence $INSTALL_LOGS/$SPELL-$VERSION
-
- # Preserve exit code (this is a subshell, so setting variables won't
work)
- echo $? >$rclog
-
- # Ignore tablet, don't include gaze install's "does not exist" message
- } 2>/dev/null | grep -v "$TABLET_PATH" | grep -v "does not exist" | sort
-
- # And grab exit code again
- rc=$(cat $rclog)
- rm -f $rclog
- return $rc
-}
-
-# This function is part of the spell tracking procedure.
-# It will try to remove directory names from the files listed on stdin.
-# We're not interested in directories that don't get installed again,
-# as they are created by extracting the tarball anyway for the files
-# they contain
-function filter_dirs() {
- local line
- while read line ;do
- test -d "$line" ||
- echo "$line"
- done
-}
-
-# Phew. This function is interesting.
-# Attempt to work out if a spell's tarball is out of date and a new version
-# is in the grimoire.
-# As the spell isn't neccessarily installed, we need to fiddle our stuff from
-# the cache tarball (its filename gets passed as $1)
-function needs_updating() {
- return 1 # TODO: disable this for now, this doesn't seem to work yet
-
- local TMPTABDIR=/tmp/tabletstuff.$$
- mkdir -p $TMPTABDIR
-
- # Try to extract the relevant fields from the tablet saved in the tarball.
- # As we do not know the exact tablet paths, we put * and rely on tar to
work it out.
- tar -C $TMPTABDIR -xjf "$1" --occurrence \
- 'var/state/sorcery/tablet/*/*/updated' \
- 'var/state/sorcery/tablet/*/*/patchlevel' \
- 'var/state/sorcery/tablet/*/*/security_patch'
-
- CACHE_UPDATED=$(cat $TMPTABDIR/var/state/sorcery/tablet/*/*/updated)
- CACHE_PATCHLEVEL=$(cat $TMPTABDIR/var/state/sorcery/tablet/*/*/patchlevel)
- CACHE_SECPATCH=$(cat
$TMPTABDIR/var/state/sorcery/tablet/*/*/security_patch)
-
- rm -rf $TMPTABDIR
-
- # If any of those have increased, we need to update.
- # NOTE: this construction might contain bugs.
- [[ ${UPDATED:-0} > ${CACHE_UPDATED:-0} ]] && return 0
- [[ ${PATCHLEVEL:-0} > ${CACHE_PATCHLEVEL:-0} ]] && return 0
- [[ ${SECURITY_PATCH:-0} > ${CACHE_SECPATCH:-0} ]] && return 0
- return 1
-}
-
-
# ---- execution of script starts here ----

if [ "$1" == "-c" ] ;then
@@ -134,7 +44,6 @@ if [ "$1" == "-c" ] ;then
fi

# Make sure dirs we need actually exist
-mkdir -p ~/broken-logs
mkdir -p /tmp

# Load sorcery and our config
@@ -162,14 +71,11 @@ for spell in "$@" ; do

# Generate a new tarball if we don't have one yet, have -c specified,
# or have an outdated one
- if ! test -e $cachefile || [ $RECAST ] || needs_updating $cachefile ;then
-
- # Grab old install log if one exists, so we can check for changes
- rm -f /tmp/old-install-log /tmp/tmp-install-log
- try_get_install_log >/tmp/tmp-install-log || rm /tmp/tmp-install-log
+ if ! test -e $cachefile || [ $RECAST ] ;then

# Do hacks needed to get this thing to work
pre_workaround $spell
+
# Cast all spells needed to cast $spell, but NOT $spell itself
# (this allows cast to extract caches for those spells )
cast --deps $spell
@@ -199,31 +105,7 @@ for spell in "$@" ; do
fi
fi

- # If we had an old install log, filter out dirs (we can only do this
- # once the spell is installed and we're sure the dirs actually exist)
- [ -e /tmp/tmp-install-log ] &&
- cat /tmp/tmp-install-log | filter_dirs >/tmp/old-install-log
-
- # Grab new install log, to compare it against the old one
- gaze install $spell >/tmp/tmp-install-log &&
- # This ">file && cat file |" hack ensures that if gaze install fails,
- # the commands after it don't get executed.
- cat /tmp/tmp-install-log | filter_dirs >/tmp/new-install-log &&
-
- # Do we have an old install log, and does it differ from the current one?
- if [ -e /tmp/old-install-log ] &&
- ! cmp -s /tmp/old-install-log /tmp/new-install-log ;then
-
- message "OOPS... Spell ${SPELL_COLOR}${SPELL}${DEFAULT_COLOR} \
-install log suddenly changed..."
-
- # Save old and new install log, in case we want to see what changed
- datestr=$(date +%s)
- cp /tmp/old-install-log ~/broken-logs/${SPELL}-${datestr}-pre
- cp /tmp/new-install-log ~/broken-logs/${SPELL}-${datestr}-post
- echo "$SPELL" >>$CHANGE_LIST
-
- elif [[ $rc == 0 ]] ;then
+ if [[ $rc == 0 ]] ;then
# Yay, everything went sweet
echo "$SPELL" >>$SUCCESS_LIST
else
@@ -232,9 +114,6 @@ install log suddenly changed..."
# hmm... we just cast a spell, but gaze install $spell fails...
strange.
echo "$SPELL" >>$FAIL_LIST

- rm -f /tmp/new-install-log
-
-
# Now, we finished what we came here for (casting one spell).
# We clean up after ourselves and dispel all spells not strictly needed,
# so the next spell gets a clean environment.
@@ -288,21 +167,4 @@ if [ -s $FAIL_LIST ] ;then
message "$DEFAULT_COLOR"
fi

-# This is a hack.
-# When ISOGEN_LOGFILE is set, we write a report there,
-# for the benefit of automated scripts that call this and
-# may want to send report mails.
-if [[ $ISOGEN_LOGFILE ]] ;then
- {
- echo "===== begin caster report ====="
- echo "Successful spells:"
- column -c 72 $SUCCESS_LIST
- echo "install log changed:"
- column -c 72 $CHANGE_LIST
- echo "failed to cast:"
- column -c 72 $FAIL_LIST
- echo "===== end caster report ====="
- } >$ISOGEN_LOGFILE
-fi
-
rm -f $SUCCESS_LIST $FAIL_LIST $CHANGE_LIST
diff --git a/iso/generation-scripts/lint-packages.sh
b/iso/generation-scripts/lint-packages.sh
deleted file mode 100644
index b158393..0000000
--- a/iso/generation-scripts/lint-packages.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-rm -f /tmp/isopackage-list
-sed -n 's/^\(begin_\)\?unpack \([^ #]*\).*$/\2/p' ../data/iso.packages
>/tmp/isopackage-list
-while read SPELL ;do
- grep "^$SPELL:[^:]*:on:" /var/state/sorcery/depends |
- cut -d: -f2 |
- while read DEPCY ;do
- if ! grep -q "^$DEPCY$" /tmp/isopackage-list ;then
- echo "unsatisfied dependency $SPELL -> $DEPCY"
- fi
- done
-done </tmp/isopackage-list
diff --git a/iso/generation-scripts/nightlybuild.sh
b/iso/generation-scripts/nightlybuild.sh
deleted file mode 100755
index aaf110d..0000000
--- a/iso/generation-scripts/nightlybuild.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash
-LOGFILE="$(pwd)/isogen-log.$(date +%Y%m%d%H)"
-[[ -e mkprep ]] ||
- cd ${0%/*}
-
-if ! [[ $1 ]] ;then
- echo "syntax: $0 /path/to/chroot"
- exit 1
-fi
-
-if ! [[ -x $1/usr/sbin/sorcery ]] ;then
- echo "error: $1 must be a working chroot"
- exit 1
-fi
-
-exec 17>$LOGFILE
-export ISOGEN_LOGFILE=/dev/fd/17
-
-./sanitize_chroot.sh $1
-
-export ISO_VERSION="smgl-nightly"
-. /etc/smgl-isogen.conf
-. config
-
-rm -f $1/root/sorcery-$SVERSION.tar.bz2
-rm -f $1/root/$GVERSION.tar.bz2
-./mkprep $1/root/p4 1>&17 2>&17
-
-chroot $1 /root/p4/generation-scripts/autoupdate.sh
diff --git a/iso/skeleton/bin/main-shell.sh b/iso/skeleton/bin/main-shell.sh
new file mode 100755
index 0000000..e670a7e
--- /dev/null
+++ b/iso/skeleton/bin/main-shell.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+cat /usr/share/doc/smgl.install/welcome
+exec /bin/login-shell.sh
diff --git a/iso/skeleton/etc/inittab b/iso/skeleton/etc/inittab
index e53dfea..6bd539f 100644
--- a/iso/skeleton/etc/inittab
+++ b/iso/skeleton/etc/inittab
@@ -3,12 +3,12 @@ fileprefix = /etc/init.d/
PATH = /sbin:/bin:/usr/sbin:/usr/bin
INIT_PATH =
runlevels:runlevels/%DEV:runlevels/%S:runlevels/%1:runlevels/%2:runlevels/%3:runlevels/%4:runlevels/%5

-tty1:linux:/sbin/agetty -n -l /usr/sbin/installer.sh /dev/tty1 9600
-tty2:linux:/sbin/agetty -n -l /usr/sbin/bg-install.sh tty2 9600
+tty1:linux:/sbin/agetty -n -l /bin/main-shell.sh /dev/tty1 9600
+tty2:linux:/sbin/agetty -n -l /bin/login-shell.sh tty2 9600
tty3:linux:/sbin/agetty -n -l /bin/login-shell.sh tty3 9600
tty4:linux:/sbin/agetty -n -l /bin/login-shell.sh tty4 9600
tty5:linux:/sbin/agetty -n -l /bin/login-shell.sh tty5 9600
-tty6:linux:/sbin/agetty -n -l /usr/bin/installer-help.sh tty6 9600
+tty6:linux:/sbin/agetty -n -l /bin/login-shell.sh tty6 9600

finalprog =
quietrollback = yes
diff --git a/iso/skeleton/etc/profile.d/smgl-install.sh
b/iso/skeleton/etc/profile.d/smgl-install.sh
new file mode 100644
index 0000000..28942a0
--- /dev/null
+++ b/iso/skeleton/etc/profile.d/smgl-install.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+# This includes the SMGL installer functions
+. /usr/share/smgl.install/bashrc
diff --git a/iso/skeleton/etc/shutdown.conf b/iso/skeleton/etc/shutdown.conf
deleted file mode 100644
index 594fe2b..0000000
--- a/iso/skeleton/etc/shutdown.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-# Custom SMGL ISO file to enable some weird magic to eject the CD on reboot
-HALT_ACTION = /sbin/dummy-halt.sh
diff --git a/iso/skeleton/usr/share/doc/smgl.install/steps/init
b/iso/skeleton/usr/share/doc/smgl.install/steps/init
new file mode 100644
index 0000000..2f0ba11
--- /dev/null
+++ b/iso/skeleton/usr/share/doc/smgl.install/steps/init
@@ -0,0 +1 @@
+enter 'next'.
diff --git a/iso/skeleton/usr/share/doc/smgl.install/welcome
b/iso/skeleton/usr/share/doc/smgl.install/welcome
new file mode 100644
index 0000000..49095f4
--- /dev/null
+++ b/iso/skeleton/usr/share/doc/smgl.install/welcome
@@ -0,0 +1,21 @@
+Welcome to the SMGL <insert version here> install CD!
+
+The install process is currently a guided shell prompt. Type 'next' to start.
+Everytime you finish a step, enter 'next' to advance to the next one.
+If you want to re-read the documentation for a step, type 'todo'.
+You can enter 'back' at any time to jump to the previous step.
+
+Don't worry, there's no magic attached to the steps, you can jump between
+them as you please without breaking anything.
+
+If you ever get lost, type 'list-steps' to get a list of installer steps,
+and e.g. 'jump copy-base' to jump to a specific step.
+
+The Source Mage GNU/Linux cauldron team hopes that this new form of installer
+will help you setting up your systems efficiently, or learning a lot.
+
+If you have any feedback you'd like us to hear, please drop by
+#sourcemage-cauldron on irc.freenode.net, file a bug on bugs.sourcemage.org,
+or just send an email to the mailing lists or to iso AT sourcemage.org.
+
+Enter 'next' to begin the installation. Have fun!
diff --git a/iso/skeleton/usr/share/smgl.install/bashrc
b/iso/skeleton/usr/share/smgl.install/bashrc
new file mode 100755
index 0000000..dd8604c
--- /dev/null
+++ b/iso/skeleton/usr/share/smgl.install/bashrc
@@ -0,0 +1,53 @@
+#!/bin/bash
+
+# This file is the SMGL installer, at least for now.
+# Take care not to pollute the user's namespace too much,
+# And make sure your functions don't collide with existing commands
+
+INSTALLER_TMP=/tmp/smgl.install
+INSTALLER_STATUS=$INSTALLER_TMP/status
+INSTALLER_DATA=/usr/share/smgl.install
+INSTALLER_DOCS=/usr/share/doc/smgl.install
+
+# This will race on startup, but it shouldn't harm anyone. I hope.
+mkdir -p $INSTALLER_TMP
+[[ -e $INSTALLER_STATUS ]] || echo 'init' >$INSTALLER_STATUS
+
+function todo() {
+ local CURSTEP
+ CURSTEP=$(cat $INSTALLER_STATUS)
+ cat $INSTALLER_DOCS/steps/$CURSTEP
+}
+
+function next() {
+ local CURSTEP
+ # get old status
+ CURSTEP=$(cat $INSTALLER_STATUS)
+ # find next status
+ CURSTEP=$(grep "^$CURSTEP:" $INSTALLER_DATA/order | cut -d: -f2)
+ # if we couldn't find a next status, jump to 'error'
+ CURSTEP=${CURSTEP:-error}
+ # save new status
+ echo "$CURSTEP" >$INSTALLER_STATUS
+ # print new message
+ todo
+}
+
+function back() {
+ local CURSTEP
+ CURSTEP=$(cat $INSTALLER_STATUS)
+ if [[ $CURSTEP != "init" ]] ;then
+ CURSTEP=$(grep ":$CURSTEP$" $INSTALLER_DATA/order | head -n 1 | cut -d:
-f1)
+ fi
+ CURSTEP=${CURSTEP:-error}
+ echo "$CURSTEP" >$INSTALLER_STATUS
+ todo
+}
+
+function list-steps() {
+ cat $INSTALLER_DATA/steps
+}
+
+function jump() {
+ echo "$*" >$INSTALLER_STATUS
+}
diff --git a/iso/skeleton/usr/share/smgl.install/default_debug
b/iso/skeleton/usr/share/smgl.install/default_debug
deleted file mode 100644
index 0cfbf08..0000000
--- a/iso/skeleton/usr/share/smgl.install/default_debug
+++ /dev/null
@@ -1 +0,0 @@
-2
diff --git a/iso/skeleton/usr/share/smgl.install/default_debug_spellinstall
b/iso/skeleton/usr/share/smgl.install/default_debug_spellinstall
deleted file mode 100644
index 00750ed..0000000
--- a/iso/skeleton/usr/share/smgl.install/default_debug_spellinstall
+++ /dev/null
@@ -1 +0,0 @@
-3
diff --git a/iso/skeleton/usr/share/smgl.install/deps-optional
b/iso/skeleton/usr/share/smgl.install/deps-optional
deleted file mode 100644
index 9a5471b..0000000
--- a/iso/skeleton/usr/share/smgl.install/deps-optional
+++ /dev/null
@@ -1,7 +0,0 @@
-keymap# Set to defkeymap automatically if unset
-font
-lang
-editor
-architecture# Copy sorcery default config anyway
-timezone# Set to UTC by default
-syslog
diff --git a/iso/skeleton/usr/share/smgl.install/deps-required
b/iso/skeleton/usr/share/smgl.install/deps-required
deleted file mode 100644
index 3802853..0000000
--- a/iso/skeleton/usr/share/smgl.install/deps-required
+++ /dev/null
@@ -1,6 +0,0 @@
-disk# Partition disks
-install_start# Initial installation
-linux# Kernel install
-bootloader# Bootloader installed
-network# Set up network (or at least seen hints for "none")
-dev_format# /dev set up
diff --git a/iso/skeleton/usr/share/smgl.install/order
b/iso/skeleton/usr/share/smgl.install/order
new file mode 100644
index 0000000..9cf5e5f
--- /dev/null
+++ b/iso/skeleton/usr/share/smgl.install/order
@@ -0,0 +1,10 @@
+init:disk-partition
+disk-partition:disk-mount
+disk-mount:copy-base
+copy-base:edit-confs
+edit-confs:install-opt-spells
+install-opt-spells:reboot
+reboot:reboot
+init:init
+error:init
+init:error
diff --git a/iso/skeleton/usr/share/smgl.install/steps
b/iso/skeleton/usr/share/smgl.install/steps
new file mode 100644
index 0000000..182e7f3
--- /dev/null
+++ b/iso/skeleton/usr/share/smgl.install/steps
@@ -0,0 +1,7 @@
+init - start of the install
+disk-partition - creating partitions
+disk-mount - creating filesystems, mounting them appropriately
+copy-base - copying basesystem and basic /etc files
+edit-confs - editing the basic configuration files
+install-opt-spells - installing other spells you may need
+reboot - reboot into the new system
diff --git a/iso/skeleton/usr/share/smgl.install/symlinks
b/iso/skeleton/usr/share/smgl.install/symlinks
deleted file mode 100644
index 511b5e2..0000000
--- a/iso/skeleton/usr/share/smgl.install/symlinks
+++ /dev/null
@@ -1,2 +0,0 @@
-/dev/null /root/.bash_history
-share/man /usr/man



  • [SM-Commit] GIT changes to master cauldron by Karsten Behrmann (392648f5774c1d8f9ebc85b62c1f7ba7729c97e5), Karsten Behrmann, 03/05/2007

Archive powered by MHonArc 2.6.24.

Top of Page