diff options
Diffstat (limited to 'libre/uboot-sunxi')
-rw-r--r-- | libre/uboot-sunxi/0001-parabola-arm-modifications.patch | 28 | ||||
-rw-r--r-- | libre/uboot-sunxi/PKGBUILD | 268 | ||||
-rw-r--r-- | libre/uboot-sunxi/boot.txt | 19 | ||||
-rwxr-xr-x | libre/uboot-sunxi/mkscr | 9 | ||||
-rw-r--r-- | libre/uboot-sunxi/uboot-sunxi.install | 22 |
5 files changed, 346 insertions, 0 deletions
diff --git a/libre/uboot-sunxi/0001-parabola-arm-modifications.patch b/libre/uboot-sunxi/0001-parabola-arm-modifications.patch new file mode 100644 index 000000000..fc504d587 --- /dev/null +++ b/libre/uboot-sunxi/0001-parabola-arm-modifications.patch @@ -0,0 +1,28 @@ +diff --git a/include/config_distro_defaults.h b/include/config_distro_defaults.h +index 9d1de55..b75c454 100644 +--- a/include/config_distro_defaults.h ++++ b/include/config_distro_defaults.h +@@ -67,4 +67,7 @@ + #define CONFIG_SUPPORT_RAW_INITRD + #define CONFIG_SYS_HUSH_PARSER + ++#define CONFIG_CMD_PART ++#define CONFIG_PARTITION_UUIDS ++ + #endif /* _CONFIG_CMD_DISTRO_DEFAULTS_H */ +diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h +index f5db4d3..1cdba92 100644 +--- a/include/configs/sunxi-common.h ++++ b/include/configs/sunxi-common.h +@@ -176,7 +176,7 @@ + #define CONFIG_SYS_NO_FLASH + + #define CONFIG_SYS_MONITOR_LEN (768 << 10) /* 768 KiB */ +-#define CONFIG_IDENT_STRING " Allwinner Technology" ++#define CONFIG_IDENT_STRING " Parabola GNU/Linux-libre" + + #define CONFIG_ENV_OFFSET (544 << 10) /* (8 + 24 + 512) KiB */ + #define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */ +-- +2.6.1 + diff --git a/libre/uboot-sunxi/PKGBUILD b/libre/uboot-sunxi/PKGBUILD new file mode 100644 index 000000000..e573f1d45 --- /dev/null +++ b/libre/uboot-sunxi/PKGBUILD @@ -0,0 +1,268 @@ +# U-Boot: sunXi +# Maintainer: André Silva <emulatorman@parabola.nu> + +buildarch=4 + +pkgbase=uboot-sunxi +pkgname=('uboot-a10-olinuxino-lime' + 'uboot-a10s-olinuxino-micro' + 'uboot-a13-olinuxino' + 'uboot-a13-olinuxino-micro' + 'uboot-a20-olinuxino-lime' + 'uboot-a20-olinuxino-lime2' + 'uboot-a20-olinuxino-micro' + 'uboot-cubieboard' + 'uboot-cubieboard2' + 'uboot-cubietruck' + 'uboot-pcduino' + 'uboot-pcduino3' + 'uboot-pcduino3-nano') +pkgver=2016.01 +pkgrel=1.parabola1 +arch=('armv7h') +url="http://git.denx.de/u-boot.git/" +license=('GPL') +makedepends=('bc' 'dtc') +depends=('linux-libre') +backup=(boot/boot.txt boot/boot.scr) +source=("ftp://ftp.denx.de/pub/u-boot/u-boot-${pkgver}.tar.bz2" + '0001-parabola-arm-modifications.patch' + 'boot.txt' + 'mkscr') +md5sums=('7d4f65fd43d4d706f5c5650e020d899d' + 'c66a4ef7a5be5622b674a69a9035558a' + 'a149665c52dc30817f98040b77999aeb' + '021623a04afd29ac3f368977140cfbfd') + +boards=('A10-OLinuXino-Lime' + 'A10s-OLinuXino-M' + 'A13-OLinuXino' + 'A13-OLinuXinoM' + 'A20-OLinuXino-Lime' + 'A20-OLinuXino-Lime2' + 'A20-OLinuXino_MICRO' + 'Cubieboard' + 'Cubieboard2' + 'Cubietruck' + 'Linksprite_pcDuino' + 'Linksprite_pcDuino3' + 'Linksprite_pcDuino3_Nano') + +prepare() { + cd u-boot-${pkgver} + + patch -Np1 -i ../0001-parabola-arm-modifications.patch +} + +build() { + cd u-boot-${pkgver} + + unset CFLAGS + unset CXXFLAGS + unset LDFLAGS + + for i in ${boards[@]}; do + mkdir ../bin_${i} + make distclean + make ${i}_config + make EXTRAVERSION=-${pkgrel} + mv u-boot-sunxi-with-spl.bin ../bin_${i} + done + + tools/mkimage -A arm -O linux -T script -C none -n "U-Boot boot script" -d ../boot.txt ../boot.scr +} + +package_uboot-a10-olinuxino-lime() { + pkgdesc="U-Boot for A10 OLinuXino Lime" + install=${pkgbase}.install + provides=('uboot-sunxi') + conflicts=('uboot-sunxi' 'uboot4extlinux-sunxi' 'uboot4grub-sunxi') + replaces=('uboot-a10-olinuxino-lime-linux-libre') + + install -d "${pkgdir}"/boot + install -Dm644 bin_A10-OLinuXino-Lime/u-boot-sunxi-with-spl.bin "${pkgdir}"/boot + + install -Dm644 boot.txt "${pkgdir}"/boot/boot.txt + install -Dm644 boot.scr "${pkgdir}"/boot/boot.scr + install -Dm755 mkscr "${pkgdir}"/boot/mkscr +} + +package_uboot-a10s-olinuxino-micro() { + pkgdesc="U-Boot for A10s OLinuXino Micro" + install=${pkgbase}.install + provides=('uboot-sunxi') + conflicts=('uboot-sunxi' 'uboot4extlinux-sunxi' 'uboot4grub-sunxi') + replaces=('uboot-a10s-olinuxino-micro-linux-libre') + + install -d "${pkgdir}"/boot + install -Dm644 bin_A10s-OLinuXino-M/u-boot-sunxi-with-spl.bin "${pkgdir}"/boot + + install -Dm644 boot.txt "${pkgdir}"/boot/boot.txt + install -Dm644 boot.scr "${pkgdir}"/boot/boot.scr + install -Dm755 mkscr "${pkgdir}"/boot/mkscr +} + +package_uboot-a13-olinuxino() { + pkgdesc="U-Boot for A13 OLinuXino" + install=${pkgbase}.install + provides=('uboot-sunxi') + conflicts=('uboot-sunxi' 'uboot4extlinux-sunxi' 'uboot4grub-sunxi') + replaces=('uboot-a13-olinuxino-linux-libre') + + install -d "${pkgdir}"/boot + install -Dm644 bin_A13-OLinuXino/u-boot-sunxi-with-spl.bin "${pkgdir}"/boot + + install -Dm644 boot.txt "${pkgdir}"/boot/boot.txt + install -Dm644 boot.scr "${pkgdir}"/boot/boot.scr + install -Dm755 mkscr "${pkgdir}"/boot/mkscr +} + +package_uboot-a13-olinuxino-micro() { + pkgdesc="U-Boot for A13 OLinuXino Micro" + install=${pkgbase}.install + provides=('uboot-sunxi') + conflicts=('uboot-sunxi' 'uboot4extlinux-sunxi' 'uboot4grub-sunxi') + replaces=('uboot-a13-olinuxino-micro-linux-libre') + + install -d "${pkgdir}"/boot + install -Dm644 bin_A13-OLinuXinoM/u-boot-sunxi-with-spl.bin "${pkgdir}"/boot + + install -Dm644 boot.txt "${pkgdir}"/boot/boot.txt + install -Dm644 boot.scr "${pkgdir}"/boot/boot.scr + install -Dm755 mkscr "${pkgdir}"/boot/mkscr +} + +package_uboot-a20-olinuxino-lime() { + pkgdesc="U-Boot for A20 OLinuXino Lime" + install=${pkgbase}.install + provides=('uboot-sunxi') + conflicts=('uboot-sunxi' 'uboot4extlinux-sunxi' 'uboot4grub-sunxi') + replaces=('uboot-a20-olinuxino-lime-linux-libre') + + install -d "${pkgdir}"/boot + install -Dm644 bin_A20-OLinuXino-Lime/u-boot-sunxi-with-spl.bin "${pkgdir}"/boot + + install -Dm644 boot.txt "${pkgdir}"/boot/boot.txt + install -Dm644 boot.scr "${pkgdir}"/boot/boot.scr + install -Dm755 mkscr "${pkgdir}"/boot/mkscr +} + +package_uboot-a20-olinuxino-lime2() { + pkgdesc="U-Boot for A20 OLinuXino Lime2" + install=${pkgbase}.install + provides=('uboot-sunxi') + conflicts=('uboot-sunxi' 'uboot4extlinux-sunxi' 'uboot4grub-sunxi') + replaces=('uboot-a20-olinuxino-lime2-linux-libre') + + install -d "${pkgdir}"/boot + install -Dm644 bin_A20-OLinuXino-Lime2/u-boot-sunxi-with-spl.bin "${pkgdir}"/boot + + install -Dm644 boot.txt "${pkgdir}"/boot/boot.txt + install -Dm644 boot.scr "${pkgdir}"/boot/boot.scr + install -Dm755 mkscr "${pkgdir}"/boot/mkscr +} + +package_uboot-a20-olinuxino-micro() { + pkgdesc="U-Boot for A20 OLinuXino Micro" + install=${pkgbase}.install + provides=('uboot-sunxi') + conflicts=('uboot-sunxi' 'uboot4extlinux-sunxi' 'uboot4grub-sunxi') + replaces=('uboot-a20-olinuxino-micro-linux-libre') + + install -d "${pkgdir}"/boot + install -Dm644 bin_A20-OLinuXino_MICRO/u-boot-sunxi-with-spl.bin "${pkgdir}"/boot + + install -Dm644 boot.txt "${pkgdir}"/boot/boot.txt + install -Dm644 boot.scr "${pkgdir}"/boot/boot.scr + install -Dm755 mkscr "${pkgdir}"/boot/mkscr +} + +package_uboot-cubieboard() { + pkgdesc="U-Boot for Cubieboard" + install=${pkgbase}.install + provides=('uboot-sunxi') + conflicts=('uboot-sunxi' 'uboot4extlinux-sunxi' 'uboot4grub-sunxi') + replaces=('uboot-cubieboard-linux-libre') + + install -d "${pkgdir}"/boot + install -Dm644 bin_Cubieboard/u-boot-sunxi-with-spl.bin "${pkgdir}"/boot/u-boot-sunxi-with-spl.bin + + install -Dm644 boot.txt "${pkgdir}"/boot/boot.txt + install -Dm644 boot.scr "${pkgdir}"/boot/boot.scr + install -Dm755 mkscr "${pkgdir}"/boot/mkscr +} + +package_uboot-cubieboard2() { + pkgdesc="U-Boot for Cubieboard 2" + install=${pkgbase}.install + provides=('uboot-sunxi') + conflicts=('uboot-sunxi' 'uboot4extlinux-sunxi' 'uboot4grub-sunxi') + replaces=('uboot-cubieboard2-linux-libre') + + install -d "${pkgdir}"/boot + install -Dm644 bin_Cubieboard2/u-boot-sunxi-with-spl.bin "${pkgdir}"/boot/u-boot-sunxi-with-spl.bin + + install -Dm644 boot.txt "${pkgdir}"/boot/boot.txt + install -Dm644 boot.scr "${pkgdir}"/boot/boot.scr + install -Dm755 mkscr "${pkgdir}"/boot/mkscr +} + +package_uboot-cubietruck() { + pkgdesc="U-Boot for Cubietruck" + install=${pkgbase}.install + provides=('uboot-sunxi') + conflicts=('uboot-sunxi' 'uboot4extlinux-sunxi' 'uboot4grub-sunxi') + replaces=('uboot-cubietruck-linux-libre') + + install -d "${pkgdir}"/boot + install -Dm644 bin_Cubietruck/u-boot-sunxi-with-spl.bin "${pkgdir}"/boot/u-boot-sunxi-with-spl.bin + + install -Dm644 boot.txt "${pkgdir}"/boot/boot.txt + install -Dm644 boot.scr "${pkgdir}"/boot/boot.scr + install -Dm755 mkscr "${pkgdir}"/boot/mkscr +} + +package_uboot-pcduino() { + pkgdesc="U-Boot for pcDuino" + install=${pkgbase}.install + provides=('uboot-sunxi') + conflicts=('uboot-sunxi' 'uboot4extlinux-sunxi' 'uboot4grub-sunxi') + replaces=('uboot-pcduino-linux-libre') + + install -d "${pkgdir}"/boot + install -Dm644 bin_Linksprite_pcDuino/u-boot-sunxi-with-spl.bin "${pkgdir}"/boot + + install -Dm644 boot.txt "${pkgdir}"/boot/boot.txt + install -Dm644 boot.scr "${pkgdir}"/boot/boot.scr + install -Dm755 mkscr "${pkgdir}"/boot/mkscr +} + +package_uboot-pcduino3() { + pkgdesc="U-Boot for pcDuino3" + install=${pkgbase}.install + provides=('uboot-sunxi') + conflicts=('uboot-sunxi' 'uboot4extlinux-sunxi' 'uboot4grub-sunxi') + replaces=('uboot-pcduino3-linux-libre') + + install -d "${pkgdir}"/boot + install -Dm644 bin_Linksprite_pcDuino3/u-boot-sunxi-with-spl.bin "${pkgdir}"/boot + + install -Dm644 boot.txt "${pkgdir}"/boot/boot.txt + install -Dm644 boot.scr "${pkgdir}"/boot/boot.scr + install -Dm755 mkscr "${pkgdir}"/boot/mkscr +} + +package_uboot-pcduino3-nano() { + pkgdesc="U-Boot for pcDuino3 Nano" + install=${pkgbase}.install + provides=('uboot-sunxi') + conflicts=('uboot-sunxi' 'uboot4extlinux-sunxi' 'uboot4grub-sunxi') + replaces=('uboot-pcduino3-nano-linux-libre') + + install -d "${pkgdir}"/boot + install -Dm644 bin_Linksprite_pcDuino3_Nano/u-boot-sunxi-with-spl.bin "${pkgdir}"/boot + + install -Dm644 boot.txt "${pkgdir}"/boot/boot.txt + install -Dm644 boot.scr "${pkgdir}"/boot/boot.scr + install -Dm755 mkscr "${pkgdir}"/boot/mkscr +} diff --git a/libre/uboot-sunxi/boot.txt b/libre/uboot-sunxi/boot.txt new file mode 100644 index 000000000..1eac14d9c --- /dev/null +++ b/libre/uboot-sunxi/boot.txt @@ -0,0 +1,19 @@ +part uuid ${devtype} ${devnum}:${bootpart} uuid +setenv bootargs console=${console} root=PARTUUID=${uuid} rw rootwait + +if load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /boot/vmlinuz-linux-libre; then + if load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} /boot/dtbs/linux-libre/${fdtfile}; then + if load ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} /boot/initramfs-linux-libre.img; then + bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r}; + else + bootz ${kernel_addr_r} - ${fdt_addr_r}; + fi; + fi; +fi + +if load ${devtype} ${devnum}:${bootpart} 0x48000000 /boot/uImage; then + if load ${devtype} ${devnum}:${bootpart} 0x43000000 /boot/script.bin; then + setenv bootm_boot_mode sec; + bootm 0x48000000; + fi; +fi diff --git a/libre/uboot-sunxi/mkscr b/libre/uboot-sunxi/mkscr new file mode 100755 index 000000000..272b6a7a5 --- /dev/null +++ b/libre/uboot-sunxi/mkscr @@ -0,0 +1,9 @@ +#!/bin/bash + +if [[ ! -x /usr/bin/mkimage ]]; then + echo "mkimage not found. Please install uboot-tools:" + echo " pacman -S uboot-tools" + exit 1 +fi + +mkimage -A arm -O linux -T script -C none -n "U-Boot boot script" -d boot.txt boot.scr diff --git a/libre/uboot-sunxi/uboot-sunxi.install b/libre/uboot-sunxi/uboot-sunxi.install new file mode 100644 index 000000000..cd4afef4b --- /dev/null +++ b/libre/uboot-sunxi/uboot-sunxi.install @@ -0,0 +1,22 @@ +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-sunxi-with-spl.bin of=/dev/mmcblk0 bs=1024 seek=8 + else + echo "You can do this later by running:" + echo "# dd if=/boot/u-boot-sunxi-with-spl.bin of=/dev/mmcblk0 bs=1024 seek=8" + 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 +} |