summaryrefslogtreecommitdiff
path: root/libre/grub
diff options
context:
space:
mode:
Diffstat (limited to 'libre/grub')
-rw-r--r--libre/grub/PKGBUILD162
1 files changed, 153 insertions, 9 deletions
diff --git a/libre/grub/PKGBUILD b/libre/grub/PKGBUILD
index 8cf0ed728..f898356c4 100644
--- a/libre/grub/PKGBUILD
+++ b/libre/grub/PKGBUILD
@@ -192,11 +192,7 @@ _build_grub-common_and_uboot() {
msg "Copy the source for building the U-Boot part"
cp -r "${srcdir}/grub-${_pkgver}" "${srcdir}/grub-${_pkgver}-uboot"
cd "${srcdir}/grub-${_pkgver}-uboot/"
-
- msg "Add the grub-extra sources for U-Boot build"
- install -d "${srcdir}/grub-${_pkgver}-uboot/grub-extras"
- export GRUB_CONTRIB="${srcdir}/grub-${_pkgver}-uboot/grub-extras/"
-
+
msg "Unset all compiler FLAGS for bios build"
unset CFLAGS
unset CPPFLAGS
@@ -206,11 +202,11 @@ _build_grub-common_and_uboot() {
cd "${srcdir}/grub-${_pkgver}-uboot/"
- msg "Run autogen.sh for bios build"
+ msg "Run autogen.sh for U-Boot build"
./autogen.sh
echo
- msg "Run ./configure for bios build"
+ msg "Run ./configure for U-Boot build"
./configure \
--with-platform="uboot" \
--target="arm" \
@@ -236,7 +232,117 @@ _build_grub-common_and_uboot() {
--disable-werror
echo
- msg "Run make for bios build"
+ msg "Run make for U-Boot build"
+ make
+ echo
+}
+
+_build_grub-ieee1275() {
+
+ msg "Copy the source for building the IEEE1275 (OpenFirmware) part"
+ cp -r "${srcdir}/grub-${_pkgver}" "${srcdir}/grub-${_pkgver}-ieee1275"
+ cd "${srcdir}/grub-${_pkgver}-ieee1275/"
+
+ msg "Add the grub-extra sources for IEEE1275 (OpenFirmware) build"
+ install -d "${srcdir}/grub-${_pkgver}-ieee1275/grub-extras"
+ cp -r "${srcdir}/grub-extras/915resolution" "${srcdir}/grub-${_pkgver}-ieee1275/grub-extras/915resolution"
+ export GRUB_CONTRIB="${srcdir}/grub-${_pkgver}-ieee1275/grub-extras/"
+
+ msg "Unset all compiler FLAGS for IEEE1275 (OpenFirmware) build"
+ unset CFLAGS
+ unset CPPFLAGS
+ unset CXXFLAGS
+ unset LDFLAGS
+ unset MAKEFLAGS
+
+ cd "${srcdir}/grub-${_pkgver}-ieee1275/"
+
+ msg "Run autogen.sh for IEEE1275 (OpenFirmware) build"
+ ./autogen.sh
+ echo
+
+ msg "Run ./configure for IEEE1275 (OpenFirmware) build"
+ ./configure \
+ --with-platform="ieee1275" \
+ --target="i386" \
+ --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
+ echo
+
+ msg "Run make for IEEE1275 (OpenFirmware) build"
+ make
+ echo
+}
+
+_build_grub-libreboot() {
+
+ msg "Copy the source for building the Libreboot part"
+ cp -r "${srcdir}/grub-${_pkgver}" "${srcdir}/grub-${_pkgver}-libreboot"
+ cd "${srcdir}/grub-${_pkgver}-libreboot/"
+
+ msg "Add the grub-extra sources for Libreboot build"
+ install -d "${srcdir}/grub-${_pkgver}-libreboot/grub-extras"
+ cp -r "${srcdir}/grub-extras/915resolution" "${srcdir}/grub-${_pkgver}-libreboot/grub-extras/915resolution"
+ export GRUB_CONTRIB="${srcdir}/grub-${_pkgver}-libreboot/grub-extras/"
+
+ msg "Unset all compiler FLAGS for Libreboot build"
+ unset CFLAGS
+ unset CPPFLAGS
+ unset CXXFLAGS
+ unset LDFLAGS
+ unset MAKEFLAGS
+
+ cd "${srcdir}/grub-${_pkgver}-libreboot/"
+
+ msg "Run autogen.sh for Libreboot build"
+ ./autogen.sh
+ echo
+
+ msg "Run ./configure for Libreboot build"
+ ./configure \
+ --with-platform="coreboot" \
+ --target="i386" \
+ --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
+ echo
+
+ msg "Run make for Libreboot build"
make
echo
}
@@ -350,6 +456,10 @@ build() {
if [[ "${CARCH}" == "x86_64" ]] || [[ "${CARCH}" == "i686" ]]; then
msg "Build grub bios stuff"
_build_grub-common_and_bios
+ msg "Build grub IEEE1275 (OpenFirmware) stuff"
+ _build_grub-ieee1275
+ msg "Build Libreboot stuff"
+ _build_grub-libreboot
elif [[ "${CARCH}" == "armv7h" ]]; then
msg "Build grub U-Boot stuff"
_build_grub-common_and_uboot
@@ -404,7 +514,7 @@ _package_grub-common_and_uboot() {
make DESTDIR="${pkgdir}/" bashcompletiondir="/usr/share/bash-completion/completions" install
echo
- msg "Remove gdb debugging related files for bios build"
+ 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
@@ -415,6 +525,36 @@ _package_grub-common_and_uboot() {
}
+_package_grub-ieee1275() {
+
+ cd "${srcdir}/grub-${_pkgver}-ieee1275/"
+
+ msg "Run make install for IEEE1275 (OpenFirmware) build"
+ make DESTDIR="${pkgdir}/" bashcompletiondir="/usr/share/bash-completion/completions" install
+ echo
+
+ msg "Remove gdb debugging related files for IEEE1275 (OpenFirmware) build"
+ rm -f "${pkgdir}/usr/lib/grub/i386-ieee1275"/*.module || true
+ rm -f "${pkgdir}/usr/lib/grub/i386-ieee1275"/*.image || true
+ rm -f "${pkgdir}/usr/lib/grub/i386-ieee1275"/{kernel.exec,gdb_grub,gmodule.pl} || true
+
+}
+
+_package_grub-libreboot() {
+
+ cd "${srcdir}/grub-${_pkgver}-libreboot/"
+
+ msg "Run make install for Libreboot build"
+ make DESTDIR="${pkgdir}/" bashcompletiondir="/usr/share/bash-completion/completions" install
+ echo
+
+ msg "Remove gdb debugging related files for Libreboot build"
+ rm -f "${pkgdir}/usr/lib/grub/i386-coreboot"/*.module || true
+ rm -f "${pkgdir}/usr/lib/grub/i386-coreboot"/*.image || true
+ rm -f "${pkgdir}/usr/lib/grub/i386-coreboot"/{kernel.exec,gdb_grub,gmodule.pl} || true
+
+}
+
_package_grub-efi() {
cd "${srcdir}/grub-${_pkgver}-efi-${_EFI_ARCH}/"
@@ -467,6 +607,10 @@ package() {
if [[ "${CARCH}" == "x86_64" ]] || [[ "${CARCH}" == "i686" ]]; then
msg "Package grub bios stuff"
_package_grub-common_and_bios
+ msg "Package grub IEEE1275 (OpenFirmware) stuff"
+ _package_grub-ieee1275
+ msg "Package grub Libreboot stuff"
+ _package_grub-libreboot
elif [[ "${CARCH}" == "armv7h" ]]; then
msg "Package grub U-Boot stuff"
_package_grub-common_and_uboot