mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-11-18 22:54:00 +00:00
Add alarm/uboot-clearfog
This commit is contained in:
parent
626e6bfae6
commit
2e9313ca79
6 changed files with 136 additions and 0 deletions
35
alarm/uboot-clearfog/PKGBUILD
Normal file
35
alarm/uboot-clearfog/PKGBUILD
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Maintainer: Oleg Rakhmanov <oleg@archlinuxarm.org>
|
||||
buildarch=4
|
||||
|
||||
pkgbase=uboot-clearfog
|
||||
pkgname=('uboot-clearfog')
|
||||
pkgver=2013.01
|
||||
pkgrel=1
|
||||
arch=('armv7h')
|
||||
url="http://git.denx.de/u-boot.git/"
|
||||
license=('GPL')
|
||||
depends=('uboot-tools')
|
||||
option=('!strip')
|
||||
source=('u-boot-clearfog.mmc.xz'
|
||||
'clearfog.txt'
|
||||
'uEnv.txt'
|
||||
'sd_fusing.sh')
|
||||
|
||||
md5sums=('8c54c8e6b7dd1c4997d2df490a3fe31d'
|
||||
'3a7ab4a3a4aa26745c134bb9e65ce3bc'
|
||||
'74553971c70ec14195955bbd579b63a6'
|
||||
'c1cd60fe31548acdbe17d55442bcee76')
|
||||
|
||||
prepare() {
|
||||
|
||||
mkenvimage -s 0x10000 -o clearfog.env clearfog.txt
|
||||
}
|
||||
|
||||
package() {
|
||||
pkgdesc="U-Boot for SolidRun ClearFog"
|
||||
install=${pkgbase}.install
|
||||
|
||||
mkdir -p "${pkgdir}"/boot
|
||||
cp ${srcdir}/{u-boot-clearfog.mmc,clearfog.env,sd_fusing.sh,uEnv.txt} "${pkgdir}"/boot
|
||||
}
|
||||
|
15
alarm/uboot-clearfog/clearfog.txt
Normal file
15
alarm/uboot-clearfog/clearfog.txt
Normal file
|
@ -0,0 +1,15 @@
|
|||
bootcmd=run loaduenv; run startboot
|
||||
bootdir=/boot
|
||||
bootfilez=zImage
|
||||
console=ttyS0,115200
|
||||
loadaddr=2080000
|
||||
rdaddr=2880000
|
||||
fdtaddr=2040000
|
||||
fdtdir=/boot/dtbs
|
||||
fdtfile=armada-388-clearfog.dtb
|
||||
root=/dev/mmcblk0p1
|
||||
mainargs=setenv bootargs console=${console} root=${root} rw rootwait ${optargs}
|
||||
loadkernel=ext4load mmc 0:1 ${loadaddr} ${bootdir}/${bootfilez}
|
||||
loadfdt=ext4load mmc 0:1 ${fdtaddr} ${fdtdir}/${fdtfile}
|
||||
startboot=run mainargs; run loadkernel; run loadfdt; bootz ${loadaddr} - ${fdtaddr}
|
||||
loaduenv=echo Checking for: ${bootdir}/uEnv.txt ...; if test -e mmc 0:1 ${bootdir}/uEnv.txt; then ext4load mmc 0:1 ${loadaddr} ${bootdir}/uEnv.txt; env import -t ${loadaddr} ${filesize}; echo Loaded environment from ${bootdir}/uEnv.txt; echo Checking if uenvcmd is set ...; if test -n ${uenvcmd}; then echo Running uenvcmd ...; run uenvcmd; fi; fi;
|
43
alarm/uboot-clearfog/sd_fusing.sh
Normal file
43
alarm/uboot-clearfog/sd_fusing.sh
Normal file
|
@ -0,0 +1,43 @@
|
|||
#!/usr/bin/bash
|
||||
####################################
|
||||
#
|
||||
# Copyright (C) 2011 Samsung Electronics Co., Ltd.
|
||||
# http://www.samsung.com/
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
####################################
|
||||
#
|
||||
# Modified for Arch Linux ARM package uboot-clearfog
|
||||
#
|
||||
####################################
|
||||
|
||||
if [ -z $1 ]
|
||||
then
|
||||
echo "usage: ./sd_fusing.sh <SD Reader's device file>"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -b $1 ]
|
||||
then
|
||||
echo "$1 reader is identified."
|
||||
else
|
||||
echo "$1 is NOT identified."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
####################################
|
||||
# fusing images
|
||||
|
||||
echo "u-boot fusing"
|
||||
dd if=/boot/u-boot-clearfog.mmc of=/dev/mmcblk0 bs=512 seek=1
|
||||
|
||||
echo "u-boot environemnt fusing"
|
||||
dd if=/dev/zero of=/dev/mmcblk0 bs=512 seek=1920 count=128
|
||||
dd if=/boot/clearfog.env of=/dev/mmcblk0 bs=512 seek=1920
|
||||
|
||||
####################################
|
||||
#<Message Display>
|
||||
echo "U-boot image is fused successfully."
|
BIN
alarm/uboot-clearfog/u-boot-clearfog.mmc.xz
Normal file
BIN
alarm/uboot-clearfog/u-boot-clearfog.mmc.xz
Normal file
Binary file not shown.
8
alarm/uboot-clearfog/uEnv.txt
Normal file
8
alarm/uboot-clearfog/uEnv.txt
Normal file
|
@ -0,0 +1,8 @@
|
|||
## Tell kernel where rootfs is located
|
||||
# root=/dev/mmcblk0p1
|
||||
|
||||
## Optional kernel arguments
|
||||
# optargs=elevator=cfq
|
||||
|
||||
## Name of fdt file for an alternative kernel
|
||||
# fdtfile=armada-388-clearfog.dtb
|
35
alarm/uboot-clearfog/uboot-clearfog.install
Normal file
35
alarm/uboot-clearfog/uboot-clearfog.install
Normal file
|
@ -0,0 +1,35 @@
|
|||
sd_fuse() {
|
||||
if [ ! -b /dev/mmcblk0 ]; then
|
||||
echo "No MMC device to flash, exiting."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Flash U-Boot
|
||||
dd if=/boot/u-boot-clearfog.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
|
||||
|
||||
#Flash new U-Boot environemnt
|
||||
dd if=/boot/clearfog.env of=/dev/mmcblk0 bs=512 seek=1920
|
||||
}
|
||||
|
||||
flash_uboot() {
|
||||
echo "A new U-Boot version needs to be flashed onto /dev/mmcblk0."
|
||||
echo "Do you want to do this now? [y|N]"
|
||||
read -r shouldwe
|
||||
if [[ $shouldwe =~ ^([yY][eE][sS]|[yY])$ ]]; then
|
||||
sd_fuse
|
||||
else
|
||||
echo "You can do this later by running:"
|
||||
echo "# cd /boot; ./sd_fusing.sh /dev/mmcblk0"
|
||||
fi
|
||||
}
|
||||
|
||||
post_install() {
|
||||
flash_uboot
|
||||
}
|
||||
|
||||
post_upgrade() {
|
||||
flash_uboot
|
||||
}
|
Loading…
Reference in a new issue