mysystem("/sbin/modprobe generic");
mysystem("/sbin/modprobe ide-cd");
mysystem("/sbin/modprobe ide-disk");
+ mysystem("/sbin/modprobe uhci_hcd");
+ mysystem("/sbin/modprobe ohci_hcd");
+ mysystem("/sbin/modprobe ehci_hcd");
+ mysystem("/sbin/modprobe ohci1394");
mysystem("/sbin/modprobe sd_mod");
mysystem("/sbin/modprobe sr_mod");
mysystem("/sbin/modprobe usb-storage");
echo "--> IDE"
for DEVICE in $(kudzu -qps -t 30 -c HD -b IDE | grep device: | cut -d ' ' -f 2 | sort | uniq); do
echo -n "---> $DEVICE"
- mount /dev/${DEVICE}1 /harddisk 2> /dev/null
- if [ -n "$(ls /harddisk/ipfire-*.tbz2 2>/dev/null)" ]; then
+ mount /dev/${DEVICE}1 /harddisk 2> /dev/null
+ if [ -n "$(ls /harddisk/ipfire-*.tbz2 2>/dev/null)" ]; then
umount /harddisk 2> /dev/null
- echo "${DEVICE} is source drive - skipping"
+ echo "${DEVICE} is source drive - SKIP"
continue
- else
- umount /harddisk 2> /dev/null
- echo -n "$DEVICE" > /tmp/dest_device
- echo "${DEVICE} - yes, it is our destination"
- exit 0
+ else
+ umount /harddisk 2> /dev/null
+ echo -n "$DEVICE" > /tmp/dest_device
+ echo "${DEVICE} - yes, it is our destination"
+ exit 0
fi
done
# scan USB/SCSI devices
echo "--> USB/SCSI"
for DEVICE in $(kudzu -qps -t 30 -c HD -b SCSI | grep device: | cut -d ' ' -f 2 | sort | uniq); do
- echo -n "---> $DEVICE"
+ echo -n "---> $DEVICE"
mount /dev/${DEVICE}1 /harddisk 2> /dev/null
- if [ -n "$(ls /harddisk/ipfire-*.tbz2 2>/dev/null)" ]; then
+ if [ -n "$(ls /harddisk/ipfire-*.tbz2 2>/dev/null)" ]; then
umount /harddisk 2> /dev/null
- echo "${DEVICE} is source drive - skipping"
+ echo "${DEVICE} is source drive - SKIP"
continue
- else
- umount /harddisk 2> /dev/null
- echo -n "$DEVICE" > /tmp/dest_device
- echo "${DEVICE} - yes, it is our destination"
- exit 1
+ else
+ umount /harddisk 2> /dev/null
+ echo -n "$DEVICE" > /tmp/dest_device
+ echo "${DEVICE} - yes, it is our destination"
+ exit 1
fi
done
# scan RAID devices
echo "--> RAID"
for DEVICE in $(kudzu -qps -t 30 -c HD -b RAID | grep device: | cut -d ' ' -f 2 | sort | uniq); do
- echo -n "---> $DEVICE"
- mount /dev/${DEVICE}p1 /harddisk 2> /dev/null
- if [ -n "$(ls /harddisk/ipfire-*.tbz2 2>/dev/null)" ]; then
+ echo -n "---> $DEVICE"
+ mount /dev/${DEVICE}p1 /harddisk 2> /dev/null
+ if [ -n "$(ls /harddisk/ipfire-*.tbz2 2>/dev/null)" ]; then
umount /harddisk 2> /dev/null
- echo "${DEVICE} is source drive - skipping"
- echo " is source drive"
+ echo "${DEVICE} is source drive - SKIP"
continue
- else
+ else
umount /harddisk 2> /dev/null
echo -n "$DEVICE" > /tmp/dest_device
- echo "${DEVICE} - yes, it is our destination"
+ echo "${DEVICE} - yes, it is our destination"
exit 2
fi
done
# scan CDROM devices
for DEVICE in $(kudzu -qps -t 30 -c CDROM | grep device: | cut -d ' ' -f 2 | sort | uniq); do
- mount /dev/${DEVICE} /cdrom 2> /dev/null
- if [ -n "$(ls /cdrom/ipfire-*.tbz2 2>/dev/null)" ]; then
- echo -n ${DEVICE} > /tmp/source_device
- echo "Found Sources in ${DEVICE}"
- else
- echo "Found no Sources in ${DEVICE} skipping"
- fi
- umount /cdrom 2> /dev/null
+ mount /dev/${DEVICE} /cdrom 2> /dev/null
+ if [ -n "$(ls /cdrom/ipfire-*.tbz2 2>/dev/null)" ]; then
+ echo -n ${DEVICE} > /tmp/source_device
+ echo "Found tarball on ${DEVICE}"
+ else
+ echo "Found no tarballs on ${DEVICE} - SKIP"
+ fi
+ umount /cdrom 2> /dev/null
done
# scan HD device (usb sticks, etc.)
for DEVICE in $(kudzu -qps -t 30 -c HD | grep device: | cut -d ' ' -f 2 | sort | uniq); do
- mount /dev/${DEVICE}1 /cdrom 2> /dev/null
- if [ -n "$(ls /cdrom/ipfire-*.tbz2 2>/dev/null)" ]; then
- echo -n ${DEVICE} > /tmp/source_device
- echo "Found Sources in ${DEVICE}"
- else
- umount /cdrom 2> /dev/null
- echo "Found no Sources in ${DEVICE} skipping"
- fi
- umount /cdrom 2> /dev/null
+ mount /dev/${DEVICE}1 /cdrom 2> /dev/null
+ if [ -n "$(ls /cdrom/ipfire-*.tbz2 2>/dev/null)" ]; then
+ echo -n ${DEVICE} > /tmp/source_device
+ echo "Found tarball on ${DEVICE}"
+ else
+ umount /cdrom 2> /dev/null
+ echo "Found no tarballs on ${DEVICE} - SKIP"
+ fi
+ umount /cdrom 2> /dev/null
done
if [ -e /tmp/source_device ]; then
- mount /dev/$(cat /tmp/source_device) /cdrom 2> /dev/null
- exit 0
+ mount /dev/$(cat /tmp/source_device) /cdrom 2> /dev/null
+ exit 0
else
- exit 10
+ exit 10
fi