build/boot/roms: substitute grub_scan_disk according to board.cfg

fsdg20230625
Leah Rowe 2021-12-29 07:10:56 +00:00
parent 835ff5ec83
commit 6b4b49cf8f
1 changed files with 15 additions and 7 deletions

View File

@ -335,14 +335,22 @@ make_grubrom_from_keymap() {
cp "${target_cbrom}" "${tmprom}" cp "${target_cbrom}" "${tmprom}"
"${cbfstool_path}" "${tmprom}" add-payload -f "${grubelf}" -n ${target_grubelf_cbfs_path} -c lzma "${cbfstool_path}" "${tmprom}" add-payload -f "${grubelf}" -n ${target_grubelf_cbfs_path} -c lzma
if [ "${grub_scan_disk}" = "ahci" ]; then
sed 's/search_grub ata//' "${grubcfg}" > "${grubcfg}"
elif [ "${grub_scan_disk}" = "ata" ]; then
sed 's/search_grub ahci//' "${grubcfg}" > "${grubcfg}"
fi
"${cbfstool_path}" "${tmprom}" add -f "${grubcfg}" -n grub.cfg -t raw tmpgrubcfg=$(mktemp -t grub.cfg.XXXXXXXXXX)
"${cbfstool_path}" "${tmprom}" add -f "${grubtestcfg}" -n grubtest.cfg -t raw tmpgrubtestcfg=$(mktemp -t grubtest.cfg.XXXXXXXXXX)
if [ "${grub_scan_disk}" = "ahci" ]; then
sed 's/set\ grub_scan_disk=\"both\"/set\ grub_scan_disk=\"ahci\"/' "${grubcfg}" > "${tmpgrubcfg}"
sed 's/set\ grub_scan_disk=\"both\"/set\ grub_scan_disk=\"ahci\"/' "${grubtestcfg}" > "${tmpgrubtestcfg}"
elif [ "${grub_scan_disk}" = "ata" ]; then
sed 's/set\ grub_scan_disk=\"both\"/set\ grub_scan_disk=\"ata\"/' "${grubcfg}" > "${tmpgrubcfg}"
sed 's/set\ grub_scan_disk=\"both\"/set\ grub_scan_disk=\"ata\"/' "${grubtestcfg}" > "${tmpgrubtestcfg}"
else
cp "${grubcfg}" "${tmpgrubcfg}"
cp "${grubtestcfg}" "${tmpgrubtestcfg}"
fi
"${cbfstool_path}" "${tmprom}" add -f "${tmpgrubcfg}" -n grub.cfg -t raw
"${cbfstool_path}" "${tmprom}" add -f "${tmpgrubtestcfg}" -n grubtest.cfg -t raw
rm -f "${tmpgrubcfg}" "${tmpgrubcfgtest}"
backgroundfile="background1280x800.png" backgroundfile="background1280x800.png"
if [ "${board}" = "x60" ] || [ "${board}" = "t60_intelgpu" ]; then if [ "${board}" = "x60" ] || [ "${board}" = "t60_intelgpu" ]; then