{"id":20747519,"url":"https://github.com/linuxboot/osf-builder","last_synced_at":"2025-04-28T12:02:19.348Z","repository":{"id":37927213,"uuid":"416811584","full_name":"linuxboot/osf-builder","owner":"linuxboot","description":"osf-builder contains tools to build OSF (Open System Firmware) firmware images, and to keep track of their versioning information.","archived":false,"fork":false,"pushed_at":"2023-09-14T20:08:42.000Z","size":3428,"stargazers_count":5,"open_issues_count":1,"forks_count":6,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-30T09:23:13.396Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"facebookarchive/osf-builder","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linuxboot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-10-13T16:06:15.000Z","updated_at":"2024-02-21T10:47:40.000Z","dependencies_parsed_at":"2023-02-09T10:00:25.297Z","dependency_job_id":null,"html_url":"https://github.com/linuxboot/osf-builder","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxboot%2Fosf-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxboot%2Fosf-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxboot%2Fosf-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxboot%2Fosf-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linuxboot","download_url":"https://codeload.github.com/linuxboot/osf-builder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251311332,"owners_count":21569008,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T08:13:29.626Z","updated_at":"2025-04-28T12:02:19.332Z","avatar_url":"https://github.com/linuxboot.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OSF Builder\n\nThis osf-builder repo is an open source repo to faciliate the development\ncommunity to collaborate on Open System Firmware (OSF).\n\n## Build pre-requisites\n\n * GNU make\n * Go version needs to be \u003e=1.19. for u-root compatibility after v0.10.0\n\n## Build process\n\nOSF boot starts with [coreboot](https://coreboot.org/) first, then [Linux kernel](https://kernel.org/) which then executes init, which in this case is provided by [u-root](https://github.com/u-root/u-root).\n\nOSF build also consists of these three stages, executed in the reverse order.\n\nEntire build requires `PLATFORM` to be defined, this specifies the platform for which build is being run.\n\n * `getdeps` is a tool used to fetch dependencies. It can clone Git repos, fetch files, etc.\n   * It is configured by a JSON file that must be specified in `CONFIG`.\n   * `CONFIG` consists of three top-level sections: `initramfs`, `kernel` and `coreboot` that specify what to fetch for each of the stages.\n * Initramfs image is built first, by building u-root with certain set of commands.\n   * `initramfs` section of the `CONFIG` is executed by `getdeps` to fetch the u-root sources and the Go toolchain.\n   * `PATCHES_DIR/initramfs-PLATFORM-*` patches are applied.\n   * Default set of commands can be found in Makefile.inc `UROOT_BASE_CMDS`, it can be augmented with `UROOT_ADDITIONAL_CMDS` or replaced entirely.\n   * Additional commands can come from u-root itself or from external packages, in which case `UROOT_ADDITIONAL_GOPATH` may be required.\n   * Initramfs can embed binary utilities, files can be added through `UROOT_ADDITIONAL_FILES` as `local_path:initramfs_path` pairs.\n * Kernel is built next\n   * `kernel` section of the `CONFIG` is executed by `getdeps` to fetch the kernel source.\n   * `PATCHES_DIR/kernel-PLATFORM-*` patches are applied.\n   * `KERNEL_CONFIG` is used as `.config`.\n * Coreboot is built last\n   * `coreboot` section of the `CONFIG` is executed by `getdeps` to fetch the source and toolchain dependencies.\n   * `PATCHES_DIR/coreboot-PLATFORM-*` patches are applied.\n   * `COREBOOT_CONFIG` is used as `.config`.\n   * Resulting flahs image is written to `osf-PLATFORM.rom` in the current directory.\n\n## How to build the sample project\n\n* Clone the repo.\n* cd examples/qemu-x86_64\n* Run `make`\n* Once the build is completed, run `make run`, it will start a VM with the OSF BIOS image.\n\n## Development tricks\n\n * To speed up builds, when not actively working on initramfs or the kernel, pass `ALWAYS_BUILD_INITRAMFS=0` and `ALWAYS_BUILD_KERNEL=0` respectively.\n   * `make ALWAYS_BUILD_INITRAMFS=0 ALWAYS_BUILD_KERNEL=0` - for hacking on coreboot only.\n * `make clean` will clean all the components without wiping the work done by `getdeps`.\n   * `make clean-coreboot` and `make clean-kernel` will clean just the coreboot and kernel components.\n * `make wipe` will wipe everything, including downloaded deps.\n   * `make wipe-coreboot` and `make wipe-kernel` will clean just the coreboot and kernel components.\n   * Note that toolchain cache survives wipe and will be used in the next build.\n * `make kernel` will only build LinuxBoot payload.\n* You can place a shell script vpd.sh under your project folder which would be executed for your customized actions such as setting your VPD key-value pairs to your coreboot image.\n* When the json configuration files' mtime is changed, osf-builder would trigger a full wipe of your downloaded coreboot, u-root and kernel code. To avoid this you can update the mtime of all the $(PLATFORM_BUILD_DIR)/.*-deps, for exmaple\n   * `cd build/qemu-x86_64` and `touch .*-deps` will update the mtime of .*-deps files.\n## License\n\nOSF Builder is MIT licensed, as found in the LICENSE file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinuxboot%2Fosf-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinuxboot%2Fosf-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinuxboot%2Fosf-builder/lists"}