-
Notifications
You must be signed in to change notification settings - Fork 20
/
build_oprom.sh
57 lines (49 loc) · 1.61 KB
/
build_oprom.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
gop_bin_dir="./gop"
docker_image_name="ubuntu:ovmf.22.04"
tmp_dir="./build_gop_tmp"
product_dir="./product"
product_filename="B660.rom"
product_goponly_filename="B660_GOP.rom"
if [ ! -d "${gop_bin_dir}" ]; then
mkdir ${gop_bin_dir}
echo "Copy IntelGopDriver.efi to ${gop_bin_dir}"
exit
fi
if [ ! -f "${gop_bin_dir}/IntelGopDriver.efi" ]; then
echo "Copy IntelGopDriver.efi to ${gop_bin_dir}"
exit
fi
efi_dir="./edk2/Build/OvmfX64/DEBUG_GCC5/X64"
if [ ! -f "${efi_dir}/PlatformGOPPolicy.efi" ]; then
echo "Run build_ovmf.sh first"
exit
fi
if [ ! -f "${efi_dir}/IgdAssignmentDxe.efi" ]; then
echo "Run build_ovmf.sh first"
exit
fi
if [ ! -d "${tmp_dir}" ]; then
mkdir ${tmp_dir}
fi
cp ${gop_bin_dir}/IntelGopDriver.efi ${tmp_dir}/
cp ${efi_dir}/PlatformGOPPolicy.efi ${tmp_dir}/
cp ${efi_dir}/IgdAssignmentDxe.efi ${tmp_dir}/
docker run \
-ti \
--rm \
-w $PWD/edk2 \
-v $PWD:$PWD \
--security-opt label=disable \
${docker_image_name} \
/bin/bash -c "source edksetup.sh && cd ../${tmp_dir} && pwd && EfiRom -f 0x8086 -i 0xffff -e ./IntelGopDriver.efi ./IgdAssignmentDxe.efi ./PlatformGOPPolicy.efi -o ${product_filename}"
cp ${tmp_dir}/${product_filename} ${product_dir}/${product_filename}
docker run \
-ti \
--rm \
-w $PWD/edk2 \
-v $PWD:$PWD \
--security-opt label=disable \
${docker_image_name} \
/bin/bash -c "source edksetup.sh && cd ../${tmp_dir} && pwd && EfiRom -f 0x8086 -i 0xffff -e ./IntelGopDriver.efi -o ${product_goponly_filename}"
cp ${tmp_dir}/${product_goponly_filename} ${product_dir}/${product_goponly_filename}
rm -r ${tmp_dir}