Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to devel-flux cauldron by Justin Boffemmyer (8e373f6bbbb85e426bca11e6061ebf4e6a1aef5e)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Justin Boffemmyer <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to devel-flux cauldron by Justin Boffemmyer (8e373f6bbbb85e426bca11e6061ebf4e6a1aef5e)
  • Date: Sun, 8 Jun 2008 20:49:14 -0500

GIT changes to devel-flux cauldron by Justin Boffemmyer <flux AT sourcemage.org>:

src/enchant/shell/bashrc | 90 +++++++++++++++++++++++++++
src/enchant/shell/keymap | 137
++++++++++++++++++++++++++++++++++++++++++
src/enchant/shell/order | 17 +++++
src/enchant/shell/smgl-chroot | 17 +++++
src/enchant/shell/steps | 12 +++
5 files changed, 273 insertions(+)

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

enchant/shell: re-added from installers->enchant move

diff --git a/src/enchant/shell/bashrc b/src/enchant/shell/bashrc
new file mode 100755
index 0000000..e639251
--- /dev/null
+++ b/src/enchant/shell/bashrc
@@ -0,0 +1,90 @@
+#!/bin/bash
+
+# This file is the SMGL shell installer.
+# Take care not to pollute the user's namespace too much,
+# And make sure your functions don't collide with existing commands.
+
+. /etc/cauldron/local/config
+. ${ISO}/${ENCHANT_DATA}/libenchant
+
+# Ensure installer sanity
+enchant_prepare
+
+function header() {
+ local doc
+ doc=$1
+ echo ""
+ echo ""
+ echo ""
+ cat $1
+}
+
+function todo() {
+ local CURSTEP=$(enchant_getstep)
+
+ header ${ENCHANT_MSGS}/steps/$CURSTEP
+}
+
+function next_step() {
+ enchant_getnext
+}
+
+function cur_step() {
+ enchant_getstep
+}
+
+function next() {
+ enchant_setnext
+ todo
+}
+
+function prev() {
+ enchant_setprev
+ todo
+}
+
+function num_current() {
+ enchant_getnum
+}
+
+function num_steps() {
+ enchant_gettotal
+}
+
+function steps() {
+ header $ENCHANT_DATA/shell/steps
+}
+
+function back() {
+ enchant_back
+}
+
+function forward() {
+ enchant_forward
+}
+
+function jump() {
+ enchant_setstep $*
+ if [[ $? = $EERR_STEP ]]
+ then
+ echo ""
+ echo "Error: '$*' is not a recognized step."
+ echo "Type steps to see a list of steps."
+ fi
+}
+
+function welcome() {
+ header ${ENCHANT_MSGS}/welcome
+}
+
+function help() {
+ helpfile=${ENCHANT_MSGS}/help/${1:-index}
+ if [[ -e $helpfile ]] ;then
+ header $helpfile
+ else
+ echo "No installer help for '$1', falling back to bash's builtin help"
+ builtin help $1
+ fi
+}
+
+PS1="[current:\$(cur_step) next:\$(next_step) \$(num_current)/\$(num_steps)]
For a list of commands, type help\n\u \w\$ "
diff --git a/src/enchant/shell/keymap b/src/enchant/shell/keymap
new file mode 100755
index 0000000..531d824
--- /dev/null
+++ b/src/enchant/shell/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/src/enchant/shell/order b/src/enchant/shell/order
new file mode 100644
index 0000000..026e51d
--- /dev/null
+++ b/src/enchant/shell/order
@@ -0,0 +1,17 @@
+init:disk-partition
+disk-partition:disk-format
+disk-format:disk-mount
+disk-mount:copy-base
+copy-base:edit-confs
+edit-confs: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
+user-setup:reboot
+reboot:reboot
+error:init
+init:init
+init:error
diff --git a/src/enchant/shell/smgl-chroot b/src/enchant/shell/smgl-chroot
new file mode 100755
index 0000000..717fcd9
--- /dev/null
+++ b/src/enchant/shell/smgl-chroot
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+# Note: don't use --rbind: It creates several mounts, and we wouldn't be able
+# to figure out easily what to umount.
+mount --bind /dev /mnt/root/dev &&
+mount --bind /dev/pts /mnt/root/dev/pts &&
+mount --bind /proc /mnt/root/proc &&
+export PS1="[inside chroot, type exit to return to installer]\n\u
\w\$ " &&
+chroot /mnt/root "$@"
+rc=$?
+umount /mnt/root/proc
+umount /mnt/root/dev/pts
+umount /mnt/root/dev
+
+exit $rc
+
+# vim:sw=2:ts=2:softtabstop=2:expandtab:ai
diff --git a/src/enchant/shell/steps b/src/enchant/shell/steps
new file mode 100644
index 0000000..c8f548d
--- /dev/null
+++ b/src/enchant/shell/steps
@@ -0,0 +1,12 @@
+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
+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
+edit-confs - editing the basic configuration files
+install-opt-spells - installing other spells you may need
+user-setup - set root password, create regular users
+reboot - reboot into the new system



  • [SM-Commit] GIT changes to devel-flux cauldron by Justin Boffemmyer (8e373f6bbbb85e426bca11e6061ebf4e6a1aef5e), Justin Boffemmyer, 06/08/2008

Archive powered by MHonArc 2.6.24.

Top of Page