Skip to content

Commit

Permalink
更新 createvmc 函数,修复相对路径引用
Browse files Browse the repository at this point in the history
  • Loading branch information
wjz304 committed Dec 8, 2024
1 parent e278b79 commit c41ba55
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 11 additions & 2 deletions scripts/func.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand Down

0 comments on commit c41ba55

Please sign in to comment.