[Dev] [PATCH] uboot-teres-i: New Package

Jacob Hrbek kreyren at rixotstudio.cz
Thu Feb 23 09:31:21 GMT 2023


Add uboot package for the OLIMEX Teres-A64 system

Signed-off-by: Jacob Hrbek <kreyren at rixotstudio.cz>
---
 libre/uboot-teres_i/PKGBUILD              | 46 +++++++++++++++++++++++
 libre/uboot-teres_i/uboot-teres_i.install | 39 +++++++++++++++++++
 2 files changed, 85 insertions(+)
 create mode 100644 libre/uboot-teres_i/PKGBUILD
 create mode 100644 libre/uboot-teres_i/uboot-teres_i.install

diff --git a/libre/uboot-teres_i/PKGBUILD b/libre/uboot-teres_i/PKGBUILD
new file mode 100644
index 000000000..7d2c77395
--- /dev/null
+++ b/libre/uboot-teres_i/PKGBUILD
@@ -0,0 +1,46 @@
+# U-Boot: OLIMEX Teres-A64
+# Package Copyright: Jacob Hrbek <kreyren at rixotstudio.cz> under the Expat License <https://mit-license.org> in 23.02.2023-EU 09:02:30 (UTC)
+# Maintainer: Jacob "Kreyren" Hrbek <kreyren+parabola at rixotstudio.cz>
+# Contributor: Bill Auger <bill-auger at peers.community>
+
+pkgname="uboot-teres_i"
+pkgver=2022.04 # ?
+pkgrel=3 # ?
+_tfaver=2.6 # ?
+pkgdesc="U-Boot for OLIMEX Teres-A64"
+arch=('armv8h') # ?
+url='http://www.denx.de/wiki/U-Boot/WebHome'
+license=('GPL')
+makedepends=('git' 'aarch64-linux-gnu-gcc' 'dtc' 'bc')
+provides=('uboot')
+conflicts=('uboot')
+install="$pkgname.install"
+source=("ftp://ftp.denx.de/pub/u-boot/u-boot-${pkgver/rc/-rc}.tar.bz2")
+sha256sums=('68e065413926778e276ec3abd28bb32fa82abaa4a6898d570c1f48fbdb08bcd0')
+
+export CROSS_COMPILE="aarch64-linux-gnu-"
+
+prepare() {
+  cd "u-boot-${pkgver/rc/-rc}"
+}
+
+build() {
+  unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
+
+  # FIXME-QA(Krey): This should be a separate function -- status_update "Building U-Boot for OLIMEX Teres-A64"
+  printf "\n%s...\n" "Building U-Boot for OLIMEX Teres-A64"
+  make teres_i_defconfig
+
+  update_config 'CONFIG_IDENT_STRING' '" Parabola"'
+  update_config 'CONFIG_SPL_MMC_SDHCI_SDMA' 'n'
+
+  make EXTRAVERSION="-$pkgrel"
+}
+
+package() {
+  cd "u-boot-${pkgver/rc/-rc}"
+
+  mkdir -p "$pkgdir/boot/extlinux"
+  install -D -m 0644 idbloader.img u-boot.itb -t "$pkgdir/boot"
+}
+
diff --git a/libre/uboot-teres_i/uboot-teres_i.install b/libre/uboot-teres_i/uboot-teres_i.install
new file mode 100644
index 000000000..6ed61319b
--- /dev/null
+++ b/libre/uboot-teres_i/uboot-teres_i.install
@@ -0,0 +1,39 @@
+_notice_uboot() {
+  printf "* %s\n" \
+    "You may flash it to your microSD card (mmcblk0)," \
+    "or eMMC module (mmcblk1), by running:" \
+    "# dd if=/boot/idbloader.img of=/dev/mmcblkX seek=64 conv=notrunc,fsync status=progress" \
+    "# dd if=/boot/u-boot.itb of=/dev/mmcblkX seek=16384 conv=notrunc,fsync status=progress"
+}
+
+# Make sure that the extlinux config is present if not, create it
+_create_config() {
+  if [ ! -f /boot/extlinux/extlinux.conf ]; then
+    mkdir -p /boot/extlinux
+    # FIXME-QA(Krey): Hardwritten kernel, expecting method to use the desired kernel on demand
+    cat > /boot/extlinux/extlinux.conf <<-CONFIG
+      timeout 1
+      DEFAULT linux-libre-64
+      LABEL Parabola
+      KERNEL /boot/vmlinuz-linux-libre-64
+      FDTDIR /boot/dtbs/linux-libre-64
+      APPEND initrd=/boot/initramfs-linux-libre-64.img console=ttyS0,115200 root=LABEL=PARABOLA rw rootwait audit=0 splash plymouth.ignore-serial-consoles
+CONFIG
+  else
+	  # FIXME-QA(Krey): Should have an error handling to check if the expected extlinux.conf is present and output debug status
+	  true
+  fi
+}
+
+post_install() {
+  printf "WARNING: %s\n" "U-Boot firmware must be manually flashed onto your boot medium"
+  _notice_uboot
+  _create_config
+}
+
+post_upgrade() {
+  printf "NOTICE: %s\n" "A new version of U-Boot firmware is ready to be flashed onto your boot medium"
+  _notice_uboot
+  _create_config
+}
+
--
2.37.3




More information about the Dev mailing list