summaryrefslogtreecommitdiff
path: root/Meta/build-image-grub.sh
diff options
context:
space:
mode:
authorTom <tomut@yahoo.com>2021-02-28 11:33:30 -0700
committerAndreas Kling <kling@serenityos.org>2021-03-01 11:11:56 +0100
commit5b1edc0678219f49ae4fb22c98fbc20705a43957 (patch)
treeed8db3bd3e17f3c41c20e2a77de31d0ea796a52f /Meta/build-image-grub.sh
parentcdbd878a145c97ffef9ba154071803fdc6c58ac3 (diff)
downloadserenity-5b1edc0678219f49ae4fb22c98fbc20705a43957.zip
Meta: Allow specifying custom grub config file for build-image-grub.sh
This allows passing a custom grub config file as second argument to build-image-grub.sh.
Diffstat (limited to 'Meta/build-image-grub.sh')
-rwxr-xr-xMeta/build-image-grub.sh12
1 files changed, 9 insertions, 3 deletions
diff --git a/Meta/build-image-grub.sh b/Meta/build-image-grub.sh
index 7c82ce2aa5..7c72d1740e 100755
--- a/Meta/build-image-grub.sh
+++ b/Meta/build-image-grub.sh
@@ -97,12 +97,18 @@ echo "done"
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
"$script_path/build-root-filesystem.sh"
-echo "installing grub using $grub..."
+if [ -z "$2" ]; then
+ grub_cfg="$SERENITY_ROOT"/Meta/grub-"${partition_scheme}".cfg
+else
+ grub_cfg=$2
+fi
+
+echo "installing grub using $grub with $grub_cfg..."
$grub --boot-directory=mnt/boot --target=i386-pc --modules="ext2 part_msdos" "${dev}"
if [ -d mnt/boot/grub2 ]; then
- cp "$SERENITY_ROOT"/Meta/grub-"${partition_scheme}".cfg mnt/boot/grub2/grub.cfg
+ cp "$grub_cfg" mnt/boot/grub2/grub.cfg
else
- cp "$SERENITY_ROOT"/Meta/grub-"${partition_scheme}".cfg mnt/boot/grub/grub.cfg
+ cp "$grub_cfg" mnt/boot/grub/grub.cfg
fi
echo "done"