new file mode 100644
@@ -0,0 +1,46 @@
+# Copyright (C) 2025 Weidmueller Interface GmbH & Co. KG
+# Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
+#
+# SPDX-License-Identifier: MIT
+#
+
+# The name of the vendor directory
+CARGO_VENDOR_SUBDIR = "vendor"
+
+# The URL of the crate registry
+CARGO_REGISTRY ?= "https://crates.io"
+
+CARGO_SRC_PATH = "${S}/${CARGO_SRC_DIR}"
+CARGO_SRC_SUBDIR = "${@os.path.relpath(d.getVar('CARGO_SRC_PATH'), d.getVar('WORKDIR'))}"
+CARGO_SRC_URI_FILE = "${VENDOR_DIR}/cargo-source-uris.txt"
+SRC_URI_FILES:append = " ${CARGO_SRC_URI_FILE}"
+
+inherit vendor
+
+CARGO_VENDORING_DIRECTORY = "${CARGO_SRC_PATH}/${CARGO_VENDOR_SUBDIR}"
+
+python vendor_cargo_do_vendor_resolve() {
+ from oe.vendor import cargo
+
+ lock_file_dir = d.getVar("CARGO_LOCK_PATH")
+ lock_file_dir = get_early_source_dir(d, lock_file_dir)
+ registry = d.getVar("CARGO_REGISTRY")
+ src_subdir = d.getVar("CARGO_SRC_SUBDIR")
+ vendor_subdir = d.getVar("CARGO_VENDOR_SUBDIR")
+ uris = cargo.resolve_src_uris(lock_file_dir, registry, src_subdir,
+ vendor_subdir)
+ with open(d.getVar("CARGO_SRC_URI_FILE"), "w") as f:
+ oe.vendor.dump(f, uris)
+}
+
+python emulate_crate_vendor() {
+ from oe.vendor import cargo
+
+ lock_file_dir = d.getVar("CARGO_LOCK_PATH")
+ lock_file_dir = get_early_source_dir(d, lock_file_dir)
+ vendor_dir = d.getVar("CARGO_VENDORING_DIRECTORY")
+ cargo.populate_vendor(lock_file_dir, vendor_dir)
+}
+do_unpack[postfuncs] += "emulate_crate_vendor"
+
+EXPORT_FUNCTIONS do_vendor_resolve