Initial commit

This commit is contained in:
nxshock 2021-11-05 16:35:44 +05:00
commit 1b54616659
4 changed files with 83 additions and 0 deletions

2
.gitattributes vendored Normal file
View file

@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto

49
PKGBUILD Normal file
View file

@ -0,0 +1,49 @@
# U-Boot: NanoPi R2S/R2C
buildarch=8
pkgname=uboot-nanopi-r2s
pkgver=2021.10
pkgrel=1
pkgdesc="U-Boot for NanoPi R2S/R2C"
arch=('aarch64')
url='http://www.denx.de/wiki/U-Boot/WebHome'
license=('GPL')
backup=('boot/extlinux/extlinux.conf')
makedepends=('bc' 'git' 'python' 'swig' 'dtc')
install=${pkgname}.install
source=("ftp://ftp.denx.de/pub/u-boot/u-boot-${pkgver}.tar.bz2"
"https://github.com/ARM-software/arm-trusted-firmware/archive/v2.5.tar.gz"
"extlinux.conf")
md5sums=('f1392080facf59dd2c34096a5fd95d4c'
'a3c01d2a73d5171e3f1c0737ff5321d9'
'faf2b85206cb66c31f7c97da7b2b281d')
prepare() {
cd ${srcdir}/arm-trusted-firmware-2.5
make PLAT=rk3328
cd ${srcdir}/u-boot-${pkgver}
cd ${srcdir}/u-boot-${pkgver}/configs
echo 'CONFIG_IDENT_STRING=" Arch Linux ARM"' >> nanopi-r2s-rk3328_defconfig
}
build() {
cd ${srcdir}/u-boot-${pkgver}
unset CLFAGS CXXFLAGS CPPFLAGS LDFLAGS
export BL31=../arm-trusted-firmware-2.5/build/rk3328/release/bl31/bl31.elf
make nanopi-r2s-rk3328_defconfig
make
}
package() {
cd u-boot-${pkgver}
mkdir -p "${pkgdir}/boot/extlinux"
cp ./u-boot-rockchip.bin "${pkgdir}/boot/u-boot-rockchip.bin"
cp ${srcdir}/extlinux.conf "${pkgdir}/boot/extlinux/extlinux.conf"
}

9
extlinux.conf Normal file
View file

@ -0,0 +1,9 @@
timeout 3
default Arch
label Arch
linux /Image
fdt /dtbs/rockchip/rk3328-nanopi-r2s.dtb
append console=ttyS2,1500000 root=/dev/mmcblk0p1 rw rootwait earlycon=uart8250,mmio32,0xff130000
initrd /initramfs-linux.img

23
uboot-nanopi-r2s.install Normal file
View file

@ -0,0 +1,23 @@
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
dd if=/boot/u-boot-rockchip.bin of=/dev/mmcblk0 seek=64 conv=notrunc
else
echo "You can do this later by running:"
echo "# dd if=/boot/u-boot-rockchip.bin of=/dev/mmcblk0 seek=64 conv=notrunc"
echo "# if you are using the emmc interface, take care to use the correct device identifier! (probably mmcblk1)"
fi
}
## arg 1: the new package version
post_install() {
flash_uboot
}
## arg 1: the new package version
## arg 2: the old package version
post_upgrade() {
flash_uboot
}