From 62800886f71f65b92c5e79adeb5939e9e42632de Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Thu, 27 Dec 2018 19:27:31 -0500 Subject: Use tabs for indentation in grub_bo functions --- projects/grub/grub-helper | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'projects/grub') diff --git a/projects/grub/grub-helper b/projects/grub/grub-helper index ccc9cd73..e28c0f9e 100755 --- a/projects/grub/grub-helper +++ b/projects/grub/grub-helper @@ -63,29 +63,29 @@ grub_modmin_path() { } grub_bo_search() { - local pattern="$1" - local comparand="$2" + local pattern="$1" + local comparand="$2" - grep -Fbof <(grub_bo_dump "$pattern") <(grub_bo_dump "$comparand") | cut -d: -f1 + grep -Fbof <(grub_bo_dump "$pattern") <(grub_bo_dump "$comparand") | cut -d: -f1 } grub_bo_dump() { - local file="$1" + local file="$1" - od -Anx -t x1 -w16 -v "$file" | paste -sd '' | tr -d ' ' + od -Anx -t x1 -w16 -v "$file" | paste -sd '' | tr -d ' ' } grub_bo() { - local pattern="$1" - local comparand="$2" + local pattern="$1" + local comparand="$2" - local nibble_offset="$(grub_bo_search "$pattern" "$comparand")" + local nibble_offset="$(grub_bo_search "$pattern" "$comparand")" - if [[ -n "$nibble_offset" ]]; then - printf '0x%X\n' $((nibble_offset / 2)) - else - return 1 - fi + if [[ -n "$nibble_offset" ]]; then + printf '0x%X\n' $((nibble_offset / 2)) + else + return 1 + fi } grub_blocklist_format() { -- cgit v1.2.3-70-g09d2 From 9e7cc1ac00d4b12147bd67e3e66cd71d11126f94 Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Thu, 27 Dec 2018 19:29:42 -0500 Subject: Remove extraneous radix specifier in grub_bo_dump() --- projects/grub/grub-helper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'projects/grub') diff --git a/projects/grub/grub-helper b/projects/grub/grub-helper index e28c0f9e..f04aedc7 100755 --- a/projects/grub/grub-helper +++ b/projects/grub/grub-helper @@ -72,7 +72,7 @@ grub_bo_search() { grub_bo_dump() { local file="$1" - od -Anx -t x1 -w16 -v "$file" | paste -sd '' | tr -d ' ' + od -An -t x1 -w16 -v "$file" | paste -sd '' | tr -d ' ' } grub_bo() { -- cgit v1.2.3-70-g09d2 From dacd26cb9014cd70dc6ddd73f692f4a08ac3db9f Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Fri, 28 Dec 2018 01:25:24 -0500 Subject: Trim some less useful comments in grub-helper --- projects/grub/grub-helper | 4 ---- 1 file changed, 4 deletions(-) (limited to 'projects/grub') diff --git a/projects/grub/grub-helper b/projects/grub/grub-helper index f04aedc7..3a74095f 100755 --- a/projects/grub/grub-helper +++ b/projects/grub/grub-helper @@ -113,14 +113,12 @@ grub_copy_modules() { } grub_build_font() { - # Font project-specific filenames and paths local font_file="$(grub_font_file "$FONTS" "$@")" local font_project="$(grub_font_project "$FONTS" "$@")" local font_build_dir="$root/$BUILD/$font_project" local grub_mkfont="$sources_path/grub-mkfont" - # GRUB font directory for outputting the built PF2 file mkdir -p "$build_path/$FONTS" "$grub_mkfont" --output="$build_path/$FONTS/${font_file%.*}.pf2" \ @@ -129,8 +127,6 @@ grub_build_font() { 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" "$@")" -- cgit v1.2.3-70-g09d2 From 9f5d89440e5219d9aef61461cc3ac6a90baccc9c Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Sat, 29 Dec 2018 00:40:00 -0500 Subject: Copy correct number of bytes for floppy BPB The Bios Parameter Block (BPB) is 51 bytes, not 52. As-is, the first byte of executable code from the floppy image boot record is copied along with the BPB to boot.img; this extra byte isn't harmful to leave in since execution begins at offset 0x63+2 rather than 0x3C+2, but is a little messy. --- projects/grub/grub-helper | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'projects/grub') diff --git a/projects/grub/grub-helper b/projects/grub/grub-helper index 3a74095f..ce874070 100755 --- a/projects/grub/grub-helper +++ b/projects/grub/grub-helper @@ -278,7 +278,7 @@ grub_floppy_image_make_bootable() { local oem_name='\x4C\x49\x42\x52\x45\x20\x20\x20' # write $floppyimg Bios Parameter Block to $bootimg first - dd if="$floppyimg" of="$bootimg" bs=1 skip=11 seek=11 count=52 conv=notrunc + dd if="$floppyimg" of="$bootimg" bs=1 skip=11 seek=11 count=51 conv=notrunc dd if=<(printf "$oem_name") of="$bootimg" bs=1 seek=3 conv=notrunc dd if=/dev/zero of="$floppyimg" count=1 conv=notrunc dd if="$bootimg" of="$floppyimg" conv=notrunc -- cgit v1.2.3-70-g09d2 From 7bf438e1a9213723e0d63b1c2b8af2cf84fb919c Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Sat, 29 Dec 2018 02:01:51 -0500 Subject: Update BIOS GRUB prefix hard coded in core.img --- projects/grub/configs/bios/prefix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'projects/grub') diff --git a/projects/grub/configs/bios/prefix b/projects/grub/configs/bios/prefix index 48604ad8..c3e91bb3 100644 --- a/projects/grub/configs/bios/prefix +++ b/projects/grub/configs/bios/prefix @@ -1 +1 @@ -(cbfsdisk)/fallback +(fd0)/boot/grub -- cgit v1.2.3-70-g09d2