diff options
author | Swift Geek <swiftgeek@gmail.com> | 2017-09-16 02:36:23 +0000 |
---|---|---|
committer | Gogs <gogitservice@gmail.com> | 2017-09-16 02:36:23 +0000 |
commit | 1c9bcab766fa1038af9feefcc584c1d4912e5164 (patch) | |
tree | ac02f5971be5d0a60650545ce25b3dd7ff84ab6d /projects/grub | |
parent | 71a2623fbef25fefc1886bc6374832a92188742d (diff) | |
parent | 38c2a13e4b9a2de040864dbd0306cb38f329addf (diff) | |
download | librebootfr-1c9bcab766fa1038af9feefcc584c1d4912e5164.tar.gz librebootfr-1c9bcab766fa1038af9feefcc584c1d4912e5164.zip |
Merge branch 'grub-integration' of kragle/libreboot into master
Diffstat (limited to 'projects/grub')
-rwxr-xr-x | projects/grub/grub | 30 | ||||
-rwxr-xr-x | projects/grub/grub-helper | 11 |
2 files changed, 20 insertions, 21 deletions
diff --git a/projects/grub/grub b/projects/grub/grub index 16b63634..c444841b 100755 --- a/projects/grub/grub +++ b/projects/grub/grub @@ -75,29 +75,21 @@ build() { grub_build_utils + if [[ "${target}" == 'bios' ]]; then + grub_build_floppy_image + else + grub_build_standalone_image + fi + for raw_keymap in "${raw_keymap_path}"/*; do grub_build_layout "${raw_keymap}" done - case "${target}" in - bios) - grub_build_floppy_image - grub_build_font - grub_copy_modules - ;; - *) - grub_build_standalone_image - grub_build_font - grub_copy_modules - ;; - esac - - # Temporary until the function project_make_distclean is written - ( - cd "${sources_path}" || return - - make distclean - ) + grub_build_font + + grub_copy_modules + + make -C "${sources_path}" distclean } build_check() { diff --git a/projects/grub/grub-helper b/projects/grub/grub-helper index e7e8a1fe..604d4a54 100755 --- a/projects/grub/grub-helper +++ b/projects/grub/grub-helper @@ -114,6 +114,10 @@ grub_build_layout() { if ! [[ -e "${keymap_out_path}" ]]; then mkdir -p "${keymap_out_path}" + elif ! [[ -d "${keymap_out_path}" ]]; then + printf '\n%s\n' "Error: File ${keymap_out_path} is not a directory" 1>&2 + + return 1 fi "${grub_mklayout}" --output="${grub_kbd_layout}" --input="${raw_layout_path}" @@ -148,8 +152,9 @@ grub_build_floppy_image() { local grubimg="${build_path}/grub2" local tempfile="${build_path}/temp.file" - if ! ( grub_build_bootable_image "$@" ); then + if ! grub_build_bootable_image "$@"; then printf '\n%s\n\n' "Error: Failed to build a GRUB image" 1>&2 + return 1 fi @@ -161,6 +166,7 @@ grub_build_floppy_image() { 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 @@ -175,7 +181,8 @@ grub_build_floppy_image() { 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 + printf '%s\n\n' "it must be less than ${size}KiB in size" 1>&2 + return 1 fi } |