aboutsummaryrefslogtreecommitdiff
path: root/projects/grub/grub-helper
diff options
context:
space:
mode:
authorLeah Rowe <info@minifree.org>2018-12-29 09:51:00 +0000
committerGogs <gogitservice@gmail.com>2018-12-29 09:51:00 +0000
commitd9abd9ef476a8f994c777f1c8621d8e7064b4fe5 (patch)
tree51de731daca03066dd11c0f968966949b0e4b679 /projects/grub/grub-helper
parent5d1fec94633eacb7abb9a17b1d88da29c458bcbe (diff)
parent7bf438e1a9213723e0d63b1c2b8af2cf84fb919c (diff)
downloadlibrebootfr-d9abd9ef476a8f994c777f1c8621d8e7064b4fe5.tar.gz
librebootfr-d9abd9ef476a8f994c777f1c8621d8e7064b4fe5.zip
Merge branch 'grub-misc' of and_who/libreboot into master
Diffstat (limited to 'projects/grub/grub-helper')
-rwxr-xr-xprojects/grub/grub-helper32
1 files changed, 14 insertions, 18 deletions
diff --git a/projects/grub/grub-helper b/projects/grub/grub-helper
index ccc9cd73..ce874070 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 -An -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() {
@@ -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" "$@")"
@@ -282,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