mirror of
https://github.com/RROrg/rr.git
synced 2025-06-21 05:51:05 +08:00
更新 createvmc 函数,修复相对路径引用
This commit is contained in:
parent
e278b79dec
commit
c41ba55739
2
.github/workflows/issues.yml
vendored
2
.github/workflows/issues.yml
vendored
@ -297,8 +297,8 @@ jobs:
|
||||
zip -9 "rr-${MODEL}-${TAG}-${{ github.run_id }}.vmdk.zip" -j rr/rr.vmdk ${USER_CONFIG_FILE} sha256sum README.txt
|
||||
elif [ "${{ env.format }}" = "vhd" ]; then
|
||||
. scripts/func.sh "${{ secrets.RRORG }}"
|
||||
createvmc "rr/rr.vmc"
|
||||
qemu-img convert rr/rr.img -O vpc rr/rr.vhd
|
||||
createvmc "rr/rr.vhd" "rr/rr.vmc"
|
||||
(cd rr; sha256sum rr.vhd >../sha256sum)
|
||||
zip -9 "rr-${MODEL}-${TAG}-${{ github.run_id }}.vhd.zip" -j rr/rr.vmc rr/rr.vhd ${USER_CONFIG_FILE} sha256sum README.txt
|
||||
elif [ "${{ env.format }}" = "vhdx" ]; then
|
||||
|
@ -442,8 +442,17 @@ function convertova() {
|
||||
rm -rf "VMX_${VMNAME}"
|
||||
}
|
||||
|
||||
# createvmc
|
||||
# $1 vhd file
|
||||
# $2 vmc file
|
||||
function createvmc() {
|
||||
cat <<_EOF_ >"${1:-rr.vmc}"
|
||||
local BLIMAGE=${1:-rr.vhd}
|
||||
local VMCPATH=${2:-rr.vmc}
|
||||
|
||||
BLIMAGE="$(basename "${BLIMAGE}")"
|
||||
VMCPATH="$(realpath "${VMCPATH}")"
|
||||
|
||||
cat <<_EOF_ >"${VMCPATH}"
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<preferences>
|
||||
<version type="string">2.0</version>
|
||||
@ -457,7 +466,7 @@ function createvmc() {
|
||||
<location id="0">
|
||||
<drive_type type="integer">1</drive_type>
|
||||
<pathname>
|
||||
<relative type="string">rr.vhd</relative>
|
||||
<relative type="string">${BLIMAGE}</relative>
|
||||
</pathname>
|
||||
</location>
|
||||
</ide_controller>
|
||||
|
Loading…
x
Reference in New Issue
Block a user