diff --git a/mk_mmc.sh b/mk_mmc.sh index 3b34e4e..fa85bac 100755 --- a/mk_mmc.sh +++ b/mk_mmc.sh @@ -60,6 +60,53 @@ if fdisk -v | grep "GNU Fdisk" >/dev/null ; then exit fi +function detect_software { + +#Currently only Ubuntu and Debian.. +#Working on Fedora... +unset DEB_PACKAGE +unset RPM_PACKAGE +unset NEEDS_PACKAGE + +if [ ! $(which mkimage) ];then + echo "Missing uboot-mkimage" + DEB_PACKAGE="uboot-mkimage " + RPM_PACKAGE="uboot-tools " + NEEDS_PACKAGE=1 +fi + +if [ ! $(which wget) ];then + echo "Missing wget" + DEB_PACKAGE+="wget " + RPM_PACKAGE+="wget " + NEEDS_PACKAGE=1 +fi + +if [ ! $(which mkfs.vfat) ];then + echo "Missing mkfs.vfat" + DEB_PACKAGE+="dosfstools " + RPM_PACKAGE+="dosfstools " + NEEDS_PACKAGE=1 +fi + +if [ ! $(which parted) ];then + echo "Missing parted" + DEB_PACKAGE+="parted " + RPM_PACKAGE+="parted " + NEEDS_PACKAGE=1 +fi + +if [ "${NEEDS_PACKAGE}" ];then + echo "" + echo "Please Install Missing Dependencies" + echo "Ubuntu/Debian: sudo apt-get install $DEB_PACKAGE" + echo "Fedora: as root: yum install $RPM_PACKAGE" + echo "" + exit +fi + +} + function set_defaults { KERNEL_REL=2.6.37 @@ -990,6 +1037,7 @@ if [ ! "${MMC}" ];then usage fi + detect_software set_defaults dl_xload_uboot prepare_initrd