Skip to Content.
Sympa Menu

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

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 (ad897e1e177fac3a5cf2be69cb17c421510949a0)
  • Date: Fri, 2 Jan 2009 14:04:04 -0600

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

data/depends/elvis.p | 1
data/initrd.files | 38 ++++----
initrd/sbin/smgl.init | 4
iso/usr/share/smgl.install/keymap | 137
--------------------------------
iso/usr/share/smgl.install/smgl-enchant | 108 +++++++++++++++++++++++++
iso/usr/share/smgl.install/smgl-kernel | 39 +++++++++
iso/usr/share/smgl.install/smgl-keymap | 137
++++++++++++++++++++++++++++++++
scripts/add-sauce.sh | 19 +++-
scripts/mkinitrd.sh | 4
scripts/mkiso.sh | 17 +++
scripts/mkrelease.sh | 14 ++-
scripts/spellcaster.sh | 45 ++++++++--
12 files changed, 384 insertions(+), 179 deletions(-)

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

smgl.install/{enchant,keymap}: add smgl- prefix

Prefix all end-user installer scripts with smgl- to make it easier for
users to identify scripts/commands that are available for use.

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

smgl.install/smgl-kernel: chmod a+x

The script needs to be executable for the ISO.

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

data/depends/elvis.p: force elvis to symlink to vi

Force /usr/bin/elvis to symlink to /usr/bin/vi.

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

smgl.install/smgl-kernel: new, installs ISO kernel

Script that can be used during the installer by the user to install the
ISO kernel to the TARGET of their choice (/mnt/root by default).

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

scripts/spellcaster.sh: update ld.so.cache

After creating the sys and iso dirs from scratch, they will be lacking
ld.so.conf in their etc/ dirs. The file needs to be added (empty is
fine) and then ldconfig run so that ld.so.cache is generated within both
chroots.

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

scripts/spellcaster.sh: ensure full pathnames

If the specified path is relative to $CWD, fill in the full path
specification. Otherwise the installation of sorcery fails in
setup_sys() because it expects to be able to write to $sys/, but the
sorcery install script needs to be run from the same directory it
resides in so CWD=$SORCERYDIR.

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

scripts/spellcaster.sh: improved setup_sys()

The sorcery and grimoire downloads now use a common dir on the TARGET
(TARGET/tmp). This will make it easier to clean up the files later. The
prefix path was missing from the untarring of the grimoire. Also, the
depends and packages files are force removed from SYSDIR so that we can
ensure we aren't writing duplicate entries in case the script is run
more than once with the same SYSDIR in existence.

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

scripts/spellcaster.sh: kernel version searching

The means of (possibly) obtaining the kernel version used in the build
have been improved. The kernel version can be passed as an optional
argument to the function. The function will scan the lib/modules
directory for different kernel versions before attemtping to get the
kernel version from the kernel config.

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

scripts/spellcaster.sh: fix up cleanup_target

Fixed the use of the $config variable, and formatted better.

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

scripts/add-sauce.sh: kernel is only for iso

The kernel only goes on the ISO and not in the sys dir, so don't
blacklist things in sys (there's no modules there to blacklist). Fixed
the CHROOTDIR variable to ensure that it doesn't have a trailing '/'.
Also, whether in sys or iso, run ldconfig afterwards, since presumably
etc/ld.so.conf will be copied over but the changes won't take effect if
the command isn't run via chroot.

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

scripts/mkinitrd.sh: fix OUTPUT and missing space

There was a missing space for I/O redirection that caused bash to get
confused (ambiguous redirection). OUTPUT was previously not being
set to a default, so if it wasn't passed on the command-line there would
be no output file.

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

scripts/spellcaster.sh: create grimoire_version

Create the grimiore_version file inside of ISODIR using the information
contained in the TARGET's stable VERSION file.

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

scripts/mkrelease.sh: use grimoire version file

The grimoire is no longer present on the ISO itself (only in
system.tar.bz2), so the grimoire information can't be taken from the
grimoire itself in the ISO. Therefore, a new file (etc/grimoire_version)
will be used that will contain the grimoire version.

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

scripts/mkiso.sh: updated usage() info

Updated the usage() info to explain the compression options as well as
the proper usage of the chown option.

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

scripts/mk{iso,release}.sh: fix chown cmds

Fixed the implementation of the chown usage in both scripts.

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

initrd/sbin/smgl.init: don't force iso9660

This should prevent the initrd from explicitly forcing iso9660 on
attempted mounts, and should allow the "ISO" to boot from more devices.
See bug #14929.

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

data/initrd.files: update for newer udev

Updated the initrd.files to match the files required by newer udev. This
file still has too much hardcoded for udev and needs to be improved on.

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

smgl.install/enchant: new, cache installer script

New script to support the installation of optional spell caches. The
script supports installing via /tmp/opt-spells, which can be set up by
alchemy (yet to be committed), or by handling caches one-off (which can
be looped to handle directories of caches). This is a powerful new
edition to the ISO installer, because not only does this allow for the
installation of optional spell caches provided on the ISO, it also
allows for one to install any caches from any medium that the ISO can
reach (and with net modules and net tools on the ISO, it's possible to
link up with nfs partitions).

diff --git a/data/depends/elvis.p b/data/depends/elvis.p
new file mode 100644
index 0000000..6e244c5
--- /dev/null
+++ b/data/depends/elvis.p
@@ -0,0 +1 @@
+MAKE_SYMLINK="y"
diff --git a/data/initrd.files b/data/initrd.files
index 1bee8ec..6764446 100644
--- a/data/initrd.files
+++ b/data/initrd.files
@@ -21,42 +21,46 @@ rmmod
pidof
killall5
udevadm
-udevcontrol
udevd
udevinfo
-udevsettle
-udevtrigger
/etc/modprobe.d/udev
/etc/scsi_id.config
/etc/udev/rules.d/40-alsa.rules
-/etc/udev/rules.d/50-default.rules
-/etc/udev/rules.d/50-udev-default.rules
+/etc/udev/rules.d/51-udev-default.rules
/etc/udev/rules.d/52-modules.rules
-/etc/udev/rules.d/60-cdrom_id.rules
-/etc/udev/rules.d/60-persistent-input.rules
-/etc/udev/rules.d/60-persistent-storage-tape.rules
-/etc/udev/rules.d/60-persistent-storage.rules
-/etc/udev/rules.d/61-persistent-storage-edd.rules
-/etc/udev/rules.d/70-cdrom_perms.rules
-/etc/udev/rules.d/75-cd-aliases-generator.rules
-/etc/udev/rules.d/75-persistent-net-generator.rules
-/etc/udev/rules.d/80-drivers.rules
-/etc/udev/rules.d/95-udev-late.rules
+/etc/udev/rules.d/76-cdrom_perms.rules
/etc/udev/rules.d/README
/etc/udev/rules.d/rules.examples
/etc/udev/udev.conf
/etc/udev/udev.missing
-/lib/libvolume_id.so.0
-/lib/libvolume_id.so.0.82.0
+/lib/libudev.so.0
+/lib/libudev.so.0.0.2
+/lib/libvolume_id.so.1
+/lib/libvolume_id.so.1.0.2
/lib/udev/ata_id
/lib/udev/cdrom_id
/lib/udev/create_floppy_devices
/lib/udev/edd_id
/lib/udev/firmware.sh
+/lib/udev/fstab_import
+/lib/udev/path_id
/lib/udev/rule_generator.functions
+/lib/udev/rules.d/50-udev-default.rules
+/lib/udev/rules.d/60-cdrom_id.rules
+/lib/udev/rules.d/60-persistent-input.rules
+/lib/udev/rules.d/60-persistent-storage-tape.rules
+/lib/udev/rules.d/60-persistent-storage.rules
+/lib/udev/rules.d/60-persistent-v4l.rules
+/lib/udev/rules.d/61-persistent-storage-edd.rules
+/lib/udev/rules.d/75-cd-aliases-generator.rules
+/lib/udev/rules.d/75-persistent-net-generator.rules
+/lib/udev/rules.d/79-fstab_import.rules
+/lib/udev/rules.d/80-drivers.rules
+/lib/udev/rules.d/95-udev-late.rules
/lib/udev/scsi_id
/lib/udev/usb_id
/lib/udev/vol_id
/lib/udev/write_cd_rules
/lib/udev/write_net_rules
+/usr/lib/libudev.so
/usr/lib/libvolume_id.so
diff --git a/initrd/sbin/smgl.init b/initrd/sbin/smgl.init
index 9410122..d213658 100755
--- a/initrd/sbin/smgl.init
+++ b/initrd/sbin/smgl.init
@@ -7,7 +7,7 @@ shell() {

test_cdrom() {
local found=false
- mount -n -r -t iso9660 $1 $MOUNT 2>/dev/null
+ mount -n -r $1 $MOUNT 2>/dev/null
if [ -f $ID ] ;then
found=true
fi
@@ -92,7 +92,7 @@ main() {

echo "Attempting to boot from $SMGL_CD..."

- ROOT=$SMGL_CD
+ ROOT="${ROOT:-$SMGL_CD}"
VFSTYPE=iso9660
OPTIONS="defaults,ro"

diff --git a/iso/usr/share/smgl.install/keymap
b/iso/usr/share/smgl.install/keymap
deleted file mode 100755
index 14f47d9..0000000
--- a/iso/usr/share/smgl.install/keymap
+++ /dev/null
@@ -1,137 +0,0 @@
-#!/bin/bash
-
-PREFIX=/usr/share/keymaps
-CHOICES=
-MAX=
-INPUT=
-RESULT=1
-
-function prompt() {
- echo ""
- printf "\tPlease enter a number (0 to go back): "
- read INPUT
- if [[ -n $INPUT ]]
- then
- if [[ $INPUT -lt 0 || $INPUT -gt $MAX ]]
- then
- echo "Error: You must enter a number corresponding to one"
- echo "of the choices in the list above!"
- return 1
- fi
- else
- return 0
- fi
-}
-
-function make_list {
- local list
-
- #LIST=$(find $PREFIX/$LISTDIR/* -maxdepth 0 -type d -not -name include)
- list=( $(find $PREFIX/* -maxdepth 0 -type d -not -name include) )
- MAX=${#list[*]}
- if [[ $MAX = 0 ]]
- then
- #LIST=$(find $PREFIX/$LISTDIR/* -type f -name *.map.gz)
- list=( $(find $PREFIX/* -type f -name *.map.gz) )
- MAX=${#list[*]}
- fi
- for ((i=0; i < $MAX; i++))
- do
- CHOICES[$i]=${list[i]##*/}
- done
-}
-
-function print_dirs {
- echo ""
- for ((i=0; i < $MAX; i++))
- do
- printf "\t\t\t[%2d] %s\n" "$(($i + 1))" "${CHOICES[i]}"
- done | more
-}
-
-function print_files {
- echo ""
- for ((i=0; i < $MAX; i++))
- do
- #printf "[%2d] %s" "$i" "${CHOICES[i]%.map.gz}"
- #printf "%2d %s" "$i" "${CHOICES[i]%.map.gz}"
- printf "[%2d] %s\n" "$(($i + 1))" "${CHOICES[i]}"
- done | column | more
-}
-
-function print_list {
- if [[ $MAX -gt 20 ]]
- then
- print_files
- else
- print_dirs
- fi
-}
-
-function go_list {
- local rc=1
-
- make_list
- print_list
- while [[ $rc = 1 ]]
- do
- prompt
- rc="$?"
- done
- if [[ $INPUT = 0 ]]
- then
- if [[ $PREFIX != "/usr/share/keymaps" ]]
- then
- PREFIX=${PREFIX%/[^/]*}
- fi
- else
- (( INPUT -= 1 ))
- INPUT=${CHOICES[INPUT]}
- if [[ $INPUT == *.map.gz ]]
- then
- PREFIX="$PREFIX/$INPUT"
- if loadkeys $PREFIX
- then
- # TODO: figure out what the user needs to enter in sysconfig/keymap
- echo "${PREFIX%.*map.*}" >/tmp/selected-keymap
- RESULT=0
- else
- RESULT=2
- fi
- else
- PREFIX="$PREFIX/$INPUT"
- fi
- fi
-}
-
-echo ""
-cat <<EOF
-Keymap selection menu.
-First, choose your keyboard's hardware type from the list below. Some
hardware
-types will also have a subtype, which will be presented in another menu.
-After you are done choosing your hardware type (and subtype), choose your
-preferred keymapping from the menu you are presented with. You may enter 0
-to go back to a previous menu.
-EOF
-
-while [[ $RESULT = "1" ]]
-do
- go_list
- #clear
-done
-
-if [[ $RESULT = "0" ]]
-then
- exit 0
-else
- exit 1
-fi
-
-#ls | sed 's/.map.gz$//' | nl -w 2 -s ' ' -nln | column | more
-
-#entries=( dummy $(echo * | sed -n 's/.k\?map\(.gz\)\?$//p') ); for((i=1;
-#i<${#entries[*]}; i++)) ;do printf "%2d %s" "$i" "${entries[i]}"; done |
-#column | more
-
-
-# vim:tabstop=2:softtabstop=2:shiftwidth=2:expandtab:ai
diff --git a/iso/usr/share/smgl.install/smgl-enchant
b/iso/usr/share/smgl.install/smgl-enchant
new file mode 100755
index 0000000..f667de4
--- /dev/null
+++ b/iso/usr/share/smgl.install/smgl-enchant
@@ -0,0 +1,108 @@
+#!/bin/bash
+
+function usage() {
+ cat <<USAGE
+Usage: $(basename $0) [-h] [-d /path/to/target] [CACHE1 [CACHE2..]]
+
+Installs caches to the target system (defined as /mnt/root if not
+specified). The caches installed can either be specified on the
+command-line as arguments, or they will be taken from information
+provided via /tmp/opt-spells. Note: if you are providing caches on the
+command-line, you must give the full cache filename, and caches with
+an extension of .tar.bz2 are expected.
+
+Options:
+ -d Path to target directory. Defaults to /mnt/root.
+
+ -h Shows this help information
+USAGE
+ exit 1
+} >&2
+
+function die() {
+ echo "$1"
+ exit 42
+}
+
+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
+ do
+ echo $spell | grep -q '.\+[-].\+' || break
+ spell=${spell%-*}
+ done
+ grep -q $spell $TABLETS ||
+ die "Couldn't create tablet information for $spell"
+
+ # generate the depends and packages info for sorcery to use
+ for date in "$tablet/$spell"/*
+ do
+ tablet_get_version $date ver
+ tablet_get_status $date stat
+ tablet_get_depends $date dep
+ echo "${spell##*/}:${date##*/}:$stat:$ver" >> "$packages"
+ cat "$dep" >> "$depends"
+ done
+}
+
+while getopts ":d:h" Option
+do
+ case $Option in
+ d ) TARGET="$OPTARG" ;;
+ h ) usage ;;
+ * ) echo "Unrecognized option." >&2 && usage ;;
+ esac
+done
+shift $(($OPTIND - 1))
+
+CACHE_DIR="${CACHE_DIR:-/var/cache/sorcery}"
+CACHE_LIST="${CACHE_LIST:-/tmp/opt-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 ]]
+then
+ echo "Gathering tablet information..."
+ find $tablet -maxdepth 1 -type d | sed 's#^.*/##' > $TABLETS
+fi
+
+if [[ $# -ge 1 ]]
+then
+ # for each cache file specified on the command line, process them one at a
+ # time and generate the necessary sorcery state for each as they are
+ # processed
+ while [[ $# -ge 1 ]]
+ do
+ CACHE="$1"
+ echo "Installing ${CACHE##*/} ..."
+ tar jxf "$CACHE" -C "$TARGET"/ &&
+ generate_state "${CACHE##*/}" &&
+ echo "${CACHE##*/} installed."
+ shift
+ done
+else
+ # for each spell-version listed in /tmp/opt-spells, untar the corresponding
+ # cache file from the ISO into the TARGET system and generate the necessary
+ # sorcery state information afterwards so the TARGET sorcery can deal with
+ # after the new system is booted
+ for cache in $(<$CACHE_LIST)
+ do
+ echo "Installing $cache ..."
+ tar jxf $CACHE_DIR/$cache*.tar.bz2 -C "$TARGET"/ &&
+ generate_state $cache &&
+ echo "$cache installed."
+ done
+fi
+
+
+
+# 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
new file mode 100755
index 0000000..7e85889
--- /dev/null
+++ b/iso/usr/share/smgl.install/smgl-kernel
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+function usage() {
+ cat <<USAGE
+Usage: $(basename $0) [-h] [-d /path/to/target]
+
+Installs the ISO kernel and it's modules to the target specified. If no
target
+is specified on the command-line, it installs to /mnt/root by default.
+
+Options:
+ -h Shows this help information
+USAGE
+ exit 1
+} >&2
+
+while getopts ":h" Option
+do
+ case $Option in
+ h ) usage ;;
+ * ) echo "Unrecognized option." >&2 && usage ;;
+ esac
+done
+shift $(($OPTIND - 1))
+
+[[ $# -eq 1 ]] && TARGET="$1"
+TARGET="${TARGET:-/mnt/root}"
+
+# Copy the kernel config
+cp -f /boot/config-$(uname -r) "$TARGET"/boot/config-$(uname -r)-SMGL-iso
+
+# Copy the kernel image
+cp -f /boot/linux-$(uname -r) "$TARGET"/boot/vmlinuz-$(uname -r)-SMGL-iso
+
+# Copy all kernel modules
+[[ -d "$TARGET"/lib/modules ]] || mkdir -p "$TARGET"/lib/modules
+cp -fr /lib/modules/$(uname -r) "$TARGET"/lib/modules/
+
+
+# vim:tabstop=2:softtabstop=2:shiftwidth=2:expandtab:ai
diff --git a/iso/usr/share/smgl.install/smgl-keymap
b/iso/usr/share/smgl.install/smgl-keymap
new file mode 100755
index 0000000..14f47d9
--- /dev/null
+++ b/iso/usr/share/smgl.install/smgl-keymap
@@ -0,0 +1,137 @@
+#!/bin/bash
+
+PREFIX=/usr/share/keymaps
+CHOICES=
+MAX=
+INPUT=
+RESULT=1
+
+function prompt() {
+ echo ""
+ printf "\tPlease enter a number (0 to go back): "
+ read INPUT
+ if [[ -n $INPUT ]]
+ then
+ if [[ $INPUT -lt 0 || $INPUT -gt $MAX ]]
+ then
+ echo "Error: You must enter a number corresponding to one"
+ echo "of the choices in the list above!"
+ return 1
+ fi
+ else
+ return 0
+ fi
+}
+
+function make_list {
+ local list
+
+ #LIST=$(find $PREFIX/$LISTDIR/* -maxdepth 0 -type d -not -name include)
+ list=( $(find $PREFIX/* -maxdepth 0 -type d -not -name include) )
+ MAX=${#list[*]}
+ if [[ $MAX = 0 ]]
+ then
+ #LIST=$(find $PREFIX/$LISTDIR/* -type f -name *.map.gz)
+ list=( $(find $PREFIX/* -type f -name *.map.gz) )
+ MAX=${#list[*]}
+ fi
+ for ((i=0; i < $MAX; i++))
+ do
+ CHOICES[$i]=${list[i]##*/}
+ done
+}
+
+function print_dirs {
+ echo ""
+ for ((i=0; i < $MAX; i++))
+ do
+ printf "\t\t\t[%2d] %s\n" "$(($i + 1))" "${CHOICES[i]}"
+ done | more
+}
+
+function print_files {
+ echo ""
+ for ((i=0; i < $MAX; i++))
+ do
+ #printf "[%2d] %s" "$i" "${CHOICES[i]%.map.gz}"
+ #printf "%2d %s" "$i" "${CHOICES[i]%.map.gz}"
+ printf "[%2d] %s\n" "$(($i + 1))" "${CHOICES[i]}"
+ done | column | more
+}
+
+function print_list {
+ if [[ $MAX -gt 20 ]]
+ then
+ print_files
+ else
+ print_dirs
+ fi
+}
+
+function go_list {
+ local rc=1
+
+ make_list
+ print_list
+ while [[ $rc = 1 ]]
+ do
+ prompt
+ rc="$?"
+ done
+ if [[ $INPUT = 0 ]]
+ then
+ if [[ $PREFIX != "/usr/share/keymaps" ]]
+ then
+ PREFIX=${PREFIX%/[^/]*}
+ fi
+ else
+ (( INPUT -= 1 ))
+ INPUT=${CHOICES[INPUT]}
+ if [[ $INPUT == *.map.gz ]]
+ then
+ PREFIX="$PREFIX/$INPUT"
+ if loadkeys $PREFIX
+ then
+ # TODO: figure out what the user needs to enter in sysconfig/keymap
+ echo "${PREFIX%.*map.*}" >/tmp/selected-keymap
+ RESULT=0
+ else
+ RESULT=2
+ fi
+ else
+ PREFIX="$PREFIX/$INPUT"
+ fi
+ fi
+}
+
+echo ""
+cat <<EOF
+Keymap selection menu.
+First, choose your keyboard's hardware type from the list below. Some
hardware
+types will also have a subtype, which will be presented in another menu.
+After you are done choosing your hardware type (and subtype), choose your
+preferred keymapping from the menu you are presented with. You may enter 0
+to go back to a previous menu.
+EOF
+
+while [[ $RESULT = "1" ]]
+do
+ go_list
+ #clear
+done
+
+if [[ $RESULT = "0" ]]
+then
+ exit 0
+else
+ exit 1
+fi
+
+#ls | sed 's/.map.gz$//' | nl -w 2 -s ' ' -nln | column | more
+
+#entries=( dummy $(echo * | sed -n 's/.k\?map\(.gz\)\?$//p') ); for((i=1;
+#i<${#entries[*]}; i++)) ;do printf "%2d %s" "$i" "${entries[i]}"; done |
+#column | more
+
+
+# vim:tabstop=2:softtabstop=2:shiftwidth=2:expandtab:ai
diff --git a/scripts/add-sauce.sh b/scripts/add-sauce.sh
index e8851eb..626df15 100755
--- a/scripts/add-sauce.sh
+++ b/scripts/add-sauce.sh
@@ -64,7 +64,7 @@ if [[ $TYPE == "bad" || -z $1 ]] ;then
usage
fi

-CHROOTDIR="$1"
+CHROOTDIR="${1%/}"

if ! $FORCE ;then
if [[ ! -x "$CHROOTDIR"/bin/bash ]] ;then
@@ -94,8 +94,11 @@ function blacklist_modules {
sort >> "$DEST"/etc/modprobe.d/blacklist
}

-KVER=${KVER:-$(find "$CHROOTDIR"/lib/modules -mindepth 1 -maxdepth 1 -print
| head -n1 | sed 's#.*/##')}
-[[ -z $KVER ]] && exit 3
+if [[ $TYPE == "iso" ]] ;then
+ # ensure kernel presence/sanity
+ KVER=${KVER:-$(find "$CHROOTDIR"/lib/modules -mindepth 1 -maxdepth 1
-print | head -n1 | sed 's#.*/##')}
+ [[ -z $KVER ]] && exit 3
+fi

# make sure we start with a clean TEMPDIR each run
rm -rf "$TEMPDIR"
@@ -105,10 +108,12 @@ KVER=${KVER:-$(find "$CHROOTDIR"/lib/modules -mindepth
1 -maxdepth 1 -print | he
# should go onto both iso and system chroots
# this is mostly /etc content
cp -a "$MYDIR"/base/* "$TEMPDIR"/
- blacklist_modules "$CHROOTDIR/lib/modules/$KVER/kernel/drivers/video"
"$TEMPDIR"/

# ISO Sauce
if [[ $TYPE == "iso" ]] ;then
+ # add the relevant modules to the blacklist
+ blacklist_modules "$CHROOTDIR/lib/modules/$KVER/kernel/drivers/video"
"$TEMPDIR"/
+
# copy everything from the cauldron repo iso dir
# into the TEMPDIR staging area
cp -a "$MYDIR"/iso/* "$TEMPDIR"/
@@ -164,5 +169,9 @@ do
fi
done

- rm -rf "$TEMPDIR"
+# ensure that ld has an up-to-date cache
+"${0%/*}"/cauldronchr.sh -d "$CHROOTDIR" /sbin/ldconfig
+
+# clean up
+rm -rf "$TEMPDIR"

diff --git a/scripts/mkinitrd.sh b/scripts/mkinitrd.sh
index 02e127e..ea25222 100755
--- a/scripts/mkinitrd.sh
+++ b/scripts/mkinitrd.sh
@@ -57,6 +57,8 @@ fi
ISO_DIR=$1
KERNEL_VERSION=$2

+OUTPUT="${OUTPUT:-./initrd.gz}"
+
if ! [[ -d $ISO_DIR/lib/modules/$KERNEL_VERSION/kernel ]] ;then
echo "Chroot failed sanity check:"
echo "Unable to find $ISO_DIR/lib/modules/$KERNEL_VERSION/kernel"
@@ -155,7 +157,7 @@ function mk_initrd_file() {
cp -a $1/* $tmp_mountdir
umount -d $tmp_mountdir

- gzip -c $tmp_file >$2
+ gzip -c $tmp_file > $2

rm -rf $tmp_file $tmp_mountdir
echo "initrd is at $2, compressed $(du -ks $2 | cut -d$'\t' -f1)K,
uncompressed ${initrd_size}K."
diff --git a/scripts/mkiso.sh b/scripts/mkiso.sh
index 2cd2467..bbc12c3 100755
--- a/scripts/mkiso.sh
+++ b/scripts/mkiso.sh
@@ -25,18 +25,27 @@ Required:
the command to execute, or to set the command to be /bin/bash -l
some_command_without_abs_path). Defaults to "/bin/bash -l".
Options:
- -u Change ownership of output files to $UID:$GID
+ -u Change ownership of output files to $UID:$GID. You must specify
the
+ $UID:$GID pair as a string such as root:root or 0:0 or the script
+ will fail.
+
+ -z Compress the resulting ISO with bzip2.
+
+ -k Keep the original ISO file in addition to the compressed version
+ when compressing. Implies -z.

-h Shows this help information
EndUsage
exit 1
} >&2

-while getopts ":kuzh" Options
+while getopts ":ku:zh" Options
do
case $Options in
k ) KEEP="-k" ;;
- u ) ISOCHOWN=true ;;
+ u ) ISOCHOWN=true
+ CHOWNSTR="$OPTARG"
+ ;;
z ) COMPRESS=true ;;
h ) usage ;;
* ) echo "Unrecognized option" >&2 && usage ;;
@@ -66,5 +75,5 @@ then
$SUODOCMD bzip2 -f -v $KEEP "${ISO_VERSION}.iso"
fi

-[[ $ISOCHOWN ]] && chown $UID:$GID ${ISO_VERSION}.iso*
+[[ $ISOCHOWN ]] && chown "$CHOWNSTR" "${ISO_VERSION}".iso*

diff --git a/scripts/mkrelease.sh b/scripts/mkrelease.sh
index 8a9cd2d..be14c01 100755
--- a/scripts/mkrelease.sh
+++ b/scripts/mkrelease.sh
@@ -25,17 +25,21 @@ Required:
resulting in smgl-VERSION.iso for the final ISO output.

Options:
- -u chown output files to $UID:$GID
+ -u Change ownership of output files to $UID:$GID. You must specify
the
+ $UID:$GID pair as a string such as root:root or 0:0 or the script
+ will fail.

-h Shows this help information
EndUsage
exit 1
} >&2

-while getopts ":uh" Option
+while getopts ":u:h" Option
do
case $Option in
- u ) ISOCHOWN="-u" ;;
+ u ) ISOCHOWN="-u"
+ CHOWNSTR="$OPTARG"
+ ;;
h ) usage ;;
* ) echo "Unrecognized option." >&2 && usage ;;
esac
@@ -58,7 +62,7 @@ fi
[[ $# -lt 2 ]] && usage

# Get the grimoire version used to generate all the spells in the ISO.
-GRIMOIRE_VER=$(< "$TARGET"/var/lib/sorcery/codex/stable/VERSION)
+GRIMOIRE_VER=$(< "$TARGET"/etc/grimoire_version)

# Replace all ISO_VERSION placeholders with the ISO version passed on the
# commandline.
@@ -71,5 +75,5 @@ done
sed -i "s/@GRIMOIRE_VERSION@/$GRIMOIRE_VER/" "$TARGET"/isolinux/isolinux.msg

# Generate the release ISO. Currently we force KEEP and COMPRESSION.
-$(dirname $0)/mkiso.sh $ISOCHOWN -kz "$TARGET" "smgl-$VERSION"
+$(dirname $0)/mkiso.sh "$ISOCHOWN $CHOWNSTR" -kz "$TARGET" "smgl-$VERSION"

diff --git a/scripts/spellcaster.sh b/scripts/spellcaster.sh
index c128fd7..0be58a9 100755
--- a/scripts/spellcaster.sh
+++ b/scripts/spellcaster.sh
@@ -194,7 +194,7 @@ function install_kernel() {
local SRC=$1
local DST=$2
local kconfig=$3
- local version=
+ local version=$4
local kernel=

# Exit if DST undefined, otherwise we could damage the host system
@@ -226,7 +226,14 @@ function install_kernel() {
# kernel config
if [[ -z $version ]]
then
- if [[ -h "$SRC"/usr/src/linux ]]
+ local modules="$SRC/lib/modules"
+ modules="$(find "$modules" -mindepth 1 -maxdepth 1 -type d)"
+ modules="$(echo "$modules" | sed 's#.*/##')"
+
+ if [[ $(echo "$modules" | wc -l) -eq 1 ]]
+ then
+ version="$modules"
+ elif [[ -h "$SRC"/usr/src/linux ]]
then
if readlink "$SRC"/usr/src/linux
then
@@ -266,7 +273,7 @@ function install_kernel() {
}

function setup_sys() {
- local SPOOL="$TARGET/var/spool"
+ 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)
@@ -292,18 +299,20 @@ function setup_sys() {
tar jxf "$SPOOL"/$SORCERY -C "$TARGET/usr/src"
pushd "$SORCERYDIR" &> /dev/null
./install "$SYSDIR"
- popd
+ popd &> /dev/null

# install the stable grimoire used for build into SYSDIR
(
- cd "$TARGET/tmp"
+ cd "$SPOOL"
wget http://download.sourcemage.org/codex/$stable
)
+ echo "Installing grimoire ${stable%.tar.bz2} ..."
[[ -d "$syscodex" ]] || mkdir -p $syscodex &&
- tar jxf $stable -C "$syscodex"/
+ tar jxf "$SPOOL"/$stable -C "$syscodex"/ &&
mv "$syscodex"/${stable%.tar.bz2} "$syscodex"/stable

# generate the depends and packages info for sorcery to use
+ rm -f "$depends" "$packages"
. "$SYSDIR"/etc/sorcery/config
for spell in "$tablet"/*
do
@@ -319,6 +328,8 @@ function setup_sys() {
}

function setup_iso() {
+ local GVERS="$TARGET/var/lib/sorcery/stable/VERSION"
+
# copy the iso caches over and unpack their contents
for cache in $(<"$TARGET"/iso-list)
do
@@ -332,17 +343,21 @@ function setup_iso() {
cp "$TARGET"/var/cache/sorcery/$cache*.tar.bz2
"$ISODIR"/var/cache/sorcery/
done

+ # install the kernel into ISODIR
install_kernel "$TARGET" "$ISODIR"
+
+ # save the grimoire version used for building everything to ISODIR
for reference
+ cp -f $GVERS "$ISODIR"/etc/grimoire_version
}

function clean_target() {
- local config="$TARGET/etc/sorcery/local/kernel.config"
+ local config="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"
+ rm -f "$TARGET/tmp/resolv.conf"

# Clean up the target
rm -f "$TARGET/rspells" \
@@ -368,6 +383,16 @@ TYPE="${TYPE:-x86}"
ISODIR="${ISODIR:-/tmp/cauldron/iso}"
SYSDIR="${SYSDIR:-/tmp/cauldron/sys}"

+# ensure full pathnames
+if [[ $(dirname "$ISODIR") == "." ]]
+then
+ ISODIR="$(pwd)/$ISODIR"
+fi
+if [[ $(dirname "$SYSDIR") == "." ]]
+then
+ SYSDIR="$(pwd)/$SYSDIR"
+fi
+
sanity_check

prepare_target
@@ -377,9 +402,13 @@ prepare_target

# unpack sys caches and set up sorcery into SYSDIR
setup_sys
+touch "$SYSDIR"/etc/ld.so.conf
+"$MYDIR/cauldronchr.sh" -d "$SYSDIR" /sbin/ldconfig

# unpack iso caches and copy iso and optional caches into ISODIR
setup_iso
+touch "$SYSDIR"/etc/ld.so.conf
+"$MYDIR/cauldronchr.sh" -d "$ISODIR" /sbin/ldconfig

# Keep a clean kitchen, wipes up the leftovers from the preparation step
clean_target



  • [SM-Commit] GIT changes to devel-andrew cauldron by Andrew Stitt (ad897e1e177fac3a5cf2be69cb17c421510949a0), Andrew Stitt, 01/02/2009

Archive powered by MHonArc 2.6.24.

Top of Page