Compare commits

..

No commits in common. "master" and "0.3.2" have entirely different histories.

3590 changed files with 1513 additions and 72980 deletions

View File

@ -1,22 +0,0 @@
[target.aarch64-unknown-redox]
linker = "aarch64-unknown-redox-gcc"
rustflags = []
[target.i586-unknown-redox]
linker = "i586-unknown-redox-gcc"
rustflags = []
[target.i686-unknown-redox]
linker = "i686-unknown-redox-gcc"
rustflags = []
[target.x86_64-unknown-redox]
linker = "x86_64-unknown-redox-gcc"
rustflags = []
[target.riscv64gc-unknown-redox]
linker = "riscv64-unknown-redox-gcc"
rustflags = []
[env]
CFLAGS_riscv64gc_unknown_redox="-march=rv64gc -mabi=lp64d"

16
.github/ISSUE_TEMPLATE vendored Normal file
View File

@ -0,0 +1,16 @@
**Reproduction**: [describe how you are able to reproduce ("trigger") this bug/issue.]
**Expected behavior**: [describe the behavior you would expect the repro to yield.]
**Actual behavior**: [describe the actual behavior, which is presented through the repro.].
**Build information**: [only when using a self build version: output of `rustc -V`, `git rev-parse HEAD` `qemu-i386 -version`, `uname -a`, etc.]
**Redox release**: [only when using a prebuild version: redox version]
**Blocking/related**: [issues or PRs blocking or being related to this issue.]
**Misc**: [optional: for other relevant information that should be known or cannot be described in the other fields.]
------
_If the above does not fit the nature of the issue feel free to modify it._

26
.gitignore vendored
View File

@ -1,25 +1 @@
/build/
/prefix/
.config
**/my_*
# Local settings folder for Jetbrains products (RustRover, IntelliJ, CLion)
.idea/
# Local settings folder for Visual Studio Professional
.vs/
# Local settings folder for vscode
.vscode/
# Local settings folder for the devcontainer extension that most IDEs support.
.devcontainer/
# Cookbook
/repo
/web
/cookbook.toml
/cookbook.lock
source
source.tmp
source-new
source-old
source.tar
source.tar.tmp
target
wget-log
build

View File

@ -1,57 +0,0 @@
# The GitLab Continuous Integration configuration
variables:
GIT_STRATEGY: "clone"
stages:
- lint
- test
workflow:
rules:
- if: '$CI_COMMIT_BRANCH == "master" && $CI_PROJECT_NAMESPACE == "redox-os"'
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"'
fmt:
image: "rust:trixie"
stage: lint
script:
- rustup component add rustfmt
- cargo fmt -- --check
cargo-test:
image: "rust:trixie"
stage: lint
script:
- cargo test --locked
fetch-changed:
image: "redoxos/redox-base-x86_64"
stage: test
script:
- |
export PATH="$HOME/.cargo/bin:$PATH" &&
(curl "https://sh.rustup.rs" -sSf | sh -s -- -y --default-toolchain stable --profile minimal ) &&
cargo install cbindgen &&
env PODMAN_BUILD=0 SKIP_CHECK_TOOLS=1 ./scripts/fetch-changed.sh
img:
image: "redoxos/redox-base-x86_64"
stage: test
script:
- |
export PATH="$HOME/.cargo/bin:$PATH" &&
(curl "https://sh.rustup.rs" -sSf | sh -s -- -y --default-toolchain stable --profile minimal ) &&
cargo install cbindgen &&
PODMAN_BUILD=0 SKIP_CHECK_TOOLS=1 REPO_BINARY=1 FSTOOLS_NO_MOUNT=1 COOKBOOK_VERBOSE=false make ci-img IMG_TAG=$CI_COMMIT_REF_NAME
pkg:
image: "rust:trixie"
stage: test
script:
- |
export PATH="$HOME/.cargo/bin:$PATH" PODMAN_BUILD=0 &&
make CONFIG_NAME=ci SKIP_CHECK_TOOLS=1 repo-tree ARCH=x86_64 &&
make CONFIG_NAME=ci SKIP_CHECK_TOOLS=1 repo-tree ARCH=i586 &&
make CONFIG_NAME=ci SKIP_CHECK_TOOLS=1 repo-tree ARCH=aarch64 &&
make CONFIG_NAME=ci SKIP_CHECK_TOOLS=1 repo-tree ARCH=riscv64gc

View File

@ -1,92 +0,0 @@
<!-- Thank you for taking the time to submit an issue! By following these comments and filling out the sections below, you can help the developers get the necessary information to fix your issue. Please provide a single issue per report. You can also preview this report before submitting it. Feel free to modify/remove sections to fit the nature of your issue. -->
<!-- Please search to check that your issue has not been created already. By preventing duplicate issues, you can help keep the repository organized. If your current issue has already been created and is still unresolved, you can contribute by commenting there. -->
<!-- Replace the empty checkbox [ ] below with a checked one [x] if you have already searched for your issue. -->
- [ ] I agree that I have searched opened and closed issues to prevent duplicates.
--------------------
## Description
<!-- Briefly summarize/describe the issue that you are experiencing below. -->
Replace me
## Environment info
<!-- To understand where your issue originates, please include some relevant information about your environment. -->
<!-- If you are using a pre-built release of Redox, please specify the release version below. -->
- Redox OS Release:
0.0.0 Remove me
<!-- If you have built Redox OS yourself, please provide the following information: -->
- Operating system:
Replace me
- `uname -a`:
`Replace me`
- `rustc -V`:
`Replace me`
- `git rev-parse HEAD`:
`Replace me`
<!-- Depending on your issue, additional information about your environment (network config, package versions, dependencies, etc.) can also help. You can list that below. -->
- Replace me:
Replace me
## Steps to reproduce
<!-- If possible, please list the steps to reproduce ("trigger") your issue below. Being detailed definitely helps speed up bug fixes. -->
1. Replace me
2. Replace me
3. ...
## Behavior
<!-- It may seem obvious to know what to expect, but isolating the behavior from everything else simplifies the development process. Remember to provide a single issue in this report. You can use the References section below to link your issues together. -->
<!-- Describe the behavior you expect your steps should yield (i.e., correct behavior). -->
- **Expected behavior**:
Replace me
<!-- Describe the behavior you observed when running your steps (i.e., buggy behavior). -->
- **Actual behavior**:
Replace me
<!-- **Logs?** Posting a log can help developers find your particular issue more easily. Please wrap your code in code blocks using triple back-ticks ``` to increase readability. -->
```
Replace me
```
<!-- **Solution?** Have a solution in mind? Propose your solution below. -->
- **Proposed solution**:
Replace me
<!-- **Screenshots?** Make it easier to get your point across with screenshots. You can drag & drop or paste your images below. -->
## Optional references
<!-- If you have found issues or pull requests that are related to or blocking this issue, please link them below. See https://help.github.com/articles/autolinked-references-and-urls/ for more options. You can also link related code snippets by providing the permalink. See https://help.github.com/articles/creating-a-permanent-link-to-a-code-snippet/ for more information. -->
Related to:
- #0000 Remove me
- Replace me
- ...
Blocked by:
- #0000 Remove me
- ...
## Optional extras
<!-- If you have other relevant information not found in other sections, you can include it below. -->
Replace me
<!-- **Code?** Awesome! You can also create a pull request with a reference to this issue. -->
<!-- **Files?** Attach your relevant files by dragging & dropping or pasting them below. -->
<!-- You also can preview your report before submitting it. Thanks for contributing to Redox! -->

21
.gitmodules vendored Normal file
View File

@ -0,0 +1,21 @@
[submodule "bootloader"]
path = bootloader
url = https://github.com/redox-os/bootloader.git
[submodule "cookbook"]
path = cookbook
url = https://github.com/redox-os/cookbook.git
[submodule "installer"]
path = installer
url = https://github.com/redox-os/installer.git
[submodule "isolinux"]
path = isolinux
url = https://github.com/redox-os/isolinux.git
[submodule "kernel"]
path = kernel
url = https://github.com/redox-os/kernel.git
[submodule "rust"]
path = rust
url = https://github.com/redox-os/rust.git
[submodule "redoxfs"]
path = redoxfs
url = https://github.com/redox-os/redoxfs.git

45
.travis.yml Normal file
View File

@ -0,0 +1,45 @@
sudo: required
language: rust
rust:
- nightly
cache: cargo
os:
- linux
#- osx
#matrix:
# allow_failures:
# - os: osx
dist: trusty
before_install:
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
sudo apt-key adv -q --batch --yes --keyserver keyserver.ubuntu.com --recv-keys AA12E97F0881517F &&
sudo add-apt-repository 'deb https://static.redox-os.org/toolchain/apt ./' &&
sudo apt-get update -qq &&
sudo apt-get purge -qq binutils-doc &&
sudo apt-get install -qq nasm pkg-config fuse libfuse-dev genisoimage syslinux x86-64-unknown-redox-gcc &&
sudo modprobe fuse &&
sudo chmod 666 /dev/fuse &&
sudo chown root:$USER /etc/fuse.conf;
fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
brew update &&
brew install nasm pkg-config Caskroom/cask/osxfuse &&
travis_wait 30 brew install redox-os/gcc_cross_compilers/x86_64-elf-gcc;
fi
- cd cookbook && ./setup.sh && cd ..
script:
- make clean && make travis
notifications:
email: false
webhooks: http://37.139.9.28:54863/travis
deploy:
provider: releases
api_key:
secure: E5w3mgFbW4fAFNJn0FGcvwGKK33d+StC4izDX7dsGPxX/gwAsMnZqabDWpsrj8n/jFI5NdPzuyz4Ojkip4AXrEs0DWfX96d9CSWvJmWIirwwKhALnxZ5cqnHnBXY3wpk9k8MKpdODzKs3ZjM3pPug2jjjp2EHdrEV6iyc8LlnLAJutbtPpNJv0rJrx/TfCZRx70YWKQyx2Lfx5P6Vj+5yoYsKk+SHmKZlIQfj2E1cfC8+/w+fzc9CRTNhM9XFBisKnu9qql3nNhEW8VUNQ9FnltGpunmcTnCmsKzHPfs8Zv6kM/6y3wuoqxwPnIwRu+zsntkjM/eT7Zy3DtTBqJDjq+L5jov50QWOxzjUuFYMv0lAMeMC0PIGn0ECpFs546M+Wqvd7HKgabac0UhilEBPbinOdW+6aOOhbo+Fe2I2ec0XIGxlQpccQeWQUsjjOQ+6QuvnpPE+CbvQaVyrx27rVAkqD44cOP8xqOq2Es651J+Dt0O1OIhLdPB3FxOLCDpEIHU5Ojci1QbUxZgGKjShpo44nNqcTv7v71JrfzFSVG2pF9a35Mpo6bFEkzyQprOyrwH2fcnN+4jyxdJXzdNsgraXsQopWAB5cL/8i7SXMwHy9ivpFaX/zgoHQqpc1a4VjrmTtPA08rLORIllw9CplfvJNsmNmCi2aSeTXR06Xk=
file_glob: true
file: build/travis/*
on:
repo: redox-os/redox
tags: true
condition: $TRAVIS_OS_NAME = linux
skip_cleanup: true

View File

@ -1,286 +1,191 @@
# Contributing to Redox
**Thank you for your interest in contributing to Redox!**
Thank you for your interest in contributing to Redox! This document will outline the basics of where to start if you wish to contribute to the project. There are many ways to help us out and and we appreciate all of them. We look forward to your contribution!
This document will outline the basics of where to start if you wish to contribute to the project. There are many ways to help us out and and we appreciate all of them. We look forward to **your contribution!**
## Index
**Please read this document until the end to not waste your and our time with unnecessary questions**
* [Communication](#communication)
* [Chat](#chat)
* [GitHub Issues](#issues)
* [Pull Requests](#prs)
* [Discourse](#discourse)
* [Reddit](#reddit)
* [News](#news)
* [Code Contributions](#code-contributions)
* [Low-Hanging Fruit - Easy Targets for Newbies](#easy-targets)
* [Creating a Pull Request](#creating-a-pr)
* [Best Practices/Guidelines](#best-practices)
* [General](#general)
* [Kernel](#kernel)
* [Testing Practices](#testing-practices)
* [Style Guidelines](#style-guidelines)
* [Rust](#rust-style-guidelines)
* [Git](#git-style-guidelines)
* [Other Ways to Contribute](#other)
* [Graphic Design](#graphic-design)
* [Patreon](#patreon)
## Code Of Conduct
## <a name="extern-links"> Other External Links </a>
We follow the [Rust Code Of Conduct](https://www.rust-lang.org/policies/code-of-conduct).
* [redox-os.org](https://redox-os.org)
* [rust-os-comparison](https://github.com/flosse/rust-os-comparison)
* [rust-lang.org](http://rust-lang.org)
## <a name="communication"> Communication </a>
### <a name="chat"> Chat </a>
The quickest and most open way to communicate with the Redox team is on our chat server. Currently, you can only get an invite by sending an email request to [info@redox-os.org](mailto:info@redox-os.org), which might take a little while, since it's not automated. Simply say you'd like to join the chat. We're working on an better way to do this, but this is the best way right now.
### <a name="issues"> GitHub Issues </a>
A bit more formal way of communication with fellow Redox devs, but a little less quick and convenient like the chat. Submit an issue when you run into problems compiling, testing, or just would like to discuss a certain topic, be it features, code style, code inconsistencies, minor changes and fixes, etc.
### <a name="prs"> Pull Requests </a>
## License
It's fine to just submit a small pull request without first making an issue or asking in the chat, but if it's a significant change that will require a lot of planning and reviewing. Also see [Creating a Pull Request](#creating-a-pr) and [Git Style Guidelines](#git-style-guidelines).
### <a name="discourse"> Discourse </a>
In general, your contributions to Redox are governed by the [MIT License](https://en.wikipedia.org/wiki/MIT_License). Each project repository has a `LICENSE` file that provides the license terms for that project.
We have a discourse forum at [discourse.redox-os.org](https://discourse.redox-os.org). This is the best way to discuss more general topics that aren't about specific things that need to be addressed one way or another. You can sign up like any other website.
### <a name="reddit"> Reddit </a>
Please review the `LICENSE` file for the project you are contributing to.
You can also find Redox on Reddit in [/r/rust/](https://www.reddit.com/r/rust) and [/r/redox/](https://www.reddit.com/r/redox). Redox news and discussion is posted on the latter, and Rust news and discussion, as well as some Redox posts, is on the former.
[This](https://doc.redox-os.org/book/philosophy.html) page we explain why we use the MIT license.
### <a name="news"> News </a>
## Contribution Terms
News and updates for Redox are posted at [redox-os.org/news](https://redox-os.org/news). It's more one-way than the other things on this list, but it should provide a good summary of what's been going on with the project lately. It's usually updated weekly, but with some exceptions. A mailing list may be included eventually, but it's not set up right now.
When making a contribution you agree to the following terms:
## <a name="code-contributions"> Code Contributions </a>
- I understand these changes in full and will be able to respond to review comments.
- I have read the [Developer Certificate of Origin](https://developercertificate.org/) and certify my contribution under its conditions.
### <a name="easy-targets"> Low-Hanging Fruit - Easy Targets for Newbies </a>
## AI Policy
#### If you're not fluent in Rust:
Redox OS does not accept contributions generated by LLMs ([Large Language Models](https://en.wikipedia.org/wiki/Large_language_model)), sometimes also referred to as "AI". This policy is not open to discussion, any content submitted that is clearly labelled as LLM-generated (including issues, merge requests, and merge request descriptions) will be immediately closed, and any attempt to bypass this policy will result in a ban from the project.
* Writing documentation
* Using/testing Redox, filing issues for bugs and needed features
* Web development ([Redox website, separate repo](https://github.com/redox-os/website))
* Writing unit tests (may require minimal knowledge of rust)
## Chat
#### If you are fluent in Rust, but not OS Development:
You can join in our chat platforms to discuss development, issues or ask questions.
* Apps development
* Shell ([Ion](https://github.com/redox-os/ion)) development
* Package management ([pkgutils](https://github.com/redox-os/pkgutils)) development
* Other high-level code tasks
### [Matrix](https://matrix.to/#/#redox-join:matrix.org)
#### If you are fluent in Rust, and have experience with OS Dev:
Matrix is the official way to talk with Redox OS team and community (these rooms are English-only, we don't accept other languages because we don't understand them).
* Familiarize yourself with the repository and codebase
* Grep for `TODO`, `FIXME`, `BUG`, `UNOPTIMIZED`, `REWRITEME`, `DOCME`, and `PRETTYFYME` and fix the code you find.
* Improve and optimize code, especially in the kernel
Matrix has several different clients. [Element](https://element.io/) is a commonly used choice, it works on web browsers, Linux, MacOSX, Windows, Android and iOS.
### <a name="creating-a-pr"> Creating a Pull Request </a>
If you have problems with Element, try [Fractal](https://gitlab.gnome.org/World/fractal).
1. Fork the repository
2. Clone the original repository to your local PC using one of the following commands based on the protocol you are using:
* HTTPS:`git clone https://github.com/redox-os/redox.git --origin upstream --recursive`
* SSH:`git clone git@github.com:redox-os/redox.git --origin upstream --recursive`
* Then rebase: `git rebase upstream master`
If you use HTTPS, you will have to log in each time when pushing to your fork. (Recommended: learn about git SSH support, it logs in automatically using SSH keys)
3. Add your fork with
* HTTPS:`git remote add origin https://github.com/your-username/redox.git`
* SSH:`git remote add origin git@github.com:your-username/redox.git`
4. Alternatively, if you already have a fork and copy of the repo, you can simply check to make sure you're up-to-date
* Pull the upstream:`git pull upstream --rebase`
* Update the submodules:`git submodule update --recursive --init`
5. Create a separate branch (recommended if you're making multiple changes simultaneously) (`git checkout -b my-branch`)
6. Make changes
7. Commit (`git add <item(s) you changed>; git commit`) and write your commit message
8. Optionally run [rustfmt](https://github.com/rust-lang-nursery/rustfmt) on the files you changed and commit again if it did anything (check with `git diff` first)
9. Test your changes by cleaning (`make clean; git clean -Xfd`) and building with `make qemu` (you might have to use `make qemu kvm=no`) or `make virtualbox`.
(see [Best Practices and Guidelines](#best-practices))
10. Pull from upstream (`git pull upstream --rebase`) (Note: Make sure to include `--rebase`, as it will apply your changes on top of the changes you just pulled, allowing for a much cleaner merge)
11. Repeat step 9 to make sure the rebase still builds and starts
12. Push to your fork (`git push origin <branch>`), `<branch>` being the branch you created earlier
13. Create a pull request
14. If your changes are minor, you can just describe them in a paragraph or less. If they're major, please fill out the provided form.
15. Submit!
- Join the [Join Requests](https://matrix.to/#/#redox-join:matrix.org) room and send a message requesting for an invite to the Redox Matrix space (the purpose of this is to avoid spam and bots).
- #redox-join:matrix.org (Use this Matrix room address if you don't want to use the external Matrix link)
## <a name="best-practices"> Best Practices and Guidelines </a>
(We recommend that you leave the "Join Requests" room after your entry on Redox space)
### <a name="general"> General </a>
If you want to have a big discussion in our rooms, you should use a Element thread, it's more organized and easy to keep track if more discussions happen on the same room.
* **Remember to do a `git rebase -i upstream/master` before you send your patch!**
* **Make sure your code is readable, commented, and well-documented.**
* **Don't hesitate to ask for help, comments or suggestions!**
* **Before implementing something, discuss it! Open an issue, or ask in the chat.**
You cand find more information on the [Chat](https://doc.redox-os.org/book/chat.html) page.
##### On the more technical side:
* Test, test, and test!
* Follow the style conventions (See [rust style guidelines](#rust-style-guidelines))
* Use `std::mem::replace` and `std::mem::swap` when you can.
* `libredox` should be 1-to-1 with the official `libstd`.
* Prefer `.into()` and `.to_owned()` over `.to_string()`.
* Prefer passing references to the data over owned data. (Don't take `String`, take `&str`. Don't take `Vec<T>` take `&[T]`).
* Use generics, traits, and other abstractions Rust provides.
* Avoid using lossy conversions (for example: don't do `my_u32 as u16 == my_u16`, prefer `my_u32 == my_u16 as my_u32`).
* Prefer in place (`box` keyword) when doing heap allocations.
* Prefer platform independently sized integer over pointer sized integer (`u32` over `usize`, for example).
* Follow the usual idioms of programming, such as "composition over inheritance", "let your program be divided in smaller pieces", and "resource acquisition is initialization".
* When `unsafe` is unnecessary, don't use it. **Longer safe code is better than shorter unsafe code!**
* Be sure to mark parts that need work with `TODO`, `FIXME`, `BUG`, `UNOPTIMIZED`, `REWRITEME`, `DOCME`, and `PRETTYFYME`. Always elaborate on these messages, too. Nothing is more annoying than seeing a `TODO` and not knowing how to actually fix it.
* Use the compiler hint attributes, such as `#[inline]`, `#[cold]`, etc. when it makes sense to do so.
* Check the [chat](#chat), [the website](http://redox-os.org/news), and [the Rust subreddit](https://www.reddit.com/r/rust) frequently.
### [Discord](https://discord.gg/JfggvrHGDY)
### <a name="kernel"> Kernel </a>
We have a Discord server as an alternative for Matrix, open the #join-requests channel and send a message requesting to be a member (the purpose of this is to avoid spam and bots)
* When trying to access a slice, **always** use the `common::GetSlice` trait and the `.get_slice()` method to get a slice without causing the kernel to panic.
The problem with slicing in regular Rust, e.g. `foo[a..b]`, is that if someone tries to access with a range that is out of bounds of an array/string/slice, it will cause a panic at runtime, as a safety measure. Same thing when accessing an element.
Always use `foo.get(n)` instead of `foo[n]` and try to cover for the possibility of `Option::None`. Doing the regular way may work fine for applications, but never in the kernel. No possible panics should ever exist in kernel space, because then the whole OS would just stop working.
The Matrix messages are sent to Discord and vice-versa using a bot, but sometimes some Discord messages aren't sent to Matrix (if this happens to you join in our Matrix space above)
### <a name="testing-practices"> Testing Practices </a>
## [GitLab](https://gitlab.redox-os.org/redox-os/redox)
* It's always better to test boot (`make qemu` or `make virtualbox`) every time you make a change, because it is important to see how the OS boots and works after it compiles.
Even though Rust is a safety-oriented language, something as unstable and low-level as an in-dev operating system will almost certainly have problems in many cases and may completely break on even the slightest critical change.
Also, make sure you check how the unmodified version runs on your machine before making any changes. Else, you won't have anything to compare to, and it will generally just lead to confusion. TLDR: Rebuild and test boot often.
A slightly more formal way of communication with fellow Redox developers, but a little less quick and convenient like the chat. Submit an issue when you run into problems compiling or testing. Issues can also be used if you would like to discuss a certain topic: be it features, code style, code inconsistencies, minor changes and fixes, etc.
* To run the ZFS tests:
* Create the zfs.img only once. If one has not been created, run `make filesystem/apps/zfs/zfs.img` before booting into Redox.
* Run `open zfs.img` to open the created ZFS image.
* Run `file /home/LICENSE.md` twice to ensure ARC isn't broken.
If you want to create an account, read the [Signing in to GitLab](https://doc.redox-os.org/book/signing-in-to-gitlab.html) page.
## <a name="style-guidelines"> Style Guidelines </a>
Once you create an issue don't forget to post the link on the Dev or Support rooms of the chat, because the GitLab email notifications have distractions (service messages or spam) and most developers don't left their GitLab pages open to receive desktop notifications from the web browser (which require a custom setting to receive issue notifications).
### <a name="rust-style-guidelines"> Rust </a>
By doing this you help us to pay attention to your issues and avoid them to be accidentally forgotten.
Since Rust is a relatively small and new language compared to others like C, there's really only one standard. Just follow the official Rust standards for formatting, and maybe run `rustfmt` on your changes, until we setup the CI system to do it automatically.
If you have ready MRs (merge requests) you must send the links in the [MRs](https://matrix.to/#/#redox-mrs:matrix.org) room. To join this room, you will need to request an invite in the [Join Requests](https://matrix.to/#/#redox-join:matrix.org) room.
### <a name="git-style-guidelines"> Git </a>
By sending a message in the room, your MR will not be forgotten or accumulate conflicts.
* You should have a fork of the repository on GitHub and a local copy on your computer. The local copy should have two remotes; `upstream` and `origin`, `upstream` should be set to the main repository and `origin` should be your fork.
* When you start to make changes, you will want to create a separate branch, and keep the `master` branch of your fork identical to the main repository, so that you can compare your changes with the main branch and test out a more stable build if you need to.
* Usually, when syncing your local copy with the master branch, you'll want to rebase instead of merge. This is because it will create duplicate commits that don't actually do anything when merged into the master branch. You can do this in one command with `git pull upstream --rebase`. This will pull from the upstream, then roll back to the current state of the upstream, and "replay" your changes on top of it. Make sure you commit before doing this, though. Git won't be able to rebase if you don't.
* Prefer to omit the `-m` when using `git commit`. This opens your editor and should help get you in the habit of writing longer commit messages.
* Commit messages should describe their changes in present tense, e.g. "`Add stuff to file.ext`" instead of "`added stuff to file.ext`". This makes sense as sometimes when you revert back, then run through commits one-by-one, you want to see what a commit will do, instead of just what the person did when they made the commit. It's also just being consistent.
* Try to remove useless duplicate/merge commits from PRs as these don't do anything except clutter up history and make it harder to read.
## <a name="other"> Other Ways to Contribute </a>
## Best Practices and Guidelines
If you're not big on coding, but you still want to help keep the project going, you can still contribute/support in a variety of ways! We'll try to find a way to use anything you have to offer.
### <a name="design"> Design </a>
If you're a good designer, whether it's 2D graphics, 3D graphics, interfaces, web design, you can help. We need logos, UI design, UI skins, app icons, desktop backgrounds, etc. More information to come on this in the future, for now just join [the chat](#chat) and ask about graphic design.
### <a name="patreon"> Patreon </a>
Our BDFL, [jackpot51](https://github.com/jackpot51), has a [Patreon campaign](https://www.patreon.com/redox_os)! All money recieved will go towards Redox OS development. If you donate, you will be listed in the Redox credits as one of the people that made Redox OS possible. You'll also get other rewards the more you donate. However, please don't donate if you can't afford it.
<!--
POSSIBLE OTHER TOPICS TO INCLUDE
- Merch (maybe in the future)
- Sound Design (things like notifications, popups, etc. for orbital)
- Video Production/Motion Graphics (tutorials, introduction videos, etc.)
- Non-Rust programming, scripting, etc. (if we even have a need for this)
- Hosting/download/git mirrors (this is not needed right now, but when downloads increase it may be necessary)
-->
You can read the best practices and guidelines on the [Best practices and guidelines](https://doc.redox-os.org/book/best-practices.html) chapter.
## Notes
This section has important details to not waste your and our time with unnecessary questions.
- We don't accept Git pushs using SSH to protect against AI scrappers and bots, you need to use [HTTPS with your PAT](https://doc.redox-os.org/book/signing-in-to-gitlab.html#setting-up-pat) in our GitLab server
- For complete or advanced development you need the [Redox build system](https://doc.redox-os.org/book/podman-build.html) instead of Redoxer
- If you want to work on individual repositories without the Redox build system you need to use [Redoxer](https://gitlab.redox-os.org/redox-os/redoxer) because our toolchain is not fully upstreamed yet
## Development Recommendations and Tips
- Copy-paste prevent and reduce typos
- Comment out configuration or code while testing is better than removal, to remember the testing conditions and prevent mistakes from forgotten logic
- Read the entire [Build System Reference](https://doc.redox-os.org/book/build-system-reference.html) and [Developer FAQ](https://doc.redox-os.org/book/developer-faq.html) pages
- Make sure your build system is up-to-date, read the [Update The Build System](https://doc.redox-os.org/book/build-system-reference.html#update-the-build-system) section if in doubt.
- If you want to make local changes in recipe sources it's recommended to automatic recipe source update, read [this](https://doc.redox-os.org/book/configuration-settings.html#local-recipe-changes) section to learn how to this for one or multiple recipes and [this](https://doc.redox-os.org/book/configuration-settings.html#cookbook-offline-mode) section for all recipes.
- If you want to make changes to system components, drivers or RedoxFS you need to manually update initfs, read [this](https://doc.redox-os.org/book/coding-and-building.html#how-to-update-initfs) section to learn how to do that.
- If some program can't build or work, something can be missing/hiding on [relibc](https://gitlab.redox-os.org/redox-os/relibc), like a POSIX/Linux function or bug.
- If you have some error on QEMU remember to test different settings or verify your operating system (Pop_OS!, Ubuntu, Debian and Fedora are the recommend Linux distributions to do testing/development for Redox).
- Remember to log all errors, you can use the following command as example:
```sh
your-command 2>&1 | tee file-name.log
```
- If you have a problem that seems to not have a solution, think on simple/stupid things. Sometimes you are very confident on your method and forget obvious things (very common).
- If you want a quick review of your Merge Request, make it small.
- If your big Merge Request is taking too long to be reviewed and merged try to split it in small MRs. But make sure it don't break anything, if this method break your changes, don't shrink.
## Style Guidelines
### Rust
Since **Rust** is a relatively small and new language compared to others like C and C++, there's really only one standard. Just follow the official Rust standards for formatting, and maybe run `rustfmt` on your changes, until we setup the CI system to do it automatically.
### Git
Please follow our [Git style](https://doc.redox-os.org/book/creating-proper-pull-requests.html) for pull requests.
## GitLab
### Identity
Once your GitLab account is created, you should add your Matrix or Discord username (the name after the `@` symbol) on the "About" section of your profile, that way we recognize you properly.
### Issues
We use issues to organize and track our current and pending work, to know how to create issues on the Redox GitLab read the [Filing Issues](https://doc.redox-os.org/book/filing-issues.html) page.
Once you create an issue don't forget to post the link on the Dev or Support rooms of the chat, because the GitLab email notifications have distractions (service messages or spam) and most developers don't left their GitLab pages open to receive desktop notifications from the web browser (which require a custom setting to receive issue notifications).
By doing this you help us to pay attention to your issues and avoid them to be accidentally forgotten.
You can see all issues on [this](https://gitlab.redox-os.org/groups/redox-os/-/issues) link.
### Pull Requests
Please follow [our process](https://doc.redox-os.org/book/creating-proper-pull-requests.html) for creating proper pull requests.
## Important Places to Contribute
Before starting to contribute, we recommend reading the [General FAQ](https://www.redox-os.org/faq/) and the [Redox Book](https://doc.redox-os.org/book/).
You can contribute to the Redox documentation and code on the following repositories (non-exhaustive, easiest-to-hardest order):
- [Website](https://gitlab.redox-os.org/redox-os/website)
- [Book](https://gitlab.redox-os.org/redox-os/book) - High-level documentation
- [Build System Configuration](https://gitlab.redox-os.org/redox-os/redox) - Our main repository
- [Orbital](https://gitlab.redox-os.org/redox-os/orbital) - Display Server and Window Manager
- [pkgutils](https://gitlab.redox-os.org/redox-os/pkgutils) - Package Manager
- [acid](https://gitlab.redox-os.org/redox-os/acid) - Redox Test Suite
- [relibc](https://gitlab.redox-os.org/redox-os/relibc) - Redox C Library
- [libredox](https://gitlab.redox-os.org/redox-os/libredox) - Redox System Library
- [Bootloader](https://gitlab.redox-os.org/redox-os/bootloader)
- [RedoxFS](https://gitlab.redox-os.org/redox-os/redoxfs) - Default filesystem
- [Base](https://gitlab.redox-os.org/redox-os/base) - Essential system components and drivers
- [Kernel](https://gitlab.redox-os.org/redox-os/kernel)
To see all Redox repositories open the [redox-os group](https://gitlab.redox-os.org/redox-os).
### Skill Levels
If you don't know programming:
- Test the [daily images](https://static.redox-os.org/img/) on your computer and add the report on the [Hardware Compatibility](https://gitlab.redox-os.org/redox-os/redox/-/blob/master/HARDWARE.md) list
- Monitor and warn developers if the [daily images](https://static.redox-os.org/img/) are outdated
- Use/test Redox and create issues for bugs or needed features (please check for duplicates first)
- Fix and write documentation
- Find or fix typos in configuration
If you don't know how to code in Rust but know other programming languages:
- Web development on the website (we only accept minimal JavaScript code to preserve performance)
- Write unit tests (may require minimal knowledge of Rust)
- Port C/C++ programs to Redox (read the `TODO`s of the recipes on the [WIP category](https://gitlab.redox-os.org/redox-os/redox/-/tree/master/recipes/wip))
- Port programs to Redox
If you know how to code in Rust but don't know operating system development:
- See the [easy](https://gitlab.redox-os.org/groups/redox-os/-/issues/?label_name[]=easy) issues
- See the "[good first issue](https://gitlab.redox-os.org/groups/redox-os/-/issues/?label_name[]=good%20first%20issue)" issues
- See the [help wanted](https://gitlab.redox-os.org/groups/redox-os/-/issues/?label_name[]=help%20wanted) issues (it's worth noting the skill level varies between projects, but a large subset of these should be approachable by contributors familiar with regular Rust/Unix application programming)
- Improve the package manager, or build system tooling like `redoxer` or `installer`
- Improve the [Ion](https://gitlab.redox-os.org/redox-os/ion) shell, or other high-level or mid-level projects
- Port Rust programs (also look for issues with the `port` label)
- Improve application compatibility in relibc by e.g. implementing missing POSIX/Linux functions
If you know how to code in Rust, and have experience with systems software/OS development:
- Familiarize yourself with the repository layout, code, and build system
- Update old code to remove warnings
- Search for `TODO`, `FIXME`, `BUG`, `UNOPTIMIZED`, `REWRITEME`, `DOCME`, and `PRETTYFYME` and fix the code you find
- Look in general for issues with the following labels: `critical`, `help wanted`, `feature`, `enhancement`, `bug` or `port`
- Improve internal libraries and abstractions, e.g. `libredox`, `redox-scheme`, `redox-event` etc.
- Help upstream Redox-specific functionality to the Rust ecosystem
- Improve Redox's automated testing suite and continuous integration testing processes
- Improve, profile, and optimize code, especially in the kernel, filesystem, and network stack
- Improve or write device drivers
For those who want to contribute to the Redox GUI, our GUI strategy has changed.
- We are improving the [Orbital](https://gitlab.redox-os.org/redox-os/orbital) display server and window manager, you can read more about it on [this tracking issue](https://gitlab.redox-os.org/redox-os/redox/-/issues/1430).
- OrbTk is in maintenance mode, and its developers have moved to other projects such as the ones below. There is currently no Redox-specific GUI development underway.
## Priorities
You can use the following GitLab issue label filters to know our development priorities on the moment:
- [Critical](https://gitlab.redox-os.org/groups/redox-os/-/issues/?label_name[]=critical)
- [High-priority](https://gitlab.redox-os.org/groups/redox-os/-/issues/?label_name[]=high-priority)
- [Medium-priority](https://gitlab.redox-os.org/groups/redox-os/-/issues/?label_name[]=medium-priority)
- [Low-priority](https://gitlab.redox-os.org/groups/redox-os/-/issues/?label_name[]=low-priority)
## Roadmap
We use tracking issues for the goals in our roadmap, you can see them in the filter below:
- [Tracking issues](https://gitlab.redox-os.org/groups/redox-os/-/issues/?label_name[]=tracking%20issue)
## RFCs
For more significant changes that affect Redox's architecture, we use the [Request for Comments](https://gitlab.redox-os.org/redox-os/rfcs) repository.
## Build System
To download the build system use the following commands:
(You need to have [curl](https://curl.se/) installed on your system)
```sh
curl -sf https://gitlab.redox-os.org/redox-os/redox/raw/master/podman_bootstrap.sh -o podman_bootstrap.sh
```
```sh
time bash -e podman_bootstrap.sh
```
To start the compilation of the default recipes run the command below:
```sh
make all
```
In case your operating system does not use SELinux, you must set the `USE_SELINUX` to `0` when calling `make all`, otherwise you might experience errors:
```sh
make all USE_SELINUX=0
```
You can find the build system organization and commands on the [Build System](https://doc.redox-os.org/book/build-system-reference.html) page.
## Developer FAQ
You can see the most common questions and problems on the [Developer FAQ](https://doc.redox-os.org/book/developer-faq.html) page.
## Porting Software
You can read how to use the Cookbook recipe system to port applications on the [Application Porting](https://doc.redox-os.org/book/porting-applications.html) page.
**Always verify if a recipe for your program or library already exist before porting to not break the build system with a recipe duplication or waste time.**
## Libraries and APIs
You can read the [Libraries and APIs](https://doc.redox-os.org/book/libraries-apis.html) page to learn about the libraries and APIs used in Redox.
## Visual Studio Code (VS Code) Configuration
To learn how to configure your VS Code to do Redox development please read the information below the [Visual Studio Code Configuration](https://doc.redox-os.org/book/coding-and-building.html#visual-studio-code-configuration) section.
## References
We maintain a list of wikis, articles and videos to learn Rust, OS development and computer science on the [References](https://doc.redox-os.org/book/references.html) page.
If you are skilled/experienced there's still a possibility that they could improve your knowledge in some way.
## Other Ways to Contribute
If you aren't good on coding, but you still want to help keep the project going, you can contribute and support in a variety of ways! We'll try to find a way to use anything you have to offer.
### Design
If you're a good designer, whether it's 2D graphics, 3D graphics, interfaces, web design, you can help. We need logos, UI design, UI skins, app icons, desktop backgrounds, etc.
- [Redox backgrounds](https://gitlab.redox-os.org/redox-os/backgrounds) - You can send your wallpapers on this repository.
- [Redox assets](https://gitlab.redox-os.org/redox-os/assets) - You can send your logos, icons and themes on this repository.
If you have questions about the graphic design, ask us on the [Chat](https://doc.redox-os.org/book/chat.html).
### Donate to Redox
If you are interested in donating to the Redox OS Nonprofit, you can find instructions on the [Donate](https://www.redox-os.org/donate/) page.

1490
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,57 +0,0 @@
[package]
name = "redox_cookbook"
version = "0.1.0"
authors = ["Jeremy Soller <jackpot51@gmail.com>"]
edition = "2024"
default-run = "repo"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[[bin]]
name = "cookbook_redoxer"
path = "src/bin/cookbook_redoxer.rs"
[[bin]]
name = "repo"
path = "src/bin/repo.rs"
[[bin]]
name = "repo_builder"
path = "src/bin/repo_builder.rs"
[lib]
name = "cookbook"
path = "src/lib.rs"
doctest = false
[features]
#TODO: Actually make without tui feature works
default = ["tui"]
tui = ["ratatui", "ansi-to-tui", "strip-ansi-escapes"]
[dependencies]
blake3 = "1"
globset = "0.4"
libc = "0.2"
ignore = "0.4"
object = { version = "0.38", features = ["build_core"] }
pkgar = { git = "https://gitlab.redox-os.org/redox-os/pkgar.git" }
pkgar-core = { git = "https://gitlab.redox-os.org/redox-os/pkgar.git" }
pkgar-keys = { git = "https://gitlab.redox-os.org/redox-os/pkgar.git" }
redox-pkg = { git = "https://gitlab.redox-os.org/redox-os/pkgutils.git", default-features = false }
redox_installer = { git = "https://gitlab.redox-os.org/redox-os/installer.git", default-features = false }
redoxer = { git = "https://gitlab.redox-os.org/redox-os/redoxer.git", default-features = false }
regex = "1.11"
serde = { version = "1", features = ["derive"] }
termion = "4"
toml = "0.8"
walkdir = "2.3.1"
ansi-to-tui = { version = "8", optional = true }
strip-ansi-escapes = { version = "0.2.1", optional = true }
serde_json = "1"
[dependencies.ratatui]
version = "0.30"
default-features = false
features = ["termion"]
optional = true

View File

@ -1,136 +0,0 @@
# Hardware Compatibility
This document tracks the current hardware compatibility of Redox OS.
- [Why are hardware reports needed?](#why-are-hardware-reports-needed)
- [What if my computer is customized?](#what-if-my-computer-is-customized)
- [Status](#status)
- [Contribute to this document](#contribute-to-this-document)
- [Template](#template)
- [Table row ordering](#table-row-ordering)
- [Recommended](#recommended)
- [Booting](#booting)
- [Broken](#broken)
## Why are hardware reports needed?
Each computer model has different hardware interfaces, firmware implementations, and devices, which can cause the following problems:
- Boot bugs
- Lack of device support
- Performance degradation
These reports helps us to fix the problems above, your report may help to fix many computers affected by the same bugs or missing drivers.
## What if my computer is customized?
If your desktop is customized (common) you should use the "Custom" word on the "Vendor" category and insert the motherboard and CPU vendor/model in the "Model" category.
A customized laptop should only be reported if you replaced the original CPU, report the CPU vendor and model in the "Model" category.
We also recommend to add your `pciutils` log as a comment on [this](https://gitlab.redox-os.org/redox-os/redox/-/issues/1797) tracking issue to help us with probable device porting.
## Status
The following limitations apply to any status.
- ACPI support is incomplete (some things are hardcoded in the kernel to work)
- Wi-Fi and Bluetooth aren't supported yet
- Only Intel GPUs are supported, other GPU vendors use BIOS VESA or UEFI GOP
- I2C devices aren't supported yet (PS/2 or USB devices should be used)
- USB support varies on each device model because some USB devices require specific drivers (use input devices with standardized controls for more compatibility)
- Automatic operating system discovery is not implemented in the boot loader yet (remember this before installing Redox)
### Recommended
This status is used when the operating system boots with video, sound, PS/2 or USB input, Ethernet, terminal and Orbital working.
### Booting
This status is used when the operating system successfully boot with some issues or lacking hardware support (write the issues and what supported hardware is not working in the "Report" section).
### Broken
This status is used when the boot loader or system boot doesn't work.
## Contribute to this document
To contribute to this document, learn how to create your GitLab account, follow the project-wide contribution guidelines and suggestions, please refer to the [CONTRIBUTING.md](./CONTRIBUTING.md) document.
### Template
You will use this template to insert your computer on the table.
```
| | | | | | | | |
```
The Redox image date should use the [ISO format](https://en.wikipedia.org/wiki/ISO_8601)
### Table row ordering
New reports should use an independent alphabetical order in the "Vendor" and "Model" table rows, for example:
```
| ASUS | ROG g55vw |
| ASUS | X554L |
| System76 | Galago Pro (galp5) |
| System76 | Lemur Pro (lemp9) |
```
A comes before S, R comes before X, G comes before L
Each "Vendor" has its own alphabetical order in "Model", independent from models from other vendor.
## Recommended
| **Vendor** | **Model** | **Redox Version** | **Image Date** | **Variant** | **CPU Architecture** | **Motherboard Firmware** | **Report** |
|------------|-----------|-------------------|----------------|-------------|----------------------|--------------------------|------------|
| Lenovo | IdeaPad Y510P | 0.8.0 | 2022-11-11 | desktop | x86-64 | BIOS, UEFI | Boots to Orbital |
| System76 | Galago Pro (galp5) | 0.8.0 | 2022-11-11 | desktop | x86-64 | UEFI | Boots to Orbital |
| System76 | Lemur Pro (lemp9) | 0.8.0 | 2022-11-11 | desktop | x86-64 | UEFI | Boots to Orbital |
## Booting
| **Vendor** | **Model** | **Redox Version** | **Image Date** | **Variant** | **CPU Architecture** | **Motherboard Firmware** | **Report** |
|------------|-----------|-------------------|----------------|-------------|----------------------|--------------------------|------------|
| ASUS | Eee PC 900 | 0.8.0 | 2022-11-11 | desktop | i686 | BIOS | Boots to Orbital, No ethernet driver, Correct video mode not offered (firmware issue) |
| ASUS | PRIME B350M-E (custom) | 0.9.0 | 2024-09-20 | desktop | x86-64 | UEFI | Partial support for the PS/2 keyboard, PS/2 mouse is broken |
| ASUS | ROG g55vw | 0.8.0 | 2023-11-11 | desktop | x86-64 | BIOS | Boots to Orbital, UEFI panic in SETUP |
| ASUS | X554L | 0.8.0 | 2022-11-11 | desktop | x86-64 | BIOS | Boots to Orbital, No audio, HDA driver cannot find output pins |
| ASUS | Vivobook 15 OLED (M1503Q) | 0.9.0 | 2025-08-04 | desktop | x86-64 | UEFI | Boots to Orbital, touchpad and usb do not work, cannot connect to the internet, right maximum display resolution 2880x1620 |
| Dell | XPS 13 (9350) | 0.8.0 | 2022-11-11 | desktop | i686 | BIOS | Boots to Orbital, NVMe driver livelocks |
| Dell | XPS 13 (9350) | 0.8.0 | 2022-11-11 | desktop | x86-64 | BIOS, UEFI | Boots to Orbital, NVMe driver livelocks |
| Dell | XPS L502X | 0.9.0 | 2026-05-01 | desktop | x86-64 | BIOS | Does not find the bootloader without patching the partition type byte to FAT32 (LBA), Boots to orbital with the patch in live mode, The entire system freezes after the orblogin screen appears unless recompiling the kernel without ACPI support, almost everything works out of box when using the kernel without ACPI, except the touchpad scrolling, WiFi and Intel graphics |
| HP | Dev One | 0.8.0 | 2022-11-11 | desktop | x86-64 | UEFI | Boots to Orbital, No touchpad support, requires I2C HID |
| HP | EliteBook Folio 9480M | 0.9.0 | 2025-11-04 | desktop | x86-64 | UEFI | Boots to Orbital, touchpad and usb work, cannot connect to the Internet, install failed, right maximum display resolution 1600x900
| Lenovo | Thinkbook 14 Gen 2 ARE (AMD Ryzen Edition) Laptop | 0.9.0 | 2026-05-02 | desktop | x86-64 | UEFI | Boots to Orbital, but trackpad and USB mouse doesn't work so unable to test further |
| Lenovo | ThinkPad Yoga 260 Laptop - Type 20FE | 0.9.0 | 2024-09-07 | demo | x86-64 | UEFI | Boots to Orbital, No audio |
| Lenovo | Yoga S730-13IWL | 0.9.0 | 2024-11-09 | desktop | x86-64 | UEFI | Boots to Orbital, No trackpad or USB mouse input support |
| Lenovo | Ideapad 710S-13IKB | 0.9.0 | 2026-02-12 | demo | x86-64 | UEFI | Boots to Orbital, No trackpad or USB mouse input support |
| Raspberry Pi | 3 Model B+ | 0.8.0 | Unknown | server | ARM64 | U-Boot | Boots to UART serial console (pl011) |
| Samsung | Series 3 (NP350V5C) | 0.9.0 | 2025-08-04 | desktop | x86-64 | UEFI | Boots to Orbital, touchpad works, USB does not work, can connect to the Internet through LAN. Wrong maximum display resolution 1024x768 |
| System76 | Oryx Pro (oryp10) | 0.8.0 | 2022-11-11 | desktop | x86-64 | UEFI | Boots to Orbital, No touchpad support, though it should be working |
| System76 | Pangolin (pang12) | 0.8.0 | 2022-11-11 | desktop | x86-64 | UEFI | Boots to Orbital, No touchpad support, requires I2C HID |
| Toshiba | Satellite L500 | 0.8.0 | 2022-11-11 | desktop | x86-64 | BIOS | Boots to Orbital, No Ethernet driver, Correct video mode not offered (firmware issue) |
## Broken
| **Vendor** | **Model** | **Redox Version** | **Image Date** | **Variant** | **CPU Architecture** | **Motherboard Firmware** | **Report** |
|------------|-----------|-------------------|----------------|-------------|----------------------|--------------------------|------------|
| Apple | Mac Mini (Late 2012, Quad Core) | 0.9.0 | 2026-05-02 | desktop | x86-64 | EFI | Hangs after selecting boot device from boot menu, EFI 1.1 incompatibility? |
| ASUS | PN41 | 0.8.0 | 2024-05-30 | server | x86-64 | Unknown | Aborts after panic in xhcid |
| Asrock (Custom) | X570 Phantom Gaming 4 (Ryzen 3600) | 2026-05-02 | desktop | x86-64 | UEFI | Not recognised as a UEFI boot disk, have to boot in CSM mode. Bootloader fails with a panic |
| BEELINK | U59 | 0.8.0 | 2024-05-30 | server | x86-64 | Unknown | Aborts after panic in xhcid |
| Framework | Laptop 16 (AMD Ryzen 7040 Series) | 0.9.0 | 2026-3-29 | desktop, demo | x86-64 | UEFI | Crash due to unimplemented acpi function, see [jackpot51/acpi #3](https://github.com/jackpot51/acpi/pull/3) on GitHub |
| Dell | Latitude D600 | 0.9.0 | 2026-01-25 | desktop | i586 | BIOS | Some kernel messages displayed, then locks up |
| HP | Compaq nc6120 | 0.9.0 | 2024-11-08 | desktop, server | i686 | BIOS | Unloads into memory at a rate slower than 1MB/s after selecting resolution. When unloading is complete the logger initializes and crashes after kernel::acpi, some information about APIC is printed. Boot logs do not progress after this point. |
| HP | EliteBook 2570p | 0.8.0 | 2022-11-23 | demo | x86-64 | BIOS (CSM mode?) | Gets to resolution selection, Fails assert in `src/os/bios/mod.rs:77` after selecting resolution |
| Lenovo | G570 | 0.8.0 | 2022-11-11 | desktop | x86-64 | BIOS | Bootloader panics in `alloc_zeroed_page_aligned`, Correct video mode not offered (firmware issue) |
| Lenovo | IdeaPad Y510P | 0.8.0 | 2022-11-11 | desktop | i686 | BIOS | Panics on `phys_to_virt overflow`, probably having invalid mappings for 32-bit |
| Lenovo | ThinkPad X1 20KH-002 | 0.9.0 | 2026-02-11 | server | x86-64 | UEFI | Boots once after build but not a second time, fails in ps2d |
| Lenovo | ThinkCentre M83 | 0.9.0 | 2025-11-09 | desktop | x86_64 | UEFI | Presents user with a set of display resolution options. After user selects an option, it takes a long time for the "live" thing to load all the way to 647MiB. Once it does reach 647MiB, however, it dumps a bunch of logs onto the screen. Those logs also happen to be offset so that the leftmost portion of all text "exists" past the leftmost part of the screen, resulting in the logs being only partially visible. The logs appear to include (among other things) 1. "thread 'main' (1) panicked at acpid/src/acpi.rs:256:68: Called `Result::unwrap()` on an `Err` value: Aml(NoCurrentOp)"; 2. "thread 'main' (1) panicked at acpid/src/main.rs:147:39:acpid: failed to daemonize: Error `I/O error` 5"; 3. "... [@hwd:40 ERROR] failed to probe with error No such device (os error 19)..."; etc. |
| Panasonic | Toughbook CF-18 | 0.8.0 | 2022-11-11 | desktop | i686 | BIOS | Hangs after PIT initialization |
| Toshiba | Satellite L500 | 0.8.0 | 2022-11-11 | desktop | i686 | BIOS | Correct video mode not offered (firmware issue), Panics on `phys_to_virt overflow`, probably having invalid mappings for 32-bit |
| Unbranded | VIA C3 CPU | 0.9.0 | 2026-01-25 | desktop | i586 | BIOS | Some kernel messages displayed, then locks up |
| XMG (Schenker) | Apex 17 (M21) | 0.9.0 | 2024-09-30 | demo, server | x86-64 | UEFI | After selecting resolution, (release) repeats `...::interrupt::irq::ERROR -- Local apic internal error: ESR=0x40` a few times before it freezes; (daily) really slowly prints statements from `...::rmm::INFO` before it abruptly aborts |

178
Makefile
View File

@ -1,152 +1,72 @@
# This file contains the build system commands configuration
# and environment variables
# Configuration and variables
include mk/config.mk
# Build system dependencies
include mk/depends.mk
all: build/harddrive.bin
all: $(BUILD)/harddrive.img
live: build/livedisk.bin
live:
-$(FUMOUNT) $(BUILD)/filesystem/ || true
-$(FUMOUNT) /tmp/redox_installer/ || true
rm -f $(BUILD)/redox-live.iso
$(MAKE) $(BUILD)/redox-live.iso
popsicle: $(BUILD)/redox-live.iso
popsicle-gtk $(BUILD)/redox-live.iso
image:
-$(FUMOUNT) $(BUILD)/filesystem/ || true
-$(FUMOUNT) /tmp/redox_installer/ || true
rm -f $(BUILD)/harddrive.img $(BUILD)/redox-live.iso
$(MAKE) all
rebuild:
-$(FUMOUNT) $(BUILD)/filesystem/ || true
-$(FUMOUNT) /tmp/redox_installer/ || true
rm -rf $(BUILD)/repo.tag $(BUILD)/harddrive.img $(BUILD)/redox-live.iso
$(MAKE) all
# To tell that it's not safe
# to execute the cookbook binary
NOT_ON_PODMAN?=0
iso: build/livedisk.iso
clean:
ifeq ($(PODMAN_BUILD),1)
ifneq ("$(wildcard $(CONTAINER_TAG))","")
$(PODMAN_RUN) make $@
else
$(info will not run cookbook clean as container is not built)
$(MAKE) clean PODMAN_BUILD=0 NOT_ON_PODMAN=1 SKIP_CHECK_TOOLS=1
endif # CONTAINER_TAG
else
ifneq ($(NOT_ON_PODMAN),1)
$(MAKE) repo_clean
-$(FUMOUNT) $(BUILD)/filesystem/ || true
-$(FUMOUNT) /tmp/redox_installer/ || true
endif # NOT_ON_PODMAN
rm -rf repo
rm -rf $(BUILD) $(PREFIX)
$(MAKE) fstools_clean
endif # PODMAN_BUILD
distclean:
ifeq ($(PODMAN_BUILD),1)
ifneq ("$(wildcard $(CONTAINER_TAG))","")
$(PODMAN_RUN) make $@
else
$(info will not run cookbook unfetch as container is not built)
$(MAKE) distclean PODMAN_BUILD=0 NOT_ON_PODMAN=1 SKIP_CHECK_TOOLS=1
endif # CONTAINER_TAG
else
ifneq ($(NOT_ON_PODMAN),1)
$(MAKE) fetch_clean
endif # NOT_ON_PODMAN
$(MAKE) clean NOT_ON_PODMAN=1
endif # PODMAN_BUILD
cd cookbook && ./clean.sh
cargo clean --manifest-path cookbook/pkgutils/Cargo.toml
cargo clean --manifest-path installer/Cargo.toml
cargo clean --manifest-path kernel/Cargo.toml
cargo clean --manifest-path redoxfs/Cargo.toml
-$(FUMOUNT) build/filesystem/ || true
rm -rf build
pull:
git pull
rm -f $(FSTOOLS_TAG)
git pull --rebase --recurse-submodules
git submodule sync
git submodule update --recursive --init
git clean -X -f -d
make clean
make update
repo: $(BUILD)/repo.tag
update:
cd cookbook; \
./update.sh "$$(cargo run --manifest-path ../installer/Cargo.toml -- --list-packages ../initfs.toml ../filesystem.toml)"
cargo update --manifest-path cookbook/pkgutils/Cargo.toml
cargo update --manifest-path installer/Cargo.toml
cargo update --manifest-path kernel/Cargo.toml
cargo update --manifest-path redoxfs/Cargo.toml
repo_clean: c.--all
fetch:
cd cookbook; \
./fetch.sh "$$(cargo run --manifest-path ../installer/Cargo.toml -- --list-packages ../initfs.toml ../filesystem.toml)"
fetch_clean: u.--all
# Emulation recipes
include mk/qemu.mk
include mk/bochs.mk
include mk/virtualbox.mk
# Podman build recipes and vars
include mk/podman.mk
# Kernel recipes
include mk/kernel.mk
# Disk Imaging and Cookbook tools
include mk/fstools.mk
# Cross compiler recipes
include mk/prefix.mk
# Repository maintenance
include mk/repo.mk
# Filesystem recipes
include mk/initfs.mk
include mk/filesystem.mk
# Disk images
include mk/disk.mk
# Emulation recipes
include mk/qemu.mk
include mk/virtualbox.mk
# CI
include mk/ci.mk
env: prefix FORCE $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
export PATH="$(PREFIX_PATH):$$PATH" && \
bash
endif
setenv: FORCE
@echo export ARCH='$(ARCH)'
@echo export BOARD='$(BOARD)'
@echo export CONFIG_NAME='$(CONFIG_NAME)'
@echo BUILD='$(BUILD)'
export RUST_GDB=gdb-multiarch # Necessary when debugging for another architecture than the host
GDB_KERNEL_FILE=recipes/core/kernel/target/$(TARGET)/build/kernel.sym
gdb: FORCE
rust-gdb $(GDB_KERNEL_FILE) --eval-command="target remote :1234"
# This target allows debugging a userspace application without requiring gdbserver running inside
# the VM. Because gdb doesn't know when the userspace application is scheduled by the kernel and as
# it stops the entire VM rather than just the userspace application that the user wants to debug,
# connecting to a gdbserver running inside the VM is highly encouraged when possible. This target
# should only be used when the application to debug runs early during boot before the network stack
# has started or you need to debug the interaction between the application and the kernel.
# tl;dr: DO NOT USE THIS TARGET UNLESS YOU HAVE TO
gdb-userspace: FORCE
rust-gdb $(GDB_APP_FILE) --eval-command="add-symbol-file $(GDB_KERNEL_FILE)" --eval-command="target remote :1234"
# Travis target
travis: FORCE
INSTALLER_FLAGS= make build/harddrive.bin.gz build/livedisk.iso
rm -rf build/travis
mkdir build/travis
mv build/harddrive.bin.gz build/travis/redox_$(TRAVIS_TAG).bin.gz
mv build/livedisk.iso build/travis/redox_$(TRAVIS_TAG).iso
cd build/travis && sha256sum -b redox_$(TRAVIS_TAG).bin.gz redox_$(TRAVIS_TAG).iso > SHA256SUM
# An empty target
FORCE:
# A method of creating a listing for any binary
%.list: %
objdump -C -M intel -D $< > $@
# Wireshark
wireshark: FORCE
wireshark $(BUILD)/network.pcap
KPROF_KERNEL_BINARY?=recipes/core/profiling-kernel/target/$(TARGET)/build/kernel
KPROF_KERNEL_SYM?=build/flamegraph/$(TARGET)-kernel-syms.txt
KPROF_OUTPUT_TXT?=build/$(ARCH)/$(CONFIG_NAME)/filesystem/home/root/kprof.txt
KPROF_PERF_SVG?=build/flamegraph/$(TARGET)-$(CONFIG_NAME)-kflamegraph.svg
# XXX: This assumes the TSC is invariant, that the value for cpu0 is the same as for all other CPUs, and that the value from ACPI actually reflects the TSC rate. It also only works on Linux.
KPROF_CPU_GHZ?=$(shell (cat /sys/devices/system/cpu/cpu0/acpi_cppc/nominal_freq || echo 3400) | xargs echo "0.001 *" | bc)
# See https://gitlab.redox-os.org/redox-os/kprofiling/-/blob/master/src/main.rs?ref_type=heads#L16-L18
# Set e.g. to "xo" to show individual instruction offsets
KPROF_OPTIONS?=_
flamegraph:
mkdir -p build/flamegraph && \
make mount && \
nm -CS $(KPROF_KERNEL_BINARY) >$(KPROF_KERNEL_SYM) && \
redox-kprofiling $(KPROF_OUTPUT_TXT) $(KPROF_KERNEL_SYM) $(KPROF_OPTIONS) $(KPROF_CPU_GHZ) | inferno-collapse-perf | inferno-flamegraph > $(KPROF_PERF_SVG) && \
make unmount
wireshark build/network.pcap

201
README.md
View File

@ -1,62 +1,173 @@
<p align="center">
<img alt="Redox" width="346" src="https://gitlab.redox-os.org/redox-os/assets/raw/master/logos/redox/logo.png">
<img alt="Redox" width="346" src="https://github.com/redox-os/assets/raw/master/logos/redox/logo.png">
</p>
This repository is the **Build System** for Redox OS.
**Redox** is an operating system written in Rust, a language with focus on safety and high performance. Redox, following the microkernel design, aims to be secure, usable, and free. Redox is inspired by previous kernels and operating systems, such as SeL4, Minix, Plan 9, and BSD.
Redox is under active development by a vibrant community, you can see the key links below:
Redox _is not_ just a kernel, it's a **full-featured Operating System**, providing packages (memory allocator, file system, display manager, core utilities, etc.) that together make up a functional and convenient operating system. You can loosely think of it as the GNU or BSD ecosystem, but in a memory safe language and with modern technology. See [this list](#ecosystem) for overview of the ecosystem.
- [The **main website** for Redox OS](https://www.redox-os.org).
- [The Redox Book](https://doc.redox-os.org/book/) and [Build Instructions](https://doc.redox-os.org/book/podman-build.html).
- [Redox Chat and Support](https://matrix.to/#/#redox-join:matrix.org).
- [Patreon](https://www.patreon.com/redox_os), [Donate](https://redox-os.org/donate/) and [Merch](https://redox-os.creator-spring.com/).
- Scroll down for a list of key Redox components and their repositories.
The website can be found at https://www.redox-os.org.
[Redox](https://www.redox-os.org) is an open-source operating system written in Rust, a language with focus on safety, efficiency and high performance. Redox uses a microkernel architecture, and aims to be reliable, secure, usable, correct, and free. Redox is inspired by previous operating systems, such as seL4, MINIX, Plan 9, Linux and BSD.
Please make sure you use the **latest nightly** of `rustc` before building (for more troubleshooting, see ["Help! Redox won't compile!"](#compile-help)).
Redox _is not_ just a kernel, it's a **full-featured operating system**, providing components (file system, display server, core utilities, etc.) that together make up a functional and convenient operating system. Redox uses the COSMIC desktop apps, and provides source code compatibility with many Rust, Linux and BSD programs.
[![Travis Build Status](https://travis-ci.org/redox-os/redox.svg?branch=master)](https://travis-ci.org/redox-os/redox)
[![Downloads](https://img.shields.io/github/downloads/redox-os/redox/total.svg)](https://github.com/redox-os/redox/releases)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.md)
![Rust Version](https://img.shields.io/badge/rust-nightly%202017--08--26-lightgrey.svg)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
## Contents
## More Links
* [What it looks like](#screenshots)
* [Ecosystem](#ecosystem)
* [Help! Redox won't compile](#compile-help)
* [Contributing to Redox](#contributing)
* [Cloning, Building and running](#cloning-building-running)
* [Quick Setup](#quick-setup)
* [Manual Setup](#manual-setup)
* [Setup Using Docker](#setup-using-docker)
- [Book](https://doc.redox-os.org/book/)
- [Contribute](CONTRIBUTING.md)
- [Hardware Compatibility](https://doc.redox-os.org/book/hardware-support.html)
- Run Redox in a [Virtual Machine](https://doc.redox-os.org/book/running-vm.html) or on [Real Hardware](https://doc.redox-os.org/book/real-hardware.html)
- [Trying Out Redox](https://doc.redox-os.org/book/trying-out-redox.html)
- [Building Redox](https://doc.redox-os.org/book/podman-build.html)
- [Build System Documentation](https://doc.redox-os.org/book/build-system-reference.html)
- [Developer FAQ](https://doc.redox-os.org/book/developer-faq.html)
- [Chat/Discussions/Help](https://doc.redox-os.org/book/chat.html)
## <a name="screenshots"> What it looks like </a>
## Ecosystem
<img alt="Redox" height="150" src="https://github.com/redox-os/assets/raw/master/screenshots/Senza%20titolo.jpeg">
<img alt="Redox" height="150" src="https://github.com/redox-os/assets/raw/master/screenshots/redox running.jpeg">
<img alt="Redox" height="150" src="https://github.com/redox-os/assets/raw/master/screenshots/IMG_1460.PNG">
Some of the key repositories on the Redox GitLab:
<img alt="Redox" height="150" src="https://github.com/redox-os/assets/raw/master/screenshots/Sodium_v1.png">
<img alt="Redox" height="150" src="https://github.com/redox-os/assets/raw/master/screenshots/Boot.png">
<img alt="Redox" height="150" src="https://github.com/redox-os/assets/raw/master/screenshots/IMG_1459.PNG">
| Essential Repositories | Maintainer
|-------------------------------------------------------------------------------------------------------------|---------------------------
| [Kernel](https://gitlab.redox-os.org/redox-os/kernel) | **@jackpot51**
| [Base (essential system components and drivers)](https://gitlab.redox-os.org/redox-os/base) | **@jackpot51**
| [RedoxFS (default filesystem)](https://gitlab.redox-os.org/redox-os/redoxfs) | **@jackpot51**
| [relibc (C POSIX library written in Rust)](https://gitlab.redox-os.org/redox-os/relibc) | **@jackpot51**
| [Ion (defauilt shell)](https://gitlab.redox-os.org/redox-os/ion) | **@jackpot51**
| [Termion (terminal library)](https://gitlab.redox-os.org/redox-os/termion) | **@jackpot51**
| [pkgutils (current package manager)](https://gitlab.redox-os.org/redox-os/pkgutils) | **@jackpot51**
| [Orbital (display server and window manager)](https://gitlab.redox-os.org/redox-os/orbital) | **@jackpot51**
| This repo - the root of the Build System | **@jackpot51** **@hatred_45**
| [Redoxer (tool for easy Redox development on Linux)](https://gitlab.redox-os.org/redox-os/redoxer) | **@jackpot51**
| [The Redox Book](https://gitlab.redox-os.org/redox-os/book) | **@jackpot51** **@hatred_45**
| [Website](https://gitlab.redox-os.org/redox-os/website) | **@jackpot51** **@hatred_45**
## <a name="ecosystem"> Ecosystem </a>
## What it looks like
The ecosystem and software Redox OS provides is listed below.
See [Redox in Action](https://www.redox-os.org/screens/) for photos and videos.
| Name (lexicographic order) | Maintainer
|-----------------------------------------------------------------------------|---------------------------
| [acid (kernel integration tests)](https://github.com/redox-os/acid) | [**@jackpot51**](https://github.com/jackpot51) (co.: [**@ticki**](https://github.com/ticki), [**@nilset](https://github.com/nilset))
| [binutils](https://github.com/redox-os/binutils) | [**@ticki**](https://github.com/ticki)
| [bots (custom Mattermost bots)](https://github.com/redox-os/bots) | [**@ticki**](https://github.com/ticki)
| [cookbook](https://github.com/redox-os/cookbook) | [**@jackpot51**](https://github.com/jackpot51)
| [coreutils](https://github.com/redox-os/coreutils) | [**@ticki**](https://github.com/ticki) (co.: [**@stratact**](https://github.com/stratact))
| [extrautils](https://github.com/redox-os/extrautils) | [**@ticki**](https://github.com/ticki)
| [games](https://github.com/redox-os/games) | [**@ticki**](https://github.com/ticki)
| [Ion (shell)](https://github.com/redox-os/ion) | [**@skylerberg**](https://github.com/skylerberg) & [**@jackpot51**](https://github.com/jackpot51)
| [kernel](https://github.com/redox-os/kernel) | [**@jackpot51**](https://github.com/jackpot51)
| [libextra](https://github.com/redox-os/libextra) | [**@ticki**](https://github.com/ticki)
| [libpager](https://github.com/redox-os/libpager) | [**@ticki**](https://github.com/ticki)
| [libstd (Redox standard library)](https://github.com/redox-os/libstd) | [**@jackpot51**](https://github.com/jackpot51)
| [netutils](https://github.com/redox-os/netutils) | [**@jackpot51**](https://github.com/jackpot51)
| [orbclient (Orbital client)](https://github.com/redox-os/orbclient) | [**@jackpot51**](https://github.com/jackpot51)
| [orbdata](https://github.com/redox-os/orbdata) | [**@jackpot51**](https://github.com/jackpot51)
| [Orbital (windowing and compositing system)](https://github.com/redox-os/orbital) | [**@jackpot51**](https://github.com/jackpot51)
| [orbtk (Orbital toolkit)](https://github.com/redox-os/orbtk) | [**@stratact**](https://github.com/stratact)
| [orbutils (Orbital utilities)](https://github.com/redox-os/orbutils) | [**@jackpot51**](https://github.com/jackpot51)
| [pkgutils (current package manager)](https://github.com/redox-os/pkgutils) | [**@jackpot51**](https://github.com/jackpot51)
| [playbot (internal REPL bot)](https://github.com/redox-os/playbot) | [**@ticki**](https://github.com/ticki)
| [ralloc](https://github.com/redox-os/ralloc) | [**@ticki**](https://github.com/ticki)
| [RANSID (Rust ANSI driver)](https://github.com/redox-os/ransid) | [**@jackpot51**](https://github.com/jackpot51)
| [redoxfs (old filesystem)](https://github.com/redox-os/redoxfs) | [**@jackpot51**](https://github.com/jackpot51)
| [syscall](https://github.com/redox-os/syscall) | [**@jackpot51**](https://github.com/jackpot51)
| [Sodium (Vim-inspired text editor)](https://github.com/redox-os/sodium) | [**@ticki**](https://github.com/ticki)
| [userutils](https://github.com/redox-os/userutils) | [**@jackpot51**](https://github.com/jackpot51)
| [TFS (ticki filesystem)](https://github.com/ticki/tfs) | [**@ticki**](https://github.com/ticki)
| [The Redox book](https://github.com/redox-os/book) | [**@ticki**](https://github.com/ticki)
| [The old kernel](https://github.com/redox-os/old) | **abandoned**
| [ZFS](https://github.com/redox-os/zfs) | **abandoned, superseded by [TFS](https://github.com/ticki/tfs)**
<img alt="Redox" height="150" src="https://gitlab.redox-os.org/redox-os/website/-/raw/master/static/img/screenshot/orbital-visual.png">
<img alt="Redox" height="150" src="https://gitlab.redox-os.org/redox-os/website/-/raw/master/static/img/screenshot/cosmic-programs.png">
<img alt="Redox" height="150" src="https://gitlab.redox-os.org/redox-os/website/-/raw/master/static/img/screenshot/cosmic-term-screenfetch.png">
## <a name="compile-help"> Help! Redox won't compile! </a>
<img alt="Redox" height="150" src="https://gitlab.redox-os.org/redox-os/website/-/raw/master/static/img/screenshot/cosmic-edit-redox.png">
<img alt="Redox" height="150" src="https://gitlab.redox-os.org/redox-os/website/-/raw/master/static/img/screenshot/image-viewer.png">
<img alt="Redox" height="150" src="https://gitlab.redox-os.org/redox-os/assets/raw/master/screenshots/Boot.png">
Sometimes things go wrong when compiling. Try the following before opening an issue:
1. Make sure you have a redox toolchain (`x86_64-unknown-redox-gcc`).
* You can install from .deb packages(`https://static.redox-os.org/toolchain/apt/`) or build [redox-os/libc](https://github.com/redox-os/libc) manually.
1. Run `rustup update`
1. Run `make clean pull`.
1. Make sure you have **the latest version of Rust nightly!** ([rustup.rs](https://www.rustup.rs) is recommended for managing Rust versions. If you already have it, run `rustup`).
1. Update **GNU Make**, **NASM** and **QEMU/VirtualBox**.
1. Pull the upstream master branch (`git remote add upstream git@github.com:redox-os/redox.git; git pull upstream master`).
1. Update submodules (`git submodule update --recursive --init`).
and then rebuild!
## <a name="contributing"> Contributing to Redox </a>
If you're interested in this project, and you'd like to help us out, [here](CONTRIBUTING.md) is a list of ways you can do just that.
## <a name="cloning-building-running"> Cloning, Building and Running </a>
Redox is big, even compressed. Downloading the full history may take a lot of bandwidth, and can even be costly on some data plans. Clone at your own risk!
### <a name="quick-setup" /> Quick Setup </a>
```bash
$ cd path/to/your/projects/folder/
# Run bootstrap setup
$ curl -sf https://raw.githubusercontent.com/redox-os/redox/master/bootstrap.sh -o bootstrap.sh && bash -e bootstrap.sh
#Change to project directory
$ cd redox
# Build Redox
$ make all
# Launch using QEMU
$ make qemu
# Launch using QEMU without using KVM (Kernel Virtual Machine). Try if QEMU gives an error.
$ make qemu kvm=no
```
#### QEMU with KVM
To use QEMU with KVM (kernel-based virtual Machine), which is faster than without KVM, you need a CPU with Intel® Virtualization Technology (Intel® VT) or AMD Virtualization™ (AMD-V™) support. Most systems have this disabled by default, so you may need to reboot, go into the BIOS, and enable it.
### <a name="manual-setup"> Manual Setup </a>
To manually clone, build and run Redox using a Unix-based host, run the following commands (with exceptions, be sure to read the comments):
```bash
$ cd path/to/your/projects/folder/
# HTTPS
$ git clone https://github.com/redox-os/redox.git --origin upstream --recursive
# SSH
$ git clone git@github.com:redox-os/redox.git --origin upstream --recursive
$ cd redox/
# Install/update dependencies
$ ./bootstrap.sh -d
# Install rustup.rs
$ curl https://sh.rustup.rs -sSf | sh
# Set override toolchain to nightly build
$ rustup override set nightly
# For successive builds start here. If this is your first build, just continue
# Update git submodules
$ git submodule update --recursive --init
# Build Redox
$ make all
# Launch using QEMU
$ make qemu
# Launch using QEMU without using KVM (Kernel Virtual Machine). Try if QEMU gives an error.
$ make qemu kvm=no
# Launch using QEMU without using KVM (Kernel Virtual Machine) nor Graphics
make qemu kvm=no vga=no
```
### <a name="setup-using-docker"> Setup using Docker </a>
We also provide docker image. After cloning this repository, please follow README under the `docker` directory.
### Updating the codebase using the Makefile
To update the codebase run:
```
make pull; make fetch
```
`make pull` pulls and updates the submodules, and `make fetch` updates the sources for cookbook recipes.

View File

@ -1,39 +0,0 @@
# Redox OS Trademark Policy
This document outlines the policy regarding the use of the Redox OS trademark owned by the Redox OS nonprofit. The purpose of this policy is to ensure that the Redox OS trademark is used correctly and consistently, maintaining the integrity and reputation of the Redox OS brand.
1. Usage of the Redox OS Trademark
1. The Redox OS trademark includes, but is not limited to, the name "Redox OS", the Redox OS logo, and any associated symbols or designs.
2. The Redox OS trademark may only be used in accordance with this policy. Unauthorized use of the trademark is prohibited.
2. Permissible Use
1. Community Projects: Community projects may use the Redox OS trademark to refer to the operating system, provided that such use is not misleading and does not imply endorsement by the Redox OS nonprofit without explicit permission.
2. Educational and Informational Use: The Redox OS trademark may be used in educational and informational materials, including books, websites, and articles, to refer to the operating system, provided that such use complies with the guidelines set forth in this policy.
3. Marketing and Promotional Use: Partners and affiliates of the Redox OS nonprofit may use the Redox OS trademark in marketing and promotional materials with prior written consent from the Redox OS nonprofit.
3. Prohibited Use
1. Misrepresentation: The Redox OS trademark must not be used in a way that misrepresents or implies false association with, endorsement by, or sponsorship from the Redox OS nonprofit.
2. Modification: The Redox OS trademark must not be altered, modified, or used as part of another trademark or logo without prior written permission from the Redox OS nonprofit.
3. Merchandising: The Redox OS trademark must not be used on merchandise (e.g., T-shirts, mugs) for commercial purposes without explicit authorization from the Redox OS nonprofit.
4. Logo Usage Guidelines
1. The Redox OS logo must be used as provided by the Redox OS nonprofit without any modifications. This includes maintaining the logos colors, proportions, and overall design.
2. The Redox OS logo must be displayed in a manner that is clear and legible. Sufficient clear space should be maintained around the logo to ensure it is not crowded by other visual elements.
3. The Redox OS name should be identified as a trademark using the “™” symbol.
5. Official Redox OS Software
1. Software hosted at [the Redox OS GitLab group](https://gitlab.redox-os.org/redox-os/) is considered official Redox OS software. Only software that has been approved by the Redox OS nonprofit is permitted to use the Redox OS trademarks to refer to itself. Software that is official Redox OS software may use the “redox-os-” package namespace and “org.redox_os.” prefixed reverse-DNS ID. Other software should avoid using these prefixes.
2. Third-party software that integrates with or extend the Redox OS operating system must not use the Redox OS trademark in a way that implies official status or endorsement without prior approval from the Redox OS nonprofit. Third-party developers are encouraged to use the "redox-os-ext-" package namespace. This software may be described as "for the Redox OS™ operating system".
3. Third-party software may request inclusion as official Redox OS software. To request inclusion, please contact the Redox OS nonprofit at trademark@redox-os.org.
6. Request for Permission
1. To request permission for uses of the Redox OS trademark not covered by this policy, please contact the Redox OS nonprofit at trademark@redox-os.org.
2. All requests will be reviewed on a case-by-case basis, and the Redox OS nonprofit reserves the right to grant or deny permission at its sole discretion.
7. Enforcement
1. The Redox OS nonprofit reserves the right to take appropriate legal action against any unauthorized use of the Redox OS trademark.
2. The Redox OS nonprofit may, at its discretion, require the cessation of use of the Redox OS trademark by any party that fails to comply with this policy.
## Contact Information
For any questions or to request permission to use the Redox OS trademark, please contact:<br><br>
Redox OS<br>
trademark@redox-os.org<br><br>
This trademark policy is effective as of December 3, 2025 and may be updated from time to time at the discretion of the Redox OS nonprofit.
---
By adhering to these guidelines, you help us protect the Redox OS brand and ensure it remains a symbol of quality and innovation. Thank you for your cooperation.

View File

@ -1 +0,0 @@
x86_64-unknown-redox-llvm-config

View File

@ -1,12 +0,0 @@
#!/usr/bin/env bash
export PKG_CONFIG_SYSROOT_DIR="${COOKBOOK_SYSROOT}"
export PKG_CONFIG_LIBDIR="${PKG_CONFIG_SYSROOT_DIR}/lib/pkgconfig"
export PKG_CONFIG_PATH="${PKG_CONFIG_SYSROOT_DIR}/share/pkgconfig"
if [ -n "${COOKBOOK_DYNAMIC}" ]
then
exec pkg-config "$@"
else
exec pkg-config --static "$@"
fi

View File

@ -1,12 +0,0 @@
#!/usr/bin/env bash
export PKG_CONFIG_SYSROOT_DIR="${COOKBOOK_SYSROOT}"
export PKG_CONFIG_LIBDIR="${PKG_CONFIG_SYSROOT_DIR}/lib/pkgconfig"
export PKG_CONFIG_PATH="${PKG_CONFIG_SYSROOT_DIR}/share/pkgconfig"
if [ -n "${COOKBOOK_DYNAMIC}" ]
then
exec pkg-config "$@"
else
exec pkg-config --static "$@"
fi

View File

@ -1,12 +0,0 @@
#!/usr/bin/env bash
export PKG_CONFIG_SYSROOT_DIR="${COOKBOOK_SYSROOT}"
export PKG_CONFIG_LIBDIR="${PKG_CONFIG_SYSROOT_DIR}/lib/pkgconfig"
export PKG_CONFIG_PATH="${PKG_CONFIG_SYSROOT_DIR}/share/pkgconfig"
if [ -n "${COOKBOOK_DYNAMIC}" ]
then
exec pkg-config "$@"
else
exec pkg-config --static "$@"
fi

View File

@ -1,12 +0,0 @@
#!/usr/bin/env bash
export PKG_CONFIG_SYSROOT_DIR="${COOKBOOK_SYSROOT}"
export PKG_CONFIG_LIBDIR="${PKG_CONFIG_SYSROOT_DIR}/lib/pkgconfig"
export PKG_CONFIG_PATH="${PKG_CONFIG_SYSROOT_DIR}/share/pkgconfig"
if [ -n "${COOKBOOK_DYNAMIC}" ]
then
exec pkg-config "$@"
else
exec pkg-config --static "$@"
fi

View File

@ -1,103 +0,0 @@
#!/usr/bin/env python3
# This script wraps llvm-config that intended for cross compiling to Redox.
# Because we can't run llvm-config compiled to Redox, we wrap it here
# and filter out architectures that do not match the current $TARGET.
import os
import sys
import subprocess
LLVM_CONFIG = "/bin/llvm-config"
# name of (--targets-built, --components prefix, --libs prefix)
ARCH_MAP = {
"x86_64": ("X86", "x86", "X86"),
"i586": ("X86", "x86", "X86"),
"aarch64": ("AArch64", "aarch64", "AArch64"),
"riscv64gc": ("RISCV", "riscv", "RISCV"),
}
ALL_ARCH_COMPS = ["x86", "aarch64", "riscv"]
ALL_ARCH_LIBS = ["X86", "AArch64", "RISCV"]
def is_unwanted_arch(item, allowed_prefix, all_prefixes, is_lib=False):
matched_arch = None
for arch in all_prefixes:
# libraries e.g., -lLLVMX86CodeGen / libLLVMAArch64Desc.a
if is_lib and f"LLVM{arch}" in item:
matched_arch = arch
break
# components e.g., x86codegen, aarch64desc
elif not is_lib and item.startswith(arch):
matched_arch = arch
break
if matched_arch and matched_arch != allowed_prefix:
return True
return False
def main():
toolchain_path = os.environ.get("COOKBOOK_HOST_SYSROOT")
sysroot_path = os.environ.get("COOKBOOK_SYSROOT")
target_triple = os.environ.get("TARGET")
if not toolchain_path or not sysroot_path or not target_triple:
print("Error: COOKBOOK_HOST_SYSROOT or COOKBOOK_SYSROOT or TARGET not set", file=sys.stderr)
sys.exit(1)
target_arch = target_triple.split('-')[0] if target_triple else ""
mapped_archs = ARCH_MAP.get(target_arch)
target_built_name, comp_prefix, lib_prefix = mapped_archs
cmd = [toolchain_path + LLVM_CONFIG] + sys.argv[1:]
try:
result = subprocess.run(
cmd,
stdout=subprocess.PIPE,
stderr=sys.stderr,
check=False,
text=True
)
except FileNotFoundError:
print(f"Error: Could not find executable '{LLVM_CONFIG}'", file=sys.stderr)
sys.exit(1)
if result.returncode != 0:
sys.exit(result.returncode)
output = result.stdout.strip()
args_set = set(sys.argv[1:])
if "--bindir" in args_set:
output = toolchain_path + "/usr/bin"
elif "--targets-built" in args_set:
output = target_built_name
elif "--components" in args_set:
components = output.split()
filtered = [c for c in components if not is_unwanted_arch(c, comp_prefix, ALL_ARCH_COMPS, is_lib=False)]
output = " ".join(filtered)
elif "--libs" in args_set:
libs = output.split()
filtered = [l for l in libs if not is_unwanted_arch(l, lib_prefix, ALL_ARCH_LIBS, is_lib=True)]
output = " ".join(filtered)
# if "--ldflags" in args_set:
src = toolchain_path.rstrip(os.sep)
dst = sysroot_path.rstrip(os.sep)
output = output.replace(src, dst)
else:
src = toolchain_path.rstrip(os.sep)
dst = sysroot_path.rstrip(os.sep)
output = output.replace(src, dst)
print(output + '\n', end='')
if __name__ == "__main__":
main()

View File

@ -1,12 +0,0 @@
#!/usr/bin/env bash
export PKG_CONFIG_SYSROOT_DIR="${COOKBOOK_SYSROOT}"
export PKG_CONFIG_LIBDIR="${PKG_CONFIG_SYSROOT_DIR}/lib/pkgconfig"
export PKG_CONFIG_PATH="${PKG_CONFIG_SYSROOT_DIR}/share/pkgconfig"
if [ -n "${COOKBOOK_DYNAMIC}" ]
then
exec pkg-config "$@"
else
exec pkg-config --static "$@"
fi

14
bochs.x86_64 Normal file
View File

@ -0,0 +1,14 @@
ata0-master: type=disk, path="build/harddrive.bin", mode=flat
boot: disk
com1: enabled=1, mode=file, dev=build/serial.log
megs: 1024
magic_break: enabled=1
display_library: x, options="gui_debug"
log: -
debug: action=ignore
info: action=report
error: action=report
panic: action=ask
debugger_log: -

1
bootloader Submodule

@ -0,0 +1 @@
Subproject commit 59fd6fbcfe9adc7e5d0c0df58fe4e2e07df5f31b

537
bootstrap.sh Executable file
View File

@ -0,0 +1,537 @@
#! /bin/bash
##########################################################
# This function is simply a banner to introduce the script
##########################################################
banner()
{
echo "|------------------------------------------|"
echo "|----- Welcome to the redox bootstrap -----|"
echo "|------------------------------------------|"
}
###################################################################################
# This function takes care of installing a dependency via package manager of choice
# for building redox on MacOS.
# @params: $1 package manager
# $2 package name
# $3 binary name (optional)
###################################################################################
install_macos_pkg()
{
PKG_MANAGER=$1
PKG_NAME=$2
BIN_NAME=$3
if [ -z "$BIN_NAME" ]; then
BIN_NAME=$PKG_NAME
fi
BIN_LOCATION=$(which $BIN_NAME || true)
if [ -z "$BIN_LOCATION" ]; then
echo "$PKG_MANAGER install $PKG_NAME"
$PKG_MANAGER install "$PKG_NAME"
else
echo "$BIN_NAME already exists at $BIN_LOCATION, no need to install $PKG_NAME..."
fi
}
install_macports_pkg()
{
install_macos_pkg "sudo port" "$1" "$2"
}
install_brew_pkg()
{
install_macos_pkg "brew" $@
}
install_brew_cask_pkg()
{
install_macos_pkg "brew cask" $@
}
###############################################################################
# This function checks which of the supported package managers
# is available on the OSX Host.
# If a supported package manager is found, it delegates the installing work to
# the relevant function.
# Otherwise this function will exit this script with an error.
###############################################################################
osx()
{
echo "Detected OSX!"
if [ ! -z "$(which brew)" ]; then
osx_homebrew $@
elif [ ! -z "$(which port)" ]; then
osx_macports $@
else
echo "Please install either Homebrew or MacPorts, if you wish to use this script"
echo "Re-run this script once you installed one of those package managers"
echo "Will not install, now exiting..."
exit 1
fi
}
###############################################################################
# This function takes care of installing all dependencies using MacPorts
# for building redox on Mac OSX
# @params: $1 the emulator to install, virtualbox or qemu
###############################################################################
osx_macports()
{
echo "Macports detected! Now updating..."
sudo port -v selfupdate
echo "Installing missing packages..."
install_macports_pkg "git"
if [ "$1" == "qemu" ]; then
install_macports_pkg "qemu" "qemu-system-x86_64"
else
install_macports_pkg "virtualbox"
fi
install_macports_pkg "coreutils"
install_macports_pkg "findutils"
install_macports_pkg "gcc49" "gcc-4.9"
install_macports_pkg "nasm"
install_macports_pkg "pkgconfig"
install_macports_pkg "osxfuse"
install_macports_pkg "x86_64-elf-gcc"
}
###############################################################################
# This function takes care of installing all dependencies using Homebrew
# for building redox on Mac OSX
# @params: $1 the emulator to install, virtualbox or qemu
###############################################################################
osx_homebrew()
{
echo "Homebrew detected! Now updating..."
brew update
echo "Installing missing packages..."
install_brew_pkg "git"
if [ "$1" == "qemu" ]; then
install_brew_pkg "qemu" "qemu-system-x86_64"
else
install_brew_pkg "virtualbox"
fi
install_brew_pkg "coreutils"
install_brew_pkg "findutils"
install_brew_pkg "gcc49" "gcc-4.9"
install_brew_pkg "nasm"
install_brew_pkg "pkg-config"
install_brew_cask_pkg "osxfuse"
install_brew_pkg "redox-os/gcc_cross_compilers/x86_64-elf-gcc"
}
###############################################################################
# This function takes care of installing all dependencies for building redox on
# Arch linux
# @params: $1 the emulator to install, virtualbox or qemu
###############################################################################
archLinux()
{
echo "Detected Arch Linux"
echo "Updating system..."
sudo pacman -Syu
if [ -z "$(which nasm)" ]; then
echo "Installing nasm..."
sudo pacman -S nasm
fi
if [ -z "$(which git)" ]; then
echo "Installing git..."
sudo pacman -S git
fi
if [ "$1" == "qemu" ]; then
if [ -z "$(which qemu-system-x86_64)" ]; then
echo "Installing QEMU..."
sudo pacman -S qemu
else
echo "QEMU already installed!"
fi
fi
echo "Installing fuse..."
sudo pacman -S --needed fuse
}
###############################################################################
# This function takes care of installing all dependencies for building redox on
# debian based linux
# @params: $1 the emulator to install, virtualbox or qemu
# $2 the package manager to use
###############################################################################
ubuntu()
{
echo "Detected Ubuntu/Debian"
echo "Updating system..."
sudo "$2" update
echo "Installing required packages..."
sudo "$2" install build-essential libc6-dev-i386 nasm curl file git libfuse-dev fuse pkg-config
if [ "$1" == "qemu" ]; then
if [ -z "$(which qemu-system-x86_64)" ]; then
echo "Installing QEMU..."
sudo "$2" install qemu-system-x86 qemu-kvm
else
echo "QEMU already installed!"
fi
else
if [ -z "$(which virtualbox)" ]; then
echo "Installing Virtualbox..."
sudo "$2" install virtualbox
else
echo "Virtualbox already installed!"
fi
fi
}
###############################################################################
# This function takes care of installing all dependencies for building redox on
# fedora linux
# @params: $1 the emulator to install, virtualbox or qemu
###############################################################################
fedora()
{
echo "Detected Fedora"
if [ -z "$(which git)" ]; then
echo "Installing git..."
sudo dnf install git-all
fi
if [ "$1" == "qemu" ]; then
if [ -z "$(which qemu-system-x86_64)" ]; then
echo "Installing QEMU..."
sudo dnf install qemu-system-x86 qemu-kvm
else
echo "QEMU already installed!"
fi
else
if [ -z "$(which virtualbox)" ]; then
echo "Installing virtualbox..."
sudo dnf install virtualbox
else
echo "Virtualbox already installed!"
fi
fi
# Use rpm -q <package> to check if it's already installed
PKGS=$(for pkg in gcc gcc-c++ glibc-devel.i686 nasm make fuse-devel; do rpm -q $pkg > /dev/null; [ $? -ne 0 ] && echo $pkg; done)
# If the list of packages is not empty, install missing
COUNT=$(echo $PKGS | wc -w)
if [ $COUNT -ne 0 ]; then
echo "Installing necessary build tools..."
sudo dnf install $PKGS
fi
}
###############################################################################
# This function takes care of installing all dependencies for building redox on
# *suse linux
# @params: $1 the emulator to install, virtualbox or qemu
###############################################################################
suse()
{
echo "Detected SUSE Linux"
if [ -z "$(which git)" ]; then
echo "Installing git..."
zypper install git
fi
if [ "$1" == "qemu" ]; then
if [ -z "$(which qemu-system-x86_64)" ]; then
echo "Installing QEMU..."
sudo zypper install qemu-x86 qemu-kvm
else
echo "QEMU already installed!"
fi
else
if [ -z "$(which virtualbox)" ]; then
echo "Please install Virtualbox and re-run this script,"
echo "or run with -e qemu"
exit
else
echo "Virtualbox already installed!"
fi
fi
echo "Installing necessary build tools..."
sudo zypper install gcc gcc-c++ glibc-devel-32bit nasm make fuse-devel
}
##############################################################################
# This function takes care of installing all dependencies for builing redox on
# gentoo linux
# @params: $1 the emulator to install, virtualbox or qemu
##############################################################################
gentoo()
{
echo "Detected Gentoo Linux"
if [ -z "$(which nasm)" ]; then
echo "Installing nasm..."
sudo emerge dev-lang/nasm
fi
if [ -z "$(which git)" ]; then
echo "Installing git..."
sudo emerge dev-vcs/git
fi
if [ -z "$(which fusermount)" ]; then
echo "Installing fuse..."
sudo emerge sys-fs/fuse
fi
if [ "$2" == "qemu" ]; then
if [ -z "$(which qemu-system-x86_64)" ]; then
echo "Please install QEMU and re-run this script"
echo "Step1. Add QEMU_SOFTMMU_TARGETS=\"x86_64\" to /etc/portage/make.conf"
echo "Step2. Execute \"sudo emerge app-emulation/qemu\""
else
echo "QEMU already installed!"
fi
fi
}
##############################################################################
# This function takes care of installing all dependencies for builing redox on
# SolusOS
# @params: $1 the emulator to install, virtualbox or qemu
##############################################################################
solus()
{
echo "Detected SolusOS"
if [ "$1" == "qemu" ]; then
if [ -z "$(which qemu-system-x86_64)" ]; then
sudo eopkg it qemu
else
echo "QEMU already installed!"
fi
else
if [ -z "$(which virtualbox)" ]; then
echo "Please install Virtualbox and re-run this script,"
echo "or run with -e qemu"
exit
else
echo "Virtualbox already installed!"
fi
fi
echo "Installing necessary build tools..."
#if guards are not necessary with eopkg since it does nothing if latest version is already installed
sudo eopkg it fuse-devel git gcc g++ libgcc-32bit libstdc++-32bit nasm make
}
######################################################################
# This function outlines the different options available for bootstrap
######################################################################
usage()
{
echo "------------------------"
echo "|Redox bootstrap script|"
echo "------------------------"
echo "Usage: ./bootstrap.sh"
echo "OPTIONS:"
echo
echo " -h,--help Show this prompt"
echo " -u [branch] Update git repo and update rust"
echo " If blank defaults to master"
echo " -s Check the status of the current travis build"
echo " -e [emulator] Install specific emulator, virtualbox or qemu"
echo " -p [package Choose an Ubuntu package manager, apt-fast or"
echo " manager] aptitude"
echo " -d Only install the dependencies, skip boot step"
echo "EXAMPLES:"
echo
echo "./bootstrap.sh -e qemu"
exit
}
####################################################################################
# This function takes care of everything associated to rust, and the version manager
# That controls it, it can install rustup and uninstall multirust as well as making
# sure that the correct version of rustc is selected by rustup
####################################################################################
rustInstall() {
# Check to see if multirust is installed, we don't want it messing with rustup
# In the future we can probably remove this but I believe it's good to have for now
if [ -e /usr/local/lib/rustlib/uninstall.sh ] ; then
echo "It appears that multirust is installed on your system."
echo "This tool has been deprecated by the maintainer, and will cause issues."
echo "This script can remove multirust from your system if you wish."
printf "Uninstall multirust (y/N):"
read multirust
if echo "$multirust" | grep -iq "^y" ;then
sudo /usr/local/lib/rustlib/uninstall.sh
else
echo "Please manually uninstall multirust and any other versions of rust, then re-run bootstrap."
exit
fi
else
echo "Old multirust not installed, you are good to go."
fi
# If rustup is not installed we should offer to install it for them
if [ -z "$(which rustup)" ]; then
echo "You do not have rustup installed."
echo "We HIGHLY recommend using rustup."
echo "Would you like to install it now?"
echo "*WARNING* this involves a 'curl | sh' style command"
printf "(y/N): "
read rustup
if echo "$rustup" | grep -iq "^y" ;then
#install rustup
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly
# You have to add the rustup variables to the $PATH
echo "export PATH=\"\$HOME/.cargo/bin:\$PATH\"" >> ~/.bashrc
# source the variables so that we can execute rustup commands in the current shell
source ~/.cargo/env
rustup default nightly
else
echo "Rustup will not be installed!"
fi
fi
#
if [ -z "$(which rustc)" ]; then
echo "Rust is not installed"
echo "Please either run the script again, accepting rustup install"
echo "or install rustc nightly manually (not recommended) via:"
echo "\#curl -sSf https://static.rust-lang.org/rustup.sh | sh -s -- --channel=nightly"
exit
fi
# If the system has rustup installed then update rustc to the latest nightly
if hash 2>/dev/null rustup; then
rustup update nightly
rustup default nightly
fi
# Check to make sure that the default rustc is the nightly
if echo "$(rustc --version)" | grep -viq "nightly" ;then
echo "It appears that you have rust installed, but it"
echo "is not the nightly version, please either install"
echo "the nightly manually (not recommended) or run this"
echo "script again, accepting the rustup install"
echo
else
echo "Your rust install looks good!"
echo
fi
}
####################################################################
# This function gets the current build status from travis and prints
# a message to the user
####################################################################
statusCheck() {
for i in $(echo "$(curl -sf https://api.travis-ci.org/repositories/redox-os/redox.json)" | tr "," "\n")
do
if echo "$i" | grep -iq "last_build_status" ;then
if echo "$i" | grep -iq "0" ;then
echo
echo "********************************************"
echo "Travis reports that the last build succeeded!"
echo "Looks like you are good to go!"
echo "********************************************"
elif echo "$i" | grep -iq "null" ;then
echo
echo "******************************************************************"
echo "The Travis build did not finish, this is an error with its config."
echo "I cannot reliably determine whether the build is succeeding or not."
echo "Consider checking for and maybe opening an issue on github"
echo "******************************************************************"
else
echo
echo "**************************************************"
echo "Travis reports that the last build *FAILED* :("
echo "Might want to check out the issues before building"
echo "**************************************************"
fi
fi
done
}
###########################################################################
# This function is the main logic for the bootstrap; it clones the git repo
# then it installs the rust version manager and the latest version of rustc
###########################################################################
boot()
{
echo "Cloning github repo..."
git clone https://github.com/redox-os/redox.git --origin upstream --recursive
rustInstall
echo "Cleaning up..."
rm bootstrap.sh
echo
echo "---------------------------------------"
echo "Well it looks like you are ready to go!"
echo "---------------------------------------"
statusCheck
echo "Run the following commands to build redox:"
echo "cd redox"
echo "make all"
echo "make virtualbox or qemu"
echo
echo " Good luck!"
exit
}
if [ "$1" == "-h" ]; then
usage
elif [ "$1" == "-u" ]; then
git pull upstream master
git submodule update --recursive --init
rustup update nightly
exit
elif [ "$1" == "-s" ]; then
statusCheck
exit
fi
emulator="qemu"
defpackman="apt-get"
dependenciesonly=false
while getopts ":e:p:d" opt
do
case "$opt" in
e) emulator="$OPTARG";;
p) defpackman="$OPTARG";;
d) dependenciesonly=true;;
\?) echo "I don't know what to do with that option, try -h for help"; exit;;
esac
done
banner
if [ "Darwin" == "$(uname -s)" ]; then
osx "$emulator"
else
# Here we will use package managers to determine which operating system the user is using.
# Arch linux
if hash 2>/dev/null pacman; then
archLinux "$emulator"
# Suse and derivatives
elif hash 2>/dev/null zypper; then
suse "$emulator"
# Debian or any derivative of it
elif hash 2>/dev/null apt-get; then
ubuntu "$emulator" "$defpackman"
# Fedora
elif hash 2>/dev/null dnf; then
fedora "$emulator"
# Gentoo
elif hash 2>/dev/null emerge; then
gentoo "$emulator"
# SolusOS
elif hash 2>/dev/null eopkg; then
solus "$emulator"
fi
fi
if [ "$dependenciesonly" = false ]; then
boot
fi

105
build.sh
View File

@ -1,105 +0,0 @@
#!/usr/bin/env bash
# Alternative script for the build system Makefiles
###########################################################################
# #
# Build the system, with a specified processor type and filesystem config #
# #
###########################################################################
usage()
{
echo "build.sh: Invoke make for a particular architecture and configuration."
echo "Usage:"
echo "./build.sh [-X | -A | -5 | -R | -a ARCH] [-c CONFIG] [-f FILESYSTEM_CONFIG] TARGET..."
echo " -X Equivalent to -a x86_64."
echo " -A Equivalent to -a aarch64."
echo " -5 Equivalent to -a i586."
echo " -6 Equivalent to -a i586 (deprecated, use -5 instead)."
echo " -R Equivalent to -a riscv64gc."
echo " -a ARCH: Processor Architecture. Normally one of x86_64, aarch64 or"
echo " i686. ARCH is not checked, so you can add a new architecture."
echo " Defaults to the directory containing the FILESYSTEM_CONFIG file,"
echo " or x86_64 if no FILESYSTEM_CONFIG is specified."
echo " -c CONFIG: The name of the config, e.g. desktop, server or demo."
echo " Determines the name of the image, build/ARCH/CONFIG/harddrive.img"
echo " e.g. build/x86_64/desktop/harddrive.img"
echo " Determines the name of FILESYSTEM_CONFIG if none is specified."
echo " Defaults to the basename of FILESYSTEM_CONFIG, or 'desktop'"
echo " if FILESYSTEM_CONFIG is not specified."
echo " -f FILESYSTEM_CONFIG:"
echo " The config file to use. It can be in any location."
echo " However, if the file is not in a directory named x86_64, aarch64"
echo " or i686, you must specify the architecture."
echo " If -f is not specified, FILESYSTEM_CONFIG is set to"
echo " config/ARCH/CONFIG.toml"
echo " If you specify both CONFIG and FILESYSTEM_CONFIG, it is not"
echo " necessary that they match, but it is recommended."
echo " Examples: ./build.sh -c demo live - make build/x86_64/demo/redox-live.iso"
echo " ./build.sh -6 qemu - make build/i686/desktop/harddrive.img and"
echo " and run it in qemu"
echo " NOTE: If you do not change ARCH or CONFIG very often, edit mk/config.mk"
echo " and set ARCH and FILESYSTEM_CONFIG. You only need to use this"
echo " script when you want to override them."
}
if [ "$1" == "-h" ] || [ "$1" == "--help" ]; then
usage
exit
fi
defaultarch="x86_64"
defaultname="desktop"
ARCH=""
CONFIG_NAME=""
FILESYSTEM_CONFIG=""
while getopts ":c:f:a:dhXA6" opt
do
case "$opt" in
a) ARCH="$OPTARG";;
c) CONFIG_NAME="$OPTARG";;
f) FILESYSTEM_CONFIG="$OPTARG";;
X) ARCH="x86_64";;
A) ARCH="aarch64";;
R) ARCH="riscv64gc";;
5) ARCH="i586";;
6) ARCH="i586";;
h) usage;;
\?) echo "Unknown option -$OPTARG, try -h for help"; exit;;
:) echo "-$OPTARG requires a value"; exit;;
esac
done
shift $((OPTIND -1))
if [ -z "$ARCH" ] && [ -n "$FILESYSTEM_CONFIG" ]; then
dirname=`dirname "$FILESYSTEM_CONFIG"`
ARCH=`basename $dirname`
case "$ARCH" in
x86_64) : ;;
aarch64) : ;;
riscv64gc) : ;;
i586) : ;;
\?) ARCH=""; echo "Unknown Architecture, please specify x86_64, aarch64, riscv64gc or i586";;
esac
fi
if [ -z "$config_name" ] && [ -n "$FILESYSTEM_CONFIG" ]; then
CONFIG_NAME=`basename "$FILESYSTEM_CONFIG" .toml`
fi
if [ -z "$ARCH" ]; then
ARCH="$defaultarch"
fi
if [ -z "$CONFIG_NAME" ]; then
CONFIG_NAME="$defaultname"
fi
if [ -z "$FILESYSTEM_CONFIG" ]; then
FILESYSTEM_CONFIG="config/$ARCH/$CONFIG_NAME.toml"
fi
export ARCH CONFIG_NAME FILESYSTEM_CONFIG
make $@

View File

@ -1,320 +0,0 @@
# The Redox build server configuration
# General settings
[general]
# Do not prompt if settings are not defined
prompt = false
# Package settings
[packages]
# If you need to disable some broken package comment out instead of removal to not increase the maintenance cost
#TODO: commented out recipes need to be built and tested inside of Redox to verify if they returned to work
# Meta-packages below
# auto-test = {}
# dev-essential = {}
# dev-redox = {}
# redox-tests = {}
# x11-minimal = {}
# x11-full = {}
# Normal packages below
acid = {}
acid-bins = {}
base = {}
bash = {}
bash-completion = {}
bootloader = {}
bottom = {}
ca-certificates = {}
contain = {}
coreutils = {}
cosmic-edit = {}
cosmic-files = {}
cosmic-icons = {}
cosmic-term = {}
cosmic-text = {}
curl = {}
dash = {}
dejavu = {}
diffutils = {}
expat = {}
extrautils = {}
file = {}
findutils = {}
freefont = {}
freetype2 = {}
gawk = {}
gcc13 = {}
gettext = {}
git = {}
gnu-binutils = {}
gnu-make = {}
hicolor-icon-theme = {}
installer = {}
installer-gui = {}
ion = {}
kernel = {}
kibi = {}
libffi = {}
libgcc = {}
libiconv = {}
libjpeg = {}
libogg = {}
liborbital = {}
libpng = {}
libstdcxx = {}
libvorbis = {}
libxkbcommon = {}
libxml2 = {}
llvm21 = {}
nano = {}
nasm = {}
ncurses = {}
netdb = {}
netsurf = {}
netutils = {}
nghttp2 = {}
openssl1 = {}
openssl3 = {}
orbdata = {}
orbital = {}
orbterm = {}
orbutils = {}
patch = {}
patchelf = {}
pcre = {}
pkgutils = {}
pls = {}
pop-icon-theme = {}
redoxfs = {}
relibc = {}
ripgrep = {}
rust = {}
rustpython = {}
sdl1 = {}
sed = {}
shared-mime-info = {}
smith = {}
terminfo = {}
userutils = {}
uutils = {}
uutils-procps = {}
vim = {}
xz = {}
zlib = {}
zstd = {}
# #"gcc13.cxx" = {}
# #"llvm21.clang" = {}
# #"llvm21.clang-dev" = {}
# #"llvm21.dev" = {}
# #"llvm21.lld" = {}
# #"llvm21.lld-dev" = {}
# #"llvm21.runtime" = {}
# #"python312.dev" = {}
# #"rust.doc" = {}
# #atk = {} # depends on glib which does not build
# #benchmarks = {}
# #binutils-gdb = {}
# #book = {}
# #cairo-demo = {} # linking errors
# #classicube = {}
# #cmake = {}
# #cmatrix = {} # needs ncursesw now
# #cookbook = {}
# #cosmic-reader = {}
# #cosmic-settings = {}
# #cosmic-store = {}
# #devilutionx = {}
# #dynamic-example = {}
# #fal
# #fd = {} # ctrlc-3.1.1
# #flycast = {}
# #freeciv = {}
# #freeglut = {}
# #friar = {} # mio patch
# #game-2048 = {} # rustc-serialize
# #gigalomania = {} # old recipe format
# #gitoxide = {}
# #goaccess = {}
# #gstreamer = {} # conflict with thread local errno
# #harfbuzz = {} # depends on glib which does not build
# #helix = {}
# #hello-redox = {}
# #hematite = {} # needs crate patches for redox-unix
# #hf = {}
# #ibm-plex = {}
# #iced = {}
# #jansson = {} # needs config.sub update
# #jq = {}
# #libarchive = {}
# #libatomic = {}
# #libcosmic = {}
# #libflac = {}
# #libmodplug1 = {}
# #libmpfr = {}
# #libnettle = {}
# #libogg = {}
# #libpsl = {}
# #libssh2 = {}
# #libtool = {}
# #liburcu = {}
# #libuv = {}
# #lua-compat-53 = {}
# #luajit = {}
# #luarocks = {}
# #luv = {}
# #mdp = {} # gcc hangs
# #miniserve = {} # actix
# #mpc = {}
# #mupen64plus = {}
# #ncdu = {} # multiple definitions of symbols
# #newlib = {} # obsolete
# #newlibtest = {} # obsolete
# #noto-color-emoji = {}
# #nushell = {} # needs cargo update
# #openjk = {}
# #openposixtestsuite = {}
# #opentyrian = {}
# #orbcalculator = {}
# #ostest-bins = {}
# #pango = {} # undefined references to std::__throw_system_error(int)
# #pastel = {} # needs crate patches for redox-unix
# #pathfinder = {} # servo-fontconfig
# #pciids = {}
# #pcre2 = {}
# #pixman = {} # depends on glib which does not build
# #pkgar = {} # uses virtual Cargo.toml, needs recipe update
# #pls = {}
# #pop-wallpapers = {}
# #powerline = {} # dirs
# #qemu = {} # can be built, but not working
# #quakespasm = {}
# #redox-posix-tests = {}
# #redox-ssh = {} # does not compile
# #retroarch = {} # OS_TLSIndex not declared
# #rust-cairo = {} # linking errors
# #rust-cairo-demo = {} # linking errors
# #rvvm = {}
# #schismtracker = {} # uses system includes
# #sdl-player = {} # wctype_t
# #sdl2-gfx = {}
# #sm64ex = {}
# #spacecadetpinball = {}
# #twin-commander = {}
# #ubuntu-wallpapers = {}
# #unibilium = {}
# #utf8proc = {}
# #vice = {} # linker errors
# #vvvvvv = {} # did not compile
# #webrender = {} # unwind
# #website = {}
# #wesnoth = {}
# #wget = {}
# autoconf = {}
# automake = {}
# binutils = {}
# bzip2 = {}
# cairo = {}
# cleye = {}
# composer = {}
# cpal = {}
# dosbox = {}
# duktape = {}
# eduke32 = {}
# exampled = {}
# expat = {}
# extrautils = {}
# ffmpeg6 = {}
# fontconfig = {}
# freedoom = {}
# freepats = {}
# fribidi = {}
# gdbserver = {} # wrong libc type
# gdk-pixbuf = {}
# gears = {}
# generaluser-gs = {}
# glib = {}
# glutin = {}
# gnu-grep = {}
# htop = {}
# intel-one-mono = {}
# lci = {}
# libavif = {}
# libc-bench = {}
# libedit = {}
# libgmp = {}
# libicu = {}
# libonig = {}
# libsodium = {}
# libuuid = {}
# libwebp = {}
# lsd = {}
# lua54 = {}
# lz4 = {}
# mednafen = {}
# mesa = {} # libudev was not found
# mesa-glu = {} # depends on mesa
# mgba = {}
# mpc = {} # libmpfr not found
# ncursesw = {}
# neverball = {}
# nginx = {}
# onefetch = {}
# openjazz = {}
# openssh = {}
# openttd = {}
# openttd-opengfx = {}
# openttd-openmsx = {}
# openttd-opensfx = {}
# orbclient = {}
# osdemo = {}
# perg = {}
# periodictable = {}
# perl5 = {}
# php84 = {}
# pixelcannon = {}
# pkg-config = {}
# prboom = {}
# procedural-wallpapers-rs = {}
# python312 = {}
# readline = {}
# redox-fatfs = {}
# redox-games = {}
# relibc-tests = {}
# relibc-tests-bins = {}
# rodioplay = {}
# rs-nes = {}
# rsync = {}
# rust64 = {}
# rustual-boy = {}
# scummvm = {}
# sdl-gfx = {}
# sdl1-image = {}
# sdl1-mixer = {}
# sdl1-ttf = {}
# sdl2 = {}
# sdl2-gears = {}
# sdl2-image = {}
# sdl2-mixer = {}
# sdl2-ttf = {}
# servo = {}
# shellharden = {}
# shellstorm = {}
# simple-http-server = {}
# sodium = {}
# sopwith = {}
# sqlite3 = {}
# strace = {} # unknown syscall
# syobonaction = {}
# timidity = {}
# tokei = {}
# ttf-hack = {}
# vttest = {}
# webkitgtk3 = {}
# winit = {}
# xxhash = {}
# zoxide = {} # untested

View File

@ -1,3 +0,0 @@
# Configuration for demonstration
include = ["../desktop.toml"]

View File

@ -1,20 +0,0 @@
# Configuration for development
include = ["../dev.toml"]
# Override the default settings here
# General settings
[general]
# Filesystem size in MiB
# filesystem_size = 1024
# Package settings
[packages]
# see ci.toml for error reasons
gdbserver = "ignore"
gnu-binutils = "ignore"
mesa = "ignore"
mesa-glu = "ignore"
mpc = "ignore"
strace = "ignore"

View File

@ -1,3 +0,0 @@
# Configuration for Jeremy Soller
include = ["demo.toml"]

View File

@ -1,10 +0,0 @@
# Minimal configuration
include = ["../../minimal.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 256
# EFI partition size in MiB
efi_partition_size = 128

View File

@ -1,8 +0,0 @@
# Configuration used for building redoxer base image
include = ["../redoxer.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 1024

View File

@ -1,31 +0,0 @@
# Configuration for "acid" testing
include = ["base.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 1024
# Package settings
[packages]
acid = {}
coreutils = {}
ion = {}
[[files]]
path = "/usr/lib/init.d/10_acid"
data = """
requires_weak 00_base.target
ion /usr/lib/run_acid.ion
"""
[[files]]
path = "/usr/lib/run_acid.ion"
data = """
#!/usr/bin/env ion
export RUST_BACKTRACE=full
cd /home/user/acid
cargo test
shutdown
"""

View File

@ -1,32 +0,0 @@
# Configuration for automated testing of essential test suites
# Smaller test suites are executed first to catch possible bugs or regressions faster
include = ["base.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 1024
# Package settings
[packages]
auto-test = {}
[[files]]
path = "/usr/lib/init.d/30_console"
data = """
requires_weak 10_net.target
ion /usr/lib/run_tests.ion
"""
[[files]]
path = "/usr/lib/run_tests.ion"
data = """
#!/usr/bin/env ion
export RUST_BACKTRACE=full
cd /home/user/acid
cargo test
bash /root/relibc-tests/run.sh
os-test-runner
shutdown
"""

View File

@ -1,254 +0,0 @@
# Base configuration: This configuration is meant to be included by
# other configurations rather than use directly. It is the greatest
# common divisor of all other configurations and misses several
# parts necessary to create a bootable system.
# General settings
[general]
# Do not prompt if settings are not defined
prompt = false
[packages]
base = {}
bootloader = {}
kernel = {}
libgcc = {}
libstdcxx = {}
netdb = {}
netutils = {}
relibc = {}
userutils = {}
uutils = {}
## Configuration files
[[files]]
path = "/etc/login_schemes.toml"
data = """
[user_schemes.root]
schemes = ["*"]
[user_schemes.user]
schemes = [
# Kernel schemes
"debug",
"event",
"memory",
"pipe",
"serio",
"irq",
"time",
"sys",
# Base schemes
"rand",
"null",
"zero",
"log",
# Network schemes
"ip",
"icmp",
"tcp",
"udp",
# IPC schemes
"shm",
"chan",
"uds_stream",
"uds_dgram",
# File schemes
"file",
# Display schemes
"display.vesa",
"display*",
# Other schemes
"proc",
"pty",
"sudo",
"audio",
"orbital",
]
"""
[[files]]
path = "/etc/hostname"
data = "redox"
## Default net configuration (optimized for QEMU)
[[files]]
path = "/etc/net/dns"
data = """
9.9.9.9
"""
[[files]]
path = "/etc/net/ip"
data = """
10.0.2.15
"""
[[files]]
path = "/etc/net/ip_router"
data = """
10.0.2.2
"""
[[files]]
path = "/etc/net/ip_subnet"
data = """
255.255.255.0
"""
# https://www.freedesktop.org/software/systemd/man/latest/os-release.html
[[files]]
path = "/usr/lib/os-release"
data = """
PRETTY_NAME="Redox OS 0.9.0"
NAME="Redox OS"
VERSION_ID="0.9.0"
VERSION="0.9.0"
ID="redox-os"
HOME_URL="https://redox-os.org/"
DOCUMENTATION_URL="https://redox-os.org/docs/"
SUPPORT_URL="https://redox-os.org/community/"
"""
# VARIANT and BUILD_ID are appended by redox_installer when creating images.
[[files]]
path = "/etc/os-release"
data = "../usr/lib/os-release"
symlink = true
[[files]]
path = "/etc/pkg.d/50_redox"
data = "https://static.redox-os.org/pkg"
## /usr and symlinks for usrmerge
[[files]]
path = "/usr"
data = ""
directory = true
mode = 0o755
[[files]]
path = "/usr/bin"
data = ""
directory = true
mode = 0o755
[[files]]
path = "/bin"
data = "usr/bin"
symlink = true
[[files]]
path = "/usr/include"
data = ""
directory = true
mode = 0o755
[[files]]
path = "/include"
data = "usr/include"
symlink = true
[[files]]
path = "/usr/lib"
data = ""
directory = true
mode = 0o755
[[files]]
path = "/lib"
data = "usr/lib"
symlink = true
[[files]]
path = "/usr/libexec"
data = ""
directory = true
mode = 0o755
[[files]]
path = "/usr/share"
data = ""
directory = true
mode = 0o755
[[files]]
path = "/share"
data = "usr/share"
symlink = true
## legacy orbital directories
[[files]]
path = "/ui"
data = "usr/share/ui"
symlink = true
[[files]]
path = "/usr/share/ui/fonts"
data = "/usr/share/fonts"
symlink = true
[[files]]
path = "/usr/share/ui/icons"
data = "/usr/share/icons"
symlink = true
## /var
[[files]]
path = "/var"
data = ""
directory = true
mode = 0o755
[[files]]
path = "/var/cache"
data = ""
directory = true
mode = 0o755
[[files]]
path = "/var/lib"
data = ""
directory = true
mode = 0o755
[[files]]
path = "/var/lock"
data = ""
directory = true
mode = 0o1777
[[files]]
path = "/var/log"
data = ""
directory = true
mode = 0o755
[[files]]
path = "/var/run"
data = ""
directory = true
mode = 0o755
[[files]]
path = "/var/tmp"
data = ""
directory = true
mode = 0o1777
# User settings
[users.root]
password = "password"
uid = 0
gid = 0
shell = "/usr/bin/ion"
[users.user]
# Password is unset
password = ""
shell = "/usr/bin/ion"
# Group settings
[groups.sudo]
gid = 1
members = ["user"]

View File

@ -1,42 +0,0 @@
# Desktop configuration using the Contain sandbox
include = ["desktop.toml"]
# Override the default settings here
# General settings
[general]
# Filesystem size in MiB
# filesystem_size = 1024
# Package settings
[packages]
# example = {}
# Override orbital init to use contain_orblogin
[[files]]
path = "/usr/lib/init.d/20_orbital"
data = """
requires_weak 10_net.target 20_audiod.service
nowait VT=3 orbital contain_orblogin launcher
"""
# Override console init to use contain
[[files]]
path = "/usr/lib/init.d/30_console"
data = """
requires_weak 20_orbital
nowait getty --contain 2
nowait getty --contain /scheme/debug/no-preserve -J
"""
[[files]]
path = "/etc/contain.toml"
data = """
pass_schemes = ["rand", "null", "tcp", "udp", "thisproc", "pty", "orbital", "display.vesa"]
sandbox_schemes = ["file"]
files = ["file:/dev/null"]
rofiles = ["file:/etc/passwd", "file:/etc/hostname", "file:/etc/localtime"]
dirs = ["file:/tmp"]
rodirs = ["file:/bin", "file:/ui"]
"""

View File

@ -1,31 +0,0 @@
# Minimal desktop configuration
include = ["minimal.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 256
# Package settings
[packages]
orbdata = {}
orbital = {}
orbterm = {}
orbutils = {}
[[files]]
path = "/usr/lib/init.d/20_orbital"
data = """
requires_weak 10_net.target 20_audiod.service
nowait VT=3 orbital orblogin launcher
"""
# Override console config to not switch to VT 2
[[files]]
path = "/usr/lib/init.d/30_console"
data = """
requires_weak 20_orbital
nowait getty 2
nowait getty /scheme/debug/no-preserve -J
"""

View File

@ -1,26 +0,0 @@
# Default build system configuration
include = ["desktop-minimal.toml", "server.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 650
# Package settings
[packages]
cosmic-edit = {}
cosmic-files = {}
cosmic-icons = {}
cosmic-term = {}
dejavu = {}
file = {}
freefont = {}
hicolor-icon-theme = {}
installer-gui = {}
netsurf = {}
patchelf = {}
pop-icon-theme = {}
shared-mime-info = {}
# orbterm from desktop-minimal should be ignored
orbterm = "ignore"

View File

@ -1,15 +0,0 @@
# Configuration for development
include = ["desktop.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 20000
# Do not prompt if settings are not defined
prompt = false
# Package settings
[packages]
dev-redox = {}
hello-redox = {}

View File

@ -1,317 +0,0 @@
# The Redox build server configuration
# General settings
[general]
# Do not prompt if settings are not defined
prompt = false
# Package settings
[packages]
# If you need to disable some broken package comment out instead of removal to not increase the maintenance cost
#TODO: commented out recipes need to be built and tested inside of Redox to verify if they returned to work
# Meta-packages below
# auto-test = {}
# dev-essential = {}
# dev-redox = {}
# redox-tests = {}
# x11-minimal = {}
# x11-full = {}
# Normal packages below
# acid = {} # rust require dynamic linking
acid-bins = {}
base = {}
bash = {}
bash-completion = {}
bootloader = {}
bottom = {}
ca-certificates = {}
contain = {}
coreutils = {}
cosmic-edit = {}
cosmic-files = {}
cosmic-icons = {}
cosmic-term = {}
cosmic-text = {}
curl = {}
dash = {}
dejavu = {}
diffutils = {}
expat = {}
extrautils = {}
file = {}
findutils = {}
freefont = {}
freetype2 = {}
gettext = {}
git = {}
gnu-make = {}
hicolor-icon-theme = {}
installer = {}
installer-gui = {}
ion = {}
kernel = {}
kibi = {}
libffi = {}
libgcc = {}
libiconv = {}
libjpeg = {}
libogg = {}
liborbital = {}
libpng = {}
libstdcxx = {}
libvorbis = {}
libxkbcommon = {}
libxml2 = {}
nano = {}
nasm = {}
ncurses = {}
netdb = {}
netsurf = {}
netutils = {}
nghttp2 = {}
openssl1 = {}
orbdata = {}
orbital = {}
orbterm = {}
orbutils = {}
patch = {}
pcre = {}
patchelf = {}
pop-icon-theme = {}
pkgutils = {}
redoxfs = {}
relibc = {}
ripgrep = {}
rustpython = {}
sdl1 = {}
sed = {}
shared-mime-info = {}
smith = {}
terminfo = {}
userutils = {}
uutils = {}
uutils-procps = {}
xz = {}
#vim = {} # conflicting types
zlib = {}
# #"gcc13.cxx" = {}
# #"llvm21.clang" = {}
# #"llvm21.clang-dev" = {}
# #"llvm21.dev" = {}
# #"llvm21.lld" = {}
# #"llvm21.lld-dev" = {}
# #"llvm21.runtime" = {}
# #"python312.dev" = {}
# #"rust.doc" = {}
# #atk = {} # depends on glib which does not build
# #benchmarks = {}
# #binutils-gdb = {}
# #book = {}
# #cairo-demo = {} # linking errors
# #classicube = {}
# #cmake = {}
# #cmatrix = {} # needs ncursesw now
# #cookbook = {}
# #cosmic-reader = {}
# #cosmic-settings = {}
# #cosmic-store = {}
# #devilutionx = {}
# #dynamic-example = {}
# #fal
# #fd = {} # ctrlc-3.1.1
# #flycast = {}
# #freeciv = {}
# #freeglut = {}
# #friar = {} # mio patch
# #game-2048 = {} # rustc-serialize
# #gawk = {} # langinfo.h
# #gigalomania = {} # old recipe format
# #gitoxide = {}
# #goaccess = {}
# #gstreamer = {} # conflict with thread local errno
# #harfbuzz = {} # depends on glib which does not build
# #helix = {}
# #hello-redox = {}
# #hematite = {} # needs crate patches for redox-unix
# #hf = {}
# #ibm-plex = {}
# #iced = {}
# #jansson = {} # needs config.sub update
# #jq = {}
# #libarchive = {}
# #libatomic = {}
# #libcosmic = {}
# #libflac = {}
# #libmodplug1 = {}
# #libmpfr = {}
# #libnettle = {}
# #libogg = {}
# #libpsl = {}
# #libssh2 = {}
# #libtool = {}
# #liburcu = {}
# #libuv = {}
# #lua-compat-53 = {}
# #luajit = {}
# #luarocks = {}
# #luv = {}
# #mdp = {} # gcc hangs
# #miniserve = {} # actix
# #mpc = {}
# #mupen64plus = {}
# #ncdu = {} # multiple definitions of symbols
# #newlib = {} # obsolete
# #newlibtest = {} # obsolete
# #noto-color-emoji = {}
# #nushell = {} # needs cargo update
# #openjk = {}
# #openposixtestsuite = {}
# #opentyrian = {}
# #orbcalculator = {}
# #ostest-bins = {}
# #pango = {} # undefined references to std::__throw_system_error(int)
# #pastel = {} # needs crate patches for redox-unix
# #pathfinder = {} # servo-fontconfig
# #pciids = {}
# #pcre2 = {}
# #pixman = {} # depends on glib which does not build
# #pkgar = {} # uses virtual Cargo.toml, needs recipe update
# #pls = {}
# #pop-wallpapers = {}
# #powerline = {} # dirs
# #qemu = {} # can be built, but not working
# #quakespasm = {}
# #redox-posix-tests = {}
# #redox-ssh = {} # does not compile
# #retroarch = {} # OS_TLSIndex not declared
# #rust-cairo = {} # linking errors
# #rust-cairo-demo = {} # linking errors
# #rvvm = {}
# #schismtracker = {} # uses system includes
# #sdl-player = {} # wctype_t
# #sdl2-gfx = {}
# #sm64ex = {}
# #spacecadetpinball = {}
# #twin-commander = {}
# #ubuntu-wallpapers = {}
# #unibilium = {}
# #utf8proc = {}
# #vice = {} # linker errors
# #vvvvvv = {} # did not compile
# #webrender = {} # unwind
# #website = {}
# #wesnoth = {}
# #wget = {}
# autoconf = {}
# automake = {}
# binutils = {}
# bzip2 = {}
# cairo = {}
# cleye = {}
# composer = {}
# cpal = {}
# dosbox = {}
# duktape = {}
# eduke32 = {}
# exampled = {}
# ffmpeg6 = {}
# fontconfig = {}
# freedoom = {}
# freepats = {}
# fribidi = {}
# gcc13 = {}
# gdbserver = {}
# gdk-pixbuf = {}
# gears = {}
# generaluser-gs = {}
# glib = {}
# glutin = {}
# gnu-binutils = {}
# gnu-grep = {}
# htop = {}
# intel-one-mono = {}
# lci = {}
# libavif = {}
# libc-bench = {}
# libedit = {}
# libgmp = {}
# libicu = {}
# libonig = {}
# libsodium = {}
# libuuid = {}
# libwebp = {}
# llvm21 = {}
# lsd = {}
# lua54 = {}
# lz4 = {}
# mednafen = {}
# mesa = {}
# mesa-glu = {}
# mgba = {}
# ncursesw = {}
# neverball = {}
# nginx = {}
# onefetch = {}
# openjazz = {}
# openssh = {}
# openssl3 = {}
# openttd = {}
# openttd-opengfx = {}
# openttd-openmsx = {}
# openttd-opensfx = {}
# orbclient = {}
# osdemo = {}
# perg = {}
# periodictable = {}
# perl5 = {}
# php84 = {}
# pixelcannon = {}
# pkg-config = {}
# prboom = {}
# procedural-wallpapers-rs = {}
# python312 = {}
# readline = {}
# redox-fatfs = {}
# redox-games = {}
# relibc-tests = {}
# relibc-tests-bins = {}
# rodioplay = {}
# rs-nes = {}
# rsync = {}
# rust = {}
# rust64 = {}
# rustual-boy = {}
# scummvm = {}
# sdl-gfx = {}
# sdl1-image = {}
# sdl1-mixer = {}
# sdl1-ttf = {}
# sdl2 = {}
# sdl2-gears = {}
# sdl2-image = {}
# sdl2-mixer = {}
# sdl2-ttf = {}
# servo = {}
# shellharden = {}
# shellstorm = {}
# simple-http-server = {}
# sodium = {}
# sopwith = {}
# sqlite3 = {}
# strace = {}
# syobonaction = {}
# timidity = {}
# tokei = {}
# ttf-hack = {}
# vttest = {}
# webkitgtk3 = {}
# winit = {}
# xxhash = {}
# zoxide = {} # untested
# zstd = {}

View File

@ -1,48 +0,0 @@
# Configuration for demonstration
include = ["../desktop.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 768
# Package settings
[packages]
# Games
dosbox = {}
freedoom = {}
prboom = {}
redox-games = {}
# Demos
pixelcannon = {}
# MIDI
freepats = {}
[[files]]
path = "/home/user/Welcome.txt"
data = """
##############################################################################
# #
# Welcome to Redox! #
# #
# Redox is an operating system written in Rust, a language with focus #
# on safety and high performance. Redox, following the microkernel design, #
# aims to be secure, usable, and free. Redox is inspired by previous kernels #
# and operating systems, such as SeL4, MINIX, Plan 9, and BSD. #
# #
# Redox _is not_ just a kernel, it's a full-featured Operating System, #
# providing packages (memory allocator, file system, display manager, core #
# utilities, etc.) that together make up a functional and convenient #
# operating system. You can loosely think of it as the GNU or BSD ecosystem, #
# but in a memory safe language and with modern technology. #
# #
# The website can be found at https://www.redox-os.org. #
# #
# For things to try on Redox, please see #
# https://doc.redox-os.org/book/ch02-06-trying-out-redox.html #
# #
##############################################################################
"""

View File

@ -1,14 +0,0 @@
# Configuration for development
include = ["../dev.toml"]
# Override the default settings here
# General settings
[general]
# Filesystem size in MiB
# filesystem_size = 1024
# Package settings
[packages]
# example = {}

View File

@ -1,39 +0,0 @@
# Configuration for Jeremy Soller
include = ["../desktop.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 4000
# Package settings
[packages]
# apps
cosmic-text = {}
pixelcannon = {}
sodium = {}
# cli
acid = {}
cleye = {}
ripgrep = {}
# demos
cpal = {}
orbclient = {}
rodioplay = {}
winit = {}
# games
dosbox = {}
eduke32 = {}
freedoom = {}
prboom = {}
redox-games = {}
# stuff
freepats = {}
generaluser-gs = {}
jeremy = {}
ttf-hack = {}

View File

@ -1,8 +0,0 @@
# Configuration used for building redoxer base image
include = ["../redoxer.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 1024

View File

@ -1,27 +0,0 @@
# Minimal configuration
include = ["base.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 196
# Package settings
[packages]
ca-certificates = {}
coreutils = {}
extrautils = {}
ion = {}
pkgutils = {}
kibi = {}
uutils-procps = {}
[[files]]
path = "/usr/lib/init.d/30_console"
data = """
requires_weak 10_net.target
inputd -A 2
nowait getty 2
nowait getty /scheme/debug/no-preserve -J
"""

View File

@ -1,22 +0,0 @@
# Configuration for "os-test" testing
include = ["server.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 1024
# Do not prompt if settings are not defined
prompt = false
# Package settings
[packages]
os-test-bins = {} # Provides source and cross-compiled binaries
[[files]]
path = "/usr/lib/init.d/30_console"
data = """
requires_weak 10_net.target
RUST_BACKTRACE=full os-test-runner
shutdown
"""

View File

@ -1,18 +0,0 @@
# Configuration for the Redoxer GUI image
include = ["redoxer.toml"]
# Package settings
[packages]
orbdata = {}
orbital = {}
# Override to run inside of orbital
[[files]]
path = "/usr/lib/init.d/30_redoxer"
data = """
requires_weak 10_net.target
echo
echo "## running redoxer in orbital ##"
nowait VT=3 orbital redoxerd
"""

View File

@ -1,57 +0,0 @@
# Configuration for the Redoxer image
include = ["base.toml"]
# Package settings
[packages]
bash = {}
ca-certificates = {}
coreutils = {}
extrautils = {}
findutils = {}
gnu-make = {}
ion = {}
pkgutils = {}
relibc = {}
sed = {}
# Override to not background dhcpd
[[files]]
path = "/usr/lib/init.d/10_dhcpd.service"
data = """
[unit]
description = "Network configuration using DHCP"
requires_weak = [
"10_smolnetd.service",
]
[service]
cmd = "dhcpd"
type = "oneshot"
"""
[[files]]
path = "/usr/lib/init.d/30_redoxer"
data = """
requires_weak 10_net.target
ion /usr/lib/run_redoxer.ion
"""
[[files]]
path = "/usr/lib/run_redoxer.ion"
data = """
#!/usr/bin/env ion
echo
echo "## preparing environment ##"
export GROUPS=0
export HOME=/root
export HOST=redox
export SHELL=/bin/sh
export UID=0
export USER=root
cd /root
env
echo
echo "## running redoxer ##"
redoxerd
"""

View File

@ -1,318 +0,0 @@
# The Redox build server configuration
# General settings
[general]
# Do not prompt if settings are not defined
prompt = false
# Package settings
[packages]
# If you need to disable some broken package comment out instead of removal to not increase the maintenance cost
#TODO: commented out recipes need to be built and tested inside of Redox to verify if they returned to work
# Meta-packages below
# auto-test = {}
# dev-essential = {}
# dev-redox = {}
# redox-tests = {}
# x11-minimal = {}
# x11-full = {}
# Normal packages below
# acid = {} # rust require dynamic linking
acid-bins = {}
base = {}
bash = {}
bash-completion = {}
bootloader = {}
bottom = {}
ca-certificates = {}
#contain = {} # redox_syscall 0.4 not working on riscv64gc?
coreutils = {}
cosmic-edit = {}
cosmic-files = {}
cosmic-icons = {}
cosmic-term = {}
#cosmic-text = {} # need to bump redox_syscall
curl = {}
dash = {}
dejavu = {}
diffutils = {}
expat = {}
extrautils = {}
file = {}
findutils = {}
freefont = {}
freetype2 = {}
gettext = {}
git = {}
gnu-make = {}
hicolor-icon-theme = {}
installer = {}
#installer-gui = {} # redox_syscall 0.4 not working on riscv64gc?
ion = {}
kernel = {}
kibi = {}
libffi = {}
libgcc = {}
#libiconv = {} # not tested yet, netsurf is commented out
libjpeg = {}
libogg = {}
#liborbital = {} # not tested yet, netsurf is commented out
libpng = {}
libstdcxx = {}
libvorbis = {}
libxkbcommon = {}
libxml2 = {}
#nano = {} # error compiling ncurses
nasm = {}
#ncurses = {}
netdb = {}
#netsurf = {} # error compiling nghttp2
netutils = {}
#nghttp2 = {}
openssl1 = {}
orbdata = {}
orbital = {}
orbterm = {}
orbutils = {}
#patch = {} error configure machine `riscv64gc-unknown' not recognized
pcre = {}
patchelf = {}
pop-icon-theme = {}
pkgutils = {}
redoxfs = {}
relibc = {}
ripgrep = {}
rustpython = {}
#sdl1 = {} # not tested yet, netsurf is commented out
sed = {}
shared-mime-info = {}
smith = {}
terminfo = {}
userutils = {}
uutils = {}
uutils-procps = {}
xz = {}
#vim = {} # error compiling ncurses
zlib = {}
# #"gcc13.cxx" = {}
# #"llvm21.clang" = {}
# #"llvm21.clang-dev" = {}
# #"llvm21.dev" = {}
# #"llvm21.lld" = {}
# #"llvm21.lld-dev" = {}
# #"llvm21.runtime" = {}
# #"python312.dev" = {}
# #"rust.doc" = {}
# #atk = {} # depends on glib which does not build
# #benchmarks = {}
# #binutils-gdb = {}
# #book = {}
# #cairo-demo = {} # linking errors
# #classicube = {}
# #cmake = {}
# #cmatrix = {} # needs ncursesw now
# #cookbook = {}
# #cosmic-reader = {}
# #cosmic-settings = {}
# #cosmic-store = {}
# #devilutionx = {}
# #dynamic-example = {}
# #fal
# #fd = {} # ctrlc-3.1.1
# #flycast = {}
# #freeciv = {}
# #freeglut = {}
# #friar = {} # mio patch
# #game-2048 = {} # rustc-serialize
# #gawk = {} # langinfo.h
# #gigalomania = {} # old recipe format
# #gitoxide = {}
# #goaccess = {}
# #gstreamer = {} # conflict with thread local errno
# #harfbuzz = {} # depends on glib which does not build
# #helix = {}
# #hello-redox = {}
# #hematite = {} # needs crate patches for redox-unix
# #hf = {}
# #ibm-plex = {}
# #iced = {}
# #jansson = {} # needs config.sub update
# #jq = {}
# #libarchive = {}
# #libatomic = {}
# #libcosmic = {}
# #libflac = {}
# #libmodplug1 = {}
# #libmpfr = {}
# #libnettle = {}
# #libogg = {}
# #libpsl = {}
# #libssh2 = {}
# #libtool = {}
# #liburcu = {}
# #libuv = {}
# #lua-compat-53 = {}
# #luajit = {}
# #luarocks = {}
# #luv = {}
# #mdp = {} # gcc hangs
# #miniserve = {} # actix
# #mpc = {}
# #mupen64plus = {}
# #ncdu = {} # multiple definitions of symbols
# #newlib = {} # obsolete
# #newlibtest = {} # obsolete
# #noto-color-emoji = {}
# #nushell = {} # needs cargo update
# #openjk = {}
# #openposixtestsuite = {}
# #opentyrian = {}
# #orbcalculator = {}
# #ostest-bins = {}
# #pango = {} # undefined references to std::__throw_system_error(int)
# #pastel = {} # needs crate patches for redox-unix
# #pathfinder = {} # servo-fontconfig
# #pciids = {}
# #pcre2 = {}
# #pixman = {} # depends on glib which does not build
# #pkgar = {} # uses virtual Cargo.toml, needs recipe update
# #pls = {}
# #pop-wallpapers = {}
# #powerline = {} # dirs
# #qemu = {} # can be built, but not working
# #quakespasm = {}
# #redox-posix-tests = {}
# #redox-ssh = {} # does not compile
# #retroarch = {} # OS_TLSIndex not declared
# #rust-cairo = {} # linking errors
# #rust-cairo-demo = {} # linking errors
# #rvvm = {}
# #schismtracker = {} # uses system includes
# #sdl-player = {} # wctype_t
# #sdl2-gfx = {}
# #sm64ex = {}
# #spacecadetpinball = {}
# #twin-commander = {}
# #ubuntu-wallpapers = {}
# #unibilium = {}
# #utf8proc = {}
# #vice = {} # linker errors
# #vvvvvv = {} # did not compile
# #webrender = {} # unwind
# #website = {}
# #wesnoth = {}
# #wget = {}
# autoconf = {}
# automake = {}
# binutils = {}
# bzip2 = {}
# cairo = {}
# cleye = {}
# composer = {}
# cosmic-text = {}
# cpal = {}
# dosbox = {}
# duktape = {}
# eduke32 = {}
# exampled = {}
# ffmpeg6 = {}
# fontconfig = {}
# freedoom = {}
# freepats = {}
# fribidi = {}
# gcc13 = {}
# gdbserver = {}
# gdk-pixbuf = {}
# gears = {}
# generaluser-gs = {}
# glib = {}
# glutin = {}
# gnu-binutils = {}
# gnu-grep = {}
# htop = {}
# intel-one-mono = {}
# lci = {}
# libavif = {}
# libc-bench = {}
# libedit = {}
# libgmp = {}
# libicu = {}
# libonig = {}
# libsodium = {}
# libuuid = {}
# libwebp = {}
# llvm21 = {}
# lsd = {}
# lua54 = {}
# lz4 = {}
# mednafen = {}
# mesa = {}
# mesa-glu = {}
# mgba = {}
# ncursesw = {}
# neverball = {}
# nginx = {}
# onefetch = {}
# openjazz = {}
# openssh = {}
# openssl3 = {}
# openttd = {}
# openttd-opengfx = {}
# openttd-openmsx = {}
# openttd-opensfx = {}
# orbclient = {}
# osdemo = {}
# perg = {}
# periodictable = {}
# perl5 = {}
# php84 = {}
# pixelcannon = {}
# pkg-config = {}
# prboom = {}
# procedural-wallpapers-rs = {}
# python312 = {}
# readline = {}
# redox-fatfs = {}
# redox-games = {}
# relibc-tests = {}
# relibc-tests-bins = {}
# rodioplay = {}
# rs-nes = {}
# rsync = {}
# rust = {}
# rust64 = {}
# rustual-boy = {}
# scummvm = {}
# sdl-gfx = {}
# sdl1-image = {}
# sdl1-mixer = {}
# sdl1-ttf = {}
# sdl2 = {}
# sdl2-gears = {}
# sdl2-image = {}
# sdl2-mixer = {}
# sdl2-ttf = {}
# servo = {}
# shellharden = {}
# shellstorm = {}
# simple-http-server = {}
# sodium = {}
# sopwith = {}
# sqlite3 = {}
# strace = {}
# syobonaction = {}
# timidity = {}
# tokei = {}
# ttf-hack = {}
# vttest = {}
# webkitgtk3 = {}
# winit = {}
# xxhash = {}
# zoxide = {} # untested
# zstd = {}

View File

@ -1,3 +0,0 @@
# Configuration for demonstration
include = ["desktop.toml"]

View File

@ -1,15 +0,0 @@
# Default build system configuration
include = ["../desktop.toml"]
# Override the default settings here
# General settings
[general]
# Filesystem size in MiB
# filesystem_size = 1024
# Package settings
[packages]
# example = {}
netsurf = "ignore" # liborbital fails to link in due to mismatching float ABI

View File

@ -1,3 +0,0 @@
# Configuration for Jeremy Soller
include = ["desktop.toml"]

View File

@ -1,22 +0,0 @@
# Server configuration
include = ["minimal.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 512
# Package settings
[packages]
bash = {}
bottom = {}
#contain = {} # needs to update dependencies
curl = {}
diffutils = {}
findutils = {}
gettext = {}
git = {}
installer = {}
kibi = {}
redoxfs = {}

View File

@ -1,31 +0,0 @@
# Configuration for automated self-hosted system compilation testing
include = ["server.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 10000
# Package settings
[packages]
cookbook = {}
bottom = "ignore"
kibi = "ignore"
[[files]]
path = "/usr/lib/init.d/30_console"
data = """
requires_weak 10_net
ion /usr/lib/sys_build.ion
"""
[[files]]
path = "/usr/lib/sys_build.ion"
data = """
#!/usr/bin/env ion
export RUST_BACKTRACE=full
cd /home/user/cookbook
make prefix r.sys,--with-package-deps
shutdown
"""

View File

@ -1,15 +0,0 @@
# Configuration for testing
include = ["server.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 10000
# Do not prompt if settings are not defined
prompt = false
# Package settings
[packages]
redox-tests = {}
benchmarks = {}

View File

@ -1,100 +0,0 @@
# Wayland configuration
include = ["desktop.toml"]
# Override the default settings here
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 2048
# Package settings
[packages]
adwaita-icon-theme = {}
bash = {}
cosmic-app-library = {}
cosmic-comp = {}
gtk3 = {}
libcosmic-wayland = {}
libxcursor = {}
iced-wayland = {}
mesa = {}
"pop-icon-theme.cursors" = {}
smallvil = {}
softbuffer-wayland = {}
wayland-rs = {}
#webkitgtk3 = {}
winit-wayland = {}
xkeyboard-config = {}
# Overridden to launch wayland compositor instead of orblogin
[[files]]
path = "/usr/lib/init.d/20_orbital"
data = """
requires_weak 10_net.target 20_audiod.service
nowait BROWSER=/bin/netsurf-fb VT=3 orbital orbital-wayland
"""
[[files]]
path = "/usr/bin/orbital-wayland"
mode = 0o755
data = """
#!/usr/bin/env bash
set -ex
# Prepare environment
unset DISPLAY
export COSMIC_BACKEND=winit
export HOME=/root
export LD_DEBUG=all
export RUST_BACKTRACE=full
export RUST_LOG=debug
export XCURSOR_THEME=Pop
export XDG_RUNTIME_DIR=/tmp/run/user/0
# Comment out once responsive
export WAYLAND_DEBUG=1
# Create XDG runtime directory
#TODO: mkdir -p not working
mkdir -p /tmp/run
mkdir -p /tmp/run/user
mkdir -p /tmp/run/user/0
# Compile glib schemas
glib-compile-schemas /usr/share/glib-2.0/schemas/
# For cosmic-comp (more features)
cosmic-comp wayland-session
# For smallvil (easier to debug)
#smallvil -c wayland-session&
"""
[[files]]
path = "/usr/bin/wayland-session"
mode = 0o755
data = """
#!/usr/bin/env bash
set -ex
#env G_MAIN_POLL_DEBUG=1 G_MESSAGES_DEBUG=all LD_DEBUG=all WEBKIT_DEBUG=all MiniBrowser&
printenv
#wayland-rs_simple-window
#winit-wayland_window
#softbuffer-wayland_animation
#iced-wayland_sctk_lazy
libcosmic-wayland_application
#gtk3-widget-factory
#cosmic-app-library run
"""
[[files]]
path = "/etc/gtk-3.0/settings.ini"
data = """
[Settings]
gtk-cursor-theme-name = "Pop"
gtk-icon-theme-name = "Cosmic"
"""

View File

@ -1,202 +0,0 @@
# X11 configuration
include = ["desktop.toml"]
# Override the default settings here
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 2048
# Package settings
[packages]
adwaita-icon-theme = {}
dbus = {}
gtk3 = {}
libxcursor = {} # loaded dynamically
#mate-common = {}
mesa-demos-x11 = {}
#firefox = {}
#webkitgtk3 = {} # not compiling
xfce4-full = {}
x11-full = {}
zenity = {}
[[files]]
path = "/usr/lib/init.d/10_dbus"
data = """
requires_weak 10_net.target
bash /usr/bin/start-dbus.sh
"""
[[files]]
path = "/usr/bin/start-dbus.sh"
mode = 0o755
data = """
#!/usr/bin/env bash
export DBUS_DEBUG_OUTPUT=1
#export DBUS_VERBOSE=1
#export G_DBUS_DEBUG=all
mkdir -p /var/lib/dbus
dbus-uuidgen --ensure
mkdir -p /run/dbus
rm -f /run/dbus/pid
dbus-daemon --system
"""
[[files]]
path = "/usr/lib/init.d/10_xenv"
data = """
requires_weak 10_net.target
glib-compile-schemas /usr/share/glib-2.0/schemas/
"""
# Overridden to launch X instead of orblogin
[[files]]
path = "/usr/lib/init.d/20_orbital"
data = """
requires_weak 10_dbus 10_xenv 20_audiod.service
nowait BROWSER=/bin/netsurf-fb VT=3 orbital orbital-x11
"""
[[files]]
path = "/run/user/0"
data = ""
directory = true
mode = 0o700
[[files]]
path = "/home/root/.config/dconf"
data = ""
directory = true
[[files]]
path = "/home/root/Desktop"
data = ""
directory = true
[[files]]
path = "/usr/share/X11/xorg.conf.d"
data = ""
directory = true
[[files]]
path = "/usr/bin/orbital-x11"
mode = 0o755
data = """
#!/usr/bin/env bash
set -ex
# for ice authority and pixbuf
export HOME=/home/root
export XDG_DATA_DIRS=/usr/share
export XDG_RUNTIME_DIR=/run/user/0
export XDG_CONFIG_HOME=/home/root/.config
# Generate config file
WIDTH="$((0x$(grep FRAMEBUFFER_WIDTH /scheme/sys/env | cut -d '=' -f 2)))"
HEIGHT="$((0x$(grep FRAMEBUFFER_HEIGHT /scheme/sys/env | cut -d '=' -f 2)))"
cat > /usr/share/X11/xorg.conf.d/orbital.conf <<EOF
Section "Device"
Identifier "Configured Video Device"
Driver "dummy"
VideoRam 256000
EndSection
Section "Monitor"
Identifier "Configured Monitor"
HorizSync 5.0 - 1000.0
VertRefresh 5.0 - 200.0
$(cvt "${WIDTH}" "${HEIGHT}")
EndSection
Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "${WIDTH}x${HEIGHT}"
EndSubSection
EndSection
EOF
# Launch X11 and session on display 0
export DISPLAY=":0"
X "${DISPLAY}" &
sleep 1
exec dbus-launch --exit-with-x11 xfce4-x11-session
"""
[[files]]
path = "/usr/bin/mate-x11-session"
mode = 0o755
data = """
#!/usr/bin/env bash
set -ex
gdk-pixbuf-query-loaders --update-cache
/usr/libexec/dconf-service &
xterm&
#zenity --info --text="running mate as $(id)!"
#exec marco
exec mate-session
"""
[[files]]
path = "/usr/bin/xfce4-x11-session"
mode = 0o755
data = """
#!/usr/bin/env bash
set -ex
gdk-pixbuf-query-loaders --update-cache
/usr/lib/xfce4/xfconf/xfconfd &
/usr/lib/tumbler-1/tumblerd &
/usr/libexec/upowerd &
xfsettingsd &
xterm&
#zenity --info --text="running xfce4 as $(id)!"
#exec xfwm4
exec xfce4-session
"""
[[files]]
path = "/usr/lib/environment.d/10_x11"
data = """
DISPLAY=:0
"""
[[files]]
path = "/usr/bin/browser"
mode = 0o755
data = """
#!/usr/bin/env bash
set -ex
#export G_MAIN_POLL_DEBUG=1
export G_MESSAGES_DEBUG=all
#export GDK_DEBUG=all
#export GTK_DEBUG=all
export LD_DEBUG=all
#export WEBKIT_DEBUG=all
exec MiniBrowser --dark-mode --ignore-tls-errors "about:blank"
"""
[users.messagebus]
uid = 100
gid = 100
name = "messagebus"
home = "/nonexistent"
shell = "/usr/bin/false"

View File

@ -1,326 +0,0 @@
# The Redox build server configuration
# General settings
[general]
# Do not prompt if settings are not defined
prompt = false
# Package settings
[packages]
# If you need to disable some broken package comment out instead of removal to not increase the maintenance cost
#TODO: commented out recipes need to be built and tested inside of Redox to verify if they returned to work
# Meta-packages below
auto-test = {}
autotools = {}
dev-essential = {}
dev-redox = {}
llvm21-common = {}
mate-common = {}
redox-tests = {}
x11-minimal = {}
x11-full = {}
xfce4-common = {}
xfce4-full = {}
# Normal packages below
acid = {}
adwaita-icon-theme = {}
atk = {}
autoconf = {}
automake = {}
base = {}
bash = {}
bash-completion = {}
binutils = {}
bootloader = {}
boxedwine = {}
bottom = {}
bzip2 = {}
ca-certificates = {}
cairo = {}
cairo-demo = {}
cbindgen = {}
classicube = {}
clang21 = {}
cleye = {}
cmake = {}
cmatrix = {}
composer = {}
contain = {}
coreutils = {}
cosmic-edit = {}
cosmic-files = {}
cosmic-icons = {}
cosmic-reader = {}
cosmic-term = {}
cosmic-text = {}
cpal = {}
curl = {}
dash = {}
dejavu = {}
devilutionx = {}
diffutils = {}
dosbox = {}
duktape = {}
eduke32 = {}
exampled = {}
expat = {}
extrautils = {}
ffmpeg6 = {}
file = {}
findutils = {}
firefox = {}
fish-shell = {}
flycast = {}
fontconfig = {}
freeciv = {}
freedoom = {}
freefont = {}
freepats = {}
freetype2 = {}
fribidi = {}
gawk = {}
gcc13 = {}
gdbserver = {}
gdk-pixbuf = {}
gears = {}
generaluser-gs = {}
gettext = {}
gigalomania = {}
git = {}
glib = {}
glutin = {}
gnu-binutils = {}
gnu-grep = {}
gnu-make = {}
goaccess = {}
gobject-introspection = {}
gitoxide = {}
gstreamer = {}
harfbuzz = {}
hicolor-icon-theme = {}
helix = {}
hello-redox = {}
hf = {}
htop = {}
jansson = {}
jq = {}
installer = {}
installer-gui = {}
intel-one-mono = {}
ion = {}
kernel = {}
kibi = {}
lci = {}
libarchive = {}
libatomic = {}
libavif = {}
libc-bench = {}
libedit = {}
libffi = {}
libflac = {}
libgcc = {}
libgmp = {}
libiconv = {}
libicu = {}
libjpeg = {}
libmodplug1 = {}
libmpfr = {}
libnettle = {}
libogg = {}
libonig = {}
liborbital = {}
libpsl = {}
libpng = {}
libsodium = {}
libssh2 = {}
libstdcxx = {}
libtool = {}
libuuid = {}
liburcu = {}
libuv = {}
libvorbis = {}
libwebp = {}
libxkbcommon = {}
libxcursor = {}
libxml2 = {}
llvm21 = {}
lsd = {}
lua54 = {}
lua-compat-53 = {}
luajit = {}
luarocks = {}
lz4 = {}
mednafen = {}
mesa = {}
mesa-glu = {}
mesa-demos = {}
mesa-demos-x11 = {}
mgba = {}
miniserve = {}
mpc = {}
nano = {}
nasm = {}
ncdu = {}
ncurses = {}
ncursesw = {}
neovim = {}
netdb = {}
netsurf = {}
netutils = {}
neverball = {}
nghttp2 = {}
nginx = {}
nodejs-21 = {}
nushell = {}
onefetch = {}
openjazz = {}
openjk = {}
openssh = {}
openssl1 = {}
openssl3 = {}
openttd = {}
openttd-opengfx = {}
openttd-openmsx = {}
openttd-opensfx = {}
opentyrian = {}
orbclient = {}
orbdata = {}
orbital = {}
orbterm = {}
orbutils = {}
os-test-bins = {}
osdemo = {}
pango = {}
patch = {}
patchelf = {}
pcre = {}
pcre2 = {}
perg = {}
periodictable = {}
perl5 = {}
php84 = {}
pixelcannon = {}
pixman = {}
pkg-config = {}
pkgar = {}
pkgutils = {}
pls = {}
pop-icon-theme = {}
powerline = {}
prboom = {}
procedural-wallpapers-rs = {}
profiled = {}
profiling-kernel = {}
python312 = {}
qemu = {}
quakespasm = {}
readline = {}
redox-fatfs = {}
redox-games = {}
redoxfs = {}
relibc = {}
relibc-tests = {}
relibc-tests-bins = {}
ripgrep = {}
rodioplay = {}
rs-nes = {}
rsync = {}
rust = {}
rust64 = {}
rustpython = {}
rustual-boy = {}
rvvm = {}
scummvm = {}
sdl-gfx = {}
sdl1 = {}
sdl1-image = {}
sdl1-mixer = {}
sdl1-ttf = {}
sdl2 = {}
sdl2-gears = {}
sdl2-image = {}
sdl2-mixer = {}
sdl2-ttf = {}
sed = {}
servo = {}
shared-mime-info = {}
shellharden = {}
shellstorm = {}
simple-http-server = {}
smallvil = {}
smith = {}
sodium = {}
softbuffer-wayland = {}
sopwith = {}
sqlite3 = {}
strace = {}
syobonaction = {}
tcl = {}
terminfo = {}
timidity = {}
tmux = {}
tokei = {}
ttf-hack = {}
userutils = {}
uutils = {}
uutils-procps = {}
vim = {}
vttest = {}
wasmtime = {}
wayland-rs = {}
webkitgtk3 = {}
wget = {}
winit = {}
winit-wayland = {}
xxhash = {}
xz = {}
zenity = {}
zoxide = {}
zsh = {}
zlib = {}
zola = {}
zstd = {}
#benchmarks = {}
#binutils-gdb = {}
#book = {}
#cookbook = {}
#cosmic-settings = {}
#cosmic-store = {}
#dynamic-example = {}
#fal
#fd = {} # ctrlc-3.1.1
#freeglut = {}
#friar = {} # mio patch
#game-2048 = {} # rustc-serialize
#hematite = {} # needs crate patches for redox-unix
#ibm-plex = {}
#iced = {}
#libcosmic = {}
#mdp = {} # gcc hangs
#mupen64plus = {}
#noto-color-emoji = {}
#orbcalculator = {}
#ostest-bins = {}
#pastel = {} # needs crate patches for redox-unix
#pathfinder = {} # servo-fontconfig
#pciids = {}
#pop-wallpapers = {}
#retroarch = {} # cannot locate GL
#rust-cairo = {} # linking errors
#rust-cairo-demo = {} # linking errors
#schismtracker = {} # uses system includes
#sdl-player = {} # wctype_t
#sdl2-gfx = {}
#twin-commander = {}
#ubuntu-wallpapers = {}
#vice = {} # linker errors
#vvvvvv = {} # did not compile
#webrender = {} # unwind
#website = {}
#wesnoth = {}

View File

@ -1,71 +0,0 @@
# Configuration for demonstration
include = ["../desktop.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 1536
# Package settings
[packages]
# GUI Apps
cosmic-reader = {}
periodictable = {}
# GUI Data
intel-one-mono = {}
# Shell Apps
gawk = {}
gnu-grep = {}
htop = {}
ripgrep = {}
terminfo = {}
vim = {}
wget = {}
# Games
dosbox = {}
freedoom = {}
neverball = {}
prboom = {}
redox-games = {}
sopwith = {}
syobonaction = {}
# Demos
nushell = {}
orbclient = {}
pixelcannon = {}
rodioplay = {}
gears = {}
# MIDI
freepats = {}
[[files]]
path = "/home/user/Welcome.txt"
data = """
##############################################################################
# #
# Welcome to Redox! #
# #
# Redox is an operating system written in Rust, a language with focus #
# on safety and high performance. Redox, following the microkernel design, #
# aims to be secure, usable, and free. Redox is inspired by previous kernels #
# and operating systems, such as SeL4, MINIX, Plan 9, and BSD. #
# #
# Redox _is not_ just a kernel, it's a full-featured Operating System, #
# providing packages (memory allocator, file system, display manager, core #
# utilities, etc.) that together make up a functional and convenient #
# operating system. You can loosely think of it as the GNU or BSD ecosystem, #
# but in a memory safe language and with modern technology. #
# #
# The website can be found at https://www.redox-os.org. #
# #
# For things to try on Redox, please see #
# https://doc.redox-os.org/book/ch02-06-trying-out-redox.html #
# #
##############################################################################
"""

View File

@ -1,9 +0,0 @@
include = [ "../base.toml", "ci.toml" ]
# General settings
[general]
filesystem_size = 8192
# Package settings
[packages]
# example = {}

View File

@ -1,100 +0,0 @@
# Configuration for Jeremy Soller
include = ["demo.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 8192
# Package settings
[packages]
# apps
#boxedwine = {}
cosmic-player = {}
cosmic-reader = {}
cosmic-settings = {}
cosmic-store = {}
cosmic-term = {}
cosmic-text = {}
#qemu = {} # not building
schismtracker = {}
servo = {}
# cli
cleye = {}
ffmpeg6 = {}
lua54 = {}
nano = {}
#nushell = {}
perg = {}
#relibc-tests = {}
russh = {}
sed = {}
shellharden = {}
xz = {}
# demos
#cairodemo = {}
cmatrix = {}
cpal = {}
gears = {}
glutin = {}
#hematite = {} # not building
iced = {}
libcosmic = {}
osdemo = {} # does not show anything
#pathfinder = {} # not building
procedural-wallpapers-rs = {}
#rust-cairo = {}
#rust-cairo-demo = {}
sdl2-gears = {}
vttest = {}
#webrender = {}
winit = {}
# dev
autoconf = {}
automake = {}
#cookbook = {}
gcc13 = {}
gnu-binutils = {}
gnu-make = {}
nasm = {}
patch = {}
pkg-config = {}
rust = {}
# games
devilutionx = {}
eduke32 = {}
flycast = {}
freeciv = {}
gigalomania = {}
love = {}
mednafen = {}
mgba = {}
openjazz = {}
openjk = {}
openttd = {}
openttd-opengfx = {}
openttd-openmsx = {}
openttd-opensfx = {}
quakespasm = {}
#retroarch = {} # need to package cores
rs-nes = {} # need game for testing
rust64 = {} # need roms
rustual-boy = {} # need game for testing
scummvm = {} # need game for testing
sm64ex = {}
#spacecadetpinball = {} # not building
syobonaction = {}
#vice = {} # broken on new toolchain
#vvvvvv = {} # cannot find -lgcc_s
# stuff
generaluser-gs = {}
jeremy = {}
noto-color-emoji = {}
timidity = {}
ttf-hack = {}

View File

@ -1,8 +0,0 @@
# Configuration used for building redoxer base image
include = ["../redoxer.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 1024

View File

@ -1,13 +0,0 @@
# Configuration for demonstration
include = ["demo.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 1536
# Package settings
[packages]
cosmic-reader = {}
rustconf2025 = {}

View File

@ -1,311 +0,0 @@
# Configuration for server stack demonstration
include = ["../server.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 4096
# Package settings
[packages]
# Daemons
openssh = {}
nginx = {}
rustysd = {}
# Backends
php84 = {}
composer = {}
luajit = {}
python312 = {}
# go = {}
# zig = {}
# Tools
nano = {}
neovim = {}
rsync = {}
vim = {}
sqlite3 = {}
# tmux = {}
htop = {}
# Content
website = {}
[[files]]
path = "/usr/lib/init.d/98_keygen_sh"
data = """
requires_weak 10_net.target
bash /root/keygen.sh
"""
[[files]]
path = "/usr/lib/init.d/99_rustysd"
data = """
requires_weak 98_keygen_sh
# Undocumented usage of rsdctl, pointing to notifications dir
RSDCTL_ADDR=/var/run/rustysd/control.socket rustysd --conf /etc/rustysd
"""
[[files]]
path = "/etc/rustysd/system/network-online.target"
data = """
[Unit]
Description=The target after networks has online
[Install]
WantedBy=default.target
"""
[[files]]
path = "/etc/rustysd/system/multi-user.target"
data = """
[Unit]
Description=The target after user administrations has online
[Install]
WantedBy=default.target
"""
[[files]]
path = "/etc/rustysd/system/nginx.service"
data = """
[Unit]
Description=The nginx HTTP and reverse proxy server
After=network-online.target
[Service]
Type=simple
ExecStart=/usr/bin/nginx -g "daemon off;"
[Install]
WantedBy=multi-user.target
"""
[[files]]
path = "/etc/rustysd/system/ssh.service"
data = """
[Unit]
Description=OpenBSD Secure Shell server
After=network-online.target
[Service]
Type=simple
ExecStart=/usr/bin/sshd -D
[Install]
WantedBy=multi-user.target
"""
[[files]]
path = "/etc/rustysd/system/php.service"
data = """
[Unit]
Description=OpenBSD Secure Shell server
After=network-online.target
[Service]
Type=simple
# currently php-fpm not that quite work
ExecStart=env PWD=/var/www/html php -S localhost:9000
# ExecStart=/usr/bin/php-fpm --fpm-config /etc/php/84/php-fpm.conf --nodaemonize
[Install]
WantedBy=multi-user.target
"""
[[files]]
path = "/var/www/html/index.php"
data = """
<?php
echo "Hello from PHP on Redox!";
"""
[[files]]
path = "/var/www/html/phpinfo.php"
data = """
<?php phpinfo();
"""
[[files]]
path = "/var/www/html/README"
data = """
This is a demonstration into PHP server.
At the moment to run composer you have to run it like:
> php /bin/composer install
"""
[[files]]
postinstall = true
data = ""
path = "/etc/nginx/conf.d"
directory = true
[[files]]
postinstall = true
path = "/etc/nginx/nginx.conf"
data = """
user nginx;
# currently nginx does a lot spin locking for some reason
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
include mime.types;
include fastcgi.conf;
default_type application/octet-stream;
include /etc/nginx/conf.d/*.conf;
}
"""
[[files]]
postinstall = true
path = "/etc/nginx/conf.d/localhost.conf"
data = """
server {
listen 80;
server_name localhost;
root /usr/share/website;
absolute_redirect off;
location / {
index index.html index.htm;
}
}
"""
[[files]]
postinstall = true
path = "/etc/nginx/conf.d/php-www.conf"
data = """
server {
listen 8081;
server_name localhost;
root /var/www/html;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ =404;
}
location ~ \\.php$ {
# because we're not using PHP FPM (see rustysd php.service)
# include fastcgi_params;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
proxy_pass http://127.0.0.1:9000;
}
}
"""
[[files]]
postinstall = true
path = "/etc/php/84/php-fpm.conf"
data = """
error_log=/var/log/php-fpm.log
include=/etc/php/84/php-fpm.d/*.conf
"""
[[files]]
postinstall = true
path = "/etc/php/84/php-fpm.d/www.conf"
data = """
[www]
user = user
group = user
listen = 127.0.0.1:9000
pm = static
pm.max_children = 1
"""
[[files]]
postinstall = true
path = "/etc/ssh/sshd_config"
data = """
Port 22
AddressFamily inet
AuthorizedKeysFile .ssh/authorized_keys
PermitRootLogin yes
PasswordAuthentication yes
PermitEmptyPasswords yes
Subsystem sftp /usr/libexec/sftp-server
"""
[users.nobody]
password = ""
shell = "/usr/bin/ion" #TODO: nologin?
[users.nginx]
password = ""
shell = "/usr/bin/ion" #TODO: nologin?
[[files]]
path = "/root/keygen.sh"
data = """
#!/usr/bin/env bash
if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ""
ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N ""
ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -N ""
fi
"""
[[files]]
path = "/home/user/server.sh"
data = """
#!/usr/bin/env bash
/bin/sshd -D &
nginx -g "daemon off;" &
php-fpm --nodaemonize &
"""
[[files]]
path = "/home/user/Welcome.txt"
data = """
##############################################################################
# Welcome to Redox Server Demo!
#
# This is a quick demonstration of Redox used as server stack.
# At the moment we support SSH, NGINX, Python, PHP. There's more to come
#
# This server demo is insecure by design, we encourage you to get familiar into
# basics of server security if you wish to use this as a production server.
#
# There should be rustysd already running, if not, you can try start it manually
# > sudo rustysd --conf /etc/rustysd
#
# You can also try running all daemons manually
# > sudo bash server.sh
#
# The server will start port 22 (ssh), 80 (static web) and 8081 (php)
# If you use the Redox OS build system, starting QEMU with `net=redir`
# should expose those port to 8022, 8080 and 8081.
# Try logging in to console via SSH with `ssh user@localhost -p 8022`
#
##############################################################################
"""

1
cookbook Submodule

@ -0,0 +1 @@
Subproject commit cc5f7523bf9567eb17372c27ea8e514ae78e2ece

3
docker/.bash_aliases Normal file
View File

@ -0,0 +1,3 @@
# Hijack this file to set this PS1, visually indicating to the user that we are running the docker container
PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[1;35m\]<$IMAGE_NAME>\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ "

39
docker/Dockerfile Executable file
View File

@ -0,0 +1,39 @@
FROM rustlang/rust:nightly
ENV IMAGE_NAME=redox-os-docker
RUN set -ex; \
apt-get update; \
apt-get install -q -y --no-install-recommends \
apt-transport-https \
bison \
flex \
fuse \
gosu \
libfuse-dev \
nasm \
qemu-utils \
sudo \
texinfo \
git \
; \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys AA12E97F0881517F; \
echo "deb https://static.redox-os.org/toolchain/apt/ /" >> \
/etc/apt/sources.list.d/redox.list; \
apt-get update -o Dir::Etc::sourcelist="redox.list"; \
apt-get install -q -y --no-install-recommends \
x86-64-unknown-redox-newlib \
x86-64-unknown-redox-binutils \
x86-64-unknown-redox-gcc \
; \
cargo install xargo; \
cargo install cargo-config; \
apt-get autoremove -q -y; \
apt-get clean -q -y; \
rm -rf /var/lib/apt/lists/*
COPY entrypoint.sh /usr/local/bin/
COPY .bash_aliases /etc/skel/
ENTRYPOINT ["bash", "/usr/local/bin/entrypoint.sh"]
CMD ["/bin/bash"]

76
docker/README.md Normal file
View File

@ -0,0 +1,76 @@
## Building Redox using a Docker image with the pre-built toolchain
*All you need is `git`, `make`, `qemu`, `fuse` and `docker`. The method requires
a non-privileged user able to run the `docker` command, which is usually achieved
by adding the user to the `docker` group.*
It's a three-steps process with variations depending on the platform.
On the first execution of one of the following docker commands, the
official container image will be pulled from dockerhub and stored
locally.
The image includes the required dependencies and the pre-built
toolchain. As long as you rely on this particular dependencies and
toolchain versions, you don't need to update the container.
### <a name='get_the_sources'></a>Get the sources
```
git clone https://github.com/redox-os/redox.git ; cd redox
```
### Upate the source tree
Note: if you use the container on a different host or
with a different user, [get the sources first](#get_the_sources).
```shell
git pull --rebase --recurse-submodules && git submodule sync \
&& git submodule update --recursive --init
```
### Run the container to build Redox
```shell
docker run --cap-add MKNOD --cap-add SYS_ADMIN --device /dev/fuse \
-e LOCAL_UID="$(id -u)" -e LOCAL_GID="$(id -g)" \
-v redox-"$(id -u)-$(id -g)"-cargo:/usr/local/cargo \
-v redox-"$(id -u)-$(id -g)"-rustup:/usr/local/rustup \
-v "$(pwd):$(pwd)" -w "$(pwd)" --rm redoxos/redox make fetch all
```
#### Linux with security modules
Add the following options depending on the security modules activated on your system:
```shell
--security-opt label=disable // disable SELinux
--security-opt seccomp=unconfined // disable seccomp
--security-opt apparmor=unconfined // disable AppArmor
```
Ex.: for a SELinux only system such as Fedora or CentOS
```shell
docker run --cap-add MKNOD --cap-add SYS_ADMIN --device /dev/fuse \
-e LOCAL_UID="$(id -u)" -e LOCAL_GID="$(id -g)" \
--security-opt label=disable \
-v redox-"$(id -u)-$(id -g)"-cargo:/usr/local/cargo \
-v redox-"$(id -u)-$(id -g)"-rustup:/usr/local/rustup \
-v "$(pwd):$(pwd)" -w "$(pwd)" --rm redoxos/redox make fetch all
```
### Run the container interactively
```shell
docker run --cap-add MKNOD --cap-add SYS_ADMIN --device /dev/fuse \
-e LOCAL_UID="$(id -u)" -e LOCAL_GID="$(id -g)" \
-v redox-"$(id -u)-$(id -g)"-cargo:/usr/local/cargo \
-v redox-"$(id -u)-$(id -g)"-rustup:/usr/local/rustup \
-v "$(pwd):$(pwd)" -w "$(pwd)" --rm -it redoxos/redox
```
#### Demo
![Image of Usage](interactive_demo.gif)
### Clear the named volumes containing the toolchain caches
```shell
docker volume rm redox-"$(id -u)-$(id -g)"-cargo \
redox-"$(id -u)-$(id -g)"-rustup
```
### Build the container manually
If you cannot access dockerhub for whatever reason, you can also build
the container image manually.
```shell
docker build -t redoxos/redox docker/
```

29
docker/entrypoint.sh Executable file
View File

@ -0,0 +1,29 @@
#!/usr/bin/env bash
# Add local user
# Either use LOCAL_UID and LOCAL_GID if passed in at runtime via
# -e LOCAL_UID="$(id -u)" -e LOCAL_GID="$(id -g)" or fallback
USER_NAME=redox
RUN_UID=${LOCAL_UID:-9001}
RUN_GID=${LOCAL_GID:-9001}
groupadd --non-unique --gid $RUN_GID $USER_NAME
useradd --non-unique --create-home --uid $RUN_UID --gid $USER_NAME --groups sudo $USER_NAME
echo "$USER_NAME ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/user-no-sudo-password
export HOME=/home/$USER_NAME
# Check current UID and GID of files in the named volume caches for
# cargo and rustup. Test only one of the top level folders to speed
# things up.
TESTFILE=$RUSTUP_HOME/settings.toml
CACHED_UID=$(stat -c "%u" $TESTFILE)
CACHED_GID=$(stat -c "%g" $TESTFILE)
if [ $CACHED_UID != $RUN_UID ] || [ $RUN_GID != $CACHED_GID ]; then
echo -e "\033[01;38;5;155mChanging user id:group to ${RUN_UID}:${RUN_GID}. Please wait...\033[0m"
chown $RUN_UID:$RUN_GID -R $CARGO_HOME $RUSTUP_HOME
fi
exec gosu $USER_NAME "$@"

BIN
docker/interactive_demo.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1006 KiB

175
filesystem.toml Normal file
View File

@ -0,0 +1,175 @@
# This is the default configuration file
# General settings
[general]
# Do not prompt if settings are not defined
prompt = false
sysroot = "build/filesystem"
# Package settings
[packages]
#acid = {}
#autoconf = {}
#automake = {}
#bash = {}
#binutils = {}
#ca-certificates = {}
#cargo = {}
#contain = {}
coreutils = {}
#curl = {}
#dash = {}
#diffutils = {}
drivers = {}
extrautils = {}
findutils = {}
#games = {}
#gawk = {}
#gcc = {}
#git = {}
#gnu-binutils = {}
#gnu-make = {}
#installer = {}
ion = {}
#lua = {}
#nasm = {}
netstack = {}
netutils = {}
#newlib = {}
#openssl = {}
orbdata = {}
orbital = {}
orbterm = {}
orbutils = {}
#pastel = {}
#patch = {}
#pixelcannon = {}
pkgutils = {}
ptyd = {}
#python = {}
randd = {}
#redoxfs = {}
#rust = {}
#rustual-boy = {}
#sed = {}
smith = {}
#sodium = {}
userutils = {}
uutils = {}
#xz = {}
# User settings
[users.root]
# Password is set to "password"
password = "$argon2i$m=4096,t=10,p=1$Tnc4UVV0N00$ML9LIOujd3nmAfkAwEcSTMPqakWUF0OUiLWrIy0nGLk"
uid = 0
gid = 0
name = "root"
home = "/root"
[users.user]
# Password is unset
password = ""
[[files]]
path = "/etc/init.d/00_base"
data = """
pcid /etc/pcid/filesystem.toml
randd
ptyd
"""
[[files]]
path = "/etc/init.d/10_net"
data = """
ethernetd
ipd
icmpd
tcpd
udpd
dhcpd -b
"""
[[files]]
path = "/etc/init.d/20_orbital"
data = """
orbital display:3/activate orblogin launcher
"""
[[files]]
path = "/etc/init.d/30_console"
data = """
getty display:2
getty debug: -J
"""
[[files]]
path = "/etc/net/dns"
data = """
208.67.222.222
"""
[[files]]
path = "/etc/net/ip"
data = """
10.0.2.15
"""
[[files]]
path = "/etc/net/ip_router"
data = """
10.0.2.2
"""
[[files]]
path = "/etc/net/ip_subnet"
data = """
255.255.255.0
"""
[[files]]
path = "/etc/net/mac"
data = """
54-52-00-ab-cd-ef
"""
[[files]]
path = "/etc/pkg.d/50_redox"
data = "https://static.redox-os.org/pkg"
[[files]]
path = "/etc/group"
data = """
root;0;root
user;1000;user
sudo;1;user
"""
[[files]]
path = "/etc/hostname"
data = """
redox
"""
[[files]]
path = "/etc/issue"
data = """
########## Redox OS ##########
# Login with the following: #
# `user` #
# `root`:`password` #
##############################
"""
[[files]]
path = "/etc/motd"
data = """
Welcome to Redox OS!
"""
[[files]]
path = "/usr"
data = "/"
symlink = true

82
flake.lock generated
View File

@ -1,82 +0,0 @@
{
"nodes": {
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1763759067,
"narHash": "sha256-LlLt2Jo/gMNYAwOgdRQBrsRoOz7BPRkzvNaI/fzXi2Q=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "2cccadc7357c0ba201788ae99c4dfa90728ef5e0",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1763934636,
"narHash": "sha256-9glbI7f1uU+yzQCq5LwLgdZqx6svOhZWkd4JRY265fc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ee09932cedcef15aaf476f9343d1dea2cb77e261",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1761765539,
"narHash": "sha256-b0yj6kfvO8ApcSE+QmA6mUfu8IYG6/uU28OFn4PaC8M=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "719359f4562934ae99f5443f20aa06c2ffff91fc",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"root": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
}
},
"rust-overlay": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1764038373,
"narHash": "sha256-M6w2wNBRelcavoDAyFL2iO4NeWknD40ASkH1S3C0YGM=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "ab3536fe850211a96673c6ffb2cb88aab8071cc9",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

202
flake.nix
View File

@ -1,202 +0,0 @@
{
description = "The Nix-flake for Redox development on NixOS";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
inputs@{
nixpkgs,
flake-parts,
rust-overlay,
...
}:
flake-parts.lib.mkFlake { inherit inputs; } (
top@{
config,
withSystem,
moduleWithSystem,
...
}:
{
systems = [
"i686-linux"
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
perSystem =
{
system,
lib,
inputs',
...
}:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ rust-overlay.overlays.default ];
};
rust-bin = pkgs.rust-bin.nightly."2026-05-24".default.override {
extensions = [
"rust-analyzer"
"rust-src"
];
targets = [ "x86_64-unknown-redox" ];
};
in
{
formatter = pkgs.nixfmt-rfc-style;
# TODO: Create Redox OS Image as package
# TODO: No cross-compile for now, as there is no pkgsCross.aarch64-unknown-redox and so on
# TODO: Get rid of make env step: package custom libtool and setup rust toolchain properly
devShells = {
# Podman config taken from https://nixos.wiki/wiki/Podman and https://gist.github.com/adisbladis/187204cb772800489ee3dac4acdd9947
# Provides a script that copies required files to ~/
default =
let
rustPlatform = pkgs.makeRustPlatform {
cargo = rust-bin;
rustc = rust-bin;
};
podmanSetupScript =
let
registriesConf = pkgs.writeText "registries.conf" ''
[registries.search]
registries = ['docker.io']
[registries.block]
registries = []
'';
in
pkgs.writeScript "podman-setup" ''
#!${pkgs.runtimeShell}
# Dont overwrite customised configuration
if ! test -f ~/.config/containers/policy.json; then
install -Dm555 ${pkgs.skopeo.src}/default-policy.json ~/.config/containers/policy.json
fi
if ! test -f ~/.config/containers/registries.conf; then
install -Dm555 ${registriesConf} ~/.config/containers/registries.conf
fi
systemctl --user start podman.socket || true
export PODMAN_SYSTEMD_UNIT=podman.socket
'';
# Provides a fake "docker" binary mapping to podman
dockerCompat = pkgs.runCommand "docker-podman-compat" { } ''
mkdir -p $out/bin
ln -s ${pkgs.podman}/bin/podman $out/bin/docker
'';
in
pkgs.mkShell rec {
buildInputs = with pkgs; [
# Podman
dockerCompat
podman # Docker compat
runc # Container runtime
conmon # Container runtime monitor
skopeo # Interact with container registry
slirp4netns # User-mode networking for unprivileged namespaces
fuse-overlayfs # CoW for images, much faster than default vfs
# with FSTOOLS_IN_PODMAN=1 these are not needed
# without it, the installer fails to link FUSE somehow
#fuse
#rust-bin
qemu_kvm
];
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
NIX_SHELL_BUILD = "1";
FSTOOLS_IN_PODMAN = "1";
shellHook = ''
# Install required configuration
${podmanSetupScript}
echo "Redox podman build environment loaded"
'';
};
#TODO: This isn't tested yet, use at your own risk
native = pkgs.mkShell rec {
nativeBuildInputs =
let
autoreconf269 = pkgs.writeShellScriptBin "autoreconf2.69" "${pkgs.autoconf269}/bin/autoreconf";
in
with pkgs;
[
ant
autoconf
autoreconf269 # gnu-binutils
automake
bison
cmake
curl
doxygen
file
flex
gettext
gnumake
gnupatch
gperf
help2man
just
llvmPackages.clang
llvmPackages.llvm
lua
m4
meson
nasm
ninja
perl
perl540Packages.HTMLParser
perl540Packages.Po4a
pkg-config
pkgconf
(python3.withPackages (ps: with ps; [ mako ]))
qemu_kvm
rust-cbindgen
scons
texinfo
unzip
waf
wget
xdg-utils
xxd
zip
] ++ pkgs.lib.optionals pkgs.stdenv.hostPlatform.isx86 [
pkgs.syslinux
];
buildInputs = with pkgs; [
rust-bin
fuse # fuser
libpng # netsurf
fontconfig # orbutils
SDL # prboom
xorg.utilmacros # libX11
xorg.xtrans # libX11
];
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
PERL_PATH = "${pkgs.perl}/bin/perl";
NIX_SHELL_BUILD = "1";
PODMAN_BUILD = "0";
shellHook = with pkgs; ''
export PKG_CONFIG_PATH="${fuse.dev}/lib/pkgconfig\
:${libpng.dev}/lib/pkgconfig"
'';
};
};
};
}
);
}

28
initfs.toml Normal file
View File

@ -0,0 +1,28 @@
# This is the default configuration file
# General settings
[general]
# Do not prompt if settings are not defined
prompt = false
sysroot = "build/initfs"
# Package settings
[packages]
drivers = {}
init = {}
redoxfs = {}
[[files]]
path="/etc/init.rc"
data="""
export PATH /bin
export TMPDIR /tmp
vesad T T G
stdio display:1
ps2d
pcid /etc/pcid/initfs.toml
redoxfs disk:0 file
cd file:
export PATH file:/bin
run.d /etc/init.d
"""

1
installer Submodule

@ -0,0 +1 @@
Subproject commit 093ae7de5541ba6068c98ea568ca6d3977e2a5b8

1
isolinux Submodule

@ -0,0 +1 @@
Subproject commit 3cf79d335400af8fc3a87a13f0ae12777a766b3b

1
kernel Submodule

@ -0,0 +1 @@
Subproject commit cf45bd34e107df2faf590475546a7d7ac34114db

2
mk/bochs.mk Normal file
View File

@ -0,0 +1,2 @@
bochs: build/harddrive.bin
bochs -f bochs.$(ARCH)

View File

@ -1,71 +0,0 @@
# Configuration file of the build system commands for the build server
IMG_TAG?=$(shell git describe --tags)
IMG_SEPARATOR?=_
IMG_DIR?=build/img/$(ARCH)
OS_TEST_DIR?=build/os-test/$(ARCH)
CI_COOKBOOK_CONFIG?=CI=1 COOKBOOK_LOGS=true COOKBOOK_CLEAN_BUILD=true COOKBOOK_VERBOSE=false COOKBOOK_COMPRESSED=true COOKBOOK_WEB=true
# CI image target - build standard images
# To leave out the build tag, set both IMG_TAG and IMG_SEPARATOR to null
ci-img: FORCE
rm -rf $(IMG_DIR)
mkdir -p $(IMG_DIR)
$(MAKE) server desktop demo
cd $(IMG_DIR) && zstd --rm *
cd $(IMG_DIR) && sha256sum -b * > SHA256SUM
# The name of the target must match the name of the filesystem config file
server desktop demo: FORCE
rm -f "build/$(ARCH)/$@/harddrive.img" "build/$(ARCH)/$@/redox-live.iso"
export $(CI_COOKBOOK_CONFIG) REPO_NONSTOP=0 && \
$(MAKE) CONFIG_NAME=$@ build/$(ARCH)/$@/harddrive.img build/$(ARCH)/$@/redox-live.iso
mkdir -p $(IMG_DIR)
cp "build/$(ARCH)/$@/harddrive.img" "$(IMG_DIR)/redox_$(@)$(IMG_SEPARATOR)$(IMG_TAG)_harddrive.img"
cp "build/$(ARCH)/$@/redox-live.iso" "$(IMG_DIR)/redox_$(@)$(IMG_SEPARATOR)$(IMG_TAG)_livedisk.iso"
ci-os-test: FORCE
make CONFIG_NAME=os-test unmount
rm -f "build/$(ARCH)/os-test/harddrive.img"
$(MAKE) CONFIG_NAME=os-test qemu gpu=no
rm -rf $(OS_TEST_DIR)
mkdir -p $(OS_TEST_DIR)
$(MAKE) CONFIG_NAME=os-test mount
cp -rv build/$(ARCH)/os-test/filesystem/usr/share/os-test/html $(OS_TEST_DIR)
cp -v build/$(ARCH)/os-test/filesystem/usr/share/os-test/os-test.json $(OS_TEST_DIR)
tar \
--create \
--gzip \
--file "$(OS_TEST_DIR)/out.tar.gz" \
--directory="build/$(ARCH)/os-test/filesystem/usr/share/os-test" \
out
$(MAKE) CONFIG_NAME=os-test unmount
# CI packaging target
ci-pkg: prefix $(FSTOOLS_TAG) $(CONTAINER_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
$(HOST_CARGO) build --manifest-path Cargo.toml --release
export $(CI_COOKBOOK_CONFIG) REPO_NONSTOP=1 PATH="$(PREFIX_PATH):$$PATH" COOKBOOK_HOST_SYSROOT="$(ROOT)/$(PREFIX_INSTALL)" && \
$(REPO_BIN) cook --with-package-deps "--filesystem=config/$(ARCH)/ci.toml"
endif
# CI toolchain
ci-toolchain: $(CONTAINER_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
$(MAKE) PREFIX_BINARY=0 \
"prefix/$(TARGET)/gcc-install.tar.gz" \
"prefix/$(TARGET)/relibc-install.tar.gz" \
"prefix/$(TARGET)/rust-install.tar.gz" \
"prefix/$(TARGET)/clang-install.tar.gz"
rm -rf "build/toolchain/$(HOST_TARGET)/$(TARGET)"
mkdir -p "build/toolchain/$(HOST_TARGET)/$(TARGET)"
cp "prefix/$(TARGET)/gcc-install.tar.gz" "build/toolchain/$(HOST_TARGET)/$(TARGET)/gcc-install.tar.gz"
cp "prefix/$(TARGET)/relibc-install.tar.gz" "build/toolchain/$(HOST_TARGET)/$(TARGET)/relibc-install.tar.gz"
cp "prefix/$(TARGET)/rust-install.tar.gz" "build/toolchain/$(HOST_TARGET)/$(TARGET)/rust-install.tar.gz"
cp "prefix/$(TARGET)/clang-install.tar.gz" "build/toolchain/$(HOST_TARGET)/$(TARGET)/clang-install.tar.gz"
cd "build/toolchain/$(HOST_TARGET)/$(TARGET)" && sha256sum -b * > SHA256SUM
endif

View File

@ -1,207 +1,38 @@
# Configuration file of the build system environment variables
-include .config
HOST_ARCH?=$(shell uname -m)
# Configuration
## Architecture to build Redox for (aarch64, i586, or x86_64). Defaults to a host one
ARCH?=$(HOST_ARCH)
## Sub-device type for aarch64 if needed
BOARD?=
## Enable to use binary prefix (much faster)
PREFIX_BINARY?=1
## Enable to use up-to-date rust compiler (experimental, only available to Tier 2 targets)
## Even more experimental, add -Zbuild-std to cookbook.toml to allow compilation to Tier 3 targets
PREFIX_USE_UPSTREAM_RUST_COMPILER?=0
## Enable to use binary packages (much faster)
REPO_BINARY?=0
## Name of the configuration to include in the image name e.g. desktop or server
CONFIG_NAME?=desktop
## Build appstream data for repo
REPO_APPSTREAM?=0
## Ignore errors when building the repo, attempt to build every package
REPO_NONSTOP?=0
## Do not update source repos, attempt to build in offline condition
REPO_OFFLINE?=0
## Do not strip debug info for local build
REPO_DEBUG?=0
## Old config value that need to be corrected
ifeq ($(ARCH),i686)
ARCH=i586
endif
## Select filesystem config
ifeq ($(BOARD),)
ifeq ($(wildcard config/$(ARCH)/$(CONFIG_NAME).toml),)
FILESYSTEM_CONFIG?=config/$(CONFIG_NAME).toml
else
FILESYSTEM_CONFIG?=config/$(ARCH)/$(CONFIG_NAME).toml
endif
else
FILESYSTEM_CONFIG?=config/$(ARCH)/$(BOARD)/$(CONFIG_NAME).toml
endif
HOST_CARGO=env -u RUSTUP_TOOLCHAIN -u CC -u TARGET cargo
## Filesystem size in MB (default comes from filesystem_size in the FILESYSTEM_CONFIG)
## FILESYSTEM_SIZE?=$(shell $(INSTALLER) --filesystem-size -c $(FILESYSTEM_CONFIG))
## Flags to pass to redoxfs-mkfs. Add --encrypt to set up disk encryption
REDOXFS_MKFS_FLAGS?=
## Set to 1 to enable Podman build, any other value will disable it
PODMAN_BUILD?=1
## Set to 1 to put filesystem tools inside podman, any other value will install it to host
FSTOOLS_IN_PODMAN?=0
## Set to 1 if FUSE is not available and we are running in a container
FSTOOLS_NO_MOUNT?=0
## Enable sccache to speed up cargo builds
## only do this by default if this is inside podman
SCCACHE_BUILD?=$(shell [ -f /run/.containerenv ] && echo 1 || echo 0)
## The containerfile to use for the Podman base image
CONTAINERFILE?=podman/redox-base-containerfile
ARCH?=x86_64
INSTALLER_FLAGS?=--cookbook=cookbook
# Per host variables
NPROC=nproc
SED=sed
FIND=find
REPO_BIN=./target/release/repo
ifneq ($(PODMAN_BUILD),1)
FSTOOLS_IN_PODMAN=0
HOST_TARGET := $(shell env -u RUSTUP_TOOLCHAIN rustc -vV | grep host | cut -d: -f2 | tr -d " ")
# x86_64 linux hosts have all toolchains
ifeq ($(PREFIX_BINARY),1)
ifeq ($(HOST_TARGET),aarch64-unknown-linux-gnu)
ifneq ($(ARCH),aarch64)
ifneq ($(ARCH),x86_64)
$(info The $(ARCH) binary prefix is only built for x86_64 Linux hosts)
PREFIX_BINARY=0
endif
endif
else ifeq ($(HOST_TARGET),x86_64-unknown-linux-gnu)
else
$(info The $(ARCH) binary prefix is only built for Linux hosts)
PREFIX_BINARY=0
endif
endif
endif
ifeq ($(SCCACHE_BUILD),1)
ifeq (,$(shell command -v sccache))
$(info sccache not found in PATH)
SCCACHE_BUILD=0
endif
endif
ifeq ($(REPO_APPSTREAM),1)
export COOKBOOK_APPSTREAM=true
endif
ifeq ($(REPO_NONSTOP),1)
export COOKBOOK_NONSTOP=true
endif
ifeq ($(REPO_OFFLINE),1)
export COOKBOOK_OFFLINE=true
endif
ifeq ($(REPO_DEBUG),1)
export COOKBOOK_NOSTRIP=true
export COOKBOOK_DEBUG=true
#TODO: https://gitlab.redox-os.org/redox-os/relibc/-/issues/226
# export PROFILE=debug
# export RUSTCFLAGS="-Cdebuginfo=2"
endif
UNAME := $(shell uname)
ifeq ($(UNAME),Darwin)
FUMOUNT=umount
NPROC=sysctl -n hw.ncpu
SED=gsed
FIND=gfind
VB_AUDIO=coreaudio
VBM=/Applications/VirtualBox.app/Contents/MacOS/VBoxManage
else ifeq ($(UNAME),FreeBSD)
FIND=gfind
ECHO=/bin/echo
FUMOUNT=sudo umount
VB_AUDIO=pulse # To check, will probably be OSS on most setups
VBM=VBoxManage
else ifeq ($(UNAME),Redox)
PODMAN_BUILD=0
export CARGO_NET_GIT_FETCH_WITH_CLI=true
# TODO: allow overriding to cross compiler toolchain when build server have one prebuilt
HOSTED_REDOX=1
ifneq ($(shell which repo),)
REPO_BIN=repo
endif
export LD=$(ARCH)-elf-ld
export NPROC=sysctl -n hw.ncpu
export STRIP=$(ARCH)-elf-strip
VB_AUDIO=coreaudio
VBM="/Applications/VirtualBox.app/Contents/MacOS/VBoxManage"
else
# Detect which version of the fusermount binary is available.
ifneq (, $(shell which fusermount3))
FUMOUNT=fusermount3 -u
else
FUMOUNT=fusermount -u
endif
VB_AUDIO=pulse
ECHO=echo
FUMOUNT=fusermount -u
export LD=ld
export NPROC=nproc
export STRIP=strip
VB_AUDIO="pulse"
VBM=VBoxManage
endif
# Automatic variables
ROOT=$(CURDIR)
export RUST_COMPILER_RT_ROOT=$(ROOT)/rust/src/llvm-project/compiler-rt
export TESTBIN?=
RUNNING_IN_PODMAN=$(shell [ -f /run/.containerenv ] && echo 1 || echo 0)
ifeq ($(PODMAN_BUILD),1)
ifeq ($(RUNNING_IN_PODMAN),1)
$(info Please unset PODMAN_BUILD=1 in .config!)
endif
endif
ROOT=$(PWD)
export INITFS_FOLDER=$(ROOT)/build/initfs
export RUST_TARGET_PATH=$(ROOT)/kernel/targets
export XARGO_HOME=$(ROOT)/build/xargo
export XARGO_RUST_SRC=$(ROOT)/rust/src
ALLOW_FSTOOLS?=0
ifeq ($(FSTOOLS_IN_PODMAN),0)
ifeq ($(RUNNING_IN_PODMAN),0)
ALLOW_FSTOOLS=1
endif
endif
# Kernel variables
KTARGET=$(ARCH)-unknown-none
KBUILD=build/kernel
## Userspace variables
ifeq ($(ARCH),riscv64gc)
export TARGET=riscv64gc-unknown-redox
export GNU_TARGET=riscv64-unknown-redox
else
export TARGET=$(ARCH)-unknown-redox
export GNU_TARGET=$(ARCH)-unknown-redox
endif
BUILD=build/$(ARCH)/$(CONFIG_NAME)
MOUNT_DIR=$(BUILD)/filesystem
FSTOOLS=build/fstools
INSTALLER=$(FSTOOLS)/bin/redox_installer
REDOXFS=$(FSTOOLS)/bin/redoxfs
REDOXFS_MKFS=$(FSTOOLS)/bin/redoxfs-mkfs
INSTALLER_OPTS=--cookbook=. --config-name=$(CONFIG_NAME)
INSTALLER_FEATURES=
REDOXFS_FEATURES=
COOKBOOK_OPTS="--filesystem=$(FILESYSTEM_CONFIG)"
ifeq ($(REPO_BINARY),1)
INSTALLER_OPTS+=--repo-binary
COOKBOOK_OPTS+=--repo-binary
endif
ifeq ($(FSTOOLS_NO_MOUNT),1)
INSTALLER_OPTS+=--no-mount
INSTALLER_FEATURES=--no-default-features --features installer
REDOXFS_FEATURES= --no-default-features --features std,log
endif
REPO_TAG=$(BUILD)/repo.tag
FSTOOLS_TAG=build/fstools.tag
export BOARD FIND
ifeq ($(SCCACHE_BUILD),1)
export CC_WRAPPER:=sccache
export RUSTC_WRAPPER:=$(CC_WRAPPER)
endif
ifeq ($(HOSTED_REDOX),1)
FSTOOLS_TAG=
endif
## If Podman is being used, a container is required
ifeq ($(PODMAN_BUILD),1)
CONTAINER_TAG=build/container.tag
else
CONTAINER_TAG=
endif
# Userspace variables
export TARGET=$(ARCH)-unknown-redox
BUILD=build/userspace

View File

@ -1,29 +0,0 @@
# Configuration file for the build system dependencies
# Don't check for dependencies if you will be using Podman
ifneq ($(PODMAN_BUILD),1)
# Don't check for dependencies if you will be using Hosted Redox
ifneq ($(HOSTED_REDOX),1)
# don't check for Rust and Cargo if building on a Nix system
ifneq ($(NIX_SHELL_BUILD),1)
ifeq ($(shell which rustup),)
$(error rustup not found, install from "https://rustup.rs/")
endif
endif
# don't check for compile tools, used internally when installing fstools on host
ifneq ($(SKIP_CHECK_TOOLS),1)
ifeq ($(shell which cbindgen),)
$(error cbindgen not found, install from crates.io or from your package manager)
endif
ifeq ($(shell which nasm),)
$(error nasm not found, install from your package manager)
endif
ifeq ($(shell which just),)
$(error 'just' not found, install from crates.io or from your package manager)
endif
endif
endif
endif

View File

@ -1,105 +1,18 @@
# Configuration file with the commands configuration of the Redox image
build/harddrive.bin: build/kernel build/filesystem.bin bootloader/$(ARCH)/**
nasm -f bin -o $@ -D ARCH_$(ARCH) -D FILESYSTEM=build/filesystem.bin -ibootloader/$(ARCH)/ bootloader/$(ARCH)/disk.asm
$(BUILD)/harddrive.img: $(FSTOOLS) $(REPO_TAG)
ifeq ($(FSTOOLS_IN_PODMAN),1)
$(PODMAN_RUN) make $@
else
mkdir -p $(BUILD)
-$(FUMOUNT) $(MOUNT_DIR) || true
-$(FUMOUNT) /tmp/redox_installer || true
rm -rf $@ $@.partial $(MOUNT_DIR)
FILESYSTEM_SIZE=$(FILESYSTEM_SIZE) && \
if [ -z "$$FILESYSTEM_SIZE" ] ; then \
FILESYSTEM_SIZE=$(shell $(INSTALLER) --filesystem-size -c $(FILESYSTEM_CONFIG)); \
fi && \
truncate -s "$$FILESYSTEM_SIZE"m $@.partial
umask 002 && $(INSTALLER) $(INSTALLER_OPTS) -c $(FILESYSTEM_CONFIG) $@.partial
mv $@.partial $@
endif
build/livedisk.bin: build/kernel_live bootloader/$(ARCH)/**
nasm -f bin -o $@ -D ARCH_$(ARCH) -D KERNEL=$< -ibootloader/$(ARCH)/ bootloader/$(ARCH)/disk.asm
$(BUILD)/redox-live.iso: $(FSTOOLS) $(REPO_TAG) redox.ipxe
ifeq ($(FSTOOLS_IN_PODMAN),1)
$(PODMAN_RUN) make $@
else
mkdir -p $(BUILD)
rm -rf $@ $@.partial
-$(FUMOUNT) /tmp/redox_installer || true
FILESYSTEM_SIZE=$(FILESYSTEM_SIZE) && \
if [ -z "$$FILESYSTEM_SIZE" ] ; then \
FILESYSTEM_SIZE=$(shell $(INSTALLER) --filesystem-size -c $(FILESYSTEM_CONFIG)); \
fi && \
truncate -s "$$FILESYSTEM_SIZE"m $@.partial
umask 002 && $(INSTALLER) $(INSTALLER_OPTS) -c $(FILESYSTEM_CONFIG) --write-bootloader="$(BUILD)/bootloader-live.efi" --live $@.partial
mv $@.partial $@
cp redox.ipxe $(BUILD)/redox.ipxe
endif
build/%.bin.gz: build/%.bin
gzip -k -f $<
$(BUILD)/filesystem.img: $(FSTOOLS) $(REPO_TAG)
ifeq ($(FSTOOLS_IN_PODMAN),1)
$(PODMAN_RUN) make $@
else
mkdir -p $(BUILD)
-$(FUMOUNT) $(MOUNT_DIR) || true
rm -rf $@ $@.partial $(MOUNT_DIR)
-$(FUMOUNT) /tmp/redox_installer || true
FILESYSTEM_SIZE=$(FILESYSTEM_SIZE) && \
if [ -z "$$FILESYSTEM_SIZE" ] ; then \
FILESYSTEM_SIZE=$(shell $(INSTALLER) --filesystem-size -c $(FILESYSTEM_CONFIG)); \
fi && \
truncate -s "$$FILESYSTEM_SIZE"m $@.partial
$(REDOXFS_MKFS) $(REDOXFS_MKFS_FLAGS) $@.partial
mkdir -p $(MOUNT_DIR)
$(REDOXFS) $@.partial $(MOUNT_DIR)
sleep 1
pgrep redoxfs
umask 002 && $(INSTALLER) $(INSTALLER_OPTS) -c $(FILESYSTEM_CONFIG) $(MOUNT_DIR)
sync
-$(FUMOUNT) $(MOUNT_DIR) || true
rm -rf $(MOUNT_DIR)
mv $@.partial $@
endif
mount: $(FSTOOLS) FORCE
ifeq ($(FSTOOLS_IN_PODMAN),1)
$(PODMAN_RUN) make $@
else
@mkdir -p $(MOUNT_DIR)
$(REDOXFS) $(BUILD)/harddrive.img $(MOUNT_DIR)
@sleep 2
@echo "\033[1;36;49mharddrive.img mounted ($$(pgrep redoxfs))\033[0m"
endif
mount_extra: $(FSTOOLS) FORCE
ifeq ($(FSTOOLS_IN_PODMAN),1)
$(PODMAN_RUN) make $@
else
@mkdir -p $(MOUNT_DIR)
$(REDOXFS) $(BUILD)/extra.img $(MOUNT_DIR)
@sleep 2
@echo "\033[1;36;49mextra.img mounted ($$(pgrep redoxfs))\033[0m"
endif
mount_live: $(FSTOOLS) FORCE
ifeq ($(FSTOOLS_IN_PODMAN),1)
$(PODMAN_RUN) make $@
else
@mkdir -p $(MOUNT_DIR)
$(REDOXFS) $(BUILD)/redox-live.iso $(MOUNT_DIR)
@sleep 2
@echo "\033[1;36;49mredox-live.iso mounted ($$(pgrep redoxfs))\033[0m"
endif
unmount: FORCE
ifeq ($(FSTOOLS_IN_PODMAN),1)
$(PODMAN_RUN) make $@
else
@sync
ifneq ($(wildcard $(MOUNT_DIR)),)
$(FUMOUNT) $(MOUNT_DIR)
@rm -rf $(MOUNT_DIR)
@echo "\033[1;36;49mFilesystem unmounted\033[0m"
else
@echo "\033[1;36;49mDisk is not mounted\033[0m"
endif
@-$(FUMOUNT) /tmp/redox_installer 2>/dev/null || true
endif
build/livedisk.iso: build/livedisk.bin.gz
rm -rf build/iso/
mkdir -p build/iso/
cp -RL isolinux build/iso/
cp $< build/iso/livedisk.gz
genisoimage -o $@ -b isolinux/isolinux.bin -c isolinux/boot.cat \
-no-emul-boot -boot-load-size 4 -boot-info-table \
build/iso/
isohybrid $@

43
mk/filesystem.mk Normal file
View File

@ -0,0 +1,43 @@
build/filesystem.bin: filesystem.toml build/kernel
-$(FUMOUNT) build/filesystem/ || true
rm -rf $@ $@.partial build/filesystem/
dd if=/dev/zero of=$@.partial bs=1048576 count=512
cargo run --manifest-path redoxfs/Cargo.toml --quiet --release --bin redoxfs-mkfs $@.partial
mkdir -p build/filesystem/
cargo build --manifest-path redoxfs/Cargo.toml --quiet --release --bin redoxfs
cargo run --manifest-path redoxfs/Cargo.toml --quiet --release --bin redoxfs -- $@.partial build/filesystem/
sleep 2
pgrep redoxfs
cp build/kernel build/filesystem/kernel
cargo run --manifest-path installer/Cargo.toml -- $(INSTALLER_FLAGS) $<
chown -R 0:0 build/filesystem
chown -R 1000:1000 build/filesystem/home/user
chmod -R uog+rX build/filesystem
chmod -R u+w build/filesystem
chmod -R og-w build/filesystem
chmod -R 755 build/filesystem/bin
chmod -R u+rwX build/filesystem/root
chmod -R og-rwx build/filesystem/root
chmod -R u+rwX build/filesystem/home/user
chmod -R og-rwx build/filesystem/home/user
chmod +s build/filesystem/bin/passwd
chmod +s build/filesystem/bin/su
chmod +s build/filesystem/bin/sudo
mkdir build/filesystem/tmp
chmod 1777 build/filesystem/tmp
sync
-$(FUMOUNT) build/filesystem/ || true
rm -rf build/filesystem/
mv $@.partial $@
mount: FORCE
mkdir -p build/filesystem/
cargo build --manifest-path redoxfs/Cargo.toml --quiet --release --bin redoxfs
cargo run --manifest-path redoxfs/Cargo.toml --quiet --release --bin redoxfs -- build/harddrive.bin build/filesystem/
sleep 2
pgrep redoxfs
unmount: FORCE
sync
-$(FUMOUNT) build/filesystem/ || true
rm -rf build/filesystem/

View File

@ -1,56 +0,0 @@
# Configuration file for redox-installer, Cookbook and RedoxFS FUSE
fstools: $(FSTOOLS_TAG) $(FSTOOLS)
GOING_TO_PODMAN_AGAIN?=0
# These tools run inside Podman if it is used, or on the host if Podman is not used
$(FSTOOLS): | prefix $(CONTAINER_TAG) $(FSTOOLS_TAG)
ifeq ($(PODMAN_BUILD),1)
ifeq ($(FSTOOLS_IN_PODMAN),1)
$(PODMAN_RUN) make $@
else
$(MAKE) $@ PODMAN_BUILD=0 SKIP_CHECK_TOOLS=1 GOING_TO_PODMAN_AGAIN=1
endif
else
rm -rf $@ $@.partial
mkdir -p $@.partial
ln -s ../../recipes $@.partial/recipes
$(MAKE) fstools_fetch PODMAN_BUILD=$(GOING_TO_PODMAN_AGAIN)
# Compile installer and redoxfs for host (may be outside of podman container)
cd $@.partial && \
export CARGO_TARGET_DIR=../$@-target && \
$(HOST_CARGO) install --root . --path recipes/core/installer/source --locked $(INSTALLER_FEATURES) && \
$(HOST_CARGO) install --root . --path recipes/core/redoxfs/source --locked $(REDOXFS_FEATURES)
mv $@.partial $@
touch $@
endif
fstools_fetch: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
$(REPO_BIN) fetch host:installer host:redoxfs
endif
CARGO_OFFLINE_FLAG=
ifeq ($(REPO_OFFLINE),1)
CARGO_OFFLINE_FLAG=--offline
endif
$(FSTOOLS_TAG): $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
$(HOST_CARGO) build --manifest-path Cargo.toml --release --locked $(CARGO_OFFLINE_FLAG)
mkdir -p $(@D)
touch $@
endif
fstools_clean: FORCE
rm -rf target
rm -rf $(FSTOOLS)
rm -rf $(FSTOOLS)-target
rm -f $(FSTOOLS_TAG)

5
mk/initfs.mk Normal file
View File

@ -0,0 +1,5 @@
build/initfs.tag: initfs.toml
cd kernel && xargo clean
rm -rf build/initfs
cargo run --manifest-path installer/Cargo.toml -- $(INSTALLER_FLAGS) $<
touch $@

16
mk/kernel.mk Normal file
View File

@ -0,0 +1,16 @@
build/libkernel.a: kernel/Cargo.toml kernel/src/* kernel/src/*/* kernel/src/*/*/* build/initfs.tag
# Temporary fix for https://github.com/redox-os/redox/issues/963 allowing to build on macOS
ifeq ($(UNAME),Darwin)
cd kernel && CC=$(ARCH)-elf-gcc AR=$(ARCH)-elf-ar CFLAGS=-ffreestanding xargo rustc --lib --target $(KTARGET) --release -- -C soft-float --emit link=../$@
else
cd kernel && xargo rustc --lib --target $(KTARGET) --release -- -C soft-float --emit link=../$@
endif
build/libkernel_live.a: kernel/Cargo.toml kernel/src/* kernel/src/*/* kernel/src/*/*/* build/initfs.tag build/filesystem.bin
cd kernel && FILESYSTEM="$(PWD)/build/filesystem.bin" xargo rustc --lib --features live --target $(KTARGET) --release -- -C soft-float --emit link=../$@
build/kernel: build/libkernel.a kernel/linkers/$(ARCH).ld
$(LD) --gc-sections -z max-page-size=0x1000 -T kernel/linkers/$(ARCH).ld -o $@ $<
build/kernel_live: build/libkernel_live.a kernel/linkers/$(ARCH).ld
$(LD) --gc-sections -z max-page-size=0x1000 -T kernel/linkers/$(ARCH).ld -o $@ $<

View File

@ -1,101 +0,0 @@
# Configuration file of the Podman commands
# Configuration variables for running make in Podman
## Tag the podman image $IMAGE_TAG
IMAGE_TAG?=redox-base
## Working Directory in Podman
CONTAINER_WORKDIR?=/mnt/redox
## Flag passed to the Podman volumes. :Z can be used only with SELinux
USE_SELINUX?=1
ifeq ($(USE_SELINUX),1)
PODMAN_VOLUME_FLAG=:Z
else
PODMAN_VOLUME_FLAG=
endif
# Cache layers to redox-os docker hub
PODMAN_CACHE=
PODMAN_CACHE_PATH?=docker.io/redoxos/$(IMAGE_TAG)-$(HOST_ARCH)
PODMAN_CACHE_PULL?=1
ifeq ($(PODMAN_CACHE_PULL),1)
PODMAN_CACHE+=--cache-from=$(PODMAN_CACHE_PATH)
endif
PODMAN_CACHE_PUSH?=0
ifeq ($(PODMAN_CACHE_PUSH),1)
PODMAN_CACHE+=--cache-to=$(PODMAN_CACHE_PATH)
endif
## Podman Home Directory
PODMAN_HOME=$(ROOT)/build/podman
## Podman command with its many arguments
PODMAN_VOLUMES=--volume $(ROOT):$(CONTAINER_WORKDIR)$(PODMAN_VOLUME_FLAG) --volume $(PODMAN_HOME):/root$(PODMAN_VOLUME_FLAG)
PODMAN_ENV=--env PATH=/root/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin --env PODMAN_BUILD=0
PODMAN_CONFIG=--env ARCH=$(ARCH) --env BOARD=$(BOARD) --env CONFIG_NAME=$(CONFIG_NAME) --env FILESYSTEM_CONFIG=$(FILESYSTEM_CONFIG) --env PREFIX_BINARY=$(PREFIX_BINARY) \
--env CI=$(CI) --env COOKBOOK_MAKE_JOBS=$(COOKBOOK_MAKE_JOBS) --env COOKBOOK_LOGS=$(COOKBOOK_LOGS) --env COOKBOOK_VERBOSE=$(COOKBOOK_VERBOSE) --env COOKBOOK_COMPRESSED=$(COOKBOOK_COMPRESSED) \
--env REPO_APPSTREAM=$(REPO_APPSTREAM) --env REPO_BINARY=$(REPO_BINARY) --env REPO_NONSTOP=$(REPO_NONSTOP) --env REPO_OFFLINE=$(REPO_OFFLINE) --env TESTBIN=$(TESTBIN) \
--env HOSTED_REDOX=$(HOSTED_REDOX) --env PREFIX_USE_UPSTREAM_RUST_COMPILER=$(PREFIX_USE_UPSTREAM_RUST_COMPILER)
PODMAN_OPTIONS=--rm --workdir $(CONTAINER_WORKDIR) --interactive --tty --cap-add SYS_ADMIN --device /dev/fuse --network=host --env TERM=$(TERM) --pids-limit=-1
PODMAN_RUN=podman run $(PODMAN_OPTIONS) $(PODMAN_VOLUMES) $(PODMAN_ENV) $(PODMAN_CONFIG) $(IMAGE_TAG)
container_shell: build/container.tag
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) bash
else
@echo PODMAN_BUILD=$(PODMAN_BUILD), please set it to 1 in mk/config.mk
endif
container_clean: FORCE
rm -f build/container.tag
@echo "If podman dir cannot be removed, remove with \"sudo rm\"."
-rm -rf $(PODMAN_HOME) || true
@echo "For complete clean of images and containers, use \"podman system reset\""
-podman image rm --force $(IMAGE_TAG) || true
container_touch: FORCE
ifeq ($(PODMAN_BUILD),1)
rm -f build/container.tag
podman image exists $(IMAGE_TAG) || (echo "Image does not exist, it will be rebuilt during normal make."; exit 1)
touch build/container.tag
else
@echo PODMAN_BUILD=$(PODMAN_BUILD), container not required.
endif
container_kill: FORCE
podman kill --latest --signal SIGKILL
## Must match the value of CONTAINER_TAG in config.mk
build/container.tag: $(CONTAINERFILE)
ifeq ($(PODMAN_BUILD),1)
rm -f $@ $(FSTOOLS_TAG)
-podman image rm --force $(IMAGE_TAG) || true
mkdir -p $(PODMAN_HOME)
@echo "Building Podman image. This may take some time."
cat $(CONTAINERFILE) | podman build --file - $(PODMAN_VOLUMES) $(PODMAN_CACHE) --tag $(IMAGE_TAG)
$(PODMAN_RUN) bash -e podman/rustinstall.sh
mkdir -p build
touch $@
@echo "Podman ready!"
else
@echo PODMAN_BUILD=$(PODMAN_BUILD), container not required.
endif
container_push: build/container.tag
podman push $(IMAGE_TAG) $(PODMAN_CACHE_PATH)
KERNEL_PATH := recipes/core/kernel
KERNEL_PATH_SOURCE := $(ROOT)/$(KERNEL_PATH)/source
KERNEL_PATH_TARGET := $(ROOT)/$(KERNEL_PATH)/target/$(TARGET)
# TODO: make this work using `make debug.kernel` and remove this
kernel_debugger:
@echo "Building and running gdbgui container..."
podman build -t redox-kernel-debug - < $(ROOT)/podman/redox-gdb-containerfile
podman run --rm -p 5000:5000 -it --name redox-gdb \
-v "$(KERNEL_PATH_TARGET)/build/kernel.sym:/kernel.sym" \
-v "$(KERNEL_PATH_SOURCE)/src:/src" \
redox-kernel-debug --gdb-cmd "gdb -ex 'set confirm off' \
-ex 'add-symbol-file /kernel.sym' \
-ex 'target remote host.containers.internal:1234'"

View File

@ -1,437 +0,0 @@
# Configuration file for the Rust/GCC cross-compilers, relibc and libtool
PREFIX=prefix/$(TARGET)
PREFIX_INSTALL=$(PREFIX)/sysroot/
PREFIX_PATH=$(ROOT)/$(PREFIX_INSTALL)/bin
BINUTILS_TARGET=recipes/dev/binutils-gdb/target/$(HOST_TARGET)/$(TARGET)
LIBTOOL_TARGET=recipes/dev/libtool/target/$(HOST_TARGET)
GCC_TARGET=recipes/dev/gcc13/target/$(HOST_TARGET)/$(TARGET)
LIBSTDCXX_TARGET=recipes/libs/libstdcxx-v3/target/$(TARGET)/$(HOST_TARGET)
RELIBC_FREESTANDING_TARGET=recipes/core/relibc/target/$(TARGET)/$(HOST_TARGET)
RELIBC_TARGET=recipes/core/relibc/target/$(TARGET)
LLVM_TARGET=recipes/dev/llvm21/target/$(HOST_TARGET)/$(TARGET)
RUST_TARGET=recipes/dev/rust/target/$(HOST_TARGET)/$(TARGET)
CLANG_TARGET=recipes/dev/clang21/target/$(HOST_TARGET)/$(TARGET)
LLD_TARGET=recipes/dev/lld21/target/$(HOST_TARGET)/$(TARGET)
# dependencies of GCC and Rust
LIBGMP_TARGET=recipes/libs/libgmp/target/$(HOST_TARGET)/$(TARGET)
LIBMPFR_TARGET=recipes/libs/libmpfr/target/$(HOST_TARGET)/$(TARGET)
LIBMPC_TARGET=recipes/libs/mpc/target/$(HOST_TARGET)/$(TARGET)
LIBZLIB_TARGET=recipes/libs/zlib/target/$(HOST_TARGET)/$(TARGET)
LIBZSTD_TARGET=recipes/libs/zstd/target/$(HOST_TARGET)/$(TARGET)
LIBSSL_TARGET=recipes/libs/openssl3/target/$(HOST_TARGET)/$(TARGET)
LIBHTTP2_TARGET=recipes/libs/nghttp2/target/$(HOST_TARGET)/$(TARGET)
LIBCURL_TARGET=recipes/net/download/curl/target/$(HOST_TARGET)/$(TARGET)
LIBGCC_TARGET=recipes/libs/libgcc/target/$(TARGET)
LIBCPP_TARGET=recipes/libs/libstdcxx/target/$(TARGET)
UPSTREAM_RUSTC_VERSION=2026-05-24
export PREFIX_RUSTFLAGS=-L $(ROOT)/$(PREFIX_INSTALL)/$(TARGET)/lib
export RUSTUP_TOOLCHAIN=$(ROOT)/$(PREFIX_INSTALL)
export REDOXER_TOOLCHAIN=$(RUSTUP_TOOLCHAIN)
PREFIX_CONFIG=CI=1 COOKBOOK_CLEAN_BUILD=true COOKBOOK_CLEAN_TARGET=false COOKBOOK_VERBOSE=true COOKBOOK_NONSTOP=false
prefix: $(PREFIX)/sysroot
# Remove prefix builds and downloads
prefix_clean:
rm -rf $(PREFIX)
ifeq ($(PREFIX_BINARY),0)
rm -rf $(BINUTILS_TARGET) $(LIBTOOL_TARGET) $(GCC_TARGET) $(LIBSTDCXX_TARGET) $(RELIBC_FREESTANDING_TARGET)
rm -rf $(RELIBC_TARGET) $(LLVM_TARGET) $(RUST_TARGET) $(CLANG_TARGET) $(LLD_TARGET) $(LIBGMP_TARGET) $(LIBMPFR_TARGET)
rm -rf $(LIBMPC_TARGET) $(LIBZLIB_TARGET) $(LIBZSTD_TARGET) $(LIBSSL_TARGET) $(LIBHTTP2_TARGET) $(LIBCURL_TARGET)
rm -rf $(LIBGCC_TARGET) $(LIBCPP_TARGET)
endif
# Remove relibc in sysroot and all statically linked recipes
static_clean: | $(FSTOOLS_TAG)
$(MAKE) c.relibc
$(MAKE) c.base,extrautils,kernel,redoxfs
$(MAKE) c.luajit,gettext,libgcc,libstdcxx,openssl1,openssl3,pcre2,sdl1,zstd,zlib,bzip2,xz
$(MAKE) c.expat,freetype2,libffi,libiconv,libjpeg,liborbital,libpng,libxml2,ncurses,ncursesw,termcap
rm -rf $(REPO_TAG)
$(PREFIX)/sysroot: $(PREFIX)/clang-install $(PREFIX)/rust-install $(PREFIX)/gcc-install | $(FSTOOLS_TAG) $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
@echo "\033[1;36;49mBuilding sysroot\033[0m"
rm -rf "$@.partial" "$@"
mkdir "$@.partial"
cp -r "$(PREFIX)/gcc-install/". "$@.partial"
cp -r "$(PREFIX)/rust-install/". "$@.partial"
cp -r "$(PREFIX)/clang-install/". "$@.partial"
ifneq ($(HOSTED_REDOX),1)
rm -rf "$@.partial/$(GNU_TARGET)/include/"*
cp -r "$(PREFIX)/gcc-install/$(GNU_TARGET)/include/c++" "$@.partial/$(GNU_TARGET)/include/c++"
else
rm -rf "$@.partial/include/"*
cp -r "$(PREFIX)/gcc-install/include/c++" "$@.partial/include/c++"
endif
export PATH="$(ROOT)/$@.partial/bin:$$PATH" && \
export CARGO="env -u CARGO cargo" $(PREFIX_CONFIG) && \
$(REPO_BIN) cook relibc
ifneq ($(HOSTED_REDOX),1)
cp -r "$(RELIBC_TARGET)/stage/usr/". "$@.partial/$(GNU_TARGET)"
mkdir -p "$@.partial/$(GNU_TARGET)/usr"
ln -s "../include" "$@.partial/$(GNU_TARGET)/usr/include"
ln -s "../lib" "$@.partial/$(GNU_TARGET)/usr/lib"
else
cp -r "$(RELIBC_TARGET)/stage/usr/". "$@.partial"
mkdir -p "$@.partial/usr"
ln -s "../include" "$@.partial/usr/include"
ln -s "../lib" "$@.partial/usr/lib"
endif
mv "$@.partial" "$@"
# adapt path for libtoolize
sed 's|/usr/share|$(ROOT)/$@/share|g' "$@/bin/libtoolize.orig" > "$@/bin/libtoolize"
chmod 0755 "$@/bin/libtoolize"
touch "$@"
endif
$(PREFIX)/relibc-install.tar.gz: $(PREFIX)/sysroot
tar \
--create \
--gzip \
--file "$@" \
--directory="$<" \
.
# PREFIX_BINARY ---------------------------------------------------
ifeq ($(PREFIX_BINARY),1)
# PREFIX_BINARY FOR LINUX -----------------------------------------
ifneq ($(HOSTED_REDOX),1)
$(PREFIX)/%.tar.gz: | $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
mkdir -p "$(@D)"
wget -O $@.partial "https://static.redox-os.org/toolchain/$(HOST_TARGET)/$(TARGET)/$(@F)"
mv $@.partial $@
endif
$(PREFIX)/gcc-install $(PREFIX)/rust-install $(PREFIX)/clang-install: %: %.tar.gz | $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
rm -rf "$@.partial" "$@"
mkdir -p "$@.partial"
tar --extract --file "$<" --directory "$@.partial" --no-same-owner --strip-components=1
touch "$@.partial"
mv "$@.partial" "$@"
endif
# PREFIX_BINARY FOR REDOX -----------------------------------------
else
$(PREFIX)/id_ed25519.pub.toml: | $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
mkdir -p "$(@D)"
wget -O $@.partial "https://static.redox-os.org/pkg/id_ed25519.pub.toml"
mv $@.partial $@
endif
$(PREFIX)/%.pkgar: $(PREFIX)/id_ed25519.pub.toml | $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
mkdir -p "$(@D)"
wget -O $@.partial "https://static.redox-os.org/pkg/$(TARGET)/$(@F)"
mv $@.partial $@
endif
$(PREFIX)/gcc-install: $(PREFIX)/gcc13.pkgar $(PREFIX)/gcc13.cxx.pkgar $(PREFIX)/libgcc.pkgar $(PREFIX)/libstdcxx.pkgar $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
rm -rf "$@.partial" "$@"
mkdir -p "$@.partial"
pkgar extract --pkey $(PREFIX)/id_ed25519.pub.toml --archive "$(PREFIX)/gcc13.pkgar" "$@.partial"
pkgar extract --pkey $(PREFIX)/id_ed25519.pub.toml --archive "$(PREFIX)/gcc13.cxx.pkgar" "$@.partial"
pkgar extract --pkey $(PREFIX)/id_ed25519.pub.toml --archive "$(PREFIX)/libgcc.pkgar" "$@.partial"
pkgar extract --pkey $(PREFIX)/id_ed25519.pub.toml --archive "$(PREFIX)/libstdcxx.pkgar" "$@.partial"
mv "$@.partial/usr"/* "$@.partial"
rmdir "$@.partial/usr"
touch "$@.partial"
mv "$@.partial" "$@"
endif
$(PREFIX)/rust-install: $(PREFIX)/llvm21.pkgar $(PREFIX)/rust.pkgar $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
rm -rf "$@.partial" "$@"
mkdir -p "$@.partial"
pkgar extract --pkey $(PREFIX)/id_ed25519.pub.toml --archive "$(PREFIX)/llvm21.pkgar" "$@.partial"
pkgar extract --pkey $(PREFIX)/id_ed25519.pub.toml --archive "$(PREFIX)/rust.pkgar" "$@.partial"
mv "$@.partial/usr"/* "$@.partial"
rmdir "$@.partial/usr"
touch "$@.partial"
mv "$@.partial" "$@"
endif
$(PREFIX)/clang-install: $(PREFIX)/llvm21.runtime.pkgar $(PREFIX)/clang21.pkgar $(PREFIX)/lld21.pkgar $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
rm -rf "$@.partial" "$@"
mkdir -p "$@.partial"
pkgar extract --pkey $(PREFIX)/id_ed25519.pub.toml --archive "$(PREFIX)/llvm21.runtime.pkgar" "$@.partial"
pkgar extract --pkey $(PREFIX)/id_ed25519.pub.toml --archive "$(PREFIX)/clang21.pkgar" "$@.partial"
pkgar extract --pkey $(PREFIX)/id_ed25519.pub.toml --archive "$(PREFIX)/lld21.pkgar" "$@.partial"
mv "$@.partial/usr"/* "$@.partial"
rmdir "$@.partial/usr"
touch "$@.partial"
mv "$@.partial" "$@"
endif
endif
else
$(PREFIX)/%.tar.gz: $(PREFIX)/%
tar \
--create \
--gzip \
--file "$@" \
--directory="$<" \
.
# BUILD GCC ---------------------------------------------------
$(PREFIX)/libtool-install: | $(FSTOOLS_TAG) $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
@echo "\033[1;36;49mBuilding libtool-install\033[0m"
rm -rf "$@.partial" "$@"
mkdir -p "$@.partial"
export $(PREFIX_CONFIG) COOKBOOK_HOST_SYSROOT=/usr && \
$(REPO_BIN) cook host:libtool
cp -r "$(LIBTOOL_TARGET)/stage/usr/". "$@.partial"
mv "$@.partial/bin/libtoolize" "$@.partial/bin/libtoolize.orig"
# adapt path for libtoolize
sed 's|/usr/share|$(ROOT)/$@/share|g' "$@.partial/bin/libtoolize.orig" > "$@.partial/bin/libtoolize"
chmod 0755 "$@.partial/bin/libtoolize"
touch "$@.partial"
mv "$@.partial" "$@"
endif
$(PREFIX)/binutils-install: | $(PREFIX)/libtool-install $(FSTOOLS_TAG) $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
@echo "\033[1;36;49mBuilding binutils-install\033[0m"
rm -rf "$@.partial" "$@"
mkdir -p "$@.partial"
export $(PREFIX_CONFIG) PATH="$(ROOT)/$(PREFIX)/libtool-install/bin:$$PATH" \
COOKBOOK_HOST_SYSROOT=/usr COOKBOOK_CROSS_TARGET=$(TARGET) COOKBOOK_CROSS_GNU_TARGET=$(GNU_TARGET) && \
$(REPO_BIN) cook host:binutils-gdb
cp -r "$(BINUTILS_TARGET)/stage/usr/". "$@.partial"
touch "$@.partial"
mv "$@.partial" "$@"
endif
$(PREFIX)/gcc-freestanding-install: $(PREFIX)/binutils-install | $(PREFIX)/libtool-install $(FSTOOLS_TAG) $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
@echo "\033[1;36;49mBuilding gcc-freestanding-install\033[0m"
rm -rf "$@.partial" "$@" $(PREFIX)/relibc-freestanding-install $(PREFIX)/sysroot
mkdir -p "$@.partial" $(PREFIX)/relibc-freestanding-install/$(GNU_TARGET)/include
export $(PREFIX_CONFIG) PATH="$(ROOT)/$(PREFIX)/libtool-install/bin:$(ROOT)/$(PREFIX)/binutils-install/bin:$$PATH" \
COOKBOOK_LIBTOOL_DIR=$(ROOT)/$(PREFIX)/libtool-install COOKBOOK_CROSS_TARGET=$(TARGET) COOKBOOK_CROSS_GNU_TARGET=$(GNU_TARGET) \
COOKBOOK_HOST_SYSROOT=/usr COOKBOOK_CROSS_SYSROOT=$(ROOT)/$(PREFIX)/relibc-freestanding-install/$(GNU_TARGET) && \
$(REPO_BIN) cook host:gcc13
cp -r "$(GCC_TARGET)/stage/usr/". "$@.partial"
cp -r "$(GCC_TARGET)/stage.cxx/usr/". "$@.partial"
cp -r "$(PREFIX)/binutils-install/". "$@.partial"
rm -rf $(PREFIX)/relibc-freestanding-install
touch "$@.partial"
mv "$@.partial" "$@"
endif
$(PREFIX)/relibc-freestanding-install: $(PREFIX)/gcc-freestanding-install | $(FSTOOLS_TAG) $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
@echo "\033[1;36;49mBuilding relibc-freestanding-install\033[0m"
rm -rf "$@.partial" "$@"
mkdir -p "$@.partial"
export CARGO="env -u CARGO -u RUSTUP_TOOLCHAIN cargo" RUSTUP="env -u CARGO -u RUSTUP_TOOLCHAIN rustup" && \
export PATH="$(ROOT)/$(PREFIX)/gcc-freestanding-install/bin:$$PATH" && \
export CC_$(subst -,_,$(TARGET))="$(GNU_TARGET)-gcc -isystem $(ROOT)/$@.partial/$(GNU_TARGET)/include" LINKFLAGS="" && \
export $(PREFIX_CONFIG) COOKBOOK_HOST_SYSROOT=/usr COOKBOOK_CROSS_TARGET=$(HOST_TARGET) && \
$(REPO_BIN) cook relibc
cp -r "$(RELIBC_FREESTANDING_TARGET)/stage/usr/". "$@.partial/$(GNU_TARGET)"
touch "$@.partial"
mv "$@.partial" "$@"
endif
$(PREFIX)/gcc-install: $(PREFIX)/relibc-freestanding-install | $(PREFIX)/libtool-install $(FSTOOLS_TAG) $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
@echo "\033[1;36;49mBuilding gcc-install\033[0m"
rm -rf "$@.partial" "$@-build.partial" "$@"
if [ ! -d "$(ROOT)/$(GCC_TARGET)" ]; then \
echo "\033[1;38;5;196m Incomplete build stages. Please re-run the build\033[0m"; \
rm -rf "$(PREFIX)"/gcc-freestanding-install && "$(PREFIX)"/relibc-freestanding-install && \
exit 1; fi
mkdir -p "$@.partial" "$@-build.partial"
cp -r "$(PREFIX)/gcc-freestanding-install/". "$@.partial"
cp -r "$(PREFIX)/relibc-freestanding-install/". "$@.partial"
cp -r "$(PREFIX)/libtool-install/". "$@.partial"
@#TODO: how to make this not conflict with libc?
rm -f "$@.partial/lib/gcc/$(GNU_TARGET)/13.2.0/include/limits.h"
# libgcc and freestanding libstdcxx
export PATH="$(ROOT)/$@.partial/bin:$$PATH" && \
$(MAKE) -C "$(ROOT)/$(GCC_TARGET)/build" all-target-libgcc all-target-libstdc++-v3 && \
$(MAKE) -C "$(ROOT)/$(GCC_TARGET)/build" install-target-libgcc install-target-libstdc++-v3 DESTDIR="$(ROOT)/$@-build.partial/usr"
cp -r "$@-build.partial/usr/". "$@.partial"
@#TODO: in riscv64gc libgcc_s.so is a GNU ld script
rm -f "$@.partial"/$(GNU_TARGET)/lib/libgcc_s.so
ln -s libgcc_s.so.1 "$@.partial"/$(GNU_TARGET)/lib/libgcc_s.so
@#TODO: generates wrong lib path for libtool
rm -f "$@.partial"/$(GNU_TARGET)/lib/libstdc++.la
rm -f "$@.partial"/$(GNU_TARGET)/lib/libsupc++.la
# hosted libstdcxx
export PATH="$(ROOT)/$@.partial/bin:$$PATH" && \
export $(PREFIX_CONFIG) "COOKBOOK_HOST_SYSROOT=$(ROOT)/$@.partial" COOKBOOK_CROSS_TARGET=$(HOST_TARGET) && \
rm -rf "$(LIBSTDCXX_TARGET)/stage" && $(REPO_BIN) cook libstdcxx-v3
cp -r "$(LIBSTDCXX_TARGET)/stage/usr/". "$@.partial/$(GNU_TARGET)"
rm -rf "$@-build.partial"
touch "$@.partial"
mv "$@.partial" "$@"
# no longer needed, delete build files to save disk space
rm -rf $(BINUTILS_TARGET) $(LIBTOOL_TARGET) $(GCC_TARGET) $(LIBSTDCXX_TARGET) $(RELIBC_FREESTANDING_TARGET)
endif
# RUST FROM UPSTREAM COMPILER ---------------------------------------------------
ifeq ($(PREFIX_USE_UPSTREAM_RUST_COMPILER),1)
PREFIX_RUST_VERSION_TAG=$(PREFIX)/rustc-version-tag-$(UPSTREAM_RUSTC_VERSION)
$(PREFIX_RUST_VERSION_TAG):
rm -f "$(PREFIX)"/rustc-version-tag-*
rm -f "$(PREFIX)"/rustc-install.tar.xz
rm -f "$(PREFIX)"/cargo-install.tar.xz
rm -f "$(PREFIX)"/rust-std-host-install.tar.xz
rm -f "$(PREFIX)"/rust-std-target-install.tar.xz
rm -f "$(PREFIX)"/rust-src-install.tar.xz:
mkdir -p "$(@D)"
touch $@
$(PREFIX)/rustc-install.tar.xz $(PREFIX)/cargo-install.tar.xz: $(PREFIX)/%-install.tar.xz: | $(PREFIX_RUST_VERSION_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
mkdir -p "$(@D)"
wget -O $@.partial "https://static.rust-lang.org/dist/$(UPSTREAM_RUSTC_VERSION)/$*-nightly-$(HOST_TARGET).tar.xz"
mv $@.partial $@
endif
$(PREFIX)/rust-std-host-install.tar.xz: | $(PREFIX_RUST_VERSION_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
mkdir -p "$(@D)"
wget -O $@.partial "https://static.rust-lang.org/dist/$(UPSTREAM_RUSTC_VERSION)/rust-std-nightly-$(HOST_TARGET).tar.xz"
mv $@.partial $@
endif
$(PREFIX)/rust-std-target-install.tar.xz: | $(PREFIX_RUST_VERSION_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
mkdir -p "$(@D)"
ifeq ($(TARGET),x86_64-unknown-redox)
wget -O $@.partial "https://static.rust-lang.org/dist/$(UPSTREAM_RUSTC_VERSION)/rust-std-nightly-$(TARGET).tar.xz"
mv $@.partial $@
else
touch $@
endif
endif
$(PREFIX)/rust-src-install.tar.xz: | $(PREFIX_RUST_VERSION_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
mkdir -p "$(@D)"
wget -O $@.partial "https://static.rust-lang.org/dist/$(UPSTREAM_RUSTC_VERSION)/rust-src-nightly.tar.xz"
mv $@.partial $@
endif
$(PREFIX)/rust-install: $(PREFIX)/rustc-install.tar.xz $(PREFIX)/cargo-install.tar.xz $(PREFIX)/rust-std-host-install.tar.xz $(PREFIX)/rust-std-target-install.tar.xz $(PREFIX)/rust-src-install.tar.xz
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
@echo "\033[1;36;49mBuilding rust-install\033[0m"
rm -rf "$@.partial" "$@"
mkdir -p "$@.partial"
tar --extract --file "$(PREFIX)/rustc-install.tar.xz" -C "$@.partial" rustc-nightly-$(HOST_TARGET)/rustc/ --strip-components=2
tar --extract --file "$(PREFIX)/cargo-install.tar.xz" --directory "$@.partial" cargo-nightly-$(HOST_TARGET)/cargo/ --strip-components=2
tar --extract --file "$(PREFIX)/rust-std-host-install.tar.xz" --directory "$@.partial" rust-std-nightly-$(HOST_TARGET)/rust-std-$(HOST_TARGET)/ --strip-components=2
tar --extract --file "$(PREFIX)/rust-src-install.tar.xz" --directory "$@.partial" rust-src-nightly/rust-src/ --strip-components=2
ifeq ($(TARGET),x86_64-unknown-redox)
tar --extract --file "$(PREFIX)/rust-std-target-install.tar.xz" --directory "$@.partial" rust-std-nightly-$(TARGET)/rust-std-$(TARGET)/ --strip-components=2
endif
rm -f "$@.partial/manifest.in"
touch "$@.partial"
mv "$@.partial" "$@"
endif
# BUILD RUST ---------------------------------------------------
else
$(PREFIX)/rust-install: | $(PREFIX)/gcc-install $(PREFIX)/libtool-install $(FSTOOLS_TAG) $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
@echo "\033[1;36;49mBuilding rust-install\033[0m"
rm -rf "$@.partial" "$@"
export PATH="$(ROOT)/$(PREFIX)/libtool-install/bin:$(ROOT)/$(PREFIX)/gcc-install/bin:$$PATH" \
$(PREFIX_CONFIG) COOKBOOK_HOST_SYSROOT=/usr COOKBOOK_CROSS_TARGET=$(TARGET) COOKBOOK_CROSS_GNU_TARGET=$(GNU_TARGET) && \
$(REPO_BIN) cook host:llvm21 host:rust
cp -r "$(RUST_TARGET)/stage/usr/". "$@.partial"
cp -r "$(LLVM_TARGET)/stage/usr/". "$@.partial"
mv "$@.partial" "$@"
# TODO: Cache from RUST_TARGET is currently not cleared.
# TIP: If you're developing std for rust, remove COOKBOOK_CLEAN_BUILD=true
# at the top of this file so your next rust build reuses the build cache
endif
endif
# BUILD CLANG ---------------------------------------------------
$(PREFIX)/clang-install: | $(PREFIX)/rust-install $(PREFIX)/libtool-install $(FSTOOLS_TAG) $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
@echo "\033[1;36;49mBuilding clang-install\033[0m"
rm -rf "$@.partial" "$@"
export PATH="$(ROOT)/$(PREFIX)/libtool-install/bin:$$PATH" \
$(PREFIX_CONFIG) COOKBOOK_HOST_SYSROOT=/usr COOKBOOK_CROSS_TARGET=$(TARGET) && \
$(REPO_BIN) cook host:llvm21 host:clang21 host:lld21
# llvm libraries is already in rust if building
ifeq ($(PREFIX_USE_UPSTREAM_RUST_COMPILER),1)
cp -r "$(LLVM_TARGET)/stage/usr/". "$@.partial"
endif
cp -r "$(LLVM_TARGET)/stage.runtime/usr/". "$@.partial"
cp -r "$(LLVM_TARGET)/stage.dev/usr/". "$@.partial"
cp -r "$(CLANG_TARGET)/stage/usr/". "$@.partial"
cp -r "$(LLD_TARGET)/stage/usr/". "$@.partial"
rm -rf "$@.partial/lib/"*.a
mv "$@.partial" "$@"
# no longer needed, delete build files to save disk space
rm -rf $(LLVM_TARGET) $(CLANG_TARGET) $(LLD_TARGET)
endif
endif

View File

@ -1,384 +1,75 @@
# Configuration file for QEMU
QEMU?=qemu-system-$(QEMU_ARCH)
QEMUFLAGS?=-d guest_errors -name "Redox OS $(ARCH)"
netboot?=no
redoxer?=no
VGA_SUPPORTED=no
ifeq ($(ARCH),i586)
audio?=ac97
disk?=ata
gpu?=vga
uefi=no
VGA_SUPPORTED=yes
QEMU_ARCH=i386
QEMU_MACHINE?=pc
QEMU_CPU?=pentium2
QEMU_SMP?=1
QEMU_MEM?=1024
# Default to using kvm when arch is i586 and host is x86_64
ifeq ($(HOST_ARCH),x86_64)
kvm?=yes
endif
else ifeq ($(ARCH),x86_64)
gpu?=vga
uefi?=yes
VGA_SUPPORTED=yes
QEMU_ARCH=x86_64
QEMU_MACHINE?=q35
QEMU_CPU?=core2duo
QEMU_SMP?=4
QEMU_MEM?=2048
ifeq ($(uefi),yes)
FIRMWARE=$(firstword \
$(wildcard /usr/share/ovmf/OVMF.fd) \
$(wildcard /usr/share/OVMF/OVMF_CODE.fd) \
)
ifeq ($(FIRMWARE),)
PFLASH0=$(firstword \
$(wildcard /usr/share/qemu/edk2-x86_64-code.fd) \
$(wildcard /run/libvirt/nix-ovmf/edk2-x86_64-code.fd) \
$(wildcard /opt/homebrew/opt/qemu/share/qemu/edk2s-x86_64-code.fd) \
)
endif
endif
ifneq ($(usb),no)
QEMUFLAGS+=-device qemu-xhci
endif
else ifeq ($(ARCH),aarch64)
# Default to UEFI as U-Boot doesn't set up a framebuffer for us and we don't yet support
# setting up a framebuffer ourself.
uefi?=yes
live?=yes
gpu?=ramfb
QEMU_ARCH=aarch64
QEMU_MACHINE?=virt
QEMU_CPU=max
QEMU_SMP?=1
QEMU_MEM?=2048
ifeq ($(BOARD),raspi3bp)
QEMU_KERNEL=$(BUILD)/raspi3bp_uboot.rom
disk?=sdcard
gpu=none
QEMU_MACHINE:=raspi3b
QEMU_SMP:=4
QEMU_MEM:=1024
net:=usb-net
audio:=no
ifneq ($(usb),no)
QEMUFLAGS+=-usb -device usb-kbd -device usb-tablet
endif
else
ifeq ($(uefi),yes)
FIRMWARE=$(firstword \
$(wildcard /usr/share/AAVMF/AAVMF_CODE.fd) \
)
ifeq ($(FIRMWARE),)
PFLASH0=$(firstword \
$(wildcard /usr/share/qemu/edk2-aarch64-code.fd) \
$(wildcard /run/libvirt/nix-ovmf/edk2-aarch64-code.fd) \
$(wildcard /opt/homebrew/opt/qemu/share/qemu/edk2-aarch64-code.fd) \
)
endif
else
FIRMWARE=$(BUILD)/qemu_uboot.rom
endif
ifneq ($(usb),no)
QEMUFLAGS+=-device qemu-xhci -device usb-kbd -device usb-tablet
endif
endif
# Default to using HVF when host is MacOS Silicon
ifeq ($(HOST_ARCH),arm64)
kvm?=yes
endif
else ifeq ($(ARCH),riscv64gc)
live=no
audio=no
gpu?=ramfb
net=bridge
QEMU_ARCH=riscv64
# QEMU_MACHINE=virt for ACPI mode instead of DTB
QEMU_MACHINE=virt,acpi=off
# QEMU_MACHINE:=${QEMU_MACHINE},aclint=on
# QEMU_MACHINE:=${QEMU_MACHINE},aia=aplic
# QEMU_MACHINE:=${QEMU_MACHINE},aia=aplic-imsic
QEMU_SMP?=4
QEMU_MEM?=2048
QEMU_CPU=max
PFLASH0=$(firstword \
$(wildcard /usr/share/qemu-efi-riscv64/RISCV_VIRT_CODE.fd) \
$(wildcard /usr/share/edk2/riscv/RISCV_VIRT_CODE.fd) \
$(wildcard /usr/share/qemu/edk2-riscv-code.fd) \
$(wildcard /run/libvirt/nix-ovmf/edk2-riscv-code.fd) \
$(wildcard /opt/homebrew/opt/qemu/share/qemu/edk2-riscv-code.fd) \
)
PFLASH1=$(firstword \
$(wildcard /usr/share/qemu-efi-riscv64/RISCV_VIRT_VARS.fd) \
$(wildcard /usr/share/edk2/riscv/RISCV_VIRT_VARS.fd) \
$(wildcard /usr/share/qemu/edk2-riscv-vars.fd) \
$(wildcard /run/libvirt/nix-ovmf/edk2-riscv-vars.fd) \
$(wildcard /opt/homebrew/opt/qemu/share/qemu/edk2-riscv-vars.fd) \
)
ifneq ($(usb),no)
QEMUFLAGS+=-device qemu-xhci -device usb-kbd -device usb-tablet
endif
else
$(error Unsupported ARCH for QEMU "$(ARCH)"))
endif
QEMUFLAGS+=-smp $(QEMU_SMP) -m $(QEMU_MEM)
# If host and target arch do not match, disable kvm
# (unless overridden above or by environment)
ifneq ($(ARCH),$(HOST_ARCH))
kvm?=no
endif
# wsl2: run qemu on windows instead
ifeq ($(QEMU_ON_WINDOWS),1)
QEMU:=$(QEMU).exe
WINDOWS_DISK=/mnt/c/ProgramData/redox.img
disk=windows
net=windows
QEMU_MACHINE=pc
FIRMWARE=
QEMU_KERNEL=
QEMUFLAGS+=-device usb-tablet
endif
ifneq ($(FIRMWARE),)
QEMUFLAGS+=-bios $(FIRMWARE)
endif
ifneq ($(QEMU_KERNEL),)
QEMUFLAGS+=-kernel $(QEMU_KERNEL)
endif
ifeq ($(live),yes)
DISK=$(BUILD)/redox-live.iso
else
DISK=$(BUILD)/harddrive.img
endif
ifeq ($(serial),no)
QEMUFLAGS+=-chardev stdio,id=debug -device isa-debugcon,iobase=0x402,chardev=debug
else
QEMUFLAGS+=-chardev stdio,id=debug,signal=off,mux=on,"$(if $(qemu_serial_logfile),logfile=$(qemu_serial_logfile))"
QEMUFLAGS+=-serial chardev:debug -mon chardev=debug
endif
# redoxer exit code: 51 => success, 53 => failure
ifeq ($(redoxer),yes)
ifeq ($(ARCH),x86_64)
QEMUFLAGS+=-device isa-debug-exit
else ifeq ($(ARCH),i586)
QEMUFLAGS+=-device isa-debug-exit
else ifeq ($(ARCH),aarch64)
QEMUFLAGS+=-semihosting-config enable=on,target=native,userspace=on
endif
endif
QEMU=SDL_VIDEO_X11_DGAMOUSE=0 qemu-system-$(ARCH)
QEMUFLAGS=-serial mon:stdio -d cpu_reset -d guest_errors
QEMUFLAGS+=-smp 4 -m 2048
ifeq ($(iommu),yes)
QEMUFLAGS+=-machine $(QEMU_MACHINE),iommu=on
QEMUFLAGS+=-machine q35,iommu=on
else
QEMUFLAGS+=-machine $(QEMU_MACHINE)
QEMUFLAGS+=-machine q35
endif
ifeq ($(audio),no)
# No audio
else ifeq ($(audio),ac97)
# AC'97
QEMUFLAGS+=-device AC97
else
# Intel High Definition Audio
QEMUFLAGS+=-device ich9-intel-hda -device hda-output
ifneq ($(audio),no)
QEMUFLAGS+=-device ich9-intel-hda -device hda-duplex
endif
ifeq ($(net),no)
QEMUFLAGS+=-net none
else
ifeq ($(net),rtl8139) # RTL8139
QEMUFLAGS+=-device rtl8139,netdev=net0
else ifeq ($(net),virtio) # virtio-net
QEMUFLAGS+=-device virtio-net,netdev=net0
else ifeq ($(net),usb-net)
QEMUFLAGS+=-device usb-net,netdev=net0
else
QEMUFLAGS+=-device e1000,netdev=net0,id=nic0
endif
EXTRANETARGS=
ifeq ($(netboot),yes)
EXTRANETARGS+=,tftp=$(BUILD),bootfile=redox.ipxe
QEMUFLAGS+=-kernel /usr/lib/ipxe/ipxe-amd64.efi
endif
ifneq ($(bridge),)
QEMUFLAGS+=-netdev bridge,br=$(bridge),id=net0
else ifeq ($(net),redir)
# port 8022 - ssh
# port 8080-8083 - webservers
# port 64126 - our gdbserver implementation
FWD_PORTS := 8081 8082 8083 64126
FWD_FLAGS := hostfwd=tcp::8022-:22,hostfwd=tcp::8080-:80
FWD_FLAGS2 := $(foreach p,$(FWD_PORTS),,hostfwd=tcp::$(p)-:$(p))
QEMUFLAGS += -netdev user,id=net0,$(FWD_FLAGS)$(subst $(eval ) ,,$(FWD_FLAGS2))$(EXTRANETARGS)
else ifeq ($(net),windows)
QEMUFLAGS+=-netdev user,id=net0$(EXTRANETARGS)
else
QEMUFLAGS+=-netdev user,id=net0$(EXTRANETARGS) -object filter-dump,id=f1,netdev=net0,file=$(BUILD)/network.pcap
QEMUFLAGS+=-net nic,model=e1000 -net user -net dump,file=build/network.pcap
ifeq ($(net),redir)
QEMUFLAGS+=-redir tcp:8023::8023 -redir tcp:8080::8080
endif
endif
ifeq ($(gpu),no)
ifeq ($(vga),no)
QEMUFLAGS+=-nographic -vga none
else ifeq ($(gpu),vga)
ifeq ($(VGA_SUPPORTED),yes)
QEMUFLAGS+=-vga std
else
QEMUFLAGS+=-vga none -device secondary-vga
endif
else ifeq ($(gpu),ramfb)
QEMUFLAGS+=-vga none -device ramfb
else ifeq ($(gpu),multi)
ifeq ($(VGA_SUPPORTED),yes)
QEMUFLAGS+=-display sdl -vga none -device virtio-vga,max_outputs=2
else
QEMUFLAGS+=-display sdl -vga none -device virtio-gpu,max_outputs=2
endif
else ifeq ($(gpu),virtio)
ifeq ($(VGA_SUPPORTED),yes)
QEMUFLAGS+=-vga none -device virtio-vga
else
QEMUFLAGS+=-vga none -device virtio-gpu
endif
else ifeq ($(gpu),virtio-sdl)
ifeq ($(VGA_SUPPORTED),yes)
QEMUFLAGS+=-vga none -device virtio-vga -display sdl,show-cursor=on
else
QEMUFLAGS+=-vga none -device virtio-gpu -display sdl,show-cursor=on
endif
else ifeq ($(gpu),virtio-gl)
ifeq ($(VGA_SUPPORTED),yes)
QEMUFLAGS+=-display gtk,gl=on -vga none -device virtio-vga-gl
else
QEMUFLAGS+=-display gtk,gl=on -vga none -device virtio-gpu-gl
endif
endif
EXTRA_DISK=$(BUILD)/extra.img
disk?=nvme
ifeq ($(disk),ata)
# For i386, ata will use ided
# For aarch64 and x86_64, ata will use ahcid
QEMUFLAGS+= \
-drive file=$(DISK),format=raw \
-drive file=$(EXTRA_DISK),format=raw
else ifeq ($(disk),nvme)
QEMUFLAGS+= \
-drive file=$(DISK),format=raw,if=none,id=drv0 -device nvme,drive=drv0,serial=NVME_SERIAL \
-drive file=$(EXTRA_DISK),format=raw,if=none,id=drv1 -device nvme,drive=drv1,serial=NVME_EXTRA
else ifeq ($(disk),usb)
QEMUFLAGS+= \
-drive if=none,id=usbstick,format=raw,file=$(DISK) \
-device usb-storage,drive=usbstick
else ifeq ($(disk),virtio)
QEMUFLAGS+= \
-drive file=$(DISK),format=raw,if=virtio \
-drive file=$(EXTRA_DISK),format=raw,if=virtio
else ifeq ($(disk),cdrom)
QEMUFLAGS+= \
-boot d -cdrom $(DISK) \
-drive file=$(EXTRA_DISK),format=raw
else ifeq ($(disk),sdcard)
QEMUFLAGS+=-drive file=$(DISK),if=sd,format=raw
else ifeq ($(disk),windows)
QEMUFLAGS+=-drive file="$(shell wslpath -w $(WINDOWS_DISK))",format=raw,if=virtio
ifneq ($(usb),no)
QEMUFLAGS+=-device nec-usb-xhci,id=xhci -device usb-tablet,bus=xhci.0
endif
ifeq ($(gdb),yes)
QEMUFLAGS+=-d cpu_reset -s -S
else ifeq ($(gdb),nonblock)
# Allow attaching gdb, but don't block for it
QEMUFLAGS+=-d cpu_reset -s
endif
ifeq ($(UNAME),Linux)
ifneq ($(kvm),no)
ifeq ($(QEMU_ON_WINDOWS),1)
QEMUFLAGS+=-accel whpx,kernel-irqchip=off -cpu Broadwell,x2apic=off
else
QEMUFLAGS+=-enable-kvm -cpu host
endif
else
QEMUFLAGS+=-cpu $(QEMU_CPU)
QEMUFLAGS+=-enable-kvm -cpu host
endif
endif
#,int,pcall
#-device intel-iommu
ifeq ($(UNAME),Darwin)
ifneq ($(kvm),no)
QEMUFLAGS+=-accel hvf -cpu max
else
QEMUFLAGS+=-cpu $(QEMU_CPU)
endif
endif
build/extra.qcow2:
qemu-img create -f qcow2 $@ 256M
ifneq ($(PFLASH0),)
QEMUFLAGS+=-drive if=pflash,format=raw,unit=0,file=$(PFLASH0),readonly=on
endif
qemu: build/harddrive.bin build/extra.qcow2
$(QEMU) $(QEMUFLAGS) \
-drive file=build/harddrive.bin,format=raw \
-drive file=build/extra.qcow2
ifneq ($(PFLASH1),)
QEMUFLAGS+=-drive if=pflash,format=raw,unit=1,file=$(BUILD)/fw_vars.bin
endif
qemu_no_build: build/extra.qcow2
$(QEMU) $(QEMUFLAGS) \
-drive file=build/harddrive.bin,format=raw \
-drive file=build/extra.qcow2
.PHONY: qemu-deps
qemu_nvme: build/harddrive.bin build/extra.qcow2
$(QEMU) $(QEMUFLAGS) \
-drive file=build/harddrive.bin,format=raw -drive file=build/extra.qcow2,if=none,id=drv0 -device nvme,drive=drv0,serial=NVME_SERIAL \
-drive file=build/extra.qcow2
qemu-deps: $(DISK)
qemu_nvme_no_build: build/extra.qcow2
$(QEMU) $(QEMUFLAGS) \
-drive file=build/harddrive.bin,format=raw -drive file=build/extra.qcow2,if=none,id=drv0 -device nvme,drive=drv0,serial=NVME_SERIAL \
-drive file=build/extra.qcow2
ifeq ($(disk),usb)
else ifeq ($(disk),sdcard)
else ifeq ($(disk),windows)
qemu-deps: $(WINDOWS_DISK)
else
qemu-deps: $(EXTRA_DISK)
endif
qemu_live: build/livedisk.bin build/extra.qcow2
$(QEMU) $(QEMUFLAGS) \
-device usb-ehci,id=flash_bus -drive id=flash_drive,file=build/livedisk.bin,format=raw,if=none -device usb-storage,drive=flash_drive,bus=flash_bus.0 \
-drive file=build/extra.qcow2
qemu-deps:$(FIRMWARE)
qemu_live_no_build: build/extra.qcow2
$(QEMU) $(QEMUFLAGS) \
-device usb-ehci,id=flash_bus -drive id=flash_drive,file=build/livedisk.bin,format=raw,if=none -device usb-storage,drive=flash_drive,bus=flash_bus.0 \
-drive file=build/extra.qcow2
qemu-deps:$(QEMU_KERNEL)
qemu_iso: build/livedisk.iso build/extra.qcow2
$(QEMU) $(QEMUFLAGS) \
-boot d -cdrom build/livedisk.iso \
-drive file=build/extra.qcow2
qemu-deps: $(PFLASH0)
ifneq ($(PFLASH1),)
qemu-deps: $(BUILD)/fw_vars.bin
.PRECIOUS: $(BUILD)/fw_vars.bin
$(BUILD)/fw_vars.bin: $(PFLASH1)
cp "$<" "$@"
endif
$(EXTRA_DISK):
truncate -s 1g $@
$(WINDOWS_DISK): $(BUILD)/harddrive.img
rm -f $@
mkdir -p $(shell dirname $@)
cp "$<" "$@"
$(BUILD)/raspi3bp_uboot.rom:
wget -O $@ https://gitlab.redox-os.org/Ivan/redox_firmware/-/raw/main/platform/raspberry_pi/rpi3/u-boot-rpi-3-b-plus.bin
$(BUILD)/qemu_uboot.rom:
wget -O $@ https://gitlab.redox-os.org/Ivan/redox_firmware/-/raw/main/platform/qemu/qemu_arm64/u-boot-qemu-arm64.bin
qemu: qemu-deps
ifeq ($(wildcard $(MOUNT_DIR)),)
$(QEMU) $(QEMUFLAGS)
else
@echo "\033[1;38;5;196mDisk is mounted. Unmounting the disk...\033[0m";
$(MAKE) unmount
$(QEMU) $(QEMUFLAGS)
endif
qemu_iso_no_build: build/extra.qcow2
$(QEMU) $(QEMUFLAGS) \
-boot d -cdrom build/livedisk.iso \
-drive file=build/extra.qcow2

View File

@ -1,401 +0,0 @@
# Configuration file for recipe commands
$(REPO_TAG): prefix $(FILESYSTEM_CONFIG) | $(FSTOOLS) $(FSTOOLS_TAG) $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
export PATH="$(PREFIX_PATH):$$PATH" && \
export COOKBOOK_HOST_SYSROOT="$(ROOT)/$(PREFIX_INSTALL)" && \
$(REPO_BIN) cook $(COOKBOOK_OPTS) --with-package-deps
mkdir -p $(BUILD)
touch $@
endif
comma := ,
# List all recipes in a cook-tree fashion specified by the filesystem config
repo-tree: $(FSTOOLS_TAG) $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
@$(REPO_BIN) cook-tree $(COOKBOOK_OPTS) --with-package-deps
endif
# List all recipes in a push-tree fashion specified by the filesystem config
image-tree: $(FSTOOLS_TAG) $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
@$(REPO_BIN) push-tree $(COOKBOOK_OPTS)
endif
# Clean specific target to all recipes, similar to repo_clean but more specific
repo_clean_target: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
$(REPO_BIN) clean-target --all
endif
# Fetch all recipes source or binary from filesystem config
fetch: prefix $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
export PATH="$(PREFIX_PATH):$$PATH" && \
export COOKBOOK_HOST_SYSROOT="$(ROOT)/$(PREFIX_INSTALL)" && \
$(REPO_BIN) fetch $(COOKBOOK_OPTS) --with-package-deps
endif
# Unfetch and clean all recipes source or binary from filesystem config
unfetch: prefix $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
$(REPO_BIN) unfetch $(COOKBOOK_OPTS) --with-package-deps
endif
# Fetch Cargo dependencies for the cookbook tool (needed for REPO_OFFLINE=1 builds)
cargo-fetch: FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
$(HOST_CARGO) fetch --manifest-path Cargo.toml --locked
endif
# Find recipe for one or more targets separated by comma
find.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
@$(REPO_BIN) find $(foreach f,$(subst $(comma), ,$*),$(f))
endif
# Invoke clean for relibc in recipe and relibc in sysroot
c.relibc: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
$(REPO_BIN) clean relibc
rm -rf $(PREFIX)/relibc-install $(PREFIX)/sysroot
@echo "\033[1;36;49mSysroot cleaned\033[0m"
endif
# Invoke clean for one or more targets separated by comma
c.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
$(REPO_BIN) clean $(foreach f,$(subst $(comma), ,$*),$(f))
endif
# Invoke fetch for one or more targets separated by comma
f.%: prefix $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
export PATH="$(PREFIX_PATH):$$PATH" && \
export COOKBOOK_HOST_SYSROOT="$(ROOT)/$(PREFIX_INSTALL)" && \
$(REPO_BIN) fetch $(foreach f,$(subst $(comma), ,$*),$(f)) $(COOKBOOK_OPTS)
endif
# Invoke cook for one or more targets separated by comma
r.%: prefix $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
export PATH="$(PREFIX_PATH):$$PATH" && \
export COOKBOOK_HOST_SYSROOT="$(ROOT)/$(PREFIX_INSTALL)" && \
$(REPO_BIN) cook $(foreach f,$(subst $(comma), ,$*),$(f)) $(COOKBOOK_OPTS)
endif
# Show what to cook
rt.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
$(REPO_BIN) cook-tree $(foreach f,$(subst $(comma), ,$*),$(f)) $(COOKBOOK_OPTS)
endif
MOUNTED_TAG=$(MOUNT_DIR)~
# Push compiled package into existing image
# DO NOT RUN THIS WHILE QEMU ALIVE, THE DISK MIGHT CORRUPT IN DOING SO
p.%: $(FSTOOLS_TAG) FORCE
ifeq ($(ALLOW_FSTOOLS),1)
@rm -f $(MOUNTED_TAG)
@if [ ! -d "$(MOUNT_DIR)" ]; then \
$(MAKE) mount; \
touch $(MOUNTED_TAG); \
fi
endif
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@ ALLOW_FSTOOLS=$(FSTOOLS_IN_PODMAN)
else
$(REPO_BIN) push $(foreach f,$(subst $(comma), ,$*),$(f)) "--sysroot=$(MOUNT_DIR)" $(COOKBOOK_OPTS)
endif
ifeq ($(ALLOW_FSTOOLS),1)
@if [ -f $(MOUNTED_TAG) ]; then \
$(MAKE) unmount && rm -f $(MOUNTED_TAG); \
else echo "\033[0;33;49mNot unmounting by ourself, don't forget to do it\033[0m"; \
fi
endif
# Show what to push
pt.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
$(REPO_BIN) push-tree $(foreach f,$(subst $(comma), ,$*),$(f)) $(COOKBOOK_OPTS)
endif
# Push all recipes specified by the filesystem config
push: $(FSTOOLS_TAG) FORCE
ifeq ($(ALLOW_FSTOOLS),1)
@rm -f $(MOUNTED_TAG)
@if [ ! -d "$(MOUNT_DIR)" ]; then \
$(MAKE) mount; \
touch $(MOUNTED_TAG); \
fi
endif
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@ ALLOW_FSTOOLS=$(FSTOOLS_IN_PODMAN)
else
$(REPO_BIN) push $(COOKBOOK_OPTS) --with-package-deps "--sysroot=$(MOUNT_DIR)"
endif
ifeq ($(ALLOW_FSTOOLS),1)
@if [ -f $(MOUNTED_TAG) ]; then \
$(MAKE) unmount && rm -f $(MOUNTED_TAG); \
else echo "\033[1;33;49mNot unmounting by ourself, don't forget to do it\033[0m"; \
fi
endif
# Rebuild and push all recipes specified by the filesystem config
rebuild-push: $(FSTOOLS_TAG) FORCE
rm -f $(REPO_TAG)
$(MAKE) repo
$(MAKE) push
# Invoke unfetch for one or more targets separated by comma
u.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
$(REPO_BIN) unfetch $(foreach f,$(subst $(comma), ,$*),$(f))
endif
# Invoke clean, and rebuild for one of more targets separated by comma
cr.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
$(MAKE) c.$*
$(MAKE) r.$*
endif
# Invoke unfetch, clean, and rebuild for one or more targets separated by comma
ucr.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
$(MAKE) u.$*
$(MAKE) cr.$*
endif
# Invoke unfetch and clean for one or more targets separated by comma
uc.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
$(MAKE) u.$*
$(MAKE) c.$*
endif
# Invoke unfetch, clean and fetch for one or more targets separated by comma
ucf.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
$(MAKE) uc.$*
$(MAKE) f.$*
endif
# Invoke rebuild and push for one of more targets separated by comma
# Don't use podman here, as the p target cannot mount inside podman
rp.%: $(FSTOOLS_TAG) FORCE
$(MAKE) r.$*,--with-package-deps
$(MAKE) p.$*
# Invoke clean, rebuild and push for one of more targets separated by comma
crp.%: $(FSTOOLS_TAG) FORCE
$(MAKE) cr.$*,--with-package-deps
$(MAKE) p.$*
# Invoke unfetch. clean, rebuild and push for one of more targets separated by comma
ucrp.%: $(FSTOOLS_TAG) FORCE
$(MAKE) ucr.$*,--with-package-deps
$(MAKE) p.$*
ifeq ($(HOSTED_REDOX),1)
DESTDIR?=/
# Install all recipes specified by the filesystem config
install:
$(REPO_BIN) push $(COOKBOOK_OPTS) --with-package-deps "--sysroot=$(DESTDIR)"
# Rebuild and install all recipes specified by the filesystem config
rebuild-install: $(FSTOOLS_TAG) FORCE
rm -f $(REPO_TAG)
$(MAKE) repo
$(MAKE) install
i.%: $(FSTOOLS_TAG) FORCE
$(REPO_BIN) push $(COOKBOOK_OPTS) --with-package-deps "--sysroot=$(DESTDIR)"
# Invoke rebuild and install for one of more targets separated by comma
ri.%: $(FSTOOLS_TAG) FORCE
$(MAKE) r.$*,--with-package-deps
$(MAKE) i.$*
# Invoke clean, rebuild and install for one of more targets separated by comma
cri.%: $(FSTOOLS_TAG) FORCE
$(MAKE) cr.$*,--with-package-deps
$(MAKE) i.$*
# Invoke unfetch. clean, rebuild and install for one of more targets separated by comma
ucri.%: $(FSTOOLS_TAG) FORCE
$(MAKE) ucr.$*,--with-package-deps
$(MAKE) i.$*
endif
# Set recipe rule to "binary" then invoke clean
bc.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
$(REPO_BIN) change-rule --set-rule=binary $(foreach f,$(subst $(comma), ,$*),$(f)) --with-package-deps
endif
# Set recipe rule to "source" then invoke clean
sc.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
$(REPO_BIN) change-rule --set-rule=source $(foreach f,$(subst $(comma), ,$*),$(f)) --with-package-deps
endif
# Set specific recipe rule to "local" then invoke clean
lc.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
$(REPO_BIN) change-rule-local --set-rule=local $(foreach f,$(subst $(comma), ,$*),$(f))
endif
# Set specific recipe rule to "ignore" then invoke clean
nc.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
$(REPO_BIN) change-rule-local --set-rule=ignore $(foreach f,$(subst $(comma), ,$*),$(f))
endif
# Reset recipe rule then invoke clean
cc.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
$(REPO_BIN) change-rule --unset $(foreach f,$(subst $(comma), ,$*),$(f)) --with-package-deps
endif
# Set recipe rule to "binary" then invoke clean and rebuild
bcr.%: $(FSTOOLS_TAG) FORCE
$(MAKE) bc.$*
$(MAKE) r.$*,--with-package-deps
# Set recipe rule to "source" then invoke clean and rebuild
scr.%: $(FSTOOLS_TAG) FORCE
$(MAKE) sc.$*
$(MAKE) r.$*,--with-package-deps
# Set specific recipe rule to "local" then invoke clean and rebuild
lcr.%: $(FSTOOLS_TAG) FORCE
$(MAKE) lc.$*
$(MAKE) r.$*
# Set specific recipe rule to "ignore" then invoke clean and rebuild
ncr.%: $(FSTOOLS_TAG) FORCE
$(MAKE) nc.$*
$(MAKE) r.$*
# Set recipe rule to "binary" then invoke clean, rebuild and push
bcrp.%: $(FSTOOLS_TAG) FORCE
$(MAKE) bcr.$*
$(MAKE) p.$*
# Set recipe rule to "source" then invoke clean, rebuild and push
scrp.%: $(FSTOOLS_TAG) FORCE
$(MAKE) scr.$*
$(MAKE) p.$*
# Save current git rev for next recipe fetch, locking git recipes frozen in time
repo-lock: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
$(REPO_BIN) capture-rev $(COOKBOOK_OPTS) --with-package-deps
endif
# Undo repo-lock, allowing git recipes to get updated by next recipe fetch
repo-unlock: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
$(REPO_BIN) capture-rev $(COOKBOOK_OPTS) --unset --with-package-deps
endif
# Like repo-lock, but also checking out the specified git rev.
# Revert this operation by "git checkout master" "make pull" then "make repo-unlock".
# Will not work if rolling back to a commit before 2026.
repo-rollback.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
# have to be done otherwise podman will rebuild
touch $(CONTAINER_TAG)
else
git checkout $*
$(REPO_BIN) capture-rev $(COOKBOOK_OPTS) --rollback --with-package-deps
endif
# have to be done otherwise cookbook will rebuild
touch $(FSTOOLS_TAG)
export DEBUG_BIN?=
# Debug a statically linked program with gdbgui, for example: debug.drivers-initfs DEBUG_BIN=pcid
# Enable debug symbols with `REPO_DEBUG=1 make cr.recipe rebuild`, make sure `file` outputs "debug_info, not stripped"
# Open http://localhost:5000/dashboard, start QEMU with `make qemu kvm=no QEMU_SMP=1 gdb=yes` before opening a session
# Experimental, may not work if ARCH is different with what host is running
debug.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
@cd $(shell make find.$* | grep ^recipes) && \
export RECIPE_STAGE=target/$(TARGET)/stage && \
export BIN_PATH=$$(find $$RECIPE_STAGE -type f -name "$(DEBUG_BIN)" -or -type f -name "$*") && \
file $$BIN_PATH 2> /dev/null || ( echo "Binary is not found, please set DEBUG_BIN" && exit 1 ) && \
echo "Opening gdbgui for debugging $* with binary '$$BIN_PATH'" && echo "----------" && \
podman build -t redox-kernel-debug - < $(ROOT)/podman/redox-gdb-containerfile > /dev/null && \
podman run --rm -p 5000:5000 -it --name redox-gdb \
-v "./$$BIN_PATH:/binary" \
-v "./source:/source" -w "/source" \
redox-kernel-debug --gdb-cmd "gdb -ex 'set confirm off' \
-ex 'add-symbol-file /binary' \
-ex 'target remote host.containers.internal:1234'"
else
@cd $(shell make find.$* | grep ^recipes) && \
export RECIPE_STAGE=target/$(TARGET)/stage && \
export BIN_PATH=$$(find $$RECIPE_STAGE -type f -name "$(DEBUG_BIN)" -or -type f -name "$*") && \
file $$BIN_PATH 2> /dev/null || ( echo "Binary is not found, please set DEBUG_BIN" && exit 1 ) && \
echo "Opening gdbgui for debugging $* with binary '$$BIN_PATH'" && echo "----------" && \
gdbgui.pex --gdb-cmd "gdb -ex 'set confirm off' \
-ex 'add-symbol-file $$BIN_PATH' \
-ex 'target remote localhost:1234'"
endif

View File

@ -1,6 +1,5 @@
# Configuration file for VirtualBox, it creates a VirtualBox virtual machine
virtualbox: $(BUILD)/harddrive.img
BUILDDIR = $(abspath $(dir $(firstword $(MAKEFILE_LIST))))/build
virtualbox: build/harddrive.bin
echo "Delete VM"
-$(VBM) unregistervm Redox --delete; \
if [ $$? -ne 0 ]; \
@ -24,21 +23,20 @@ virtualbox: $(BUILD)/harddrive.img
$(VBM) modifyvm Redox --nictype1 82540EM; \
$(VBM) modifyvm Redox --cableconnected1 on; \
$(VBM) modifyvm Redox --nictrace1 on; \
$(VBM) modifyvm Redox --nictracefile1 "$(ROOT)/$(BUILD)/network.pcap"; \
$(VBM) modifyvm Redox --nictracefile1 "$(BUILDDIR)/network.pcap"; \
fi
$(VBM) modifyvm Redox --uart1 0x3F8 4
$(VBM) modifyvm Redox --uartmode1 file "$(ROOT)/$(BUILD)/serial.log"
$(VBM) modifyvm Redox --uartmode1 file "$(BUILDDIR)/serial.log"
$(VBM) modifyvm Redox --usb off # on
$(VBM) modifyvm Redox --keyboard ps2
$(VBM) modifyvm Redox --mouse ps2
$(VBM) modifyvm Redox --audio-driver $(VB_AUDIO)
$(VBM) modifyvm Redox --audio $(VB_AUDIO)
$(VBM) modifyvm Redox --audiocontroller hda
$(VBM) modifyvm Redox --audioout on
$(VBM) modifyvm Redox --nestedpaging on
echo "Create Disk"
$(VBM) convertfromraw $< $(BUILD)/harddrive.vdi
$(VBM) convertfromraw $< build/harddrive.vdi
echo "Attach Disk"
$(VBM) storagectl Redox --name ATA --add sata --controller IntelAHCI --bootable on --portcount 1
$(VBM) storageattach Redox --storagectl ATA --port 0 --device 0 --type hdd --medium $(BUILD)/harddrive.vdi
$(VBM) storageattach Redox --storagectl ATA --port 0 --device 0 --type hdd --medium build/harddrive.vdi
echo "Run VM"
$(VBM) startvm Redox

File diff suppressed because it is too large Load Diff

View File

@ -1,84 +0,0 @@
# Configuration file to install the recipe dependencies inside the Podman container
FROM docker.io/library/debian:trixie
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
appstream \
appstream-compose \
autoconf \
autoconf2.69 \
automake \
autopoint \
bison \
bsdextrautils \
build-essential \
cmake \
curl \
dos2unix \
doxygen \
expect \
file \
flex \
fuse3 \
g++ \
genisoimage \
git \
git-lfs \
gobject-introspection \
gtk-doc-tools \
gtk-update-icon-cache \
help2man \
ipxe-qemu \
intltool \
libaudiofile-dev \
libdbus-glib-1-dev-bin \
libfuse3-dev \
libgdk-pixbuf2.0-bin \
libglib2.0-dev-bin \
libhtml-parser-perl \
librsvg2-common \
libsdl1.2-dev \
libsdl2-ttf-dev \
lzip \
m4 \
make \
meson \
nano \
nasm \
ninja-build \
patch \
patchelf \
perl \
pkg-config \
po4a \
protobuf-compiler \
qemu-system-x86 \
qemu-system-arm \
qemu-efi-aarch64 \
python3 \
python3-dev \
python3-libxml2 \
python3-mako \
python3-venv \
python3-yaml \
rsync \
ruby \
scons \
ssh \
texinfo \
unifdef \
unzip \
wget \
xdg-utils \
xfonts-utils \
xserver-xorg-dev \
xutils-dev \
xxd \
zip \
zstd \
&& if [ "$(uname -m)" = "x86_64" ]; then \
apt-get install -y --no-install-recommends \
libc6-dev-i386 \
syslinux-utils \
; fi

View File

@ -1,15 +0,0 @@
FROM debian:stable-backports
RUN apt-get update \
&& apt-get install -y --no-install-recommends -t stable-backports \
python3 \
python3-pip \
gdb \
curl \
&& rm -rf /var/lib/apt/lists/*
RUN pip3 install gdbgui --break-system-packages
EXPOSE 5000
ENTRYPOINT [ "gdbgui", "--remote", "--port", "5000" ]

View File

@ -1,46 +0,0 @@
# Configuration file to build linux toolchain using lower glibc constraint
FROM docker.io/library/debian:oldstable-backports
RUN apt-get update \
&& apt-get install -y --no-install-recommends -t oldstable-backports \
autoconf \
autoconf2.69 \
automake \
autopoint \
bison \
build-essential \
cmake \
curl \
dos2unix \
doxygen \
expect \
file \
flex \
fuse3 \
g++ \
git \
git-lfs \
help2man \
libfuse3-dev \
lzip \
m4 \
make \
meson \
nano \
nasm \
ninja-build \
patch \
patchelf \
perl \
pkg-config \
po4a \
python3 \
rsync \
scons \
texinfo \
unifdef \
unzip \
wget \
zip \
zstd

View File

@ -1,40 +0,0 @@
# The Redox build server configuration for host tools
# Packages listed here is to aid the build server to compile `host:` recipes
# commonly found within dev dependencies of packages and distribute them.
# This is not a replacement for cross compilers that exist within the prebuilt
# prefix: GCC, Rust, LLVM and Clang. This is the place for the rest of
# cross compilers that's might be needed by other recipes, such as Go or Zig.
# General settings
[general]
# Do not prompt if settings are not defined
prompt = false
[packages]
# Binaries
#dotnet10 = {}
#go = {}
gperf = {}
installer = {}
itstool = {}
luajit = {}
neovim = {}
nodejs-21 = {}
#openjdk21 = {}
#perl5 = {}
#protobuf = {}
python312 = {}
redoxfs = {}
redoxer = {}
#ruby = {}
xz = {}
#zig = {}
# Libraries
libarchive = {}
libjpeg = {}
libogg = {}
libxml = {}
libxslt = {}
ncurses = {}

View File

@ -1,20 +0,0 @@
#!/usr/bin/env bash
# This must be run outside podman build so the build/podman volume mount to /root contains all home folder changes
set -ex
echo "Installing rust..."
curl "https://sh.rustup.rs" -sSf | sh -s -- -y --default-toolchain stable --profile minimal
echo "Downloading sccache..."
SCCACHE_URL="https://github.com/mozilla/sccache/releases/download/v0.15.0/sccache-v0.15.0-$(uname -m)-unknown-linux-musl.tar.gz"
wget -qO- --show-progress "${SCCACHE_URL}" | tar -xz -C ~/.cargo/bin --strip-components=1 --wildcards '*/sccache'
echo "Downloading just..."
JUST_URL="https://github.com/casey/just/releases/download/1.50.0/just-1.50.0-$(uname -m)-unknown-linux-musl.tar.gz"
wget -qO- --show-progress "${JUST_URL}" | tar -xz -C ~/.cargo/bin --wildcards 'just'
echo "Downloading cbindgen..."
CBINDGEN_NAME="$( [ "$(uname -m)" = "x86_64" ] && echo "ubuntu22.04" || echo "ubuntu22.04-aarch64" )"
CBINDGEN_URL="https://github.com/mozilla/cbindgen/releases/download/0.29.0/cbindgen-${CBINDGEN_NAME}"
wget -qO- --show-progress "${CBINDGEN_URL}" > ~/.cargo/bin/cbindgen
chmod +x ~/.cargo/bin/cbindgen

View File

@ -1,666 +0,0 @@
#!/usr/bin/env bash
# This script setup the Redox build system with Podman
# It install the Podman dependencies for cross-compilation
# and download the build system configuration files
set -e
##########################################################
# This function is simply a banner to introduce the script
##########################################################
banner()
{
echo "|------------------------------------------|"
echo "|----- Welcome to the redox bootstrap -----|"
echo "|-------- for building with Podman --------|"
echo "|------------------------------------------|"
}
############################################################################
# This function takes care of installing a dependency via package manager of
# choice for building Redox on BSDs (macOS, FreeBSD, etc.).
# @params: $1 package manager
# $2 package name
# $3 binary name (optional)
############################################################################
install_bsd_pkg()
{
PKG_MANAGER=$1
PKG_NAME=$2
BIN_NAME=$3
if [ -z "$BIN_NAME" ]; then
BIN_NAME=$PKG_NAME
fi
BIN_LOCATION=$(which $BIN_NAME || true)
if [ -z "$BIN_LOCATION" ]; then
echo "$PKG_MANAGER install $PKG_NAME"
$PKG_MANAGER install "$PKG_NAME"
else
echo "$BIN_NAME already exists at $BIN_LOCATION, no need to install $PKG_NAME..."
fi
}
install_macports_pkg()
{
install_bsd_pkg "sudo port" "$1" "$2"
}
install_brew_pkg()
{
install_bsd_pkg "brew" $@
}
install_brew_cask_pkg()
{
install_bsd_pkg "brew cask" $@
}
install_freebsd_pkg()
{
install_bsd_pkg "sudo pkg" $@
}
###############################################################################
# This function checks which of the supported package managers
# is available on the macOS host.
# If a supported package manager is found, it delegates the installing work to
# the relevant function.
# Otherwise this function will exit this script with an error.
###############################################################################
osx()
{
echo "Detected macOS!"
if [ ! -z "$(which brew)" ]; then
osx_homebrew $@
elif [ ! -z "$(which port)" ]; then
osx_macports $@
else
echo "Please install either Homebrew or MacPorts, if you wish to use this script"
echo "Re-run this script once you installed one of those package managers"
echo "Will not install, now exiting..."
exit 1
fi
}
###############################################################################
# This function takes care of installing all dependencies using MacPorts
# for building Redox on macOS
# @params: $1 the emulator to install, "virtualbox" or "qemu"
###############################################################################
osx_macports()
{
echo "MacPorts detected! Now updating..."
sudo port -v selfupdate
echo "Installing missing packages..."
install_macports_pkg "git"
install_macports_pkg "gmake"
install_macports_pkg "curl"
install_macports_pkg "podman"
install_macports_pkg "gdb +multiarch"
if [ "$1" == "qemu" ]; then
install_macports_pkg "qemu" "qemu-system-x86_64"
elif [ "$1" == "virtualbox" ]; then
install_macports_pkg "virtualbox"
else
echo "Unknown emulator: $1"
exit 1
fi
}
###############################################################################
# This function takes care of installing all dependencies using Homebrew
# for building Redox on macOS
# @params: $1 the emulator to install, "virtualbox" or "qemu"
###############################################################################
osx_homebrew()
{
echo "Homebrew detected! Now updating..."
brew update
echo "Installing missing packages..."
install_brew_pkg "git"
install_brew_pkg "make"
install_brew_pkg "curl"
install_brew_pkg "podman"
install_brew_pkg "gdb"
if [ "$1" == "qemu" ]; then
install_brew_pkg "qemu" "qemu-system-x86_64"
elif [ "$1" == "virtualbox" ]; then
install_brew_pkg "virtualbox"
else
echo "Unknown emulator: $1"
exit 1
fi
}
###############################################################################
# This function takes care of installing all dependencies using pkg
# for building Redox on FreeBSD
# @params: $1 the emulator to install, "virtualbox" or "qemu"
###############################################################################
freebsd()
{
set -x
echo "FreeBSD detected!"
echo "Installing missing packages..."
install_freebsd_pkg "git"
install_freebsd_pkg "gmake"
install_freebsd_pkg "curl"
install_freebsd_pkg "podman"
install_freebsd_pkg "gdb"
if [ "$1" == "qemu" ]; then
install_freebsd_pkg "qemu" "qemu-system-x86_64"
elif [ "$1" == "virtualbox" ]; then
install_freebsd_pkg "virtualbox"
else
echo "Unknown emulator: $1"
exit 1
fi
set +x
}
###############################################################################
# This function takes care of installing all dependencies for building Redox on
# Arch Linux
# @params: $1 the emulator to install, "virtualbox" or "qemu"
###############################################################################
archLinux()
{
echo "Detected Arch Linux"
packages="git make curl fuse3 fuse-overlayfs slirp4netns podman gdb"
if [ "$1" == "qemu" ]; then
packages="$packages qemu-desktop qemu-system-arm qemu-system-riscv"
elif [ "$1" == "virtualbox" ]; then
packages="$packages virtualbox"
else
echo "Unknown emulator: $1"
exit 1
fi
# Scripts should not cause a system update in order to just install a
# couple of packages. If pacman -S --needed is going to fail, let it fail
# and the user will figure out the issues (without updating if required)
# and rerun the script.
#echo "Updating system..."
#sudo pacman -Syu
echo "Installing packages $packages..."
sudo pacman -S --needed $packages
}
###############################################################################
# This function takes care of installing all dependencies for building Redox on
# Debian-based Linux
# @params: $1 the emulator to install, "virtualbox" or "qemu"
# $2 the package manager to use
###############################################################################
ubuntu()
{
echo "Detected Ubuntu/Debian"
echo "Updating system..."
sudo "$2" update
echo "Installing required packages..."
sudo "$2" install \
podman curl git make pkg-config fuse3 libfuse3-dev fuse-overlayfs slirp4netns gdb-multiarch
if [ "$1" == "qemu" ]; then
if [ -z "$(which qemu-system-x86_64)" ]; then
echo "Installing QEMU..."
if apt-cache show qemu-system-riscv > /dev/null 2>&1
then riscv="qemu-system-riscv" # ubuntu 26 / debian 13
else riscv="qemu-system-riscv64" # ubuntu 24 / debian 12
fi
sudo $install_command qemu-system-x86 qemu-kvm \
qemu-system-arm qemu-efi-aarch64 $riscv
else
echo "QEMU already installed!"
fi
elif [ "$1" == "virtualbox" ]; then
if [ -z "$(which virtualbox)" ]; then
if grep '^ID=debian$' /etc/os-release > /dev/null; then
echo "Virtualbox is not in the official debian packages"
echo "To install virtualbox on debian, see https://wiki.debian.org/VirtualBox"
echo "Please install VirtualBox and re-run this script,"
echo "or run with -e qemu"
exit 1
else
echo "Installing VirtualBox..."
sudo "$2" install virtualbox
fi
else
echo "VirtualBox already installed!"
fi
else
echo "Unknown emulator: $1"
exit 1
fi
}
###############################################################################
# This function takes care of installing all dependencies for building Redox on
# Fedora Linux
# @params: $1 the emulator to install, "virtualbox" or "qemu"
###############################################################################
fedora()
{
echo "Detected Fedora"
if [ -z "$(which git)" ]; then
echo "Installing git..."
sudo dnf install git-all
fi
if [ "$1" == "qemu" ]; then
if [ -z "$(which qemu-system-x86_64)" ]; then
echo "Installing QEMU..."
sudo dnf install qemu-system-x86 qemu-system-arm \
qemu-system-riscv qemu-kvm edk2-aarch64
else
echo "QEMU already installed!"
fi
elif [ "$1" == "virtualbox" ]; then
if [ -z "$(which virtualbox)" ]; then
echo "Please install VirtualBox and re-run this script,"
echo "or run with -e qemu"
exit 1
else
echo "VirtualBox already installed!"
fi
else
echo "Unknown emulator: $1"
exit 1
fi
# Use rpm -q <package> to check if it's already installed
PKGS=$(for pkg in podman curl make fuse3 fuse3-devel fuse-overlayfs slirp4netns gdb; do rpm -q $pkg > /dev/null || echo $pkg; done)
# If the list of packages is not empty, install missing
COUNT=$(echo $PKGS | wc -w)
if [ $COUNT -ne 0 ]; then
echo "Installing necessary build tools..."
sudo dnf install $PKGS
fi
}
###############################################################################
# This function takes care of installing all dependencies for building Redox on
# *SUSE Linux
# @params: $1 the emulator to install, "virtualbox" or "qemu"
###############################################################################
suse()
{
echo "Detected SUSE Linux"
packages=(
"git"
"curl"
"make"
"fuse"
"fuse-overlayfs"
"slirp4netns"
"podman"
"gdb-multiarch"
)
if [ -z "$(which git)" ]; then
echo "Will install git ..."
packages+=(git)
fi
if [ "$1" == "qemu" ]; then
if [ -z "$(which qemu-system-x86_64)" ]; then
echo "Will install QEMU..."
packages+=(qemu-x86 qemu-kvm)
else
echo "QEMU already installed!"
fi
elif [ "$1" == "virtualbox" ]; then
if [ -z "$(which virtualbox)" ]; then
echo "Please install VirtualBox and re-run this script,"
echo "or run with -e qemu"
exit 1
else
echo "VirtualBox already installed!"
fi
else
echo "Unknown emulator: $1"
exit 1
fi
echo "Installing necessary build tools..."
# We could install all the packages in a single zypper command with:
#
# zypper install package1 package2 package3
#
# But there is an issue with this: zypper returns a success code if at
# least one of the packages was correctly installed, but we need it to fail
# if any of the packages is missing.
#
# To confirm that the packages are available, we try to install them one by
# one with --dry-run.
# We still install all the packages in a single zypper command so that the
# user has to confirm only once.
for p in ${packages[@]}; do
if rpm -q "${p}" > /dev/null ; then
echo "${p} is already installed"
else
# Zypper shows a confirmation prompt and the "y" answer even with
# --non-interactive and --no-confirm:
#
# 1 new package to install.
# Overall download size: 281.7 KiB. Already cached: 0 B.
# After the operation, additional 394.6 KiB will be used.
# Continue? [y/n/v/...? shows all options] (y): y
#
# That could make the user think that the package was installed,
# when it was only a dry run.
# To avoid the confusion, we hide the output unless there was an
# error.
if out="$(zypper --non-interactive install --no-confirm --dry-run --force-resolution ${p} 2>&1)" ; then
echo "${p} can be installed"
else
echo "no"
echo ""
echo "Zypper output:"
echo ""
echo "${out}"
echo ""
echo "Could not find how to install '${p}', try running:"
echo ""
echo " zypper install ${p}"
echo ""
exit 1
fi
fi
done
zypper install ${packages[@]}
}
###############################################################################
# This function takes care of installing all dependencies for building Redox on
# Gentoo Linux
# @params: $1 the emulator to install, "virtualbox" or "qemu"
###############################################################################
gentoo()
{
echo "Detected Gentoo Linux"
if [ -z "$(which git)" ]; then
echo "Installing git..."
sudo emerge dev-vcs/git
fi
if [ -z "$(which fusermount 2>/dev/null)" ] && [ -z "$(which fusermount3 2>/dev/null)" ]; then
echo "Installing fuse..."
sudo emerge sys-fs/fuse
fi
if [ "$1" == "qemu" ]; then
if [ -z "$(which qemu-system-x86_64)" ]; then
echo "Please install QEMU and re-run this script"
echo "Step1. Add QEMU_SOFTMMU_TARGETS=\"x86_64\" to /etc/portage/make.conf"
echo "Step2. Execute \"sudo emerge app-emulation/qemu\""
exit 1
else
echo "QEMU already installed!"
fi
elif [ "$1" == "virtualbox" ]; then
if [ -z "$(which virtualbox)" ]; then
echo "Please install VirtualBox and re-run this script,"
echo "or run with -e qemu"
exit 1
else
echo "VirtualBox already installed!"
fi
else
echo "Unknown emulator: $1"
exit 1
fi
if [ -z "$(which cmake)" ]; then
echo "Installing cmake..."
sudo emerge dev-util/cmake
fi
if [ -z "$(which podman)" ]; then
echo "Please install Podman, https://wiki.gentoo.org/wiki/Podman"
exit 1
fi
}
###############################################################################
# This function takes care of installing all dependencies for building Redox on
# Solus
# @params: $1 the emulator to install, "virtualbox" or "qemu"
###############################################################################
solus()
{
echo "Detected Solus"
if [ "$1" == "qemu" ]; then
if [ -z "$(which qemu-system-x86_64)" ]; then
sudo eopkg it qemu
else
echo "QEMU already installed!"
fi
elif [ "$1" == "virtualbox" ]; then
if [ -z "$(which virtualbox)" ]; then
echo "Please install VirtualBox and re-run this script,"
echo "or run with -e qemu"
exit 1
else
echo "VirtualBox already installed!"
fi
else
echo "Unknown emulator: $1"
exit 1
fi
echo "Installing necessary build tools..."
# if guards are not necessary with eopkg since it does nothing if latest
# version is already installed
sudo eopkg it fuse-devel git make fuse2-devel rsync
if [ -z "$(which podman)" ]; then
echo "Please install Podman"
exit 1
fi
}
######################################################################
# This function outlines the different options available for bootstrap
######################################################################
usage()
{
echo "------------------------"
echo "|Redox bootstrap script|"
echo "------------------------"
echo "Usage: ./podman_bootstrap.sh"
echo "OPTIONS:"
echo
echo " -h,--help Show this prompt"
echo " -u [branch] Update git repo and update rust"
echo " If blank defaults to master"
echo " -e [emulator] Install specific emulator, virtualbox or qemu"
echo " -p [package Choose an Ubuntu package manager, apt-fast or"
echo " manager] aptitude"
echo " -d Only install the dependencies, skip boot step"
echo "EXAMPLES:"
echo
echo "./podman_bootstrap.sh -e qemu"
exit
}
#############################################################################
# This function takes care of everything associated to rust, and the version
# manager that controls it, it can install rustup and uninstall multirust as
# well as making sure that the correct version of rustc is selected by rustup
# @params: $1 install non-interactively, boolean
#############################################################################
rustInstall()
{
noninteractive=$1
# Check to see if multirust is installed, we don't want it messing with rustup
# In the future we can probably remove this but I believe it's good to have for now
if [ -e /usr/local/lib/rustlib/uninstall.sh ] ; then
echo "It appears that multirust is installed on your system."
echo "This tool has been deprecated by the maintainer, and will cause issues."
echo "This script can remove multirust from your system if you wish."
printf "Uninstall multirust (y/N):"
read multirust
if echo "$multirust" | grep -iq "^y" ;then
sudo /usr/local/lib/rustlib/uninstall.sh
else
echo "Please manually uninstall multirust and any other versions of rust, then re-run bootstrap."
exit 1
fi
fi
# If rustup is not installed we should offer to install it for them
if [ -z "$(which rustup)" ]; then
rustup_options="--default-toolchain stable"
echo "You do not have rustup installed."
if [ "$noninteractive" = true ]; then
rustup="y"
rustup_options+=" -y"
else
echo "We HIGHLY recommend using rustup."
echo "Would you like to install it now?"
echo "*WARNING* this involves a 'curl | sh' style command"
printf "(y/N): "
read rustup
fi
if echo "$rustup" | grep -iq "^y" ;then
#install rustup
curl https://sh.rustup.rs -sSf | sh -s -- $rustup_options
# You have to add the rustup variables to the $PATH
echo "export PATH=\"\$HOME/.cargo/bin:\$PATH\"" >> ~/.bashrc
# source the variables so that we can execute rustup commands in the current shell
source ~/.cargo/env
else
echo "Rustup will not be installed!"
fi
fi
if [ -z "$(which rustc)" ]; then
echo "Rust is not installed"
echo "Please either run the script again, accepting rustup install"
echo "or install rustc stable manually (not recommended) via:"
echo "\#curl -sSf https://static.rust-lang.org/rustup.sh | sh -s -- --channel=stable"
exit 1
else
echo "Your Rust install looks good!"
fi
}
###########################################################################
# This function is the main logic for the bootstrap; it clones the git repo
# then it installs the dependent packages
###########################################################################
boot()
{
echo "Cloning gitlab repo..."
git clone https://gitlab.redox-os.org/redox-os/redox.git --origin upstream
echo "Creating .config with PODMAN_BUILD=1"
echo 'PODMAN_BUILD?=1' > redox/.config
if [[ "$(uname -m)" == "arm64" ]]; then
echo "Appending .config with ARCH=aarch64"
echo 'ARCH=aarch64' >> redox/.config
fi
echo "Cleaning up..."
rm podman_bootstrap.sh
echo
echo "---------------------------------------"
echo "Well it looks like you are ready to go!"
echo "---------------------------------------"
echo "The file redox/.config was created with PODMAN_BUILD=1."
echo "If you need a much quicker installation, run: "
echo " echo REPO_BINARY=1 >> redox/.config"
echo
echo "Run the following commands to build Redox using Podman:"
echo
echo "cd redox"
MAKE="make"
if [[ "$(uname)" == "FreeBSD" ]]; then
MAKE="gmake"
fi
echo "$MAKE all"
echo "$MAKE $emulator"
echo
echo " Good luck!"
exit
}
if [ "$1" == "-h" ] || [ "$1" == "--help" ]; then
usage
elif [ "$1" == "-u" ]; then
git pull upstream master
exit
fi
emulator="qemu"
defpackman="apt-get"
dependenciesonly=false
update=false
while getopts ":e:p:udhs" opt
do
case "$opt" in
e) emulator="$OPTARG";;
p) defpackman="$OPTARG";;
d) dependenciesonly=true;;
u) update=true;;
h) usage;;
\?) echo "I don't know what to do with that option, try -h for help"; exit 1;;
esac
done
banner
rustInstall "$noninteractive"
if [ "$update" == "true" ]; then
git pull upstream master
exit
fi
if [ "Darwin" == "$(uname -s)" ]; then
osx "$emulator"
else
# Here we will use package managers to determine which operating system the user is using.
# SUSE and derivatives
if hash 2>/dev/null zypper; then
suse "$emulator"
# Fedora
elif hash 2>/dev/null dnf; then
fedora "$emulator"
# Debian or any derivative of it
elif hash 2>/dev/null apt-get; then
ubuntu "$emulator" "$defpackman"
# Gentoo
elif hash 2>/dev/null emerge; then
gentoo "$emulator"
# Solus
elif hash 2>/dev/null eopkg; then
solus "$emulator"
# Arch Linux
elif hash 2>/dev/null pacman; then
archLinux "$emulator"
# FreeBSD
elif hash 2>/dev/null pkg; then
freebsd "$emulator"
# Unsupported platform
else
printf "\e[31;1mFatal error: \e[0;31mUnsupported platform, please open an issue\e[0m\n"
fi
fi
if [ "$dependenciesonly" = false ]; then
boot
fi
echo "Redox bootstrap complete!"

View File

@ -1,10 +0,0 @@
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: bzip2
Description: A file compression library
Version: 1.0.8
Libs: -L${libdir} -lbz2
Cflags: -I${includedir}

View File

@ -1,38 +0,0 @@
[source]
tar = "https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz"
blake3 = "97af3f520629c65fe41292f77e6ca798fe594d7987bfb2aebe7c6fcdc7ab5ed2"
[build]
template = "custom"
script = """
DYNAMIC_INIT
# This installs the static library regardless of config options
# The static lib is preferred according to the README because it's faster
rsync -av --delete "${COOKBOOK_SOURCE}/" ./
"${COOKBOOK_MAKE}" -j"${COOKBOOK_MAKE_JOBS}" \
AR="${AR}" \
CC="${CC}" \
RANLIB="${RANLIB}" \
PREFIX="${COOKBOOK_STAGE}/usr" \
install
# However, distros distribute libbz2 as well so we'll support it too
# Linking the lib fails if we don't rebuild the objects from earlier
"${COOKBOOK_MAKE}" clean
# This DOES NOT build/clobber the binaries already built above
"${COOKBOOK_MAKE}" -f Makefile-libbz2_so \
-j"${COOKBOOK_MAKE_JOBS}" \
AR="${AR}" \
CC="${CC}" \
RANLIB="${RANLIB}" \
PREFIX="${COOKBOOK_STAGE}/usr"
cp -av libbz2.so* "${COOKBOOK_STAGE}/usr/lib"
ln -s "libbz2.so.1.0" "${COOKBOOK_STAGE}/usr/lib/libbz2.so.1"
ln -s "libbz2.so.1.0" "${COOKBOOK_STAGE}/usr/lib/libbz2.so"
mkdir -p "${COOKBOOK_STAGE}/usr/lib/pkgconfig"
cp "${COOKBOOK_RECIPE}/pkgconfig" "${COOKBOOK_STAGE}/usr/lib/pkgconfig/bzip2.pc"
"""

Some files were not shown because too many files have changed in this diff Show More