sm-commit AT lists.ibiblio.org
Subject: Source Mage code commit list
List archive
[SM-Commit] GIT changes to master cauldron by Karsten Behrmann (d25f7b2b1e9b1a4defd3435ca0d441a02afb1501)
- From: Karsten Behrmann <scm AT sourcemage.org>
- To: sm-commit AT lists.ibiblio.org
- Subject: [SM-Commit] GIT changes to master cauldron by Karsten Behrmann (d25f7b2b1e9b1a4defd3435ca0d441a02afb1501)
- Date: Mon, 6 Aug 2007 03:03:50 -0500
GIT changes to master cauldron by Karsten Behrmann <karsten AT BearBook.local>:
initrd/bin/boot-from | 2
initrd/sbin/smgl.init | 242
++--------------
iso/mnt/initrd/.dummy | 1
iso/mnt/root/.dummy | 1
iso/usr/share/doc/smgl.install/steps/copy-base | 13
iso/usr/share/doc/smgl.install/steps/disk-mount | 23 +
iso/usr/share/doc/smgl.install/steps/disk-partition | 22 +
iso/usr/share/doc/smgl.install/steps/edit-confs | 8
iso/usr/share/doc/smgl.install/steps/init | 2
iso/usr/share/doc/smgl.install/steps/install-opt-spells | 5
iso/usr/share/doc/smgl.install/steps/reboot | 2
iso/usr/share/doc/smgl.install/welcome | 14
iso/usr/share/smgl.install/bashrc | 2
13 files changed, 122 insertions(+), 215 deletions(-)
New commits:
commit d25f7b2b1e9b1a4defd3435ca0d441a02afb1501
Author: Karsten Behrmann <karsten AT BearBook.local>
Commit: Karsten Behrmann <karsten AT BearBook.local>
add directories needed on the iso
commit 45271b9d392260de47cefde493fb91f292b8c051
Author: Karsten Behrmann <karsten AT BearBook.local>
Commit: Karsten Behrmann <karsten AT BearBook.local>
improve in-shell installing docs a bunch
commit 4051fa2c2b690b64c58082134d054f1079dfa7ad
Author: Karsten Behrmann <karsten AT BearBook.local>
Commit: Karsten Behrmann <karsten AT BearBook.local>
change initrd to pure console-based, this kills the initrd's dependency
on dialog and hopefully makes stuff less complicated
commit f742a16f57295a7f2b2bafd57b0e1f3d8f00d1f8
Author: Karsten Behrmann <karsten AT BearBook.local>
Commit: Karsten Behrmann <karsten AT BearBook.local>
Fix bug with doc message advancing
diff --git a/initrd/bin/boot-from b/initrd/bin/boot-from
new file mode 100755
index 0000000..4b2c617
--- /dev/null
+++ b/initrd/bin/boot-from
@@ -0,0 +1,2 @@
+#!/bin/bash
+echo "$*" >/cdrom.hint
diff --git a/initrd/sbin/smgl.init b/initrd/sbin/smgl.init
index 6a5ad94..591d44c 100755
--- a/initrd/sbin/smgl.init
+++ b/initrd/sbin/smgl.init
@@ -5,66 +5,6 @@ shell() {
/bin/bash
}
-show_modules() {
- for ITEM in "$1"/* ;do
- echo ${ITEM%%*/}
- if [[ -d "${ITEM}" ]] ;then
- echo "Directory"
- else
- echo "Module"
- fi
- done
-}
-
-input_module_parameters() {
- "${DIALOG[@]}" --nocancel --inputbox \
- "You can optionally enter module parameters" 0 60
-}
-
-# returns when the user is done loading modules
-
-load_module() {
-
- if [ -n "$1" ]; then
- while true ;do
- MODULE=$("${DIALOG[@]}" \
- --title "Module Menu" --cancel-label "back" \
- --menu "Please select a module to load:" 15 60 0 \
- $(show_modules "$1"))
-
- # if the user hit the <Cancel> button, we return.
- [ -n "${MODULE}" ] ||
- return -1;
-
- if [ -d "$1/${MODULE}" ] ;then
- #the user selected a directory, we display a new menu
- load_module "$1/${MODULE}"
- elif [ -f "$1/${MODULE}" ]; then
- # he selected a file, load that menu
- # remove .o (2.4 kernels) or .ko (2.6 kernels) extension.
- MODULE=${MODULE%.o} &&
- MODULE=${MODULE%.ko} &&
- PARAMETERS=$(input_module_parameters) &&
- echo "Running modprobe ${MODULE} ${PARAMETERS}" &&
- if modprobe "${MODULE}" $PARAMETERS ;then
- read -p "Success. Press enter..."
- else
- read -p "Failure. Press enter..."
- fi
- fi
- done
-
- else
- MODULE_DIR="/lib/modules/${KERNEL}/kernel"
-
- if [ ! -d "${MODULE_DIR}" ]; then
- "${DIALOG[@]}" --msgbox "Unable to find any modules" 6 60
- return -1;
- fi
- load_module "${MODULE_DIR}"
- fi
-}
-
test_cdrom() {
local found=false
mount -n -r -t iso9660 $1 $MOUNT 2>/dev/null
@@ -80,8 +20,14 @@ test_cdrom() {
scan_cdroms() {
- unset SMGL_CD
+ SMGL_CD='unknown'
+
+ if [[ -e /cdrom.hint ]] ;then
+ SMGL_CD=$(<cdrom.hint)
+ return
+ fi
+ echo "Trying to find the SMGL CD automatically..."
for handler in /proc/*/*/media ;do
if grep -q 'cdrom' $handler ;then
handler=${handler%/media}
@@ -113,145 +59,49 @@ scan_cdroms() {
done </proc/partitions
}
+main() {
-toggle_hotplug() {
- [[ "$HOTPLUG_ACTION" == "enable" ]] &&
- HOTPLUG_ACTION="disable" ||
- HOTPLUG_ACTION="enable"
-}
-
-show_filesystems() {
-
- for FILESYSTEM in `grep -v nodev /proc/filesystems`;
- do
-
- echo "${FILESYSTEM}"
- echo filesystem
-
+ # Process init options directed at us
+ while [[ $# -gt 0 ]] ;do
+ if [[ $1 == 'shellout' ]] ;then
+ echo "requested a shellout!"
+ else
+ INITOPTS[i++]=$1
+ fi
+ shift
done
-}
-
-
-select_root() {
-
- FILESYSTEMS=`show_filesystems` &&
-
- NEW_ROOT=`"${DIALOG[@]}" --inputbox \
- "Please enter the root device." \
- 8 60 \
- "${ROOT}"` &&
-
- NEW_VFSTYPE=`"${DIALOG[@]}" --menu \
- "Please select a file system." \
- 7 60 0 \
- $FILESYSTEMS` &&
-
- NEW_OPTIONS=`"${DIALOG[@]}" --inputbox \
- "Please enter mounting options" \
- 8 60 \
- "${OPTIONS}"` &&
-
- ROOT="${NEW_ROOT}" &&
- VFSTYPE="${NEW_VFSTYPE}" &&
- OPTIONS="${NEW_OPTIONS}"
-
-}
-
-main_menu() {
-
- HOTPLUG_ACTION="disable"
- # NOTE: this is the opposite of the status of the toggle
-
- while true;
- do
-
- M_HELP="Select modules to load"
- S_HELP="Shell out for a moment"
- H_HELP="toggle if the ISO runs hotplug"
- R_HELP="Choose the device to be mounted as /"
- D_HELP="Continue the normal boot process"
-
- scan_cdroms
-
- if [ -z "$SMGL_CD" ] &&
- [ -z "$ROOT" ]; then
-
- HELP="Load the correct low level SCSI driver kernel module
- to be able to detect and read the SCSI CDROM."
-
- DEFAULT_ITEM="M"
-
- elif [ -z "$ROOT" ]; then
-
- HELP="The Source Mage GNU/Linux Install/Rescue CDROM is
- detected on $SMGL_CD"
-
- DEFAULT_ITEM="D"
-
- else
-
- HELP="You have selected to mount $ROOT as the root file
- system."
-
- DEFAULT_ITEM="D"
-
- fi
-
- COMMAND=`"${DIALOG[@]}" --title "Initrd Menu" \
- --nocancel \
- --item-help \
- --default-item "$DEFAULT_ITEM" \
- --menu \
- "$HELP" \
- 8 60 0 \
- "M" "Load modules " "$M_HELP" \
- "S" "Shell " "$S_HELP" \
- "H" "$HOTPLUG_ACTION hotplug" "$H_HELP" \
- "R" "Choose root device (For rescue mode)"
"$R_HELP" \
- "D" "Continue booting " "$D_HELP"`
-
- case $COMMAND in
- M) load_module ;;
- S) shell ;;
- H) toggle_hotplug ;;
- R) select_root ;;
- D) return ;;
- esac
-
- done
-}
-
-
-main() {
-
while true ;do
- main_menu
- if [ -z $ROOT ] && [ -z $SMGL_CD ] ;then
- # height is 6 lines :
- # 1 line for drawing a top line
- # 1 line for a blank line
- # 1 line of text
- # 1 line for drawing a line
- # 1 line for <OK> button
- # 1 line for drawing a bottom line
- "${DIALOG[@]}" --msgbox "Unable to boot without a root." 6 60
+ scan_cdroms
+
+ if [[ $SMGL_CD == "unknown" ]] ;then
+ echo "Unable to find the SMGL CD in anything remotely looking like a"
+ echo "CD drive that I can see right now. Please load appropriate"
+ echo "modules, or explicitly specify a device to boot from by entering
e.g."
+ echo " boot-from /dev/hdc"
+ echo "Press Ctrl-D or type 'exit' when done."
+ /bin/bash
continue
fi
- ROOT=${ROOT:-$SMGL_CD}
- VFSTYPE=${VFSTYPE:-iso9660}
- OPTIONS=${OPTIONS:-"defaults,ro"}
+ echo "Attempting to boot from $SMGL_CD..."
+
+ ROOT=$SMGL_CD
+ VFSTYPE=iso9660
+ OPTIONS="defaults,ro"
mount -n -t $VFSTYPE -o $OPTIONS $ROOT $MOUNT ||
{
- "${DIALOG[@]}" --msgbox "Unable to mount $ROOT as $VFSTYPE." 6 60
- continue
+ echo "Unable to mount $ROOT as $VFSTYPE, retrying with type auto."
+ mount -n -t auto $ROOT $MOUNT || {
+ echo "ERROR: Unable to mount $ROOT even with type auto."
+ continue
+ }
}
if [ ! -x $MOUNT/sbin/init ]; then
- "${DIALOG[@]}" --msgbox "Unable to locate /sbin/init on $ROOT." 6 60
+ echo "ERROR: Unable to locate /sbin/init on $ROOT."
umount -n $MOUNT
continue
fi
@@ -267,10 +117,10 @@ main() {
/bin/mount -t tmpfs tmpfs $MOUNT/dev
$MOUNT/bin/cp -a --parents dev $MOUNT
- for i in etc root var/log var/lib/nfs ;do
- echo "NOT!!! Setting up writable /$i for install"
- #/bin/mount -t tmpfs tmpfs $MOUNT/$i
- #$MOUNT/bin/cp -a --parents $i $MOUNT
+ for i in tmp etc root var/log var/lib/nfs ;do
+ echo "Setting up writable /$i for install"
+ /bin/mount -t tmpfs tmpfs $MOUNT/$i
+ $MOUNT/bin/cp -a --parents $i $MOUNT
done
cd $MOUNT
/bin/umount $MOUNT/mnt/cdrom
@@ -279,11 +129,6 @@ main() {
echo "$ROOT" >$MOUNT/etc/cddev
fi
- if [[ "$HOTPLUG_ACTION" == "enable" ]] ;then
- # Menu entry was "enable", so it was set to disabled
- $MOUNT/bin/chmod a-x $MOUNT/etc/init.d/runlevels/%S/hotplug
- fi
-
cd $MOUNT
if [ -d initrd ]; then
@@ -292,7 +137,7 @@ main() {
pivot_root . mnt
fi
- echo "Running /sbin/init $@"
+ echo "Running /sbin/init ${INITOPTS[*]}"
# if the new root filesystem uses devfs, /dev/console should not exist
if [ ! -e dev/console ]; then
@@ -301,7 +146,7 @@ main() {
mount -n -t proc proc proc
- exec chroot . /sbin/init "$@" <dev/console >dev/console 2>&1
+ exec chroot . /sbin/init "${INITOPTS[*]}" <dev/console >dev/console 2>&1
done
@@ -311,9 +156,6 @@ main() {
export PATH=/bin:/usr/bin:/sbin:/usr/sbin
-DIALOG=( "dialog" "--trim" "--stdout" \
- "--backtitle" "Source Mage GNU/Linux initrd" )
-
mount -n -t proc proc /proc
KERNEL=`uname -r`
diff --git a/iso/mnt/initrd/.dummy b/iso/mnt/initrd/.dummy
new file mode 100644
index 0000000..1b57741
--- /dev/null
+++ b/iso/mnt/initrd/.dummy
@@ -0,0 +1 @@
+initrd will be mounted here
diff --git a/iso/mnt/root/.dummy b/iso/mnt/root/.dummy
new file mode 100644
index 0000000..eed69fc
--- /dev/null
+++ b/iso/mnt/root/.dummy
@@ -0,0 +1 @@
+system will be mounted here
diff --git a/iso/usr/share/doc/smgl.install/steps/copy-base
b/iso/usr/share/doc/smgl.install/steps/copy-base
index d42ba6d..d370c9d 100644
--- a/iso/usr/share/doc/smgl.install/steps/copy-base
+++ b/iso/usr/share/doc/smgl.install/steps/copy-base
@@ -1 +1,12 @@
-untar the big tarball.
+Now, it's time to set up the basic smgl installation.
+
+Run the following command:
+[1mtar -xjvf /system.tar.bz2 -C /mnt/root[m
+(if BearPerson gets his lazy ass in gear, we might have an alias for this
+soon to cut down on typing)
+
+If you don't need to see output rushing by to give you the feeling that
+something is going on, leave out the [1mv[m (turning [1m-xjvf[m into
[1m-xjf[m)
+to make tar shut up unless there's errors.
+
+When the command has completed, type [1mnext[m as usual.
diff --git a/iso/usr/share/doc/smgl.install/steps/disk-mount
b/iso/usr/share/doc/smgl.install/steps/disk-mount
index 93e4be9..ded3bf2 100644
--- a/iso/usr/share/doc/smgl.install/steps/disk-mount
+++ b/iso/usr/share/doc/smgl.install/steps/disk-mount
@@ -1 +1,22 @@
-mount your disks now
+Now, we need to create filesystems on the partitions you just created.
+Preferences for filesystems differ, and we're not here to tell you which you
+should use (should we?), so here's just a list of commands to create the
+different filesystems I know about:
+
+mke2fs /dev/hda1
+# This one is the same as mke2fs -j /dev/hda1
+mkfs.ext3 /dev/hda1
+# big TODO: seems we don't actually ship this yet 8)
+mkfs.reiserfs /dev/hda1
+# same for xfs and jfs
+
+# swap:
+mkswap /dev/hda2
+
+Now, you need to mount the filesystems. We'll be installing to /mnt/root,
+so mount the filesystem that will be / as
+mount -t ext2 /dev/hda1 /mnt/root
+Then mount the others.
+
+Don't forget to turn on swap via
+swapon /dev/hda2
diff --git a/iso/usr/share/doc/smgl.install/steps/disk-partition
b/iso/usr/share/doc/smgl.install/steps/disk-partition
index 4e39301..36b994e 100644
--- a/iso/usr/share/doc/smgl.install/steps/disk-partition
+++ b/iso/usr/share/doc/smgl.install/steps/disk-partition
@@ -1 +1,21 @@
-describe partitioning here
+First, we'll need to create some partitions on your disk that we can install
+SMGL to. You'll need to know the device of your hard disk to do this
+(TODO: describe how to find that out).
+
+This image ships with several popular programs for partitioning:
+
+cfdisk is probably the most popular, a curses-based menu system:
+[1mcfdisk /dev/hda[m
+
+parted is also menu-based, can resize partitions, but may be a tad confusing:
+[1mparted /dev/hda[m
+
+Then for the purists there's plain line-based fdisk. Can be a bit hard to
use:
+[1mfdisk /dev/hda[m
+
+The iso also ships with [1msfdisk[m, if you're insane enough to want to use
+it.
+
+Remember to save your new partitioning scheme before quitting the program,
+create a swap partition, and remember you can always see this screen again
+by typing [1mtodo[m. Type [1mnext[m when you're done.
diff --git a/iso/usr/share/doc/smgl.install/steps/edit-confs
b/iso/usr/share/doc/smgl.install/steps/edit-confs
index 0bc61a0..f4ba75d 100644
--- a/iso/usr/share/doc/smgl.install/steps/edit-confs
+++ b/iso/usr/share/doc/smgl.install/steps/edit-confs
@@ -1 +1,7 @@
-edit the configuration so the system will boot
+Hmm. This is a bit fun to document. Big TODO.
+
+You need to edit /mnt/root/etc/fstab so the system knows your partitions on
+bootup. Also, pick either lilo or grub, edit its conf, and install it.
+We'll need better-documented conf file templates for this.
+
+And more doc monkeys.
diff --git a/iso/usr/share/doc/smgl.install/steps/init
b/iso/usr/share/doc/smgl.install/steps/init
index 2f0ba11..9b508f6 100644
--- a/iso/usr/share/doc/smgl.install/steps/init
+++ b/iso/usr/share/doc/smgl.install/steps/init
@@ -1 +1 @@
-enter 'next'.
+enter [1mnext[m.
diff --git a/iso/usr/share/doc/smgl.install/steps/install-opt-spells
b/iso/usr/share/doc/smgl.install/steps/install-opt-spells
index 83d33db..075d123 100644
--- a/iso/usr/share/doc/smgl.install/steps/install-opt-spells
+++ b/iso/usr/share/doc/smgl.install/steps/install-opt-spells
@@ -1 +1,4 @@
-install more spells you need now, if you can
+At this point, you'll be installing other spells that might come in handy.
+
+Except that this version of the iso doesn't actually ship with any yet,
+so just hit that [1mnext[m.
diff --git a/iso/usr/share/doc/smgl.install/steps/reboot
b/iso/usr/share/doc/smgl.install/steps/reboot
index e92e386..7317958 100644
--- a/iso/usr/share/doc/smgl.install/steps/reboot
+++ b/iso/usr/share/doc/smgl.install/steps/reboot
@@ -1,2 +1,2 @@
-you should be able to reboot now.
+You should be able to reboot now.
Don't forget to take out the CD
diff --git a/iso/usr/share/doc/smgl.install/welcome
b/iso/usr/share/doc/smgl.install/welcome
index 49095f4..b198f71 100644
--- a/iso/usr/share/doc/smgl.install/welcome
+++ b/iso/usr/share/doc/smgl.install/welcome
@@ -1,15 +1,15 @@
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.
+The install process is currently a guided shell prompt. Type [1mnext[m to
start.
+Everytime you finish a step, enter [1mnext[m to advance to the next one.
+If you want to re-read the documentation for a step, type [1mtodo[m.
+You can enter [1mback[m 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.
+If you ever get lost, type [1mlist-steps[m to get a list of installer
steps,
+and e.g. [1mjump copy-base[m 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.
@@ -18,4 +18,4 @@ 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!
+Enter [1mnext[m to begin the installation. Have fun!
diff --git a/iso/usr/share/smgl.install/bashrc
b/iso/usr/share/smgl.install/bashrc
index dd8604c..56fc160 100755
--- a/iso/usr/share/smgl.install/bashrc
+++ b/iso/usr/share/smgl.install/bashrc
@@ -24,7 +24,7 @@ function next() {
# get old status
CURSTEP=$(cat $INSTALLER_STATUS)
# find next status
- CURSTEP=$(grep "^$CURSTEP:" $INSTALLER_DATA/order | cut -d: -f2)
+ CURSTEP=$(grep "^$CURSTEP:" $INSTALLER_DATA/order | head -n 1 | cut -d:
-f2)
# if we couldn't find a next status, jump to 'error'
CURSTEP=${CURSTEP:-error}
# save new status
- [SM-Commit] GIT changes to master cauldron by Karsten Behrmann (d25f7b2b1e9b1a4defd3435ca0d441a02afb1501), Karsten Behrmann, 08/06/2007
Archive powered by MHonArc 2.6.24.