Skip to content
This repository has been archived by the owner on Oct 28, 2023. It is now read-only.

Commit

Permalink
iso: update winpe.lua (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
a1ive committed May 13, 2020
1 parent 6f5be83 commit 6b690dc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
11 changes: 0 additions & 11 deletions boot/grubfm/distro/win.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
source ${prefix}/func.sh;

function auto_swap {
if regexp '^hd[0-9a-zA-Z,]+$' ${grubfm_disk};
then
regexp -s devnum '^hd([0-9]+).*$' ${grubfm_disk};
if test "devnum" != "0";
then
drivemap -s (hd0) (${grubfm_disk});
fi;
fi;
}

if [ -z "${grubfm_startbat}" -o ! -f "${grubfm_startbat}" ];
then
set grubfm_startbat="(install)/start.bat";
Expand Down
11 changes: 11 additions & 0 deletions boot/grubfm/func.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ function unmap_cd {
done;
}

function auto_swap {
if regexp '^hd[0-9a-zA-Z,]+$' ${grubfm_disk};
then
regexp -s devnum '^hd([0-9]+).*$' ${grubfm_disk};
if test "devnum" != "0";
then
drivemap -s (hd0) (${grubfm_disk});
fi;
fi;
}

regexp --set=1:grubfm_path '(/.*)$' "${grubfm_file}";
regexp --set=1:grubfm_dir '^(.*/).*$' "${grubfm_path}";
regexp --set=1:grubfm_device '^\(([0-9a-zA-Z,]+)\)/.*' "${grubfm_file}";
Expand Down
5 changes: 3 additions & 2 deletions boot/grubfm/rules/iso/winpe.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,16 @@ local function gen_wimboot (wim)
local platform = grub.getenv ("grub_platform")
local iso_path = string.match (grub.getenv ("grubfm_file"), "^%([%w,]+%)(.*)$")
local cmd = "set installiso=\"" .. iso_path .. "\"\n" ..
"terminal_output console\n" ..
"set lang=en_US\n" ..
"tr --set=installiso \"/\" \"\\\\\"\n" ..
"loopback -m envblk ${prefix}/null.cpio\n" ..
"save_env -s -f (envblk)/null.cfg installiso\n" ..
"cat (envblk)/null.cfg\n" ..
"loopback wimboot ${prefix}/wimboot.gz\n" ..
"loopback install ${prefix}/install.gz\n"
if platform == "efi" then
cmd = cmd .. "set lang=en_US\n" ..
"terminal_output console\n" ..
cmd = cmd ..
"wimboot @:bootmgfw.efi:(wimboot)/bootmgfw.efi" ..
" @:bcd:(wimboot)/bcd @:boot.sdi:(wimboot)/boot.sdi" ..
" @:null.cfg:(envblk)/null.cfg" ..
Expand Down

0 comments on commit 6b690dc

Please sign in to comment.