card script: check for software, before trying to figure out what version we have

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
pull/8/head
Robert Nelson 13 years ago
parent 52a912a9e3
commit 844ff73918

@ -111,29 +111,10 @@ function is_valid_addon {
} }
function check_root { function check_root {
if [[ $UID -ne 0 ]]; then if [[ $UID -ne 0 ]]; then
echo "$0 must be run as sudo user or root" echo "$0 must be run as sudo user or root"
exit exit
fi fi
}
function find_issue {
check_root
#Software Qwerks
#Check for gnu-fdisk
#FIXME: GNU Fdisk seems to halt at "Using /dev/xx" when trying to script it..
if fdisk -v | grep "GNU Fdisk" >/dev/null ; then
echo "Sorry, this script currently doesn't work with GNU Fdisk"
exit
fi
unset PARTED_ALIGN
if parted -v | grep parted | grep 2.[1-3] >/dev/null ; then
PARTED_ALIGN="--align cylinder"
fi
} }
function check_for_command { function check_for_command {
@ -166,6 +147,18 @@ function detect_software {
echo "" echo ""
exit exit
fi fi
#Check for gnu-fdisk
#FIXME: GNU Fdisk seems to halt at "Using /dev/xx" when trying to script it..
if fdisk -v | grep "GNU Fdisk" >/dev/null ; then
echo "Sorry, this script currently doesn't work with GNU Fdisk"
exit
fi
unset PARTED_ALIGN
if parted -v | grep parted | grep 2.[1-3] >/dev/null ; then
PARTED_ALIGN="--align cylinder"
fi
} }
function rcn-ee_down_use_mirror { function rcn-ee_down_use_mirror {
@ -1730,7 +1723,7 @@ while [ ! -z "$1" ]; do
then then
PARTITION_PREFIX="p" PARTITION_PREFIX="p"
fi fi
find_issue check_root
check_mmc check_mmc
;; ;;
--uboot) --uboot)
@ -1802,7 +1795,7 @@ fi
echo "Script Version git: ${GIT_VERSION}" echo "Script Version git: ${GIT_VERSION}"
echo "-----------------------------" echo "-----------------------------"
find_issue check_root
detect_software detect_software
dl_bootloader dl_bootloader
dl_kernel_image dl_kernel_image

Loading…
Cancel
Save