diff --git a/alarm/uboot-clearfog/PKGBUILD b/alarm/uboot-clearfog/PKGBUILD index 9a6c0dc69..102de0af9 100644 --- a/alarm/uboot-clearfog/PKGBUILD +++ b/alarm/uboot-clearfog/PKGBUILD @@ -4,21 +4,21 @@ buildarch=4 pkgbase=uboot-clearfog pkgname=('uboot-clearfog') pkgver=2013.01 -pkgrel=4 +pkgrel=5 arch=('armv7h') url="http://git.denx.de/u-boot.git/" license=('GPL') depends=('uboot-tools') option=('!strip') -source=('u-boot-clearfog.mmc.xz' +source=('u-boot-clearfog.tar.xz' 'clearfog.txt' 'uEnv.txt' 'sd_fusing.sh') -md5sums=('7d4703da3cb5e278801512eaf3833987' +md5sums=('03b2a5122da09712abe8cf4d1740736a' '0d5c13ccc7045af73de8685d4f961bb7' '74553971c70ec14195955bbd579b63a6' - 'cb9ea2fa6f4436c2645b0e465597a734') + 'b6f566f456c4a066c41b8706613fd8ec') prepare() { @@ -30,6 +30,6 @@ package() { install=${pkgbase}.install mkdir -p "${pkgdir}"/boot - cp ${srcdir}/{u-boot-clearfog.mmc,clearfog.env,sd_fusing.sh,uEnv.txt} "${pkgdir}"/boot + cp ${srcdir}/{u-boot-clearfog.??.mmc,clearfog.env,sd_fusing.sh,uEnv.txt} "${pkgdir}"/boot } diff --git a/alarm/uboot-clearfog/sd_fusing.sh b/alarm/uboot-clearfog/sd_fusing.sh index 9e7d8d26c..2cbd79b60 100755 --- a/alarm/uboot-clearfog/sd_fusing.sh +++ b/alarm/uboot-clearfog/sd_fusing.sh @@ -14,6 +14,54 @@ # #################################### +sd_fuse() { + #################################### + # fusing images + + echo "u-boot fusing version $1" + dd if=./u-boot-clearfog.mmc of=$1 bs=512 seek=1 + + echo "u-boot environemnt fusing" + dd if=/dev/zero of=$1 bs=512 seek=1920 count=128 + dd if=./clearfog.env of=$1 bs=512 seek=1920 + + #################################### + # + echo "U-boot image is fused successfully." + +} + +choose_uboot() { + while : + do + cat< + 1) PCIe, PCIe (default) + 2) PCIe, mSata + 3) mSata, PCIe + 4) mSata, mSata +EOF + read -n1 -s + case "$REPLY" in + "1") sd_fuse pp + break + ;; + "2") sd_fuse ps + break + ;; + "3") sd_fuse sp + break + ;; + "4") sd_fuse ss + break + ;; + * ) echo "invalid option" ;; + esac + done +} + + if [ -z $1 ] then echo "usage: ./sd_fusing.sh " @@ -28,16 +76,4 @@ else exit 0 fi -#################################### -# fusing images - -echo "u-boot fusing" -dd if=./u-boot-clearfog.mmc of=$1 bs=512 seek=1 - -echo "u-boot environemnt fusing" -dd if=/dev/zero of=$1 bs=512 seek=1920 count=128 -dd if=./clearfog.env of=$1 bs=512 seek=1920 - -#################################### -# -echo "U-boot image is fused successfully." +choose_uboot \ No newline at end of file diff --git a/alarm/uboot-clearfog/u-boot-clearfog.mmc.xz b/alarm/uboot-clearfog/u-boot-clearfog.mmc.xz deleted file mode 100644 index ff20fdd84..000000000 Binary files a/alarm/uboot-clearfog/u-boot-clearfog.mmc.xz and /dev/null differ diff --git a/alarm/uboot-clearfog/u-boot-clearfog.tar.xz b/alarm/uboot-clearfog/u-boot-clearfog.tar.xz new file mode 100644 index 000000000..aa0c58637 Binary files /dev/null and b/alarm/uboot-clearfog/u-boot-clearfog.tar.xz differ diff --git a/alarm/uboot-clearfog/uboot-clearfog.install b/alarm/uboot-clearfog/uboot-clearfog.install index 983fcda5b..da0cfd8d1 100644 --- a/alarm/uboot-clearfog/uboot-clearfog.install +++ b/alarm/uboot-clearfog/uboot-clearfog.install @@ -5,7 +5,7 @@ sd_fuse() { fi # Flash U-Boot - dd if=/boot/u-boot-clearfog.mmc of=/dev/mmcblk0 bs=512 seek=1 + dd if=/boot/u-boot-clearfog.$1.mmc of=/dev/mmcblk0 bs=512 seek=1 # Zero out old U-Boot environment dd if=/dev/zero of=/dev/mmcblk0 bs=512 seek=1920 count=128 @@ -19,13 +19,43 @@ flash_uboot() { echo "Do you want to do this now? [y|N]" read -r shouldwe if [[ $shouldwe =~ ^([yY][eE][sS]|[yY])$ ]]; then - sd_fuse + choose_uboot else echo "You can do this later by running:" echo "# cd /boot; ./sd_fusing.sh /dev/mmcblk0" fi } +choose_uboot() { +while : +do + cat< + 1) PCIe, PCIe (default) + 2) PCIe, mSata + 3) mSata, PCIe + 4) mSata, mSata +EOF + read -n1 -s + case "$REPLY" in + "1") sd_fuse pp + break + ;; + "2") sd_fuse ps + break + ;; + "3") sd_fuse sp + break + ;; + "4") sd_fuse ss + break + ;; + * ) echo "invalid option" ;; + esac +done +} + post_install() { flash_uboot }