From: <ale...@us...> - 2008-04-14 11:56:57
|
Revision: 2624 http://morphix.svn.sourceforge.net/morphix/?rev=2624&view=rev Author: alextreme Date: 2008-04-14 04:56:54 -0700 (Mon, 14 Apr 2008) Log Message: ----------- * number of minor changes to get basic USB/SCSI-CD/DVD devices working Modified Paths: -------------- trunk/scripts-base/miniroot/linuxrc-scripts/linuxrc trunk/scripts-base/miniroot/mkminiroot.sh Modified: trunk/scripts-base/miniroot/linuxrc-scripts/linuxrc =================================================================== --- trunk/scripts-base/miniroot/linuxrc-scripts/linuxrc 2008-04-05 18:15:43 UTC (rev 2623) +++ trunk/scripts-base/miniroot/linuxrc-scripts/linuxrc 2008-04-14 11:56:54 UTC (rev 2624) @@ -218,47 +218,29 @@ echo -n "${CRE}" } -case "$CMDLINE" in *bootusb2*) USBBOOT2="yes"; ;; esac -case "$CMDLINE" in *bootusb1*) USBBOOT1="yes"; ;; esac -case "$CMDLINE" in *vfat*) VFAT="yes"; ;; esac - -if test -n "$VFAT" - then # load modules needed to use VFAT filesystem - $INSMOD -f /modules/nls/nls_cp437$KEXT >/dev/null - $INSMOD -f /modules/nls/nls_iso8859-1$KEXT >/dev/null -fi +$INSMOD -f /modules/nls/nls_cp437$KEXT >/dev/null +$INSMOD -f /modules/nls/nls_iso8859-1$KEXT >/dev/null -if test -n "$USBBOOT2" -o -n "$USBBOOT1" - then -# load usb-modules first (so that memory-stick becomes /dev/sda1) - echo "6" > /proc/sys/kernel/printk - - # NLS charsets required for VFAT-formatted USB drives - $INSMOD -f /modules/nls/nls_iso8859-1$KEXT >/dev/null - $INSMOD -f /modules/nls/nls_cp437$KEXT >/dev/null +# SCSI modules need to be loaded before usb-storage +$INSMOD -f /modules/scsi/scsi_mod$KEXT >/dev/null +$INSMOD -f /modules/scsi/sg$KEXT >/dev/null +$INSMOD -f /modules/scsi/sr_mod$KEXT >/dev/null +$INSMOD -f /modules/scsi/sd_mod$KEXT >/dev/null +$INSMOD -f /modules/scsi/st$KEXT >/dev/null + +$INSMOD -f /modules/usb/usbcore$KEXT >/dev/null + +$INSMOD -f /modules/usb/ehci-hcd$KEXT >/dev/null +$INSMOD -f /modules/usb/uhci-hcd$KEXT >/dev/null +$INSMOD -f /modules/usb/ohci-hcd$KEXT >/dev/null +$INSMOD -f /modules/scsi/sd_mod$KEXT >/dev/null +$INSMOD -f /modules/usb/usb-storage$KEXT >/dev/null - # scsi_mod and sd_mod SCSI modules need to be loaded before usb-storage - $INSMOD -f /modules/scsi/scsi_mod$KEXT >/dev/null - $INSMOD -f /modules/usb/usbcore$KEXT >/dev/null - FOUNDUSB="" - if test -n "$USBBOOT2" - then - $INSMOD -f /modules/usb/ehci-hcd$KEXT >/dev/null && FOUNDUSB="yes" - fi - if test -n "$USBBOOT1" - then - $INSMOD -f /modules/usb/uhci-hcd$KEXT >/dev/null && FOUNDUSB="yes" - $INSMOD -f /modules/usb/ohci-hcd$KEXT >/dev/null && FOUNDUSB="yes" - fi - $INSMOD -f /modules/scsi/sd_mod$KEXT >/dev/null - $INSMOD -f /modules/usb/usb-storage$KEXT >/dev/null +# Wait for devices to be registered +sleep 2 +echo "0" > /proc/sys/kernel/printk - # wait 5 seconds for usb device to be registered - sleep 5 - echo "0" > /proc/sys/kernel/printk -fi - # Check for a Firewire Cdrom boot -- thanatermesis if test -z "$NOFIREWIRE"; then @@ -282,21 +264,7 @@ fi # End of FIREWIRE check -# Unfortunately, hotpluggable devices tend to need some time in order to register -if test -n "$FOUNDUSB" -o -n "$FOUNDFIREWIRE"; then - echo -n "${CRE}${BLUE}Scanning for USB/Firewire devices... ${NORMAL}" - if test -n "$FOUNDFIREWIRE"; then -# Wait for driver to register - sleep 2 -# Kernel 2.6 does this automatically - case "$(cat /proc/version 2>/dev/null)" in *version\ 2.6.*) ;; *) for host in 0 1 2 3 4 5 6 7; do for channel in 0 1; do for id in 0 1 2 3 4 5 6 7; do echo "scsi add-single-device $host $channel $id 0" >/proc/scsi/scsi 2>/dev/null; done; done; done ;; esac - fi - sleep 6 - echo "${BLUE}Done.${NORMAL}" -fi -# <--- thanatermesis (Firewire) - # Check for SCSI, use modules on bootfloppy first if test -n "$INTERACTIVE"; then # Let the user select interactively @@ -342,16 +310,12 @@ # Now that the right SCSI driver is (hopefully) loaded, try to find CDROM DEVICES="/dev/hd?" test -n "$FOUND_SCSI" -a -z "$NOCD" && DEVICES="/dev/scd? /dev/scd?? $DEVICES" -# New: Also try parallel port CD-Roms [for Mike]. DEVICES="$DEVICES /dev/pcd?" -# New: also check HD partitions for a MORPHIX/MORPHIX image -test -n "$FOUND_SCSI" && DEVICES="$DEVICES /dev/sd?[1-9] /dev/sd?[1-9][0-9]" -test -n "$USBBOOT2" -o -n "$USBBOOT1" && DEVICES="$DEVICES /dev/sda1" +DEVICES="$DEVICES /dev/sd?[1-9] /dev/sd?[1-9][0-9]" DEVICES="$DEVICES /dev/hd?[1-9] /dev/hd?[1-9][0-9]" +DEVICES="/dev/scd? /dev/scd?? $DEVICES" +DEVICES="$DEVICES /dev/hd?[1-9] /dev/hd?[1-9][0-9]" -#UML device -#DEVICES="$DEVICES /dev/ubd[1-9]" - MOUNT_IMAGE="cdrom" MOUNT_OPT="ro" #you could not define a directory with space @@ -437,11 +401,9 @@ fi fi -# Harddisk-installed script part version has been removed -# (MORPHIX can be booted directly from HD now). if test -n "$FOUND_MORPHIX" -a -f /cdrom/base/morphix; then -# DEBUG + if test -n "$DEBUG"; then echo "6" > /proc/sys/kernel/printk fi @@ -450,15 +412,26 @@ $LOSETUP /dev/cloop /cdrom/base/morphix mountit /dev/cloop /MorphixCD "-o ro" || FOUND_MORPHIX="" 2> /dev/null else - echo "Warning: unable to find base module!" - echo "" - echo "Dropping you to a simple shell. Make sure /cdrom/base/morphix exists!" - PS1="morphix# " - export PS1 - echo "6" > /proc/sys/kernel/printk + # Wait until any USB/SCSI devices have been registered, and try again + # This is a poor fallback, but tends to work for certain devices + sleep 10 + mount /dev/scd0 /cdrom + + if test -f /cdrom/base/morphix; then + $INSMOD -f /modules/cloop$KEXT 2> /dev/null + $LOSETUP /dev/cloop /cdrom/base/morphix + mountit /dev/cloop /MorphixCD "-o ro" || FOUND_MORPHIX="" 2> /dev/null + else + echo "Warning: unable to find base module!" + echo "" + echo "Dropping you to a simple shell. Make sure /cdrom/base/morphix exists!" + PS1="morphix# " + export PS1 + echo "6" > /proc/sys/kernel/printk # Allow signals - trap 1 2 3 15 - exec /static/ash + trap 1 2 3 15 + exec /static/ash + fi fi # COPYTORAM copied (ironic, isn't it?) from Fabian's linuxrc.rampatch 2003-07-26 Modified: trunk/scripts-base/miniroot/mkminiroot.sh =================================================================== --- trunk/scripts-base/miniroot/mkminiroot.sh 2008-04-05 18:15:43 UTC (rev 2623) +++ trunk/scripts-base/miniroot/mkminiroot.sh 2008-04-14 11:56:54 UTC (rev 2624) @@ -179,7 +179,7 @@ cp $BASEDIR/lib/modules/*/extra/cloop.* $DESTDIR/modules/ cp $BASEDIR/lib/modules/*/kernel/drivers/cdrom/cdrom.* $DESTDIR/modules/ cp $BASEDIR/lib/modules/*/kernel/drivers/ide/ide-cd.* $DESTDIR/modules/ -cp $BASEDIR/lib/modules/*/kernel/drivers/scsi/{3w-xxxx.*,BusLogic.*,NCR53c406a.*,a100u2w.*,advansys.*,aha152x.*,aha1542.*,aic7xxx/aic7xxx.*,atp870u.*,dtc.*,eata.*,fdomain.*,gdth.*,initio.*,megaraid.*,pas16.*,psi240i.*,qlogicfas.*,qlogicfc.*,seagate.*,t128.*,tmscsim.*,u14-34f.*,ultrastor.*,wd7000.*} $DESTDIR/modules/scsi +cp $BASEDIR/lib/modules/*/kernel/drivers/scsi/{3w-xxxx.*,BusLogic.*,NCR53c406a.*,a100u2w.*,advansys.*,aha152x.*,aha1542.*,aic7xxx/aic7xxx.*,atp870u.*,dtc.*,eata.*,fdomain.*,gdth.*,initio.*,megaraid.*,pas16.*,psi240i.*,qlogicfas.*,qlogicfc.*,seagate.*,t128.*,tmscsim.*,u14-34f.*,ultrastor.*,wd7000.*,sd_mod.*,sg.*,sr_mod.*,st.*} $DESTDIR/modules/scsi cp $BASEDIR/lib/modules/*/kernel/drivers/scsi/{scsi_transport_spi.*,scsi_mod.*,qlogicfas408.*,sd_mod.*} $DESTDIR/modules/scsi cp $BASEDIR/lib/modules/*/kernel/drivers/usb/{core/usbcore.*,host/ehci-hcd.*,host/ohci-hcd.*,host/uhci-hcd.*,storage/usb-storage.*} $DESTDIR/modules/usb This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |