linux-qubasis

linux oasis port as a qubes template

git clone https://9o.is/git/linux-qubasis.git

commit ec25a689fbeeca43e57f045df159ef05d09d8785
parent 7c370e6d2798a768a864baa6dfdd0bd886da9ffc
Author: Jul <jul@9o.is>
Date:   Wed, 26 Nov 2025 02:40:40 -0500

build libxenlight.a

Diffstat:
Mpkg/gen.sh | 1+
Apkg/xen/dsdt_pvh.sh | 16++++++++++++++++
Mpkg/xen/gen.sh | 150+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
Apkg/xen/iasl.sh | 11+++++++++++
Apkg/xen/libxl_save_msgs_gen.py | 445+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mpkg/xen/patch/0001-handle-outfile-path-in-mkheader.py.patch | 4++--
Apkg/xen/patch/0002-remove-config.h-in-acpi-static_tables.patch | 24++++++++++++++++++++++++
Mpkg/yajl/gen.sh | 14+++++---------
8 files changed, 651 insertions(+), 14 deletions(-)

diff --git a/pkg/gen.sh b/pkg/gen.sh @@ -42,5 +42,6 @@ pkg util-linux pkg vis pkg xen pkg xz +pkg yajl pkg zlib pkg zstd diff --git a/pkg/xen/dsdt_pvh.sh b/pkg/xen/dsdt_pvh.sh @@ -0,0 +1,16 @@ +set -eu + +mk_dsdt=$1 +in=$2 +out=$3 +outpath=${3%/*} + +printf 'DefinitionBlock ("DSDT.aml", "DSDT", 5, "Xen", "HVM", 0)\n{' > $outpath/dsdt_pvh.asl +cat $in >> $outpath/dsdt_pvh.asl +$mk_dsdt --debug=n --maxcpu any --dm-version none >> $outpath/dsdt_pvh.asl + +iasl -vs -p $outpath/dsdt_pvh.tmp -tc $outpath/dsdt_pvh.asl >/dev/null 2>&1 +sed -e 's/AmlCode/dsdt_pvh/g' -e 's/_aml_code//g' $outpath/dsdt_pvh.hex > $out.tmp +printf 'int dsdt_pvh_len=sizeof(dsdt_pvh);\n' >> $outpath/dsdt_pvh.c.tmp +mv -f $out.tmp $out +rm -f $outpath/dsdt_pvh.aml $outpath/dsdt_pvh.hex diff --git a/pkg/xen/gen.sh b/pkg/xen/gen.sh @@ -23,18 +23,41 @@ dep " $outdir/internal/xen/foreign/x86_32.h $outdir/internal/xen/foreign/x86_64.h $outdir/internal/xen/lib/x86/cpuid-autogen.h + util-linux/headers + yajl/headers zlib/headers " rule linkheaders 'sh $dir/linkheaders.sh $srcdir && touch $out' bind description 'XEN $out' -rule mkheader 'python $srcdir/tools/include/xen-foreign/mkheader.py $arch $out $in' +rule mkheader 'python3 $srcdir/tools/include/xen-foreign/mkheader.py $arch $out $in >/dev/null' bind description 'XEN $out' -rule gen_cpuid '$srcdir/xen/tools/gen-cpuid.py -i $in -o $out' +rule gencpuid 'python3 $srcdir/xen/tools/gen-cpuid.py -i $in -o $out' bind description 'XEN $out' +rule gentypes 'python3 $srcdir/tools/libs/light/gentypes.py $in $out >/dev/null 2>&1' +bind description 'XEN $out' + +rule genlibxlsavemsgs 'python3 $dir/libxl_save_msgs_gen.py $arg > $out' +bind description 'XEN $out' + +rule gendsdt_pvh 'sh $dir/dsdt_pvh.sh $hostdir/mk_dsdt $in $out' +bind description 'XEN $out' + +rule iasl 'sh $dir/iasl.sh $in $out' +bind description 'XEN $out' + +rule mkflask 'sh $srcdir/xen/xsm/flask/policy/mkflask.sh $$(which awk) $path $in' +bind description 'XEN $out' +bind path $outdir/internal/xen-xsm/flask + +genlibxlsavemsgs() { + build genlibxlsavemsgs $1 '|' $dir/libxl_save_msgs_gen.py + bind arg ${1##*_} +} + mkx86header() { mkheader $1.h.tmp " $srcdir/xen/include/public/arch-x86/xen-$1.h @@ -50,7 +73,7 @@ mkx86header() { linkheaders headerslinked '||' $outdir/fetched mkx86header x86_32 mkx86header x86_64 -gen_cpuid internal/xen/lib/x86/cpuid-autogen.h xen/include/public/arch-x86/cpufeatureset.h +gencpuid internal/xen/lib/x86/cpuid-autogen.h xen/include/public/arch-x86/cpufeatureset.h lib libxentoolcore.a --src-prefix tools/libs/toolcore " handlereg.c @@ -172,3 +195,124 @@ lib libxenvchan.a --src-prefix tools/libs/vchan " lib libxenhypfs.a --src-prefix tools/libs/hypfs -I$pkgdir/zlib/include " core.c " + +gentypes " + _libxl_types.h + _libxl_types_private.h + _libxl_types_json.h + _libxl_types.c +" tools/libs/light/libxl_types.idl + +gentypes " + _libxl_types_internal.h + _libxl_types_internal_private.h + _libxl_types_internal_json.h + _libxl_types_internal.c +" tools/libs/light/libxl_types_internal.idl + +genlibxlsavemsgs _libxl_save_msgs_callout.h +genlibxlsavemsgs _libxl_save_msgs_callout.c +gendsdt_pvh dsdt_pvh.c tools/libacpi/dsdt_acpi_info.asl +mkflask internal/xen-xsm/flask/flask.h xen/xsm/flask/policy/initial_sids + +iasl ssdt_s3.h tools/libacpi/ssdt_s3.asl +iasl ssdt_s4.h tools/libacpi/ssdt_s4.asl +iasl ssdt_pm.h tools/libacpi/ssdt_pm.asl +iasl ssdt_tpm.h tools/libacpi/ssdt_tpm.asl +iasl ssdt_tpm2.h tools/libacpi/ssdt_tpm2.asl +iasl ssdt_laptop_slate.h tools/libacpi/ssdt_laptop_slate.asl + +libxenlight_cflags=" + -I$outdir + -I$srcdir/tools/libacpi \ + -I$srcdir/tools/libs/light + -I$pkgdir/util-linux/include + -I$pkgdir/yajl/include + -D__XEN_TOOLS__ + -DCONFIG_PCI_SUPP_LEGACY_IRQ + -DLIBACPI_STDUTILS=\\\"../libs/light/libxl_x86_acpi.h\\\" + -Wshadow + -Wno-unused-but-set-variable + -Wno-cast-function-type + -Wno-implicit-fallthrough + -Wno-format-zero-length +" + +lib libxenlight.a --src-prefix tools/libs/light $libxenlight_cflags " + flexarray.c + libxl.c + libxl_9pfs.c + libxl_aoutils.c + libxl_bootloader.c + libxl_checkpoint_device.c + libxl_console.c + libxl_convert_callout.c + libxl_cpuid.c + libxl_cpupool.c + libxl_create.c + libxl_device.c + libxl_disk.c + libxl_dm.c + libxl_dom.c + libxl_dom_save.c + libxl_dom_suspend.c + libxl_domain.c + libxl_event.c + libxl_exec.c + libxl_flask.c + libxl_fork.c + libxl_genid.c + libxl_internal.c + libxl_json.c + libxl_linux.c + libxl_mem.c + libxl_nic.c + libxl_no_colo.c + libxl_nonetbuffer.c + libxl_numa.c + libxl_paths.c + libxl_pci.c + libxl_psr.c + libxl_pvcalls.c + libxl_qmp.c + libxl_remus.c + libxl_remus_disk_drbd.c + libxl_save_callout.c + libxl_sched.c + libxl_setresuid.c + libxl_stream_read.c + libxl_stream_write.c + libxl_tmem.c + libxl_usb.c + libxl_utils.c + libxl_uuid.c + libxl_vdispl.c + libxl_virtio.c + libxl_vkb.c + libxl_vnuma.c + libxl_vsnd.c + libxl_vtpm.c + libxl_x86.c + libxl_x86_acpi.c + libxl_xshelp.c + osdeps.c + $outdir/_libxl_types.c + $outdir/_libxl_types_internal.c + $outdir/_libxl_save_msgs_callout.h + $outdir/_libxl_save_msgs_callout.c + $outdir/ssdt_s3.h + $outdir/ssdt_s4.h + $outdir/ssdt_pm.h + $outdir/ssdt_tpm.h + $outdir/ssdt_tpm2.h + $outdir/ssdt_laptop_slate.h + $outdir/internal/xen-xsm/flask/flask.h + $srcdir/tools/libacpi/build.c + $srcdir/tools/libacpi/static_tables.c + $outdir/dsdt_pvh.c +" + +host() { + cflags -D__XEN_TOOLS__ -DCONFIG_X86 -I$srcdir/tools/include + exe mk_dsdt tools/libacpi/mk_dsdt.c +} diff --git a/pkg/xen/iasl.sh b/pkg/xen/iasl.sh @@ -0,0 +1,11 @@ +set -eu + +in=$1 +out=$2 +name=${in##*/} +name=${name%.*} +file=${out%/*}/$name + +iasl -vs -p $file.tmp -tc $in >/dev/null 2>&1 +sed -e "s/AmlCode/$name/g" -e 's/_aml_code//g' $file.hex >$out +rm -f $file.aml $file.hex diff --git a/pkg/xen/libxl_save_msgs_gen.py b/pkg/xen/libxl_save_msgs_gen.py @@ -0,0 +1,445 @@ +import sys +import re +import textwrap + +# --- Configuration and Globals --- +DEBUG = False # produce copious debugging output at run-time? + +# Message Definitions (similar to the Perl @msgs array) +# flags: +# s - applicable to save +# r - applicable to restore +# c - function pointer in callbacks struct rather than fixed function +# x - function pointer is in struct {save,restore}_callbacks +# and its null-ness needs to be passed through to the helper's xc +# W - needs a return value; callback is synchronous +# A - needs a return value; callback is asynchronous +msgs = [ + { + 'flags': 'sr', 'name': 'log', 'args': [ + 'uint32_t', 'level', 'uint32_t', 'errnoval', + 'STRING', 'context', 'STRING', 'formatted' + ] + }, + { + 'flags': 'sr', 'name': 'progress', 'args': [ + 'STRING', 'context', 'STRING', 'doing_what', + 'unsigned long', 'done', 'unsigned long', 'total' + ] + }, + {'flags': 'srcxA', 'name': 'suspend', 'args': []}, + {'flags': 'srcxA', 'name': 'postcopy', 'args': []}, + {'flags': 'srcxA', 'name': 'checkpoint', 'args': []}, + {'flags': 'srcxA', 'name': 'wait_checkpoint', 'args': []}, + { + 'flags': 'scxA', 'name': 'switch_qemu_logdirty', 'args': [ + 'uint32_t', 'domid', 'unsigned', 'enable' + ] + }, + { + 'flags': 'rcxW', 'name': 'static_data_done', 'args': [ + 'unsigned', 'missing' + ] + }, + { + 'flags': 'rcx', 'name': 'restore_results', 'args': [ + 'xen_pfn_t', 'store_gfn', 'xen_pfn_t', 'console_gfn' + ] + }, + { + 'flags': 'srW', 'name': 'complete', 'args': [ + 'int', 'retval', 'int', 'errnoval' + ] + }, +] + +# Output storage +cbs = {} +func = {} +func_ah = {} +outfuncs = [] +out_decls = {} +out_body = {} +msgnum = 0 + +# C prefix definitions +libxl = "libxl__srm" +callback = f"{libxl}_callout_callback" +receiveds = f"{libxl}_callout_received" +sendreply = f"{libxl}_callout_sendreply" +getcallbacks = f"{libxl}_callout_get_callbacks" +enumcallbacks = f"{libxl}_callout_enumcallbacks" +helper = "helper" +encode = f"{helper}_stub" +allocbuf = f"{helper}_allocbuf" +transmit = f"{helper}_transmitmsg" +getreply = f"{helper}_getreply" +setcallbacks = f"{helper}_setcallbacks" + +# --- Utility Functions --- + +def cbtype(sr): + """Returns the name of the callback structure type.""" + return f"{libxl}_{sr}_autogen_callbacks" + +def typeid(t): + """Sanitizes a type name for use as a function suffix.""" + return re.sub(r'\W', '_', t) + +def f_decl(name, ah, c_rtype, c_decl, declprefix=''): + """Declares a C function and starts its definition.""" + out_decls[name] = f"{declprefix}{c_rtype} {name}{c_decl};\n" + func[name] = f"{c_rtype} {name}{c_decl}\n{{\n" + func.get(name, '') + func_ah[name] = ah + +def f_more(name, addbody): + """Appends to a C function's body.""" + func[name] = func.get(name, '') + addbody + if name not in outfuncs: + outfuncs.append(name) + +def generate_body_header(ah): + """Generates the common includes/headers for the C file.""" + base_includes = textwrap.dedent("""\ + #include "libxl_osdeps.h" + #include <assert.h> + #include <string.h> + #include <stdint.h> + #include <limits.h> + """) + if ah == 'callout': + return f"""{base_includes} +#include "libxl_internal.h" +""" + else: # helper + return f"""{base_includes} +#include <xenctrl.h> +#include <xenguest.h> +#include "_libxl_save_msgs_{ah}.h" +""" + +def generate_simple_type_get_put(simpletype): + """Generates C functions for serializing/deserializing simple types.""" + type_id = typeid(simpletype) + + callout_get = textwrap.dedent(f"""\ + static int {type_id}_get(const unsigned char **msg, + const unsigned char *const endmsg, + {simpletype} *result) + {{ + return bytes_get(msg, endmsg, result, sizeof(*result)); + }} + """) + + helper_put = textwrap.dedent(f"""\ + static void {type_id}_put(unsigned char *const buf, int *len, + const {simpletype} value) + {{ + bytes_put(buf, len, &value, sizeof(value)); + }} + """) + return callout_get, helper_put + +# --- Main Logic --- + +if __name__ == "__main__": + if len(sys.argv) != 2: + sys.stderr.write("Usage: python3 script.py <output_file>\n") + sys.exit(1) + + intendedout = sys.argv[1] + match = re.match(r"([a-z]+)\.([ch])$", intendedout) + if not match: + sys.stderr.write(f"Invalid output file name: {intendedout}\n") + sys.exit(1) + + want_ah, ch = match.groups() + + # 1. Generate base file contents + for ah in ['callout', 'helper']: + out_body[ah] = generate_body_header(ah) + + if want_ah not in out_body: + sys.stderr.write(f"Unknown target: {want_ah}\n") + sys.exit(1) + + # 2. Define base functions (sendreply, allocbuf, transmit, getreply) + f_decl(sendreply, 'callout', 'void', "(int r, void *user)") + f_decl(allocbuf, 'helper', 'unsigned char *', '(int len, void *user)') + f_decl(transmit, 'helper', 'void', '(unsigned char *msg_freed, int len, void *user)') + f_decl(getreply, 'helper', 'int', '(void *user)') + + # 3. Generate generic byte and special type functions (BLOCK, STRING) + out_body['callout'] += textwrap.dedent("""\ + static int bytes_get(const unsigned char **msg, + const unsigned char *const endmsg, + void *result, int rlen) + { + if (endmsg - *msg < rlen) return 0; + memcpy(result, *msg, rlen); + *msg += rlen; + return 1; + } + + """) + + out_body['helper'] += textwrap.dedent("""\ + static void bytes_put(unsigned char *const buf, int *len, + const void *value, int vlen) + { + assert(vlen < INT_MAX/2 - *len); + if (buf) + memcpy(buf + *len, value, vlen); + *len += vlen; + } + + """) + + # Simple types + simple_types = ['int', 'uint16_t', 'uint32_t', 'unsigned', 'unsigned long', 'xen_pfn_t'] + for st in simple_types: + callout_get, helper_put = generate_simple_type_get_put(st) + out_body['callout'] += callout_get + out_body['helper'] += helper_put + + # Complex types (BLOCK, STRING) + out_body['callout'] += textwrap.dedent("""\ + static int BLOCK_get(const unsigned char **msg, + const unsigned char *const endmsg, + const uint8_t **result, uint32_t *result_size) + { + if (!uint32_t_get(msg, endmsg, result_size)) return 0; + if (endmsg - *msg < *result_size) return 0; + *result = (const void*)*msg; + *msg += *result_size; + return 1; + } + + static int STRING_get(const unsigned char **msg, + const unsigned char *const endmsg, + const char **result) + { + const uint8_t *data; + uint32_t datalen; + if (!BLOCK_get(msg, endmsg, &data, &datalen)) return 0; + if (datalen == 0) return 0; + if (data[datalen-1] != '\\0') return 0; + *result = (const void*)data; + return 1; + } + + """) + + out_body['helper'] += textwrap.dedent("""\ + static void BLOCK_put(unsigned char *const buf, + int *len, + const uint8_t *bytes, uint32_t size) + { + uint32_t_put(buf, len, size); + bytes_put(buf, len, bytes, size); + } + + static void STRING_put(unsigned char *const buf, + int *len, + const char *string) + { + size_t slen = strlen(string); + assert(slen < INT_MAX / 4); + assert(slen < (uint32_t)0x40000000); + BLOCK_put(buf, len, (const void*)string, slen+1); + } + + """) + + # 4. Generate save/restore specific functions (getcallbacks, receiveds, enumcallbacks, setcallbacks) + for sr in ['save', 'restore']: + f_decl(f"{getcallbacks}_{sr}", 'callout', + f"const {cbtype(sr)} *", "(void *data)") + + f_decl(f"{receiveds}_{sr}", 'callout', 'int', + "(const unsigned char *msg, uint32_t len, void *user)") + + f_decl(f"{enumcallbacks}_{sr}", 'callout', 'unsigned', + f"(const {cbtype(sr)} *cbs)") + f_more(f"{enumcallbacks}_{sr}", " unsigned cbflags = 0;\n") + + f_decl(f"{setcallbacks}_{sr}", 'helper', 'void', + f"(struct {sr}_callbacks *cbs, unsigned cbflags)") + + receiveds_body = textwrap.dedent("""\ + const unsigned char *const endmsg = msg + len; + uint16_t mtype; + if (!uint16_t_get(&msg, endmsg, &mtype)) return 0; + """) + if DEBUG: + receiveds_body += f' fprintf(stderr,"libxl callout receiver: got len=%u mtype=%u\\n",len,mtype);\n' + receiveds_body += textwrap.dedent("""\ + switch (mtype) { + """) + f_more(f"{receiveds}_{sr}", receiveds_body) + + cbs[sr] = f"typedef struct {cbtype(sr)} {{\n" + + # 5. Loop through messages and generate code + for msg in msgs: + msgnum += 1 + flags = msg['flags'] + name = msg['name'] + args_list = msg['args'] + + # Function to add code to the receiveds and other save/restore functions + def f_more_sr(contents_spec, fnamebase=receiveds): + for sr in ['save', 'restore']: + if sr[0] in flags: # Check if flag 's' or 'r' is present + contents = contents_spec(sr) if callable(contents_spec) else contents_spec + f_more(f"{fnamebase}_{sr}", contents) + + # Start of case block in receiveds + f_more_sr(f" case {msgnum}: {{ /* {name} */\n") + if 'W' in flags: + f_more_sr(" int r;\n") + + # C types for the generated functions + c_rtype_helper = 'int' if any(f in flags for f in 'WA') else 'void' + c_rtype_callout = 'int' if 'W' in flags else 'void' + c_decl = '(' + c_callback_args = '' + + # Start of encode function body + encode_body = textwrap.dedent(f"""\ + unsigned char *buf = 0; + int len = 0, allocd = 0; + """) + if DEBUG: + encode_body += f' fprintf(stderr,"libxl-save-helper: encoding {name}\\n");\n' + encode_body += textwrap.dedent("""\ + for (;;) { + uint16_t_put(buf, &len, msgnum); + """) + f_more(f"{encode}_{name}", encode_body) + + # Loop through arguments + c_recv = '' + arg_iter = iter(args_list) + for argtype, arg in zip(arg_iter, arg_iter): + type_id = typeid(argtype) + c_args = arg + c_get_args = f"&{arg}" + + if argtype == 'STRING': + c_decl += f"const char *{arg}, " + f_more_sr(f" const char *{arg};\n") + elif argtype == 'BLOCK': + c_decl += f"const uint8_t *{arg}, uint32_t {arg}_size, " + c_args += f", {arg}_size" + c_get_args += f", &{arg}_size" + f_more_sr(f" const uint8_t *{arg};\n" + f" uint32_t {arg}_size;\n") + else: + c_decl += f"{argtype} {arg}, " + f_more_sr(f" {argtype} {arg};\n") + + c_callback_args += f"{c_args}, " + c_recv += f" if (!{type_id}_get(&msg, endmsg, {c_get_args})) return 0;\n" + f_more(f"{encode}_{name}", f" {type_id}_put(buf, &len, {c_args});\n") + + # Finalize function signatures + c_decl += "void *user)" + c_callback_args += "user" + + # Finalize receiveds: argument decoding check + f_more_sr(c_recv) + f_more_sr(" if (msg != endmsg) return 0;\n") + + # Set up the callback dispatch + c_callback = '' + if 'c' not in flags: + c_callback = f"{callback}_{name}" + else: + def cb_struct_update(sr): + cbs[sr] += f" {c_rtype_callout} (*{name}){c_decl};\n" + return ( + f" const {cbtype(sr)} *const cbs =\n" + f" {getcallbacks}_{sr}(user);\n" + ) + f_more_sr(cb_struct_update) + c_callback = f"cbs->{name}" + + c_make_callback = f"{c_callback}({c_callback_args})" + + # Handle return value / reply + if 'W' not in flags: + f_more_sr(f" {c_make_callback};\n") + else: + f_more_sr(f" r = {c_make_callback};\n" + f" {sendreply}(r, user);\n") + f_decl(sendreply, 'callout', 'void', '(int r, void *user)') # Redundant, but harmless + + # Handle 'x' (null-ness check) flag for callbacks struct + if 'x' in flags: + c_v = f"(1u<<{msgnum})" + c_cb = f"cbs->{name}" + f_more_sr(f" if ({c_cb}) cbflags |= {c_v};\n", enumcallbacks) + f_more_sr(f" if (cbflags & {c_v}) {c_cb} = {encode}_{name};\n", setcallbacks) + + # Finalize case block in receiveds + f_more_sr(" return 1;\n }\n\n") + + # Declare the generated functions + f_decl(f"{callback}_{name}", 'callout', c_rtype_callout, c_decl) + f_decl(f"{encode}_{name}", 'helper', c_rtype_helper, c_decl) + + # Finalize encode function body + encode_finalize = textwrap.dedent(f"""\ + if (buf) break; + buf = {allocbuf}(len, user); + assert(buf); + allocd = len; + len = 0; + }} + assert(len == allocd); + {transmit}(buf, len, user); + """) + f_more(f"{encode}_{name}", encode_finalize) + + # Add reply handling for helper (if W or A) + if any(f in flags for f in 'WA'): + reply_body = textwrap.dedent(f"""\ + int r = {getreply}(user); + """) + if DEBUG: + reply_body += f' fprintf(stderr,"libxl-save-helper: {name} got reply %d\\n",r);\n' + reply_body += textwrap.dedent("""\ + return r; + """) + f_more(f"{encode}_{name}", reply_body) + + + # 6. Final output generation + output = "/* AUTOGENERATED by libxl_save_msgs_gen.py DO NOT EDIT */\n\n" + + for sr in ['save', 'restore']: + f_more(f"{enumcallbacks}_{sr}", " return cbflags;\n") + f_more(f"{receiveds}_{sr}", + " default:\n" + " return 0;\n" + " }\n") + cbs[sr] += f"}} {cbtype(sr)};\n\n" + + if ch == 'h': + output += cbs[sr] + output += f"struct {sr}_callbacks;\n" + + if ch == 'c': + for name in outfuncs: + if name in func: + func[name] += "}\n\n" + out_body[func_ah[name]] += func[name] + del func[name] + output += out_body[want_ah] + else: # ch == 'h' + for name in sorted(out_decls.keys()): + if func_ah[name] == want_ah: + output += out_decls[name] + + sys.stdout.write(output) diff --git a/pkg/xen/patch/0001-handle-outfile-path-in-mkheader.py.patch b/pkg/xen/patch/0001-handle-outfile-path-in-mkheader.py.patch @@ -1,7 +1,7 @@ -From 01ad13e04b323d2c815d14961ef36d94127c8e3a Mon Sep 17 00:00:00 2001 +From c64e6a452caec85e116f2b263bed1e80fa83e0b3 Mon Sep 17 00:00:00 2001 From: Jul <jul@qh.is> Date: Tue, 25 Nov 2025 00:22:03 -0500 -Subject: [PATCH] handle outfile path in mkheader.py +Subject: [PATCH 1/2] handle outfile path in mkheader.py --- tools/include/xen-foreign/mkheader.py | 4 ++-- diff --git a/pkg/xen/patch/0002-remove-config.h-in-acpi-static_tables.patch b/pkg/xen/patch/0002-remove-config.h-in-acpi-static_tables.patch @@ -0,0 +1,24 @@ +From 5746c856f5df1bd9eda8d987ca1aca30d9acd060 Mon Sep 17 00:00:00 2001 +From: Jul <jul@qh.is> +Date: Wed, 26 Nov 2025 02:37:07 -0500 +Subject: [PATCH 2/2] remove config.h in acpi static_tables + +--- + tools/libacpi/static_tables.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/tools/libacpi/static_tables.c b/tools/libacpi/static_tables.c +index 715f46fee0..93da20ccb8 100644 +--- a/tools/libacpi/static_tables.c ++++ b/tools/libacpi/static_tables.c +@@ -5,7 +5,6 @@ + */ + + #include "acpi2_0.h" +-#include "../config.h" + + /* + * Firmware ACPI Control Structure (FACS). +-- +2.51.0 + diff --git a/pkg/yajl/gen.sh b/pkg/yajl/gen.sh @@ -1,8 +1,4 @@ -fetch git - -setv major 2 -setv minor 1 -setv micro 1 +fetch git 2.1.0 cflags " -std=c99 @@ -11,18 +7,18 @@ cflags " -Wno-implicit-fallthrough " -dep $tgtdir/headers +dep $dir/headers include --prefix yajl --src-prefix src/api " yajl_common.h yajl_gen.h yajl_parse.h yajl_tree.h + $outdir/yajl_version.h " -awk include/yajl/yajl_version.h src/api/yajl_version.h.cmake '|' $dir/version.awk -bind expr '-f $dir/version.awk -v major=$major -v minor=$minor -v micro=$micro' -include $outdir/include/yajl/yajl_version.h +sed yajl_version.h src/api/yajl_version.h.cmake +bind expr '-e "s,\$${YAJL_MAJOR},2," -e "s,\$${YAJL_MINOR},1," -e "s,\$${YAJL_MICRO},0,"' lib yajl.a " src/yajl.c