|
楼主 |
发表于 2008-11-9 15:13:08
|
显示全部楼层
改动了两个 但有错误,帮忙修改下了。。。
第一个版本:
提示 line 98: syntax error near unexpected token `done'
- test_live_data_dir ()
- {
- /bin/mount -r -t iso9660 "$1" $2 >/dev/null 2>/dev/null || \
- /bin/mount -r -t vfat -o noatime,nodiratime "$1" $2 >/dev/null 2>/dev/null || \
- /bin/mount -r -t ntfs-3g -o noatime,nodiratime "$1" $2 >/dev/null 2>/dev/null || \
- /bin/mount -r -t ext2 -o noatime,nodiratime "$1" $2 >/dev/null 2>/dev/null
- if [ $? -eq 0 ]; then
- if [ -f "$2/${from}/carbon" ]; then
- LDEV="$1"
- msg_ " ... found at $1"
- found=1
- return 0
- else
- /bin/umount $2 2>/dev/null
- msg_ " ... $1 mounted, but no 'carbon' found"
- fi
- else
- msg_ " ... not $1"
- fi
- return 1
- }
- run_hook ()
- {
- # external drives may need to settle
- msg ":: Waiting for usb devices to settle..."
- /sbin/udevadm trigger --subsystem-match=usb
- /sbin/udevadm settle
- sleep 5
- msg_ ":: Scanning for boot device..."
- /bin/mkdir -p /bootmnt
- /bin/mkdir -p /live
- live="/live"
- bootmnt="/bootmnt"
- found=0
-
- if [ "${break}" = "y" ]; then
- echo ":: Break requested, type 'exit' to resume operation"
- echo " NOTE: klibc contains no 'ls' binary, use 'echo *' instead"
- PS1="ramfs$ " /bin/sh -i
- fi
-
- # look for livecd data directory, first try ${root}
- LDEV="${root}"
- if [ "x${LDEV}" != "x" ]; then
- /bin/mount -r -t iso9660 "${LDEV}" "${bootmnt}" >/dev/null 2>/dev/null || \
- /bin/mount -r -t vfat -o noatime,nodiratime "${LDEV}" "${bootmnt}" >/dev/null 2>/dev/null || \
- /bin/mount -r -t ntfs-3g -o noatime,nodiratime "${LDEV}" "${bootmnt}" >/dev/null 2>/dev/null || \
- /bin/mount -r -t ext2 -o noatime,nodiratime "${LDEV}" "${bootmnt}" >/dev/null 2>/dev/null
- if [ $? -eq 0 ]; then
- if [ -d "${bootmnt}/${from}/carbon" ]; then
- msg_ ":: Archlive system at ${LDEV}"
- /bin/mount -o bind "${bootmnt}/${from}" "${live}"
- found=1
- break
- else
- /bin/umount "${bootmnt}" 2>/dev/null
- echo "!! No Archlive system at ${LDEV}"
- LDEV=""
- fi
- else
- echo "!! Couldn't mount ${LDEV}"
- LDEV=""
- fi
- fi
- # then try cdroms
- if [ "x${LDEV}" = "x" ]; then
- msg_ ":: Looking for boot device"
- cdroms=$( /bin/cat /proc/sys/dev/cdrom/info | { while read a b c; do
- if [ "${a}" = "drive" -a "${b}" = "name:" ]; then
- echo "${c}"
- break
- fi
- done
- } )
- for i in ${cdroms}; do
- test_live_data_dir "/dev/${i}" "${bootmnt}"
- if [ $? -eq 0 ]; then break; fi
- done
- fi
- # test USB devices (and disks) repeatedly until timed out
- if [ "x${LDEV}" = "x" ]; then
- msg_ ":: Searching for usb (and disk) devices .."
- for i in 1 2 3 4 5; do
- msg_ " :wait ${i} :::"
- /bin/sleep ${i}
- for d in /dev/sd[a-z][0-9]*; do
- test_live_data_dir "${d}" "${bootmnt}"
- if [ $? -eq 0 ]; then break 2; fi
- done
- done
- fi
- export BOOT_MOUNT="${bootmnt}"
- done
- }
复制代码
第二个版本
提示 line 63: syntax error near unexpected token `elif'
|
|