diff options
author | Luke T. Shumaker <lukeshu@parabola.nu> | 2024-01-07 15:22:54 -0700 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@parabola.nu> | 2024-01-07 20:17:33 -0700 |
commit | dbc32760f6d1cb21ddce5ba8c0b60a29c6fd6681 (patch) | |
tree | 22c16913bf2bf114de0ede3c2e783d9252cdfae4 /libre/grub | |
parent | b04dc7f90e0eab051f49d61637d33658e011b151 (diff) |
libre/grub: factor out the common part of the arm-uboot package_* functions
Diffstat (limited to 'libre/grub')
-rw-r--r-- | libre/grub/PKGBUILD | 125 |
1 files changed, 18 insertions, 107 deletions
diff --git a/libre/grub/PKGBUILD b/libre/grub/PKGBUILD index e62d7488c..2f408e0a3 100644 --- a/libre/grub/PKGBUILD +++ b/libre/grub/PKGBUILD @@ -706,18 +706,21 @@ package_grub() { install -D -m0644 "${srcdir}/grub.default" "${pkgdir}/etc/default/grub" } -package_grub-am335x_bone() { - pkgdesc='GNU GRand Unified Bootloader (2) for BeagleBone and BeagleBone Black (am335x-bone), (Parabola rebranded)' +_package_grub-uboot-dev() { + local devname=$1 + local devdesc=$2 + + pkgdesc="GNU GRand Unified Bootloader (2) for $devdesc ($devname), (Parabola rebranded)" optdepends+=('dosfstools: For grub-mkrescue FAT FS' 'os-prober: To detect other OSes when generating grub.cfg in BIOS systems' 'mtools: For grub-mkrescue FAT FS support') - echo "Copy the source for packaging the U-Boot (am335x-bone) part..." - cp -r "${srcdir}/grub-uboot/" "${srcdir}/grub-uboot_am335x-bone/" - cd "${srcdir}/grub-uboot_am335x-bone/" + echo "Copy the source for packaging the U-Boot ($devname) part..." + cp -r "${srcdir}/grub-uboot/" "${srcdir}/grub-uboot_$devname/" + cd "${srcdir}/grub-uboot_$devname/" - echo 'Patch to detect am335x-bone device tree blob file (dtb)...' - patch -Np1 -i "${srcdir}/1000-am335x_bone--10_linux-20_linux_xen-detect-devicetree-file.patch" + echo "Patch to detect $devname device tree blob file (dtb)..." + patch -Np1 -i "${srcdir}/1000-${pkgname#grub-}--10_linux-20_linux_xen-detect-devicetree-file.patch" echo 'Package grub U-Boot stuff...' ## _package_grub-uboot @@ -734,117 +737,25 @@ package_grub-am335x_bone() { install -D -m0644 "${srcdir}/grub.default" "${pkgdir}/etc/default/grub" } +package_grub-am335x_bone() { + _package_grub-uboot-dev 'am335x-bone' 'BeagleBone and BeagleBone Black' +} + package_grub-omap3_beagle() { - pkgdesc='GNU GRand Unified Bootloader (2) for BeagleBoard (omap3_beagle), (Parabola rebranded)' provides+=('grub-beagleboard') - optdepends+=('dosfstools: For grub-mkrescue FAT FS' - 'os-prober: To detect other OSes when generating grub.cfg in BIOS systems' - 'mtools: For grub-mkrescue FAT FS support') - - echo "Copy the source for packaging the U-Boot (omap3_beagle) part..." - cp -r "${srcdir}/grub-uboot/" "${srcdir}/grub-uboot_omap3_beagle/" - cd "${srcdir}/grub-uboot_omap3_beagle/" - - echo 'Patch to detect omap3_beagle device tree blob file (dtb)...' - patch -Np1 -i "${srcdir}/1000-omap3_beagle--10_linux-20_linux_xen-detect-devicetree-file.patch" - - echo 'Package grub U-Boot stuff...' - ## _package_grub-uboot - - echo 'Run make install for U-Boot build...' - make DESTDIR="${pkgdir}/" bashcompletiondir="/usr/share/bash-completion/completions" install - - echo '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 - - echo 'Install /etc/default/grub (used by grub-mkconfig)...' - install -D -m0644 "${srcdir}/grub.default" "${pkgdir}/etc/default/grub" + _package_grub-uboot-dev "${pkgname#grub-}" 'BeagleBoard' } package_grub-omap3_beagle_xm() { - pkgdesc='GNU GRand Unified Bootloader (2) for BeagleBoard-xM (omap3_beagle_xm), (Parabola rebranded)' provides+=('grub-beagleboard') - optdepends+=('dosfstools: For grub-mkrescue FAT FS' - 'os-prober: To detect other OSes when generating grub.cfg in BIOS systems' - 'mtools: For grub-mkrescue FAT FS support') - - echo "Copy the source for packaging the U-Boot (omap3_beagle_xm) part..." - cp -r "${srcdir}/grub-uboot/" "${srcdir}/grub-uboot_omap3_beagle_xm/" - cd "${srcdir}/grub-uboot_omap3_beagle_xm/" - - echo 'Patch to detect omap3_beagle_xm device tree blob file (dtb)...' - patch -Np1 -i "${srcdir}/1000-omap3_beagle_xm--10_linux-20_linux_xen-detect-devicetree-file.patch" - - echo 'Package grub U-Boot stuff...' - ## _package_grub-uboot - - echo 'Run make install for U-Boot build...' - make DESTDIR="${pkgdir}/" bashcompletiondir="/usr/share/bash-completion/completions" install - - echo '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 - - echo 'Install /etc/default/grub (used by grub-mkconfig)...' - install -D -m0644 "${srcdir}/grub.default" "${pkgdir}/etc/default/grub" + _package_grub-uboot-dev "${pkgname#grub-}" 'BeagleBoard-xM' } package_grub-omap3_beagle_xm_ab() { - pkgdesc='GNU GRand Unified Bootloader (2) for BeagleBoard-xM rev A/B (omap3_beagle_xm_ab), (Parabola rebranded)' provides+=('grub-beagleboard') - optdepends+=('dosfstools: For grub-mkrescue FAT FS' - 'os-prober: To detect other OSes when generating grub.cfg in BIOS systems' - 'mtools: For grub-mkrescue FAT FS support') - - echo "Copy the source for packaging the U-Boot (omap3_beagle_xm_ab) part..." - cp -r "${srcdir}/grub-uboot/" "${srcdir}/grub-uboot_omap3_beagle_xm_ab/" - cd "${srcdir}/grub-uboot_omap3_beagle_xm_ab/" - - echo 'Patch to detect omap3_beagle_xm_ab device tree blob file (dtb)...' - patch -Np1 -i "${srcdir}/1000-omap3_beagle_xm_ab--10_linux-20_linux_xen-detect-devicetree-file.patch" - - echo 'Package grub U-Boot stuff...' - ## _package_grub-uboot - - echo 'Run make install for U-Boot build...' - make DESTDIR="${pkgdir}/" bashcompletiondir="/usr/share/bash-completion/completions" install - - echo '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 - - echo 'Install /etc/default/grub (used by grub-mkconfig)...' - install -D -m0644 "${srcdir}/grub.default" "${pkgdir}/etc/default/grub" + _package_grub-uboot-dev "${pkgname#grub-}" 'BeagleBoard-xM rev A/B' } package_grub-udoo() { - pkgdesc='GNU GRand Unified Bootloader (2) for UDOO (udoo), (Parabola rebranded)' - optdepends+=('dosfstools: For grub-mkrescue FAT FS' - 'os-prober: To detect other OSes when generating grub.cfg in BIOS systems' - 'mtools: For grub-mkrescue FAT FS support') - - echo "Copy the source for packaging the U-Boot (udoo) part..." - cp -r "${srcdir}/grub-uboot/" "${srcdir}/grub-uboot_udoo/" - cd "${srcdir}/grub-uboot_udoo/" - - echo 'Patch to detect udoo device tree blob file (dtb)...' - patch -Np1 -i "${srcdir}/1000-udoo--10_linux-20_linux_xen-detect-devicetree-file.patch" - - echo 'Package grub U-Boot stuff...' - ## _package_grub-uboot - - echo 'Run make install for U-Boot build...' - make DESTDIR="${pkgdir}/" bashcompletiondir="/usr/share/bash-completion/completions" install - - echo '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 - - echo 'Install /etc/default/grub (used by grub-mkconfig)...' - install -D -m0644 "${srcdir}/grub.default" "${pkgdir}/etc/default/grub" + _package_grub-uboot-dev "${pkgname#grub-}" 'UDOO' } |