Skip to content
Snippets Groups Projects
recipe.toml 893 B
Newer Older
[source]
git = "https://gitlab.redox-os.org/redox-os/redox-initfs.git"

[build]
template = "custom"
dependencies = [
  "drivers-initfs",
  "init",
  "logd",
  "ramfs",
  "randd",
  "redoxfs",
  "zerod",
]
script = """
INITFS_RM_BINS='redoxfs-ar redoxfs-mkfs'

Jacob Lorentzon's avatar
Jacob Lorentzon committed
mkdir -p "${COOKBOOK_BUILD}/initfs/etc"
Jacob Lorentzon's avatar
Jacob Lorentzon committed
cp -r "${COOKBOOK_SYSROOT}/"* "${COOKBOOK_BUILD}/initfs"

# TODO: Move init.rc to another recipe, perhaps initfs-misc? Then it can be installed as a regular dependency.
Jacob Lorentzon's avatar
Jacob Lorentzon committed
cp "${COOKBOOK_RECIPE}/init.rc" "${COOKBOOK_BUILD}/initfs/etc/init.rc"
Jacob Lorentzon's avatar
Jacob Lorentzon committed
for bin in ${INITFS_RM_BINS}; do
  rm -f "${COOKBOOK_BUILD}/initfs/bin/$bin"
Jacob Lorentzon's avatar
Jacob Lorentzon committed
env -u CARGO cargo run --manifest-path "${COOKBOOK_SOURCE}/tools/Cargo.toml" --bin redox-initfs-ar -- "${COOKBOOK_BUILD}/initfs" -o "${COOKBOOK_BUILD}/initfs.img"
mkdir -v "${COOKBOOK_STAGE}/boot"
cp "${COOKBOOK_BUILD}/initfs.img" "${COOKBOOK_STAGE}/boot/initfs"