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.
+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