Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- INSTALL_DIR=/usr/local/share/u-boot/beaglebone-eabi
- UBOOT_IMG=bb-uboot.img
- TITLE=`basename $0`
- usage() {
- echo "Usage: $TITLE [-v|<installdir>]"
- echo " -v: Print u-boot version information"
- exit 2
- }
- show_version() {
- VER=`strings $INSTALL_DIR/$UBOOT_IMG | grep -E "U-Boot [^(]+\([^)]+\)" | sed 's/[^0-9.]*\([0-9.]*\).*/\1/'`
- if [ -z '$VER' ]; then
- echo "Unable to extract version from $INSTALL_DIR/$UBOOT_IMG ..."
- exit 5
- fi
- echo $VER
- exit 0
- }
- check_install() {
- if [ ! -d $INSTALL_DIR ]; then
- echo "You must first install sysutils/u-boot-beaglebone-eabi"
- exit 3
- fi
- if [ ! -f $INSTALL_DIR/$UBOOT_IMG ]; then
- echo "Please build and install sysutils/u-boot-beaglebone-eabi"
- exit 4
- fi
- }
- check_install
- args=`getopt v $*`
- if [ $? -ne 0 ]; then
- usage
- fi
- set -- $args
- while true; do
- case "$1" in
- -v)
- show_version
- shift
- ;;
- --)
- shift; break
- ;;
- *)
- usage
- esac
- done
- if [ -z "$1" ]; then
- usage
- else
- TARGET_DIR=`(cd "$1"; pwd)`
- fi
- echo "Installing $TITLE to $TARGET_DIR"
- for FN in MLO bb-uboot.img bb-uenv.txt; do
- echo " $FN ..."
- cp $INSTALL_DIR/$FN $TARGET_DIR/$FN
- done
- # EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement