summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2015-10-16 17:41:20 -0300
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2015-10-16 17:41:20 -0300
commitea0fa15b0a60539f29f0785fed9581c004e67115 (patch)
treecfba9c6111cabec07a458ef24617140af660b902
parentb9c11b8528a906f60545b4713fa6ab9a91fe6d54 (diff)
downloadabslibre-ea0fa15b0a60539f29f0785fed9581c004e67115.tar.gz
abslibre-ea0fa15b0a60539f29f0785fed9581c004e67115.tar.bz2
abslibre-ea0fa15b0a60539f29f0785fed9581c004e67115.zip
grub: add grub-udoo
-rw-r--r--libre/grub/PKGBUILD82
-rw-r--r--libre/grub/grub-10_linux-20_linux_xen-detect-udoo-devicetree-file.patch58
2 files changed, 138 insertions, 2 deletions
diff --git a/libre/grub/PKGBUILD b/libre/grub/PKGBUILD
index fa15c1ee5..3060f30f5 100644
--- a/libre/grub/PKGBUILD
+++ b/libre/grub/PKGBUILD
@@ -38,6 +38,7 @@
# 0xa0800000 - imx27lite
# 0xc0000014 - davinci[ea20]
# 0xc0700000 - davinci[ea20]
+# 0x12000000 - udoo_dl udoo_quad
# alt
# am335x_igep0033
@@ -315,7 +316,6 @@
# tt01
# twister
# tx25
-# udoo udoo_quad
# uniphier-ph1-ld4-ref
# uniphier-ph1-pro4-ref
# uniphier-ph1-sld8-ref
@@ -368,7 +368,7 @@ _UNIFONT_VER='6.3.20131217'
pkgbase='grub'
pkgname=('grub')
-[[ $CARCH = armv7h ]] && pkgname+=('grub-am335x_bone')
+[[ $CARCH = armv7h ]] && pkgname+=('grub-am335x_bone' 'grub-udoo')
pkgdesc='GNU GRand Unified Bootloader (2), (Parabola rebranded)'
pkgver='2.02.beta2'
pkgrel='5.parabola8'
@@ -418,6 +418,7 @@ source=("grub-${_pkgver}::git+git://git.sv.gnu.org/grub.git#tag=${_GRUB_GIT_TAG}
'60_memtest86+'
'grub.default'
'grub-10_linux-20_linux_xen-detect-am335x_bone+am335x_boneblack-devicetree-file.patch'
+ 'grub-10_linux-20_linux_xen-detect-udoo-devicetree-file.patch'
'grub-10_linux-20_linux_xen-rebrand-free-distros.patch')
md5sums=('SKIP'
@@ -429,6 +430,7 @@ md5sums=('SKIP'
'be55eabc102f2c60b38ed35c203686d6'
'8d1dd54ae4a1b550c097e056892ce953'
'a46695e19b588a53b8bac9e3b3c56096'
+ '95b721dfe74f42df52b7ae94e0e7c067'
'e0133ad89ab3014210d4599f396a556e')
validpgpkeys=('95D2E9AB8740D8046387FD151A09227B1F435A33') #Paul Hardy
@@ -906,6 +908,61 @@ _build_grub-uboot_am335x-bone() {
make
}
+_build_grub-uboot_udoo() {
+ msg "Copy the source for building the U-Boot (udoo) part"
+ cp -r "${srcdir}/grub-${_pkgver}" "${srcdir}/grub-${_pkgver}-uboot_udoo"
+ cd "${srcdir}/grub-${_pkgver}-uboot_udoo/"
+
+ msg 'Patch to detect udoo device tree blob file (dtb)'
+ patch -Np1 -i "${srcdir}/grub-10_linux-20_linux_xen-detect-udoo-devicetree-file.patch"
+
+ msg 'change memory adapted for udoo support'
+ sed -i '\|arm_uboot_ldflags| s|0x08000000|0x12000000|
+ \|GRUB_KERNEL_ARM_UBOOT_LINK_ADDR| s|0x08000000|0x12000000|
+ ' grub-core/Makefile.core.def \
+ include/grub/offsets.h
+
+ msg 'Unset all compiler FLAGS for U-Boot (udoo) build'
+ unset CFLAGS
+ unset CPPFLAGS
+ unset CXXFLAGS
+ unset LDFLAGS
+ unset MAKEFLAGS
+
+ cd "${srcdir}/grub-${_pkgver}-uboot_udoo/"
+
+ msg 'Run autogen.sh for U-Boot (udoo) build'
+ ./autogen.sh
+
+ msg 'Run ./configure for U-Boot (udoo) build'
+ ./configure \
+ --with-platform='uboot' \
+ --target='arm' \
+ --disable-efiemu \
+ --enable-mm-debug \
+ --enable-nls \
+ --enable-device-mapper \
+ --enable-cache-stats \
+ --enable-boot-time \
+ --enable-grub-mkfont \
+ --enable-grub-mount \
+ --prefix='/usr' \
+ --bindir='/usr/bin' \
+ --sbindir='/usr/bin' \
+ --mandir='/usr/share/man' \
+ --infodir='/usr/share/info' \
+ --datarootdir='/usr/share' \
+ --sysconfdir='/etc' \
+ --program-prefix='' \
+ --with-bootdir='/boot' \
+ --with-grubdir='grub' \
+ --disable-silent-rules \
+ --disable-werror
+
+ msg 'Run make for U-Boot (udoo) build'
+ make
+}
+
build() {
cd "${srcdir}/grub-${_pkgver}/"
@@ -1131,3 +1188,24 @@ package_grub-am335x_bone() {
msg 'Install /etc/default/grub (used by grub-mkconfig)'
install -D -m0644 "${srcdir}/grub.default" "${pkgdir}/etc/default/grub"
}
+
+package_grub-udoo() {
+ pkgdesc='GNU GRand Unified Bootloader (2) for UDOO (udoo), (Parabola rebranded)'
+ provides+=('grub')
+ conflicts+=('grub')
+
+ cd "${srcdir}/grub-${_pkgver}-uboot_udoo/"
+
+ msg 'Package grub U-Boot stuff'
+
+ msg 'Run make install for U-Boot build'
+ make DESTDIR="${pkgdir}/" bashcompletiondir="/usr/share/bash-completion/completions" install
+
+ msg 'Remove gdb debugging related files for U-Boot build'
+ rm -f "${pkgdir}/usr/lib/grub/arm-uboot"/*.module || true
+ rm -f "${pkgdir}/usr/lib/grub/arm-uboot"/*.image || true
+ rm -f "${pkgdir}/usr/lib/grub/arm-uboot"/{kernel.exec,gdb_grub,gmodule.pl} || true
+
+ msg 'Install /etc/default/grub (used by grub-mkconfig)'
+ install -D -m0644 "${srcdir}/grub.default" "${pkgdir}/etc/default/grub"
+}
diff --git a/libre/grub/grub-10_linux-20_linux_xen-detect-udoo-devicetree-file.patch b/libre/grub/grub-10_linux-20_linux_xen-detect-udoo-devicetree-file.patch
new file mode 100644
index 000000000..7cd6be6b4
--- /dev/null
+++ b/libre/grub/grub-10_linux-20_linux_xen-detect-udoo-devicetree-file.patch
@@ -0,0 +1,58 @@
+diff -Nur a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
+--- a/util/grub.d/10_linux.in 2015-09-27 14:14:45.544730230 -0300
++++ b/util/grub.d/10_linux.in 2015-09-27 18:43:26.911364096 -0300
+@@ -139,6 +139,14 @@
+ initrd ${rel_dirname}/${initrd}
+ EOF
+ fi
++ if test -d "${rel_dirname}/dtbs/${version}/imx6q-udoo.dtb" ; then
++ # TRANSLATORS: Device tree path isn't identifier. Should be translated.
++ message="$(gettext_printf "Loading devices tree path ...")"
++ sed "s/^/$submenu_indentation/" << EOF
++ echo '$(echo "$message" | grub_quote)'
++ devicetree ${rel_dirname}/dtbs/${version}/imx6q-udoo.dtb
++EOF
++ fi
+ sed "s/^/$submenu_indentation/" << EOF
+ }
+ EOF
+@@ -222,6 +230,10 @@
+ linux_root_device_thisversion=${GRUB_DEVICE}
+ fi
+
++ if test -d "${dirname}/dtbs/${version}/imx6q-udoo.dtb" ; then
++ gettext_printf "Found device tree directory: %s\n" "${dirname}/dtbs/${version}/imx6q-udoo.dtb" >&2
++ fi
++
+ if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then
+ linux_entry "${OS}" "${version}" simple \
+ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
+diff -Nur a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in
+--- a/util/grub.d/20_linux_xen.in 2015-09-27 14:14:45.544730230 -0300
++++ b/util/grub.d/20_linux_xen.in 2015-09-27 18:47:34.953427471 -0300
+@@ -132,6 +132,14 @@
+ module --nounzip ${rel_dirname}/${initrd}
+ EOF
+ fi
++ if test -d "${rel_dirname}/dtbs/${version}/imx6q-udoo.dtb" ; then
++ # TRANSLATORS: Device tree path isn't identifier. Should be translated.
++ message="$(gettext_printf "Loading devices tree path ...")"
++ sed "s/^/$submenu_indentation/" << EOF
++ echo '$(echo "$message" | grub_quote)'
++ devicetree ${rel_dirname}/dtbs/${version}/imx6q-udoo.dtb
++EOF
++ fi
+ sed "s/^/$submenu_indentation/" << EOF
+ }
+ EOF
+@@ -235,6 +243,10 @@
+ linux_root_device_thisversion=${GRUB_DEVICE}
+ fi
+
++ if test -d "${dirname}/dtbs/${version}/imx6q-udoo.dtb" ; then
++ gettext_printf "Found device tree directory: %s\n" "${dirname}/dtbs/${version}/imx6q-udoo.dtb" >&2
++ fi
++
+ if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then
+ linux_entry "${OS}" "${version}" "${xen_version}" simple \
+ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}"