Skip to content

Commit

Permalink
xen: use vsrcextract
Browse files Browse the repository at this point in the history
  • Loading branch information
sgn committed Aug 21, 2023
1 parent e1a6b64 commit 77a4de4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 16 deletions.
17 changes: 17 additions & 0 deletions common/environment/setup/archive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,20 @@ vsrcextract() {
vextract "$sc" ${dst:+-C "$dst"} \
"${XBPS_SRCDISTDIR}/${pkgname}-${version}/$1"
}

vtar() {
bsdtar "$@"
}

vsrccopy() {
local _tgt
if [ $# -lt 2 ]; then
msg_error "vsrccopy <file>... <target>"
fi
_tgt="${@:-1}"
mkdir -p "$_tgt"
while [ $# -gt 1 ]; do
cp -a "${XBPS_SRCDISTDIR}/${pkgname}-${version}/$1" "$_tgt"
shift
done
}
28 changes: 12 additions & 16 deletions srcpkgs/xen/template
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,11 @@ conf_files="
/etc/xen/xl.conf"

post_extract() {
local _src="${XBPS_SRCDISTDIR}/${pkgname}-${version}"

msg_normal "Extracting etherboot ipxe files ...\n"
mkdir tools/firmware/etherboot/ipxe
tar --strip-components=1 -x \
-f ${_src}/${_git_tag_ipxe}.tar.gz \
-C tools/firmware/etherboot/ipxe/
vsrcextract -C tools/firmware/etherboot/ipxe ${_git_tag_ipxe}.tar.gz
# Create a tarball w/o the git tag
tar -czf tools/firmware/etherboot/ipxe.tar.gz \
vtar -czf tools/firmware/etherboot/ipxe.tar.gz \
-C tools/firmware/etherboot/ ipxe

if [ "$build_option_stubdom" ]; then
Expand All @@ -121,16 +117,16 @@ post_extract() {
-e"/RAW_ADDR/s/(int) grub_scratch_mem/(long) grub_scratch_mem/"
mkdir -p stubdom/mini-os-x86_64-grub/{arch/x86,console,lib,xenbus}
msg_normal "Copying stubdom files ...\n"
cp -pv \
${_src}/grub-${_grub_version}.tar.gz \
${_src}/gmp-${_gmp_version}.tar.bz2 \
${_src}/zlib-${_zlib_version}.tar.gz \
${_src}/lwip-${_lwip_version}.tar.gz \
${_src}/polarssl-${_polarssl_version}-gpl.tgz \
${_src}/newlib-${_newlib_version}.tar.gz \
${_src}/pciutils-${_libpci_version}.tar.bz2 \
${_src}/tpm_emulator-${_tpmemu_version}.tar.gz \
${_src}/ocaml-${_ocaml_version}.tar.gz \
vsrccopy \
grub-${_grub_version}.tar.gz \
gmp-${_gmp_version}.tar.bz2 \
zlib-${_zlib_version}.tar.gz \
lwip-${_lwip_version}.tar.gz \
polarssl-${_polarssl_version}-gpl.tgz \
newlib-${_newlib_version}.tar.gz \
pciutils-${_libpci_version}.tar.bz2 \
tpm_emulator-${_tpmemu_version}.tar.gz \
ocaml-${_ocaml_version}.tar.gz \
stubdom/
fi
}
Expand Down

0 comments on commit 77a4de4

Please sign in to comment.