Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to test cauldron by Justin Boffemmyer (b4ab2d63e8a2e395fe99e5b840a2b4ffa67d961a)

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 test cauldron by Justin Boffemmyer (b4ab2d63e8a2e395fe99e5b840a2b4ffa67d961a)
  • Date: Tue, 30 Sep 2008 23:47:26 -0500

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

initrd/sbin/smgl.init | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)

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

smgl.init: improved boot media selection algo

Improved the algorithms for how the initrd selects the media to boot
from. It will now use /sys instead of /proc to autodetect removable
media and try those for booting. I also added the missing boot-from
function so that users can now properly override the boot media
autodetection and force the initrd to try booting from a
user-specified device.

diff --git a/initrd/sbin/smgl.init b/initrd/sbin/smgl.init
index 570b31e..6b9c3bc 100755
--- a/initrd/sbin/smgl.init
+++ b/initrd/sbin/smgl.init
@@ -15,22 +15,26 @@ test_cdrom() {
$found
}

+boot-from() {
+ echo "$1" > /cdrom.hint
+}
+
# at the end SMGL_CD is defined to the device where the SMGL CD is found
# or else SMGL_CD is undefined

scan_cdroms() {
-
SMGL_CD='unknown'

if [[ -e /cdrom.hint ]] ;then
- SMGL_CD=$(<cdrom.hint)
+ 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}
+ for handler in /sys/block/*/removable ;do
+ if [[ $(cat $handler) -eq 1 ]]
+ then
+ handler=${handler%/removable}
device=/dev/${handler##*/}

test_cdrom $device &&



  • [SM-Commit] GIT changes to test cauldron by Justin Boffemmyer (b4ab2d63e8a2e395fe99e5b840a2b4ffa67d961a), Justin Boffemmyer, 10/01/2008

Archive powered by MHonArc 2.6.24.

Top of Page