Skip to content

Commit

Permalink
Repair issues with efibootmgr, response was being parsed incorrectly
Browse files Browse the repository at this point in the history
  • Loading branch information
slaclau committed Mar 27, 2024
1 parent 55e7caa commit b22c714
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions customreboot/efibootmgr.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ export class EFIBootManager {
const regex = /(Boot[0-9]{4})/;
const vLine = regex.exec(line)
if (vLine && vLine.length) {
const option = line.replace("Boot", "").split("*");
const title = option[1];
if (title.includes("HD") || title.includes("RC")) {
const trimed_title = title.replace(/(?<=[\S\s]*)(HD|RC)([\s\S()]*|$)/, "").trim();
const option = line.replace("Boot", "").replace("*"," ").split(" ");
var title = option[1];
//title = title.split("\t")[0]
if (title.includes("HD") || title.includes("RC") || title.includes("PciRoot")) {
const trimed_title = title.replace(/(?<=[\S\s]*)(HD|RC|PciRoot)([\s\S()]*|$)/, "").trim();
boot_options.set(trimed_title, option[0].trim());
}
else {
Expand Down Expand Up @@ -98,4 +99,4 @@ export class EFIBootManager {
static async QuickRebootEnabled() {
return false;
}
}
}

0 comments on commit b22c714

Please sign in to comment.