From b18ea1f73f90b8c3b21e9ba8793f286b377a7fc3 Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Sun, 27 Aug 2017 16:27:16 -0400 Subject: Add grub-helper script --- projects/grub/grub-helper | 174 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100755 projects/grub/grub-helper diff --git a/projects/grub/grub-helper b/projects/grub/grub-helper new file mode 100755 index 00000000..342b03eb --- /dev/null +++ b/projects/grub/grub-helper @@ -0,0 +1,174 @@ +#!/usr/bin/env bash + +# Copyright (C) 2017 Andrew Robbins +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +ARCH='arch' +CONFIG='config' +FORMAT='format' +MODMIN='modules-minimal' +PLATFORM='platform' +PREFIX='prefix' +SIZE='size' + +grub_arch() { + project_file_contents "${project}" "${CONFIGS}" "${ARCH}" "$@" +} + +grub_format() { + project_file_contents "${project}" "${CONFIGS}" "${FORMAT}" "$@" +} + +grub_platform() { + project_file_contents "${project}" "${CONFIGS}" "${PLATFORM}" "$@" +} + +grub_prefix() { + project_file_contents "${project}" "${CONFIGS}" "${PREFIX}" "$@" +} + +grub_size() { + project_file_contents "${project}" "${CONFIGS}" "${SIZE}" "$@" +} + +grub_config_path() { + project_file_path "${project}" "${CONFIGS}" "${CONFIG}" "$@" +} + +grub_modmin_path() { + project_file_path "${project}" "${CONFIGS}" "${MODMIN}" "$@" +} + +grub_copy_modules() { + local grub_module_dir="${sources_path}/grub-core" + local keep_dir="${build_path}/$(grub_format "${target}" "$@")" + + mkdir -p "${keep_dir}" + + cp -a "${grub_module_dir}"/*.@(mod|lst) "${keep_dir}" +} + +grub_build_utils() { + ( + # If arch and/or platform files don't exist, + # the configure script will pick a reasonable default + local arch="$(grub_arch "${target}" "$@")" + local platform="$(grub_platform "${target}" "$@")" + + cd "${sources_path}" || return + + if git_project_check "${repository}"; then + ./autogen.sh + fi + + ./configure --target="${arch}" --with-platform="${platform}" + + make -j"${TASKS}" + ) +} + +grub_build_layout() { + local raw_layout="${1##*/}" + local raw_layout_path="$1" + local grub_kbdcomp="${sources_path}/grub-kbdcomp" + local grub_kbd_layout="${build_path}/${raw_layout}.gkb" + + "${grub_kbdcomp}" --output="${grub_kbd_layout}" "${raw_layout_path}" +} + +grub_build_bootable_image() { + local arch="$(grub_arch "${target}" "$@")" + local format="$(grub_format "${target}" "$@")" + local prefix="$(grub_prefix "${target}" "$@")" + local config_path="$(grub_config_path "${target}" "$@")" + + local grub_mkimage="${sources_path}/grub-mkimage" + local grub_module_dir="${sources_path}/grub-core" + + local grubimg="${build_path}/grub.img" + local grub_bootimg="${grub_module_dir}/boot.img" + local grub_bootable_img="${build_path}/grub2" + + "${grub_mkimage}" \ + --config="${config_path}" \ + --directory="${grub_module_dir}" \ + --output="${grubimg}" \ + --format="${format}" \ + --prefix="${prefix}" \ + cbfs configfile + + cat "${grub_bootimg}" "${grubimg}" > "${grub_bootable_img}" + rm -f "${grubimg}" +} + +grub_build_floppy_image() { + local grubimg="${build_path}/grub2" + local tempfile="${build_path}/temp.file" + + if ! ( grub_build_bootable_image "$@" ); then + printf '\n%s\n\n' "Error: Failed to build a GRUB image" 1>&2 + return 1 + fi + + local size="$(grub_size "${target}" "$@")" + + # Pre-allocate a floppy-sized image + # SeaBIOS requires floppy images to have a "correct" size + if ! [[ -e "${tempfile}" ]]; then + dd if=/dev/zero of="${tempfile}" bs=1024 count="${size:-160}" + else + printf '\n%s\n\n' "Error: File ${tempfile} already exists!" 1>&2 + return 1 + fi + + local -i grubimg_size="$(stat -c %s "${grubimg}")" + local -i floppy_size="$((${size:-160} * 1024))" + + # Graft the GRUB image onto the blank floppy image + if ((grubimg_size <= floppy_size)); then + dd if="${grubimg}" of="${tempfile}" bs=1 conv=notrunc + + rm -f "${grubimg}" + mv "${tempfile}" "${grubimg}" + else + printf '\n%s' "Error: Image ${grubimg##*/} is too large; " 1>&2 + printf '%s\n\n' "it must be less than ${size}KiB in size." 1>&2 + return 1 + fi +} + +grub_build_standalone_image() { + local arch="$(grub_arch "${target}" "$@")" + local format="$(grub_format "${target}" "$@")" + local prefix="$(grub_prefix "${target}" "$@")" + local config_path="$(grub_config_path "${target}" "$@")" + + local grubimg="${build_path}/grub2" + + local grub_mkimage="${sources_path}/grub-mkimage" + local grub_mkstandalone="${sources_path}/grub-mkstandalone" + local grub_module_dir="${sources_path}/grub-core" + + "${grub_mkstandalone}" \ + --grub-mkimage="${grub_mkimage}" \ + --fonts='' \ + --themes='' \ + --locales='' \ + --install-modules='cbfs configfile' \ + --directory="${grub_module_dir}" \ + --format="${format}" \ + --output="${grubimg}" \ + /boot/grub/grub.cfg="${config_path}" +} -- cgit v1.2.3-70-g09d2 From 125bb6c56e61dbe52a7ca4c6885686c0d045cab2 Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Sun, 27 Aug 2017 16:29:01 -0400 Subject: Add configuration files to GRUB BIOS target dir The purpose of each new file is as follows: * arch -- CPU architecture to target when building images * config -- embedded GRUB configuration * format -- GRUB output format * platform -- the platform GRUB should build images for * prefix -- where GRUB should search for modules by default * size -- the size of the floppy image to produce, in KiB --- projects/grub/configs/bios/arch | 1 + projects/grub/configs/bios/config | 2 ++ projects/grub/configs/bios/format | 1 + projects/grub/configs/bios/platform | 1 + projects/grub/configs/bios/prefix | 1 + projects/grub/configs/bios/size | 1 + 6 files changed, 7 insertions(+) create mode 100644 projects/grub/configs/bios/arch create mode 100644 projects/grub/configs/bios/config create mode 100644 projects/grub/configs/bios/format create mode 100644 projects/grub/configs/bios/platform create mode 100644 projects/grub/configs/bios/prefix create mode 100644 projects/grub/configs/bios/size diff --git a/projects/grub/configs/bios/arch b/projects/grub/configs/bios/arch new file mode 100644 index 00000000..5a9a476a --- /dev/null +++ b/projects/grub/configs/bios/arch @@ -0,0 +1 @@ +i386 diff --git a/projects/grub/configs/bios/config b/projects/grub/configs/bios/config new file mode 100644 index 00000000..9e627e2f --- /dev/null +++ b/projects/grub/configs/bios/config @@ -0,0 +1,2 @@ +set root=(cbfsdisk) +source (cbfsdisk)/fallback/grub.cfg diff --git a/projects/grub/configs/bios/format b/projects/grub/configs/bios/format new file mode 100644 index 00000000..58df395e --- /dev/null +++ b/projects/grub/configs/bios/format @@ -0,0 +1 @@ +i386-pc diff --git a/projects/grub/configs/bios/platform b/projects/grub/configs/bios/platform new file mode 100644 index 00000000..581a7690 --- /dev/null +++ b/projects/grub/configs/bios/platform @@ -0,0 +1 @@ +pc diff --git a/projects/grub/configs/bios/prefix b/projects/grub/configs/bios/prefix new file mode 100644 index 00000000..48604ad8 --- /dev/null +++ b/projects/grub/configs/bios/prefix @@ -0,0 +1 @@ +(cbfsdisk)/fallback diff --git a/projects/grub/configs/bios/size b/projects/grub/configs/bios/size new file mode 100644 index 00000000..a7625603 --- /dev/null +++ b/projects/grub/configs/bios/size @@ -0,0 +1 @@ +160 -- cgit v1.2.3-70-g09d2 From bb7abb3fd3b2c1b01a5341c42000bc6285f7379c Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Sun, 27 Aug 2017 16:29:10 -0400 Subject: Rename files grub-{install,load}-modules It's fairly obvious that the files refer to _GRUB_ modules considering the files are located in the GRUB project's configuration directory. --- projects/grub/configs/grub-install-modules | 80 ------------------- projects/grub/configs/grub-load-modules | 122 ----------------------------- projects/grub/configs/modules-install | 80 +++++++++++++++++++ projects/grub/configs/modules-preload | 122 +++++++++++++++++++++++++++++ projects/grub/grub | 4 +- 5 files changed, 204 insertions(+), 204 deletions(-) delete mode 100644 projects/grub/configs/grub-install-modules delete mode 100644 projects/grub/configs/grub-load-modules create mode 100644 projects/grub/configs/modules-install create mode 100644 projects/grub/configs/modules-preload diff --git a/projects/grub/configs/grub-install-modules b/projects/grub/configs/grub-install-modules deleted file mode 100644 index 1d0d78ba..00000000 --- a/projects/grub/configs/grub-install-modules +++ /dev/null @@ -1,80 +0,0 @@ -adler32 -all_video -archelp -ata -backtrace -bitmap -bitmap_scale -cmp -cpio -cpio_be -cpuid -crc64 -cs5536 -div_test -efiemu -elf -eval -exfat -extcmd -file -fshelp -gettext -gfxmenu -gptsync -gzio -hashsum -hexdump -http -linux16 -loadenv -lzopio -mda_text -mmap -mpi -msdospart -multiboot -multiboot2 -nativedisk -net -newc -ntfs -ntfscomp -odc -offsetio -parttool -priority_queue -procfs -progress -read -relocator -scsi -search -search_fs_file -search_fs_uuid -search_label -setjmp -setpci -sleep -squash4 -tar -terminfo -testload -testspeed -tftp -time -tr -trig -true -udf -ufs1 -ufs1_be -ufs2 -usbserial_common -usbserial_ftdi -usbserial_pl2303 -usbserial_usbdebug -usbtest -video_colors -videotest_checksum -xzio diff --git a/projects/grub/configs/grub-load-modules b/projects/grub/configs/grub-load-modules deleted file mode 100644 index bbbac61f..00000000 --- a/projects/grub/configs/grub-load-modules +++ /dev/null @@ -1,122 +0,0 @@ -acpi -affs -afs -ahci -at_keyboard -bfs -boot -bsd -btrfs -cat -cbfs -cbls -cbmemc -cbtime -chain -cmosdump -cmostest -configfile -crypto -cryptodisk -date -datehook -datetime -disk -diskfilter -echo -ehci -ext2 -fat -gcry_arcfour -gcry_blowfish -gcry_camellia -gcry_cast5 -gcry_crc -gcry_des -gcry_dsa -gcry_idea -gcry_md4 -gcry_md5 -gcry_rfc2268 -gcry_rijndael -gcry_rmd160 -gcry_rsa -gcry_seed -gcry_serpent -gcry_sha1 -gcry_sha256 -gcry_sha512 -gcry_tiger -gcry_twofish -gcry_whirlpool -gfxmenu -gfxterm_background -gfxterm_menu -halt -hdparm -help -hfs -hfsplus -iorw -iso9660 -jfs -jpeg -keystatus -linux -loopback -ls -lsacpi -lsmmap -lspci -luks -lvm -mdraid09 -mdraid09_be -mdraid1x -memdisk -memrw -minicmd -minix -minix2 -minix2_be -minix3 -minix3_be -minix_be -morse -nilfs2 -normal -ohci -part_bsd -part_gpt -part_msdos -password -password_pbkdf2 -pata -pbkdf2 -pci -pcidump -play -png -probe -raid5rec -raid6rec -reboot -regexp -reiserfs -romfs -serial -sfs -spkmodem -syslinuxcfg -terminal -test -tga -uhci -usb -usb_keyboard -usbms -verify -videoinfo -videotest -xfs -zfs diff --git a/projects/grub/configs/modules-install b/projects/grub/configs/modules-install new file mode 100644 index 00000000..1d0d78ba --- /dev/null +++ b/projects/grub/configs/modules-install @@ -0,0 +1,80 @@ +adler32 +all_video +archelp +ata +backtrace +bitmap +bitmap_scale +cmp +cpio +cpio_be +cpuid +crc64 +cs5536 +div_test +efiemu +elf +eval +exfat +extcmd +file +fshelp +gettext +gfxmenu +gptsync +gzio +hashsum +hexdump +http +linux16 +loadenv +lzopio +mda_text +mmap +mpi +msdospart +multiboot +multiboot2 +nativedisk +net +newc +ntfs +ntfscomp +odc +offsetio +parttool +priority_queue +procfs +progress +read +relocator +scsi +search +search_fs_file +search_fs_uuid +search_label +setjmp +setpci +sleep +squash4 +tar +terminfo +testload +testspeed +tftp +time +tr +trig +true +udf +ufs1 +ufs1_be +ufs2 +usbserial_common +usbserial_ftdi +usbserial_pl2303 +usbserial_usbdebug +usbtest +video_colors +videotest_checksum +xzio diff --git a/projects/grub/configs/modules-preload b/projects/grub/configs/modules-preload new file mode 100644 index 00000000..bbbac61f --- /dev/null +++ b/projects/grub/configs/modules-preload @@ -0,0 +1,122 @@ +acpi +affs +afs +ahci +at_keyboard +bfs +boot +bsd +btrfs +cat +cbfs +cbls +cbmemc +cbtime +chain +cmosdump +cmostest +configfile +crypto +cryptodisk +date +datehook +datetime +disk +diskfilter +echo +ehci +ext2 +fat +gcry_arcfour +gcry_blowfish +gcry_camellia +gcry_cast5 +gcry_crc +gcry_des +gcry_dsa +gcry_idea +gcry_md4 +gcry_md5 +gcry_rfc2268 +gcry_rijndael +gcry_rmd160 +gcry_rsa +gcry_seed +gcry_serpent +gcry_sha1 +gcry_sha256 +gcry_sha512 +gcry_tiger +gcry_twofish +gcry_whirlpool +gfxmenu +gfxterm_background +gfxterm_menu +halt +hdparm +help +hfs +hfsplus +iorw +iso9660 +jfs +jpeg +keystatus +linux +loopback +ls +lsacpi +lsmmap +lspci +luks +lvm +mdraid09 +mdraid09_be +mdraid1x +memdisk +memrw +minicmd +minix +minix2 +minix2_be +minix3 +minix3_be +minix_be +morse +nilfs2 +normal +ohci +part_bsd +part_gpt +part_msdos +password +password_pbkdf2 +pata +pbkdf2 +pci +pcidump +play +png +probe +raid5rec +raid6rec +reboot +regexp +reiserfs +romfs +serial +sfs +spkmodem +syslinuxcfg +terminal +test +tga +uhci +usb +usb_keyboard +usbms +verify +videoinfo +videotest +xfs +zfs diff --git a/projects/grub/grub b/projects/grub/grub index 4a7ba1ec..547c770d 100755 --- a/projects/grub/grub +++ b/projects/grub/grub @@ -69,8 +69,8 @@ build() { local sources_path="$(project_sources_path "${project}" "${repository}" "$@")" local build_path="$(project_build_path "${project}" "$@")" - mapfile -t grub_install_modules < "${project_path}/${CONFIGS}/grub-install-modules" - mapfile -t grub_load_modules < "${project_path}/${CONFIGS}/grub-load-modules" + mapfile -t grub_install_modules < "${project_path}/${CONFIGS}/modules-install" + mapfile -t grub_load_modules < "${project_path}/${CONFIGS}/modules-preload" mkdir -p "${build_path}" -- cgit v1.2.3-70-g09d2 From 485fb20d9eb2a23930e289fa1011591c799acb34 Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Sun, 27 Aug 2017 16:29:18 -0400 Subject: Copy GRUB module lists to BIOS target dir A GRUB image will be produced on a target-specific basis so the target will need its own copy of the modules to include in either the GRUB image itself or CBFS. --- projects/grub/configs/bios/modules-install | 80 +++++++++++++++++++ projects/grub/configs/bios/modules-preload | 122 +++++++++++++++++++++++++++++ 2 files changed, 202 insertions(+) create mode 100644 projects/grub/configs/bios/modules-install create mode 100644 projects/grub/configs/bios/modules-preload diff --git a/projects/grub/configs/bios/modules-install b/projects/grub/configs/bios/modules-install new file mode 100644 index 00000000..1d0d78ba --- /dev/null +++ b/projects/grub/configs/bios/modules-install @@ -0,0 +1,80 @@ +adler32 +all_video +archelp +ata +backtrace +bitmap +bitmap_scale +cmp +cpio +cpio_be +cpuid +crc64 +cs5536 +div_test +efiemu +elf +eval +exfat +extcmd +file +fshelp +gettext +gfxmenu +gptsync +gzio +hashsum +hexdump +http +linux16 +loadenv +lzopio +mda_text +mmap +mpi +msdospart +multiboot +multiboot2 +nativedisk +net +newc +ntfs +ntfscomp +odc +offsetio +parttool +priority_queue +procfs +progress +read +relocator +scsi +search +search_fs_file +search_fs_uuid +search_label +setjmp +setpci +sleep +squash4 +tar +terminfo +testload +testspeed +tftp +time +tr +trig +true +udf +ufs1 +ufs1_be +ufs2 +usbserial_common +usbserial_ftdi +usbserial_pl2303 +usbserial_usbdebug +usbtest +video_colors +videotest_checksum +xzio diff --git a/projects/grub/configs/bios/modules-preload b/projects/grub/configs/bios/modules-preload new file mode 100644 index 00000000..bbbac61f --- /dev/null +++ b/projects/grub/configs/bios/modules-preload @@ -0,0 +1,122 @@ +acpi +affs +afs +ahci +at_keyboard +bfs +boot +bsd +btrfs +cat +cbfs +cbls +cbmemc +cbtime +chain +cmosdump +cmostest +configfile +crypto +cryptodisk +date +datehook +datetime +disk +diskfilter +echo +ehci +ext2 +fat +gcry_arcfour +gcry_blowfish +gcry_camellia +gcry_cast5 +gcry_crc +gcry_des +gcry_dsa +gcry_idea +gcry_md4 +gcry_md5 +gcry_rfc2268 +gcry_rijndael +gcry_rmd160 +gcry_rsa +gcry_seed +gcry_serpent +gcry_sha1 +gcry_sha256 +gcry_sha512 +gcry_tiger +gcry_twofish +gcry_whirlpool +gfxmenu +gfxterm_background +gfxterm_menu +halt +hdparm +help +hfs +hfsplus +iorw +iso9660 +jfs +jpeg +keystatus +linux +loopback +ls +lsacpi +lsmmap +lspci +luks +lvm +mdraid09 +mdraid09_be +mdraid1x +memdisk +memrw +minicmd +minix +minix2 +minix2_be +minix3 +minix3_be +minix_be +morse +nilfs2 +normal +ohci +part_bsd +part_gpt +part_msdos +password +password_pbkdf2 +pata +pbkdf2 +pci +pcidump +play +png +probe +raid5rec +raid6rec +reboot +regexp +reiserfs +romfs +serial +sfs +spkmodem +syslinuxcfg +terminal +test +tga +uhci +usb +usb_keyboard +usbms +verify +videoinfo +videotest +xfs +zfs -- cgit v1.2.3-70-g09d2 From a48685beded83e0929e2034eaa82f9de2b75e496 Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Sun, 27 Aug 2017 16:30:02 -0400 Subject: Create GRUB BIOS target file 'modules-minimal' This file should only contain the minimum of modules necessary to create a working, bootable image able to source other modules and files from CBFS and/or a separate device. (module dependencies are installed automatically) By including as few modules as possible into the GRUB image, selective addition/removal of modules to/from CBFS is now possible. In addition, modules can be reloaded without issue (modules included in the GRUB image can't be reloaded). --- projects/grub/configs/bios/modules-minimal | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 projects/grub/configs/bios/modules-minimal diff --git a/projects/grub/configs/bios/modules-minimal b/projects/grub/configs/bios/modules-minimal new file mode 100644 index 00000000..abd265c0 --- /dev/null +++ b/projects/grub/configs/bios/modules-minimal @@ -0,0 +1,7 @@ +biosdisk +ext2 +halt +part_bsd +part_gpt +reboot +verify -- cgit v1.2.3-70-g09d2 From dfe1bef1312dc8a30d40669bb48c2e980ec3d0a7 Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Sun, 27 Aug 2017 23:12:18 -0400 Subject: Consolidate GRUB BIOS target modules into 'install' Since the majority of GRUB modules will be placed into CBFS instead of the GRUB image itself, the modules-install and modules-preload files no longer have any use as-is. However, they serve as a useful reference to which modules should be retained for later processing (thus the addition to the new install file). --- projects/grub/configs/bios/install | 201 +++++++++++++++++++++++++++++ projects/grub/configs/bios/modules-install | 80 ------------ projects/grub/configs/bios/modules-preload | 122 ----------------- 3 files changed, 201 insertions(+), 202 deletions(-) create mode 100644 projects/grub/configs/bios/install delete mode 100644 projects/grub/configs/bios/modules-install delete mode 100644 projects/grub/configs/bios/modules-preload diff --git a/projects/grub/configs/bios/install b/projects/grub/configs/bios/install new file mode 100644 index 00000000..f9d62a94 --- /dev/null +++ b/projects/grub/configs/bios/install @@ -0,0 +1,201 @@ +i386-pc/acpi.mod:i386-pc/acpi.mod +i386-pc/adler32.mod:i386-pc/adler32.mod +i386-pc/affs.mod:i386-pc/affs.mod +i386-pc/afs.mod:i386-pc/afs.mod +i386-pc/ahci.mod:i386-pc/ahci.mod +i386-pc/all_video.mod:i386-pc/all_video.mod +i386-pc/archelp.mod:i386-pc/archelp.mod +i386-pc/ata.mod:i386-pc/ata.mod +i386-pc/at_keyboard.mod:i386-pc/at_keyboard.mod +i386-pc/backtrace.mod:i386-pc/backtrace.mod +i386-pc/bfs.mod:i386-pc/bfs.mod +i386-pc/bitmap.mod:i386-pc/bitmap.mod +i386-pc/bitmap_scale.mod:i386-pc/bitmap_scale.mod +i386-pc/boot.mod:i386-pc/boot.mod +i386-pc/bsd.mod:i386-pc/bsd.mod +i386-pc/btrfs.mod:i386-pc/btrfs.mod +i386-pc/cat.mod:i386-pc/cat.mod +i386-pc/cbfs.mod:i386-pc/cbfs.mod +i386-pc/cbls.mod:i386-pc/cbls.mod +i386-pc/cbmemc.mod:i386-pc/cbmemc.mod +i386-pc/cbtime.mod:i386-pc/cbtime.mod +i386-pc/chain.mod:i386-pc/chain.mod +i386-pc/cmosdump.mod:i386-pc/cmosdump.mod +i386-pc/cmostest.mod:i386-pc/cmostest.mod +i386-pc/cmp.mod:i386-pc/cmp.mod +i386-pc/configfile.mod:i386-pc/configfile.mod +i386-pc/cpio.mod:i386-pc/cpio.mod +i386-pc/cpio_be.mod:i386-pc/cpio_be.mod +i386-pc/cpuid.mod:i386-pc/cpuid.mod +i386-pc/crc64.mod:i386-pc/crc64.mod +i386-pc/crypto.mod:i386-pc/crypto.mod +i386-pc/cryptodisk.mod:i386-pc/cryptodisk.mod +i386-pc/cs5536.mod:i386-pc/cs5536.mod +i386-pc/date.mod:i386-pc/date.mod +i386-pc/datehook.mod:i386-pc/datehook.mod +i386-pc/datetime.mod:i386-pc/datetime.mod +i386-pc/disk.mod:i386-pc/disk.mod +i386-pc/diskfilter.mod:i386-pc/diskfilter.mod +i386-pc/div_test.mod:i386-pc/div_test.mod +i386-pc/echo.mod:i386-pc/echo.mod +i386-pc/efiemu.mod:i386-pc/efiemu.mod +i386-pc/ehci.mod:i386-pc/ehci.mod +i386-pc/elf.mod:i386-pc/elf.mod +i386-pc/eval.mod:i386-pc/eval.mod +i386-pc/exfat.mod:i386-pc/exfat.mod +i386-pc/ext2.mod:i386-pc/ext2.mod +i386-pc/extcmd.mod:i386-pc/extcmd.mod +i386-pc/fat.mod:i386-pc/fat.mod +i386-pc/file.mod:i386-pc/file.mod +i386-pc/fshelp.mod:i386-pc/fshelp.mod +i386-pc/gcry_arcfour.mod:i386-pc/gcry_arcfour.mod +i386-pc/gcry_blowfish.mod:i386-pc/gcry_blowfish.mod +i386-pc/gcry_camellia.mod:i386-pc/gcry_camellia.mod +i386-pc/gcry_cast5.mod:i386-pc/gcry_cast5.mod +i386-pc/gcry_crc.mod:i386-pc/gcry_crc.mod +i386-pc/gcry_des.mod:i386-pc/gcry_des.mod +i386-pc/gcry_dsa.mod:i386-pc/gcry_dsa.mod +i386-pc/gcry_idea.mod:i386-pc/gcry_idea.mod +i386-pc/gcry_md4.mod:i386-pc/gcry_md4.mod +i386-pc/gcry_md5.mod:i386-pc/gcry_md5.mod +i386-pc/gcry_rfc2268.mod:i386-pc/gcry_rfc2268.mod +i386-pc/gcry_rijndael.mod:i386-pc/gcry_rijndael.mod +i386-pc/gcry_rmd160.mod:i386-pc/gcry_rmd160.mod +i386-pc/gcry_rsa.mod:i386-pc/gcry_rsa.mod +i386-pc/gcry_seed.mod:i386-pc/gcry_seed.mod +i386-pc/gcry_serpent.mod:i386-pc/gcry_serpent.mod +i386-pc/gcry_sha1.mod:i386-pc/gcry_sha1.mod +i386-pc/gcry_sha256.mod:i386-pc/gcry_sha256.mod +i386-pc/gcry_sha512.mod:i386-pc/gcry_sha512.mod +i386-pc/gcry_tiger.mod:i386-pc/gcry_tiger.mod +i386-pc/gcry_twofish.mod:i386-pc/gcry_twofish.mod +i386-pc/gcry_whirlpool.mod:i386-pc/gcry_whirlpool.mod +i386-pc/gettext.mod:i386-pc/gettext.mod +i386-pc/gfxmenu.mod:i386-pc/gfxmenu.mod +i386-pc/gfxterm_background.mod:i386-pc/gfxterm_background.mod +i386-pc/gfxterm_menu.mod:i386-pc/gfxterm_menu.mod +i386-pc/gptsync.mod:i386-pc/gptsync.mod +i386-pc/gzio.mod:i386-pc/gzio.mod +i386-pc/halt.mod:i386-pc/halt.mod +i386-pc/hashsum.mod:i386-pc/hashsum.mod +i386-pc/hdparm.mod:i386-pc/hdparm.mod +i386-pc/help.mod:i386-pc/help.mod +i386-pc/hexdump.mod:i386-pc/hexdump.mod +i386-pc/hfs.mod:i386-pc/hfs.mod +i386-pc/hfsplus.mod:i386-pc/hfsplus.mod +i386-pc/http.mod:i386-pc/http.mod +i386-pc/iorw.mod:i386-pc/iorw.mod +i386-pc/iso9660.mod:i386-pc/iso9660.mod +i386-pc/jfs.mod:i386-pc/jfs.mod +i386-pc/jpeg.mod:i386-pc/jpeg.mod +i386-pc/keystatus.mod:i386-pc/keystatus.mod +i386-pc/linux.mod:i386-pc/linux.mod +i386-pc/linux16.mod:i386-pc/linux16.mod +i386-pc/loadenv.mod:i386-pc/loadenv.mod +i386-pc/loopback.mod:i386-pc/loopback.mod +i386-pc/ls.mod:i386-pc/ls.mod +i386-pc/lsacpi.mod:i386-pc/lsacpi.mod +i386-pc/lsmmap.mod:i386-pc/lsmmap.mod +i386-pc/lspci.mod:i386-pc/lspci.mod +i386-pc/luks.mod:i386-pc/luks.mod +i386-pc/lvm.mod:i386-pc/lvm.mod +i386-pc/lzopio.mod:i386-pc/lzopio.mod +i386-pc/mda_text.mod:i386-pc/mda_text.mod +i386-pc/mdraid09.mod:i386-pc/mdraid09.mod +i386-pc/mdraid09_be.mod:i386-pc/mdraid09_be.mod +i386-pc/mdraid1x.mod:i386-pc/mdraid1x.mod +i386-pc/memdisk.mod:i386-pc/memdisk.mod +i386-pc/memrw.mod:i386-pc/memrw.mod +i386-pc/minicmd.mod:i386-pc/minicmd.mod +i386-pc/minix.mod:i386-pc/minix.mod +i386-pc/minix2.mod:i386-pc/minix2.mod +i386-pc/minix2_be.mod:i386-pc/minix2_be.mod +i386-pc/minix3.mod:i386-pc/minix3.mod +i386-pc/minix3_be.mod:i386-pc/minix3_be.mod +i386-pc/minix_be.mod:i386-pc/minix_be.mod +i386-pc/mmap.mod:i386-pc/mmap.mod +i386-pc/morse.mod:i386-pc/morse.mod +i386-pc/mpi.mod:i386-pc/mpi.mod +i386-pc/msdospart.mod:i386-pc/msdospart.mod +i386-pc/multiboot.mod:i386-pc/multiboot.mod +i386-pc/multiboot2.mod:i386-pc/multiboot2.mod +i386-pc/nativedisk.mod:i386-pc/nativedisk.mod +i386-pc/net.mod:i386-pc/net.mod +i386-pc/newc.mod:i386-pc/newc.mod +i386-pc/nilfs2.mod:i386-pc/nilfs2.mod +i386-pc/normal.mod:i386-pc/normal.mod +i386-pc/ntfs.mod:i386-pc/ntfs.mod +i386-pc/ntfscomp.mod:i386-pc/ntfscomp.mod +i386-pc/odc.mod:i386-pc/odc.mod +i386-pc/offsetio.mod:i386-pc/offsetio.mod +i386-pc/ohci.mod:i386-pc/ohci.mod +i386-pc/part_bsd.mod:i386-pc/part_bsd.mod +i386-pc/part_gpt.mod:i386-pc/part_gpt.mod +i386-pc/part_msdos.mod:i386-pc/part_msdos.mod +i386-pc/parttool.mod:i386-pc/parttool.mod +i386-pc/password.mod:i386-pc/password.mod +i386-pc/password_pbkdf2.mod:i386-pc/password_pbkdf2.mod +i386-pc/pata.mod:i386-pc/pata.mod +i386-pc/pbkdf2.mod:i386-pc/pbkdf2.mod +i386-pc/pci.mod:i386-pc/pci.mod +i386-pc/pcidump.mod:i386-pc/pcidump.mod +i386-pc/play.mod:i386-pc/play.mod +i386-pc/png.mod:i386-pc/png.mod +i386-pc/priority_queue.mod:i386-pc/priority_queue.mod +i386-pc/probe.mod:i386-pc/probe.mod +i386-pc/procfs.mod:i386-pc/procfs.mod +i386-pc/progress.mod:i386-pc/progress.mod +i386-pc/raid5rec.mod:i386-pc/raid5rec.mod +i386-pc/raid6rec.mod:i386-pc/raid6rec.mod +i386-pc/read.mod:i386-pc/read.mod +i386-pc/reboot.mod:i386-pc/reboot.mod +i386-pc/regexp.mod:i386-pc/regexp.mod +i386-pc/reiserfs.mod:i386-pc/reiserfs.mod +i386-pc/relocator.mod:i386-pc/relocator.mod +i386-pc/romfs.mod:i386-pc/romfs.mod +i386-pc/scsi.mod:i386-pc/scsi.mod +i386-pc/search.mod:i386-pc/search.mod +i386-pc/search_fs_file.mod:i386-pc/search_fs_file.mod +i386-pc/search_fs_uuid.mod:i386-pc/search_fs_uuid.mod +i386-pc/search_label.mod:i386-pc/search_label.mod +i386-pc/serial.mod:i386-pc/serial.mod +i386-pc/setjmp.mod:i386-pc/setjmp.mod +i386-pc/setpci.mod:i386-pc/setpci.mod +i386-pc/sfs.mod:i386-pc/sfs.mod +i386-pc/sleep.mod:i386-pc/sleep.mod +i386-pc/spkmodem.mod:i386-pc/spkmodem.mod +i386-pc/squash4.mod:i386-pc/squash4.mod +i386-pc/syslinuxcfg.mod:i386-pc/syslinuxcfg.mod +i386-pc/tar.mod:i386-pc/tar.mod +i386-pc/terminal.mod:i386-pc/terminal.mod +i386-pc/terminfo.mod:i386-pc/terminfo.mod +i386-pc/test.mod:i386-pc/test.mod +i386-pc/testload.mod:i386-pc/testload.mod +i386-pc/testspeed.mod:i386-pc/testspeed.mod +i386-pc/tftp.mod:i386-pc/tftp.mod +i386-pc/tga.mod:i386-pc/tga.mod +i386-pc/time.mod:i386-pc/time.mod +i386-pc/tr.mod:i386-pc/tr.mod +i386-pc/trig.mod:i386-pc/trig.mod +i386-pc/true.mod:i386-pc/true.mod +i386-pc/udf.mod:i386-pc/udf.mod +i386-pc/ufs1.mod:i386-pc/ufs1.mod +i386-pc/ufs1_be.mod:i386-pc/ufs1_be.mod +i386-pc/ufs2.mod:i386-pc/ufs2.mod +i386-pc/uhci.mod:i386-pc/uhci.mod +i386-pc/usb.mod:i386-pc/usb.mod +i386-pc/usb_keyboard.mod:i386-pc/usb_keyboard.mod +i386-pc/usbms.mod:i386-pc/usbms.mod +i386-pc/usbserial_common.mod:i386-pc/usbserial_common.mod +i386-pc/usbserial_ftdi.mod:i386-pc/usbserial_ftdi.mod +i386-pc/usbserial_pl2303.mod:i386-pc/usbserial_pl2303.mod +i386-pc/usbserial_usbdebug.mod:i386-pc/usbserial_usbdebug.mod +i386-pc/usbtest.mod:i386-pc/usbtest.mod +i386-pc/verify.mod:i386-pc/verify.mod +i386-pc/video_colors.mod:i386-pc/video_colors.mod +i386-pc/videoinfo.mod:i386-pc/videoinfo.mod +i386-pc/videotest.mod:i386-pc/videotest.mod +i386-pc/videotest_checksum.mod:i386-pc/videotest_checksum.mod +i386-pc/xfs.mod:i386-pc/xfs.mod +i386-pc/xzio.mod:i386-pc/xzio.mod +i386-pc/zfs.mod:i386-pc/zfs.mod diff --git a/projects/grub/configs/bios/modules-install b/projects/grub/configs/bios/modules-install deleted file mode 100644 index 1d0d78ba..00000000 --- a/projects/grub/configs/bios/modules-install +++ /dev/null @@ -1,80 +0,0 @@ -adler32 -all_video -archelp -ata -backtrace -bitmap -bitmap_scale -cmp -cpio -cpio_be -cpuid -crc64 -cs5536 -div_test -efiemu -elf -eval -exfat -extcmd -file -fshelp -gettext -gfxmenu -gptsync -gzio -hashsum -hexdump -http -linux16 -loadenv -lzopio -mda_text -mmap -mpi -msdospart -multiboot -multiboot2 -nativedisk -net -newc -ntfs -ntfscomp -odc -offsetio -parttool -priority_queue -procfs -progress -read -relocator -scsi -search -search_fs_file -search_fs_uuid -search_label -setjmp -setpci -sleep -squash4 -tar -terminfo -testload -testspeed -tftp -time -tr -trig -true -udf -ufs1 -ufs1_be -ufs2 -usbserial_common -usbserial_ftdi -usbserial_pl2303 -usbserial_usbdebug -usbtest -video_colors -videotest_checksum -xzio diff --git a/projects/grub/configs/bios/modules-preload b/projects/grub/configs/bios/modules-preload deleted file mode 100644 index bbbac61f..00000000 --- a/projects/grub/configs/bios/modules-preload +++ /dev/null @@ -1,122 +0,0 @@ -acpi -affs -afs -ahci -at_keyboard -bfs -boot -bsd -btrfs -cat -cbfs -cbls -cbmemc -cbtime -chain -cmosdump -cmostest -configfile -crypto -cryptodisk -date -datehook -datetime -disk -diskfilter -echo -ehci -ext2 -fat -gcry_arcfour -gcry_blowfish -gcry_camellia -gcry_cast5 -gcry_crc -gcry_des -gcry_dsa -gcry_idea -gcry_md4 -gcry_md5 -gcry_rfc2268 -gcry_rijndael -gcry_rmd160 -gcry_rsa -gcry_seed -gcry_serpent -gcry_sha1 -gcry_sha256 -gcry_sha512 -gcry_tiger -gcry_twofish -gcry_whirlpool -gfxmenu -gfxterm_background -gfxterm_menu -halt -hdparm -help -hfs -hfsplus -iorw -iso9660 -jfs -jpeg -keystatus -linux -loopback -ls -lsacpi -lsmmap -lspci -luks -lvm -mdraid09 -mdraid09_be -mdraid1x -memdisk -memrw -minicmd -minix -minix2 -minix2_be -minix3 -minix3_be -minix_be -morse -nilfs2 -normal -ohci -part_bsd -part_gpt -part_msdos -password -password_pbkdf2 -pata -pbkdf2 -pci -pcidump -play -png -probe -raid5rec -raid6rec -reboot -regexp -reiserfs -romfs -serial -sfs -spkmodem -syslinuxcfg -terminal -test -tga -uhci -usb -usb_keyboard -usbms -verify -videoinfo -videotest -xfs -zfs -- cgit v1.2.3-70-g09d2 From f4bbd9b7c237f6ceb5adaffe8d8bd4734f84c5ed Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Sun, 27 Aug 2017 23:12:33 -0400 Subject: Add GRUB module 'biosdisk' to BIOS target install Without this module the GRUB can't find devices--as in, 'ls' literally lists nothing, not even the device GRUB booted from. --- projects/grub/configs/bios/install | 1 + 1 file changed, 1 insertion(+) diff --git a/projects/grub/configs/bios/install b/projects/grub/configs/bios/install index f9d62a94..241e2762 100644 --- a/projects/grub/configs/bios/install +++ b/projects/grub/configs/bios/install @@ -9,6 +9,7 @@ i386-pc/ata.mod:i386-pc/ata.mod i386-pc/at_keyboard.mod:i386-pc/at_keyboard.mod i386-pc/backtrace.mod:i386-pc/backtrace.mod i386-pc/bfs.mod:i386-pc/bfs.mod +i386-pc/biosdisk.mod:i386-pc/biosdisk.mod i386-pc/bitmap.mod:i386-pc/bitmap.mod i386-pc/bitmap_scale.mod:i386-pc/bitmap_scale.mod i386-pc/boot.mod:i386-pc/boot.mod -- cgit v1.2.3-70-g09d2 From f1768eddd0222e46735ddb2388eda8712b5f1b1d Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Sun, 27 Aug 2017 23:12:37 -0400 Subject: Rewrite GRUB 'build' action, integrating grub-helper The previous build function definition only allowed for a one-size-fits-all build process for any given target. The function was rewritten to allow for different build processes based on the target passed to it (e.g. building GRUB keylayouts is very different from building GRUB images). --- projects/grub/grub | 50 +++++++++++++++++++++++--------------------------- 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/projects/grub/grub b/projects/grub/grub index 547c770d..e77deb6d 100755 --- a/projects/grub/grub +++ b/projects/grub/grub @@ -57,6 +57,7 @@ update_check() { } build() { + local target="$1" local repository="${project}" project_sources_directory_missing_empty_error "${project}" "${repository}" "$@" @@ -68,37 +69,32 @@ build() { local project_path="$(project_path "${project}")" local sources_path="$(project_sources_path "${project}" "${repository}" "$@")" local build_path="$(project_build_path "${project}" "$@")" - - mapfile -t grub_install_modules < "${project_path}/${CONFIGS}/modules-install" - mapfile -t grub_load_modules < "${project_path}/${CONFIGS}/modules-preload" + local rawmap_path="${project_path}/${CONFIGS}/${target}/original" mkdir -p "${build_path}" + grub_build_utils + + case "${target}" in + bios) + grub_build_floppy_image + grub_copy_modules + ;; + keymap) + for rawmap in "${rawmap_path}"/*; do + grub_build_layout "${rawmap}" + done + ;; + *) + grub_build_standalone_image + grub_copy_modules + ;; + esac + + # Temporary until the function project_make_distclean is written ( - cd "${sources_path}" - - # Compile GRUB first - ./autogen.sh - ./configure --with-platform=coreboot - make -j"${TASKS}" - - # Now compile GRUB ELF executable - ./grub-mkstandalone \ - --grub-mkimage=./grub-mkimage \ - --fonts='' \ - --themes='' \ - --locales='' \ - --modules="${grub_load_modules[*]}" \ - --install-modules="${grub_install_modules[*]}" \ - --directory=grub-core \ - -O i386-coreboot \ - -o grub.elf \ - /boot/grub/grub.cfg="${project_path}/${CONFIGS}/grub.cfg" - - # Copy the ELF to its build directory - cp grub.elf "${build_path}" - - # Tidy up + cd "${sources_path}" || return + make distclean ) } -- cgit v1.2.3-70-g09d2 From 934508416c93bb23942b75c4555b4b2a91235aed Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Sun, 27 Aug 2017 23:19:03 -0400 Subject: Create GRUB 'targets' file 'keymap' isn't included as a target yet due to it needing further work done to it. --- projects/grub/configs/targets | 1 + 1 file changed, 1 insertion(+) create mode 100644 projects/grub/configs/targets diff --git a/projects/grub/configs/targets b/projects/grub/configs/targets new file mode 100644 index 00000000..b033e320 --- /dev/null +++ b/projects/grub/configs/targets @@ -0,0 +1 @@ +bios -- cgit v1.2.3-70-g09d2 From 33c337e484d39ae86b0f2752336334a2d84c8c2d Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Sun, 27 Aug 2017 23:19:19 -0400 Subject: Alter GRUB image name in its default 'install' file The produced GRUB image now has a more generalized name for applicability to disparate platform builds (e.g. EFI vs. bootable floppy image). --- projects/grub/configs/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/grub/configs/install b/projects/grub/configs/install index dead10fa..b167d022 100644 --- a/projects/grub/configs/install +++ b/projects/grub/configs/install @@ -1 +1 @@ -grub.elf:grub.elf +grub2:grub2 -- cgit v1.2.3-70-g09d2