Compare commits

..

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

96 changed files with 2353 additions and 4107 deletions

1
.gitignore vendored
View File

@ -1,4 +1,3 @@
/build/ /build/
/prefix/ /prefix/
.config .config
**/my_*

View File

@ -1,12 +1,11 @@
image: "ubuntu:22.04" image: "ubuntu:20.04"
variables: variables:
GIT_STRATEGY: "clone" GIT_STRATEGY: "pull"
GIT_SUBMODULE_STRATEGY: "recursive" GIT_SUBMODULE_STRATEGY: "recursive"
GIT_CHECKOUT: "true"
before_script: before_script:
# Disable the wget progress bar
- echo 'show-progress = off' >> ~/.wgetrc
- | - |
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
apt-get update -qq && apt-get update -qq &&
@ -14,27 +13,31 @@ before_script:
bison \ bison \
build-essential \ build-essential \
curl \ curl \
dosfstools \
flex \ flex \
fuse3 \ fuse \
genisoimage \
git \ git \
gnupg \
libfuse-dev \ libfuse-dev \
nasm \ nasm \
parted \
pkg-config \ pkg-config \
software-properties-common \
syslinux \
syslinux-utils \
texinfo \ texinfo \
wget \ wget &&
zstd &&
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none
img: img:
script: script:
- | - |
source "$HOME/.cargo/env" && source "$HOME/.cargo/env" &&
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash && cargo install --version 0.1.1 cargo-config &&
cargo binstall --no-confirm --version 0.1.1 cargo-config && cargo install cargo-xbuild &&
cargo binstall --no-confirm --version 1.16.0 just && cargo install --version 0.3.20 xargo &&
cargo binstall --no-confirm --version 0.26.0 cbindgen && make ci-img IMG_TAG=$CI_COMMIT_REF_NAME
cargo build --manifest-path installer/Cargo.toml --release &&
make ci-img IMG_TAG=$CI_COMMIT_REF_NAME REPO_BINARY=1
artifacts: artifacts:
paths: paths:
- build/img/ - build/img/

22
.gitmodules vendored
View File

@ -1,3 +1,7 @@
[submodule "bootloader"]
path = bootloader
url = https://gitlab.redox-os.org/redox-os/bootloader.git
branch = master
[submodule "cookbook"] [submodule "cookbook"]
path = cookbook path = cookbook
url = https://gitlab.redox-os.org/redox-os/cookbook.git url = https://gitlab.redox-os.org/redox-os/cookbook.git
@ -6,11 +10,18 @@
path = installer path = installer
url = https://gitlab.redox-os.org/redox-os/installer.git url = https://gitlab.redox-os.org/redox-os/installer.git
branch = master branch = master
[submodule "isolinux"]
path = isolinux
url = https://gitlab.redox-os.org/redox-os/isolinux.git
branch = master
[submodule "kernel"]
path = kernel
url = https://gitlab.redox-os.org/redox-os/kernel.git
branch = master
[submodule "rust"] [submodule "rust"]
path = rust path = rust
url = https://gitlab.redox-os.org/redox-os/rust.git url = https://gitlab.redox-os.org/redox-os/rust.git
branch = redox-2023-09-07 branch = redox-2022-03-18
update = none
[submodule "redoxfs"] [submodule "redoxfs"]
path = redoxfs path = redoxfs
url = https://gitlab.redox-os.org/redox-os/redoxfs.git url = https://gitlab.redox-os.org/redox-os/redoxfs.git
@ -19,3 +30,10 @@
path = relibc path = relibc
url = https://gitlab.redox-os.org/redox-os/relibc.git url = https://gitlab.redox-os.org/redox-os/relibc.git
branch = master branch = master
[submodule "bootloader-coreboot"]
path = bootloader-coreboot
url = https://gitlab.redox-os.org/redox-os/bootloader-coreboot.git
branch = master
[submodule "redox-initfs"]
path = redox-initfs
url = https://gitlab.redox-os.org/redox-os/redox-initfs.git

View File

@ -1,141 +1,205 @@
# Contributing to Redox # 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
## Code Of Conduct * [Communication](#communication)
* [Chat](#chat)
* [GitLab 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)
We follow the [Rust Code Of Conduct](https://www.rust-lang.org/policies/code-of-conduct). ## <a name="extern-links"> Other External Links </a>
## License * [redox-os.org](https://redox-os.org)
* [rust-os-comparison](https://github.com/flosse/rust-os-comparison)
* [rust-lang.org](http://rust-lang.org)
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. ## <a name="communication"> Communication </a>
Please review the LICENSE for the project you are contributing to. ### <a name="chat"> Chat </a>
On [this](https://doc.redox-os.org/book/ch01-02-philosophy.html) page we explain why we use the MIT license. 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.
## Chat ### <a name="issues"> GitLab Issues </a>
Join us on [Matrix Chat](https://doc.redox-os.org/book/ch13-01-chat.html) to discuss issues or ask questions. 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._
## Important Places to Contribute ### <a name="prs"> Pull Requests </a>
(Before starting to contribute you **must** read the [FAQ](https://www.redox-os.org/faq/) and the [Redox Book](https://doc.redox-os.org/book/)) It's fine to just submit a small pull request without first making an issue or asking in the chat, **unless** 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).
You can contribute to the Redox documentation and code on these repositories: ### <a name="discourse"> Discourse </a>
(The order is based on difficulty, easy things first) 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.
- [Website](https://gitlab.redox-os.org/redox-os/website) ### <a name="reddit"> Reddit </a>
- [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
- [Cookbook](https://gitlab.redox-os.org/redox-os/cookbook) - Ports system
- [Orbital](https://gitlab.redox-os.org/redox-os/orbital) - Display server and window manager
- [Package Manager](https://gitlab.redox-os.org/redox-os/pkgutils)
- [relibc](https://gitlab.redox-os.org/redox-os/relibc) - Redox C Library
- [Drivers](https://gitlab.redox-os.org/redox-os/drivers) - Device daemons
- [Kernel](https://gitlab.redox-os.org/redox-os/kernel)
### Skill Levels 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.
If you aren't fluent in Rust: ### <a name="news"> News </a>
- Write documentation 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.
- Use and test Redox, fill issues for bugs or needed features (please verify the repository issues before)
- Web development on the website (we don't accept JavaScript code)
- Write unit tests (may require minimal knowledge of Rust)
If you are fluent in Rust, but not operating system Development: ## <a name="code-contributions"> Code Contributions </a>
- Improve the Orbital display server and window manager. ### <a name="easy-targets"> Low-Hanging Fruit - Easy Targets for Newbies </a>
- Port programs written in Rust to Redox (in most cases you need to port crates, be aware of missing functions on relibc, porting without these functions will make patches dirty)
- Improve the program compatibility in relibc
- Improve the package manager
- Improve the [Ion](https://gitlab.redox-os.org/redox-os/ion) shell
If you are fluent in Rust, and have experience with operating system development: #### If you're not fluent in Rust:
- Familiarize yourself with the repository and code * Writing _documentation_
- Grep for `TODO`, `FIXME`, `BUG`, `UNOPTIMIZED`, `REWRITEME`, `DOCME`, and `PRETTYFYME` and fix the code you find * **Using/testing Redox**, filing issues for bugs and needed features
- Update old code to remove warnings * **Web development** ([Redox website, separate repo](https://gitlab.redox-os.org/redox-os/website))
- Improve and optimize code, especially in the kernel * **Writing unit tests** (may require minimal knowledge of rust)
- Write device drivers
For those who want to contribute to the Redox GUI, our GUI strategy has recently changed. #### If you are fluent in Rust, but not OS Development:
- 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](https://gitlab.redox-os.org/redox-os/redox/-/issues/1430) tracking issue. * **Apps** development
- Redox is in the process of adopting other Rust-written GUI toolkits, such as [Iced](https://iced.rs) and [Slint](https://slint-ui.com/). Please check out those projects if this is your area of interest. * **Shell** ([Ion](https://gitlab.redox-os.org/redox-os/ion)) development
- 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. * **Package management** ([pkgutils](https://gitlab.redox-os.org/redox-os/pkgutils)) development
* Other high-level code tasks
## Tracking Issues Index #### If you are fluent in Rust, and have experience with OS Dev:
We use an index to track the development priorities, you can find them on [this](https://gitlab.redox-os.org/redox-os/redox/-/issues/1384) page. * 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**
## Build System ### <a name="creating-a-pr"> Creating a Pull Request </a>
You can find the Redox build system organization and commands on [this](https://doc.redox-os.org/book/ch08-06-build-system-reference.html) page. **1**. _**Fork**_ the repository
## Developer FAQ **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://gitlab.redox-os.org/redox-os/redox.git --origin upstream --recursive`
* SSH:`git clone git@gitlab.redox-os.org: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)
You can see the most common questions and problems on [this](https://doc.redox-os.org/book/ch09-07-developer-faq.html) page. **3**. **Add** your fork with
* HTTPS:`git remote add origin https://gitlab.redox-os.org/your-username/redox.git`
* SSH:`git remote add origin git@gitlab.redox-os.org:your-username/redox.git`
## Porting Software **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`
You can read how to use the Cookbook recipe system to port applications on [this](https://doc.redox-os.org/book/ch09-03-porting-applications.html) page. **5**. Create a _**separate branch**_ (recommended if you're making multiple changes simultaneously) (`git checkout -b my-branch`)
## Libraries and APIs **6**. _Make changes_
You can read [this](https://doc.redox-os.org/book/ch09-06-libraries-apis.html) page to learn about the libraries and APIs used in Redox. **7**. **Commit** (`git add <item(s) you changed>; git commit`) and write your commit message
## Development Tips **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)
You can find important tips on [this](https://doc.redox-os.org/book/ch09-02-coding-and-building.html#development-tips) section. **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))
## References **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)
We maintain a list of wikis, articles and videos to learn Rust, OS development and computer science on [this](https://doc.redox-os.org/book/ch09-08-references.html) page. **11**. Repeat step **9** to make sure the rebase still builds and starts
If you are skilled there's a possibility that they could improve your knowledge in some way. **12**. Push to **your fork** (`git push origin <branch>`), `<branch>` being the branch you created earlier
## Best Practices and Guidelines **13**. Create a _pull request_
You can read the best practices and guidelines on [this](https://doc.redox-os.org/book/ch11-00-best-practices.html) chapter. **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.
## Style Guidelines **15. Submit!**
### Rust ## <a name="best-practices"> Best Practices and Guidelines </a>
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. ### <a name="general"> General </a>
### Git * **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.**
Please follow our [Git style](https://doc.redox-os.org/book/ch12-04-creating-proper-pull-requests.html) for pull requests. ##### 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 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.
## GitLab ### <a name="kernel"> Kernel </a>
### Issues * 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.
To know how to create issues on the Redox GitLab, read [this](https://doc.redox-os.org/book/ch12-05-filing-issues.html) page. ### <a name="testing-practices"> Testing Practices </a>
### Pull Requests * 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.
Please follow [our process](https://doc.redox-os.org/book/ch12-04-creating-proper-pull-requests.html) for creating proper pull requests. * 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.
## Other Ways to Contribute ## <a name="style-guidelines"> Style Guidelines </a>
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. ### <a name="rust-style-guidelines"> Rust </a>
### Design 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'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. ### <a name="git-style-guidelines"> Git </a>
- [Redox backgrounds](https://gitlab.redox-os.org/redox-os/backgrounds) - You can send your wallpapers on this repository. * 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.
- [Redox assets](https://gitlab.redox-os.org/redox-os/assets) - You can send your logos, icons and themes on this repository. * 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.
If you have questions about the graphic design, ask us on the [Chat](https://doc.redox-os.org/book/ch13-01-chat.html). ## <a name="other"> Other Ways to Contribute </a>
### Donate to Redox 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://gitlab.redox-os.org/jackpot51), has a [Patreon campaign](https://www.patreon.com/redox_os)! **All money received 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)
-->
If you are interested in donating to the Redox OS Nonprofit, you can find instructions [here](https://www.redox-os.org/donate/).

View File

@ -1,327 +0,0 @@
# Hardware Compatibility
This document tracks the current hardware compatibility of Redox.
- [Status](#status)
- [General](#general)
- [Template](#template)
- [x86-64](#x86-64)
- [System76](#system76)
- [Dell](#dell)
- [HP](#hp)
- [ASUS](#asus)
- [Lenovo](#lenovo)
- [Toshiba](#toshiba)
- [Custom](#custom)
- [i686](#i686)
- [Dell](#dell-1)
- [ASUS](#asus-1)
- [Lenovo](#lenovo-1)
- [Toshiba](#toshiba-1)
- [Panasonic](#panasonic)
- [Custom](#custom-1)
- [ARM64](#arm64)
- [Custom](#custom-2)
## Status
- Broken - The system can't boot.
- Booting - The system boots with some issues.
- Recommended - The system start with all features working.
## General
This section cover things to consider.
- ACPI support is incomplete (some things are hardcoded on the kernel)
- USB support is incomplete (desktops are generally not recommended)
- Wi-Fi is not supported
- GPU drivers aren't supported (only VESA and GOP)
- Automatic operating system discovery on boot loader is not implemented (remember this before installing Redox)
## Template
You will use this template to insert your computer.
- **Computer model**
```
Status - (Broken, Booting or Recommended)
Redox version - 0.0.0
Variant - (server-minimal, desktop-minimal, server, desktop, demo, dev or customized)
Image date - day-month-year
- Additional details goes here as items
```
## x86-64
Computers using a 64 bits Intel/AMD CPU.
### System76
- **System76 Galago Pro (galp5)**
```
Status - Recommended
Redox version - 0.8.0
Variant - desktop
Image date - 11-11-2022
- Booted using UEFI
- Boots to desktop
```
- **System76 Lemur Pro (lemp9)**
```
Status - Recommended
Redox version - 0.8.0
Variant - desktop
Image date - 11-11-2022
- Booted using UEFI
- Boots to desktop
```
- **System76 Oryx Pro (oryp10)**
```
Status - Booting
Redox version - 0.8.0
Variant - desktop
Image date - 11-11-2022
- Booted using UEFI
- Boots to desktop
- No touchpad support, though it should be working
```
- **System76 Pangolin (pang12)**
```
Status - Booting
Redox version - 0.8.0
Variant - desktop
Image date - 11-11-2022
- Booted using UEFI
- Boots to desktop
- No touchpad support, requires I2C HID
```
### Dell
- **Dell XPS 13 (9350)**
```
Status - Booting
Redox version - 0.8.0
Variant - desktop
Image date - 11-11-2022
- Booted using both BIOS and UEFI
- Boots to desktop
- NVMe driver livelocks
```
### HP
- **HP Dev One**
```
Status - Booting
Redox version - 0.8.0
Variant - desktop
Image date - 11-11-2022
- Booted using UEFI
- Boots to desktop
- No touchpad support, requires I2C HID
```
### ASUS
- **ASUS X554L**
```
Status - Booting
Redox version - 0.8.0
Variant - desktop
Image date - 11-11-2022
- Booted using BIOS
- Boots to desktop
- No audio, HDA driver cannot find output pins
```
- **ASUS ROG g55vw**
```
Satus - Booting
Redox version - 0.8.0
Variant - desktop
Image date - 11-11-2023
- Booted using BIOS
- Boots to desktop
- UEFI panic in SETUP
```
### Lenovo
- **Lenovo IdeaPad Y510P**
```
Status - Recommended
Redox version - 0.8.0
Variant - desktop
Image date - 11-11-2022
- Booted using both BIOS and UEFI
- Boots to desktop
```
- **Lenovo G570**
```
Status - Broken
Redox version - 0.8.0
Variant - desktop
Image date - 11-11-2022
- Booted using BIOS
- Correct video mode not offered, this is a firmware issue
- Bootloader panics in alloc_zeroed_page_aligned
```
### Toshiba
- **Toshiba Satellite L500**
```
Status - Booting
Redox version - 0.8.0
Variant - desktop
Image date - 11-11-2022
- Booted using BIOS
- Correct video mode not offered, this is a firmware issue
- Boots to desktop
- No ethernet driver
```
### Custom
If you have a customized computer, put it here.
## i686
Computers with a 32 bits Intel/AMD CPU.
### Dell
- **Dell XPS 13 (9350)**
```
Status - Booting
Redox version - 0.8.0
Variant - desktop
Image date - 11-11-2022
- Booted using BIOS
- Boots to desktop
- NVMe driver livelocks
```
### ASUS
- **ASUS Eee PC 900**
```
Status - Booting
Redox version - 0.8.0
Variant - desktop
Image date - 11-11-2022
- Booted using BIOS
- Correct video mode not offered, this is a firmware issue
- Boots to desktop
- No ethernet driver
```
### Lenovo
- **Lenovo IdeaPad Y510P**
```
Status - Broken
Redox version - 0.8.0
Variant - desktop
Image date - 11-11-2022
- Booted using BIOS
- Panics on phys_to_virt overflow, probably having invalid mappings for 32-bit
```
### Toshiba
- **Toshiba Satellite L500**
```
Status - Broken
Redox version - 0.8.0
Variant - desktop
Image date - 11-11-2022
- Booted using BIOS
- Correct video mode not offered, this is a firmware issue
- Panics on phys_to_virt overflow, probably having invalid mappings for 32-bit
```
### Panasonic
- **Panasonic Toughbook CF-18**
```
Status - Broken
Redox version - 0.8.0
Variant - desktop
Image date - 11-11-2022
- Booted using BIOS
- Hangs after PIT initialization
```
### Custom
If you have a customized computer, put it here.
## ARM64
Computers using a 64 bits ARM CPU.
### Raspberry Pi
- **Raspberry Pi 3 Model B+**
```
Status - Booting
Redox version - 0.8.0
Variant - server
Image date - None
- Booted using Uboot
- Boots to UART serial console
- a bcm2835-sdhci/mmc driver
- pl011 UART
```
### Custom
If you have a customized ARM board, put it here.

138
Makefile
View File

@ -4,97 +4,127 @@ include mk/config.mk
# Dependencies # Dependencies
include mk/depends.mk include mk/depends.mk
all: $(BUILD)/harddrive.img all: build/harddrive.bin
live: coreboot: build/coreboot.elf
-$(FUMOUNT) $(BUILD)/filesystem/ || true
-$(FUMOUNT) /tmp/redox_installer/ || true
rm -f $(BUILD)/livedisk.iso
$(MAKE) $(BUILD)/livedisk.iso
popsicle: $(BUILD)/livedisk.iso live: build/livedisk.bin
popsicle-gtk $(BUILD)/livedisk.iso
image: iso: build/livedisk.iso
-$(FUMOUNT) $(BUILD)/filesystem/ || true
-$(FUMOUNT) /tmp/redox_installer/ || true
rm -f $(BUILD)/harddrive.img $(BUILD)/livedisk.iso
$(MAKE) all
rebuild: clean:
-$(FUMOUNT) $(BUILD)/filesystem/ || true
-$(FUMOUNT) /tmp/redox_installer/ || true
rm -rf $(BUILD)
$(MAKE) all
clean: $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) $(MAKE) $@
else
cd cookbook && ./clean.sh cd cookbook && ./clean.sh
-rm -rf cookbook/repo
cargo clean --manifest-path cookbook/pkgutils/Cargo.toml cargo clean --manifest-path cookbook/pkgutils/Cargo.toml
cargo clean --manifest-path installer/Cargo.toml cargo clean --manifest-path installer/Cargo.toml
cargo clean --manifest-path kernel/Cargo.toml
cargo clean --manifest-path kernel/syscall/Cargo.toml
cargo clean --manifest-path redoxfs/Cargo.toml cargo clean --manifest-path redoxfs/Cargo.toml
cargo clean --manifest-path relibc/Cargo.toml -$(FUMOUNT) build/filesystem/ || true
endif rm -rf build
-$(FUMOUNT) $(BUILD)/filesystem/ || true
-$(FUMOUNT) /tmp/redox_installer/ || true
rm -rf $(BUILD)
distclean: $(CONTAINER_TAG) distclean:
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) $(MAKE) $@
else
$(MAKE) clean $(MAKE) clean
cd cookbook && ./unfetch.sh cd cookbook && ./unfetch.sh
endif
pull: pull:
git pull git pull --recurse-submodules
git submodule sync --recursive git submodule sync --recursive
git submodule update --recursive --init git submodule update --recursive --init
fetch: $(BUILD)/fetch.tag update:
cd cookbook && ./update.sh \
"$$(cargo run --manifest-path ../installer/Cargo.toml -- --list-packages -c ../initfs.toml)" \
"$$(cargo run --manifest-path ../installer/Cargo.toml -- --list-packages -c ../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: $(BUILD)/repo.tag fetch:
cargo build --manifest-path cookbook/Cargo.toml --release
# Podman build recipes and vars cd cookbook && ./fetch.sh \
include mk/podman.mk "$$(cargo run --manifest-path ../installer/Cargo.toml -- --list-packages -c ../initfs.toml)" \
"$$(cargo run --manifest-path ../installer/Cargo.toml -- --list-packages -c ../filesystem.toml)"
# Disk Imaging and Cookbook tools
include mk/fstools.mk
# Cross compiler recipes # Cross compiler recipes
include mk/prefix.mk include mk/prefix.mk
# Repository maintenance # Bootloader recipes
include mk/repo.mk include mk/bootloader.mk
# Kernel recipes
include mk/kernel.mk
# Filesystem recipes
include mk/initfs.mk
include mk/filesystem.mk
# Disk images # Disk images
include mk/disk.mk include mk/disk.mk
# Emulation recipes # Emulation recipes
include mk/qemu.mk include mk/qemu.mk
include mk/bochs.mk
include mk/virtualbox.mk include mk/virtualbox.mk
# CI # CI image target
include mk/ci.mk ci-img: FORCE
$(MAKE) INSTALLER_FLAGS= \
build/harddrive.bin.gz \
build/livedisk.bin.gz \
build/livedisk.iso.gz \
build/harddrive-efi.bin.gz \
build/livedisk-efi.bin.gz
rm -rf build/img
mkdir -p build/img
cp "build/harddrive.bin.gz" "build/img/redox_$(IMG_TAG)_harddrive.bin.gz"
cp "build/livedisk.bin.gz" "build/img/redox_$(IMG_TAG)_livedisk.bin.gz"
cp "build/livedisk.iso.gz" "build/img/redox_$(IMG_TAG)_livedisk.iso.gz"
cp "build/harddrive-efi.bin.gz" "build/img/redox_$(IMG_TAG)_harddrive-efi.bin.gz"
cp "build/livedisk-efi.bin.gz" "build/img/redox_$(IMG_TAG)_livedisk-efi.bin.gz"
cd build/img && sha256sum -b * > SHA256SUM
env: prefix FORCE $(CONTAINER_TAG) # CI packaging target
ifeq ($(PODMAN_BUILD),1) ci-pkg: prefix FORCE
$(PODMAN_RUN) $(MAKE) $@ cargo build --manifest-path cookbook/Cargo.toml --release
else export PATH="$(PREFIX_PATH):$$PATH" && \
PACKAGES="$$(cargo run --manifest-path installer/Cargo.toml -- --list-packages -c ci.toml)" && \
cd cookbook && \
./fetch.sh "$${PACKAGES}" && \
./repo.sh "$${PACKAGES}"
# CI toolchain
ci-toolchain: FORCE
$(MAKE) PREFIX_BINARY=0 \
"prefix/$(TARGET)/gcc-install.tar.gz" \
"prefix/$(TARGET)/relibc-install.tar.gz" \
"prefix/$(TARGET)/rust-install.tar.gz"
rm -rf "build/toolchain/$(TARGET)"
mkdir -p "build/toolchain/$(TARGET)"
cp "prefix/$(TARGET)/gcc-install.tar.gz" "build/toolchain/$(TARGET)/gcc-install.tar.gz"
cp "prefix/$(TARGET)/relibc-install.tar.gz" "build/toolchain/$(TARGET)/relibc-install.tar.gz"
cp "prefix/$(TARGET)/rust-install.tar.gz" "build/toolchain/$(TARGET)/rust-install.tar.gz"
cd "build/toolchain/$(TARGET)" && sha256sum -b * > SHA256SUM
env: prefix FORCE
export PATH="$(PREFIX_PATH):$$PATH" && \ export PATH="$(PREFIX_PATH):$$PATH" && \
bash bash
endif
gdb: FORCE gdb: FORCE
gdb cookbook/recipes/core/kernel/target/$(TARGET)/build/kernel.sym --eval-command="target remote localhost:1234" gdb build/kernel.sym --eval-command="target remote localhost:1234"
# An empty target # An empty target
FORCE: FORCE:
# Gzip any binary
%.gz: %
gzip -k -f $<
# Create a listing for any binary
%.list: %
export PATH="$(PREFIX_PATH):$$PATH" && \
$(OBJDUMP) -C -M intel -D $< > $@
# Wireshark # Wireshark
wireshark: FORCE wireshark: FORCE
wireshark $(BUILD)/network.pcap wireshark build/network.pcap

205
README.md
View File

@ -2,65 +2,31 @@
<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://gitlab.redox-os.org/redox-os/assets/raw/master/logos/redox/logo.png">
</p> </p>
[Redox](https://www.redox-os.org) is an operating system written in Rust, a language with focus on safety, efficiency and high performance. Redox, following the microkernel design, 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. **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 components (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. 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 website can be found at https://www.redox-os.org.
Please make sure you use the **latest nightly** of `rustc` before building (for more troubleshooting, see ["Help! Redox won't compile!"](#compile-help)).
[![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://gitlab.redox-os.org/redox-os/redox/tags) [![Downloads](https://img.shields.io/github/downloads/redox-os/redox/total.svg)](https://gitlab.redox-os.org/redox-os/redox/tags)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE) [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
![Rust Version](https://img.shields.io/badge/rust-nightly%202017--10--03-lightgrey.svg)
## Guide ## Contents
This is the main repository of the Redox GitLab where the build system files are stored, this README is used to guide new developers. * [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)
You can find the most important pages below: ## <a name="screenshots"> What it looks like </a>
- [Book](https://doc.redox-os.org/book/)
- [Contribute](CONTRIBUTING.md)
- [Hardware Compatibility](HARDWARE.md)
- [Trying Out Redox](https://doc.redox-os.org/book/ch02-04-trying-out-redox.html)
- [Building Redox](https://doc.redox-os.org/book/ch02-05-building-redox.html)
- [Build System Documentation](https://doc.redox-os.org/book/ch08-06-build-system-reference.html)
- [Developer FAQ](https://doc.redox-os.org/book/ch09-07-developer-faq.html)
- [Chat/Discussions/Help](https://doc.redox-os.org/book/ch13-01-chat.html)
## Ecosystem
These are the most important repositories available on the Redox GitLab:
| Name (lexicographic order) | Maintainer
|--------------------------------------------------------------------------------------|---------------------------
| [acid (kernel integration tests)](https://gitlab.redox-os.org/redox-os/acid) | **@jackpot51**
| [binutils](https://gitlab.redox-os.org/redox-os/binutils) | **@jackpot51**
| [cookbook](https://gitlab.redox-os.org/redox-os/cookbook) | **@jackpot51** **@hatred_45** **@ids1024**
| [coreutils](https://gitlab.redox-os.org/redox-os/coreutils) | **@jackpot51**
| [extrautils](https://gitlab.redox-os.org/redox-os/extrautils) | **@jackpot51**
| [games](https://gitlab.redox-os.org/redox-os/games) | **@fabiao**
| [Ion (shell)](https://gitlab.redox-os.org/redox-os/ion) | **@jackpot51**
| [ipcd](https://gitlab.redox-os.org/redox-os/ipcd) | **@jackpot51**
| [kernel](https://gitlab.redox-os.org/redox-os/kernel) | **@jackpot51**
| [libextra](https://gitlab.redox-os.org/redox-os/libextra) | **@jackpot51**
| [libpager](https://gitlab.redox-os.org/redox-os/libpager) | **@jackpot51**
| [netstack](https://gitlab.redox-os.org/redox-os/netstack) | **@jackpot51**
| [netutils](https://gitlab.redox-os.org/redox-os/netutils) | **@jackpot51**
| [orbclient (Orbital client)](https://gitlab.redox-os.org/redox-os/orbclient) | **@jackpot51** **@FloVanGH**
| [orbdata](https://gitlab.redox-os.org/redox-os/orbdata) | **@jackpot51**
| [orbgame (Orbital 2D game engine)](https://gitlab.redox-os.org/redox-os/orbgame) | **@FloVanGH**
| [Orbital (windowing and compositing system)](https://gitlab.redox-os.org/redox-os/orbital) | **@jackpot51**
| [orbtk (Orbital toolkit)](https://gitlab.redox-os.org/redox-os/orbtk) | **@FloVanGH**
| [orbutils (Orbital utilities)](https://gitlab.redox-os.org/redox-os/orbutils) | **@jackpot51**
| [pkgutils (current package manager)](https://gitlab.redox-os.org/redox-os/pkgutils) | **@jackpot51**
| [ralloc](https://gitlab.redox-os.org/redox-os/ralloc) | **@jackpot51**
| [RANSID (Rust ANSI driver)](https://gitlab.redox-os.org/redox-os/ransid) | **@jackpot51**
| [redoxfs (default filesystem)](https://gitlab.redox-os.org/redox-os/redoxfs) | **@jackpot51**
| [relibc (C Library in Rust)](https://gitlab.redox-os.org/redox-os/relibc) | **@jackpot51**
| [small (stack String and other collections)](https://gitlab.redox-os.org/redox-os/small) | **@jackpot51**
| [syscall](https://gitlab.redox-os.org/redox-os/syscall) | **@jackpot51**
| [Sodium (Vim-inspired text editor)](https://gitlab.redox-os.org/redox-os/sodium) | **@jackpot51**
| [The Redox book](https://gitlab.redox-os.org/redox-os/book) | **@hatred_45**
| [userutils](https://gitlab.redox-os.org/redox-os/userutils) | **@jackpot51**
## What it looks like
<img alt="Redox" height="150" src="https://gitlab.redox-os.org/redox-os/assets/raw/master/screenshots/Senza%20titolo.jpeg"> <img alt="Redox" height="150" src="https://gitlab.redox-os.org/redox-os/assets/raw/master/screenshots/Senza%20titolo.jpeg">
<img alt="Redox" height="150" src="https://gitlab.redox-os.org/redox-os/assets/raw/master/screenshots/redox running.jpeg"> <img alt="Redox" height="150" src="https://gitlab.redox-os.org/redox-os/assets/raw/master/screenshots/redox running.jpeg">
@ -70,4 +36,137 @@ These are the most important repositories available on the Redox GitLab:
<img alt="Redox" height="150" src="https://gitlab.redox-os.org/redox-os/assets/raw/master/screenshots/Boot.png"> <img alt="Redox" height="150" src="https://gitlab.redox-os.org/redox-os/assets/raw/master/screenshots/Boot.png">
<img alt="Redox" height="150" src="https://gitlab.redox-os.org/redox-os/assets/raw/master/screenshots/IMG_1459.PNG"> <img alt="Redox" height="150" src="https://gitlab.redox-os.org/redox-os/assets/raw/master/screenshots/IMG_1459.PNG">
See [Redox in Action](https://www.redox-os.org/screens/) for photos and videos. ## <a name="ecosystem"> Ecosystem </a>
The ecosystem and software Redox OS provides is listed below.
| Name (lexicographic order) | Maintainer
|--------------------------------------------------------------------------------------|---------------------------
| [acid (kernel integration tests)](https://gitlab.redox-os.org/redox-os/acid) | **@jackpot51** **@NilSet**
| [binutils](https://gitlab.redox-os.org/redox-os/binutils) | **vacant**
| [cookbook](https://gitlab.redox-os.org/redox-os/cookbook) | **@jackpot51** **@ids1024** **@sajattack**
| [coreutils](https://gitlab.redox-os.org/redox-os/coreutils) | **vacant**
| [extrautils](https://gitlab.redox-os.org/redox-os/extrautils) | **vacant**
| [games](https://gitlab.redox-os.org/redox-os/games) | **@enrico** (AKA **@HenryTheCat**) **@fabiao**
| [Ion (shell)](https://gitlab.redox-os.org/redox-os/ion) | **@mmstick** **@stratact**
| [ipcd](https://gitlab.redox-os.org/redox-os/ipcd) | **@jD91mZM2**
| [kernel](https://gitlab.redox-os.org/redox-os/kernel) | **@jackpot51**
| [libextra](https://gitlab.redox-os.org/redox-os/libextra) | **vacant**
| [libpager](https://gitlab.redox-os.org/redox-os/libpager) | **vacant**
| [netstack](https://gitlab.redox-os.org/redox-os/netstack) | **@batonius** **@dlrobertson**
| [netutils](https://gitlab.redox-os.org/redox-os/netutils) | **@jackpot51**
| [orbclient (Orbital client)](https://gitlab.redox-os.org/redox-os/orbclient) | **@jackpot51** **@FloVanGH**
| [orbdata](https://gitlab.redox-os.org/redox-os/orbdata) | **@jackpot51**
| [orbgame (Orbital 2D game engine)](https://gitlab.redox-os.org/redox-os/orbgame) | **@FloVanGH**
| [Orbital (windowing and compositing system)](https://gitlab.redox-os.org/redox-os/orbital) | **@jackpot51**
| [orbtk (Orbital toolkit)](https://gitlab.redox-os.org/redox-os/orbtk) | **@FloVanGH**
| [orbutils (Orbital utilities)](https://gitlab.redox-os.org/redox-os/orbutils) | **@jackpot51**
| [pkgutils (current package manager)](https://gitlab.redox-os.org/redox-os/pkgutils) | **@jackpot51**
| [ralloc](https://gitlab.redox-os.org/redox-os/ralloc) | **@Tommoa** **@NilSet**
| [RANSID (Rust ANSI driver)](https://gitlab.redox-os.org/redox-os/ransid) | **@jackpot51**
| [redoxfs (old filesystem)](https://gitlab.redox-os.org/redox-os/redoxfs) | **@jackpot51**
| [relibc (C Library in Rust)](https://gitlab.redox-os.org/redox-os/relibc) | **@jD91mZM2** **@sajattack** **@Tommoa** **@stratact**
| [small (stack String and other collections)](https://gitlab.redox-os.org/redox-os/small) | **@Tommoa**
| [syscall](https://gitlab.redox-os.org/redox-os/syscall) | **@jackpot51**
| [Sodium (Vim-inspired text editor)](https://gitlab.redox-os.org/redox-os/sodium) | **vacant**
| [TFS ((ticki) **T**he **F**ile **S**ystem)](https://gitlab.redox-os.org/redox-os/tfs) | **@Tommoa**
| [The Redox book](https://gitlab.redox-os.org/redox-os/book) | **vacant**
| [userutils](https://gitlab.redox-os.org/redox-os/userutils) | **@jackpot51**
## <a name="compile-help"> Help! Redox won't compile! </a>
Sometimes things go wrong when compiling. Try the following before opening an issue:
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@gitlab.redox-os.org: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://gitlab.redox-os.org/redox-os/redox/raw/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-based 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://gitlab.redox-os.org/redox-os/redox.git --origin upstream --recursive
# SSH
$ git clone git@gitlab.redox-os.org: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
$ source $HOME/.cargo/env
# Install the sysroot manager Xargo and cargo-config
$ cargo install xargo cargo-config
# 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-based Virtual Machine). Try if QEMU gives an error.
$ make qemu kvm=no
# Launch using QEMU without using KVM (Kernel-based 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.

16
bochs.x86_64 Normal file
View File

@ -0,0 +1,16 @@
ata0-master: type=disk, path="build/harddrive.bin", mode=flat
boot: disk
com1: enabled=1, mode=file, dev=build/serial.log
cpu: model=corei7_haswell_4770
#e1000: enabled=1, mac=52:54:00:12:34:56 ethmod=vnet
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 c92ba0b82fe23d7f0565c5a0821db0fc6aabed06

1
bootloader-coreboot Submodule

@ -0,0 +1 @@
Subproject commit 6c31909f75f3d707efa606e546113ee508be0748

View File

@ -1,20 +1,18 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -e
########################################################## ##########################################################
# This function is simply a banner to introduce the script # This function is simply a banner to introduce the script
########################################################## ##########################################################
banner() banner()
{ {
echo "|------------------------------------------|" echo "|------------------------------------------|"
echo "|----- Welcome to the Redox bootstrap -----|" echo "|----- Welcome to the redox bootstrap -----|"
echo "|------------------------------------------|" echo "|------------------------------------------|"
} }
################################################################################### ###################################################################################
# This function takes care of installing a dependency via package manager of choice # This function takes care of installing a dependency via package manager of choice
# for building Redox on BSDs (macOS, FreeBSD, etc.). # for building redox on BSDs (MacOS, FreeBSD, etc.).
# @params: $1 package manager # @params: $1 package manager
# $2 package name # $2 package name
# $3 binary name (optional) # $3 binary name (optional)
@ -59,14 +57,14 @@ install_freebsd_pkg()
############################################################################### ###############################################################################
# This function checks which of the supported package managers # This function checks which of the supported package managers
# is available on the macOS host. # is available on the OSX Host.
# If a supported package manager is found, it delegates the installing work to # If a supported package manager is found, it delegates the installing work to
# the relevant function. # the relevant function.
# Otherwise this function will exit this script with an error. # Otherwise this function will exit this script with an error.
############################################################################### ###############################################################################
osx() osx()
{ {
echo "Detected macOS!" echo "Detected OSX!"
if [ ! -z "$(which brew)" ]; then if [ ! -z "$(which brew)" ]; then
osx_homebrew $@ osx_homebrew $@
@ -82,26 +80,22 @@ osx()
############################################################################### ###############################################################################
# This function takes care of installing all dependencies using MacPorts # This function takes care of installing all dependencies using MacPorts
# for building Redox on macOS # for building redox on Mac OSX
# @params: $1 the emulator to install, "virtualbox" or "qemu" # @params: $1 the emulator to install, virtualbox or qemu
############################################################################### ###############################################################################
osx_macports() osx_macports()
{ {
echo "MacPorts detected! Now updating..." echo "Macports detected! Now updating..."
sudo port -v selfupdate sudo port -v selfupdate
echo "Installing missing packages..." echo "Installing missing packages..."
install_macports_pkg "git" install_macports_pkg "git"
if [ "$1" == "qemu" ]; then if [ "$1" == "qemu" ]; then
install_macports_pkg "qemu" "qemu-system-x86_64" install_macports_pkg "qemu" "qemu-system-x86_64"
elif [ "$1" == "virtualbox" ]; then
install_macports_pkg "virtualbox"
else else
echo "Unknown emulator: $1" install_macports_pkg "virtualbox"
exit 1
fi fi
install_macports_pkg "coreutils" install_macports_pkg "coreutils"
@ -112,51 +106,12 @@ osx_macports()
install_macports_pkg "osxfuse" install_macports_pkg "osxfuse"
install_macports_pkg "x86_64-elf-gcc" install_macports_pkg "x86_64-elf-gcc"
install_macports_pkg "cmake" install_macports_pkg "cmake"
install_macports_pkg "ninja"
install_macports_pkg "po4a"
install_macports_pkg "findutils"
install_macports_pkg "texinfo"
install_macports_pkg "autoconf"
install_macports_pkg "openssl3"
install_macports_pkg "openssl11"
install_macports_pkg "bison"
install_macports_pkg "curl"
install_macports_pkg "wget"
install_macports_pkg "file"
install_macports_pkg "flex"
install_macports_pkg "gperf"
install_macports_pkg "expat"
install_macports_pkg "gmp"
install_macports_pkg "libpng"
install_macports_pkg "jpeg"
install_macports_pkg "libsdl12"
install_macports_pkg "libsdl2_ttf"
install_macports_pkg "libtool"
install_macports_pkg "m4"
install_macports_pkg "ninja"
install_macports_pkg "meson"
install_macports_pkg "python311"
install_macports_pkg "py37-mako"
install_macports_pkg "xdg-utils"
install_macports_pkg "zip"
install_macports_pkg "unzip"
install_macports_pkg "llvm-16"
install_macports_pkg "clang-16"
install_macports_pkg "perl5.24"
install_macports_pkg "p5-html-parser"
install_macports_pkg "doxygen"
install_macports_pkg "gpatch"
install_macports_pkg "automake"
install_macports_pkg "scons"
install_macports_pkg "gmake"
install_macports_pkg "lua"
install_macports_pkg "protobuf-c"
} }
############################################################################### ###############################################################################
# This function takes care of installing all dependencies using Homebrew # This function takes care of installing all dependencies using Homebrew
# for building Redox on macOS # for building redox on Mac OSX
# @params: $1 the emulator to install, "virtualbox" or "qemu" # @params: $1 the emulator to install, virtualbox or qemu
############################################################################### ###############################################################################
osx_homebrew() osx_homebrew()
{ {
@ -167,14 +122,10 @@ osx_homebrew()
install_brew_pkg "git" install_brew_pkg "git"
if [ "$1" == "qemu" ]; then if [ "$1" == "qemu" ]; then
install_brew_pkg "qemu" "qemu-system-x86_64" install_brew_pkg "qemu" "qemu-system-x86_64"
elif [ "$1" == "virtualbox" ]; then
install_brew_pkg "virtualbox"
else else
echo "Unknown emulator: $1" install_brew_pkg "virtualbox"
exit 1
fi fi
install_brew_pkg "automake" install_brew_pkg "automake"
@ -186,180 +137,63 @@ osx_homebrew()
install_brew_pkg "gcc@7" "gcc-7" install_brew_pkg "gcc@7" "gcc-7"
install_brew_pkg "pkg-config" install_brew_pkg "pkg-config"
install_brew_pkg "cmake" install_brew_pkg "cmake"
install_brew_pkg "ninja" install_brew_pkg "Caskroom/cask/osxfuse"
install_brew_pkg "po4a"
install_brew_pkg "macfuse"
install_brew_pkg "findutils"
install_brew_pkg "texinfo"
install_brew_pkg "openssl@1.1"
install_brew_pkg "openssl@3.0"
install_brew_pkg "autoconf"
install_brew_pkg "curl"
install_brew_pkg "wget"
install_brew_pkg "flex"
install_brew_pkg "gperf"
install_brew_pkg "expat"
install_brew_pkg "gmp"
install_brew_pkg "libpng"
install_brew_pkg "jpeg"
install_brew_pkg "sdl12-compat"
install_brew_pkg "sdl2_ttf"
install_brew_pkg "perl"
install_brew_pkg "libtool"
install_brew_pkg "m4"
install_brew_pkg "ninja"
install_brew_pkg "meson"
install_brew_pkg "python@3.11"
install_brew_pkg "zip"
install_brew_pkg "unzip"
install_brew_pkg "llvm"
install_brew_pkg "doxygen"
install_brew_pkg "gpatch"
install_brew_pkg "automake"
install_brew_pkg "scons"
install_brew_pkg "lua"
install_brew_pkg "ant"
install_brew_pkg "protobuf"
install_brew_pkg "redox-os/gcc_cross_compilers/x86_64-elf-gcc" "x86_64-elf-gcc" install_brew_pkg "redox-os/gcc_cross_compilers/x86_64-elf-gcc" "x86_64-elf-gcc"
} }
############################################################################### ###############################################################################
# This function takes care of installing all dependencies using pkg # This function takes care of installing all dependencies using pkg
# for building Redox on FreeBSD # for building redox on FreeBSD
# @params: $1 the emulator to install, "virtualbox" or "qemu" # @params: $1 the emulator to install, virtualbox or qemu
############################################################################### ###############################################################################
freebsd() freebsd()
{ {
set -x set -xe
echo "FreeBSD detected!" echo "FreeBSD detected!"
echo "Installing missing packages..." echo "Installing missing packages..."
install_freebsd_pkg "git" install_freebsd_pkg "git"
if [ "$1" == "qemu" ]; then if [ "$1" == "qemu" ]; then
install_freebsd_pkg "qemu" "qemu-system-x86_64" install_freebsd_pkg "qemu" "qemu-system-x86_64"
elif [ "$1" == "virtualbox" ]; then
install_freebsd_pkg "virtualbox"
else else
echo "Unknown emulator: $1" install_freebsd_pkg "virtualbox"
exit 1
fi fi
install_freebsd_pkg "coreutils" install_freebsd_pkg "coreutils"
install_freebsd_pkg "findutils" install_freebsd_pkg "findutils"
install_freebsd_pkg "gcc" install_freebsd_pkg "gcc"
install_freebsd_pkg "nasm" install_freebsd_pkg "nasm"
install_freebsd_pkg "pkgconf" install_freebsd_pkg "pkgconf"
install_freebsd_pkg "fusefs-libs3" install_freebsd_pkg "fusefs-libs"
install_freebsd_pkg "cmake" install_freebsd_pkg "cmake"
install_freebsd_pkg "gmake" install_freebsd_pkg "gmake"
install_freebsd_pkg "wget" install_freebsd_pkg "wget"
install_freebsd_pkg "openssl"
install_freebsd_pkg "texinfo" install_freebsd_pkg "texinfo"
install_freebsd_pkg "python" install_freebsd_pkg "python"
install_freebsd_pkg "automake" install_freebsd_pkg "automake"
install_freebsd_pkg "gettext" install_freebsd_pkg "gettext"
install_freebsd_pkg "bison" install_freebsd_pkg "bison"
install_freebsd_pkg "gperf" install_freebsd_pkg "gperf"
install_freebsd_pkg "autoconf" set +xe
install_freebsd_pkg "curl"
install_freebsd_pkg "file"
install_freebsd_pkg "flex"
install_freebsd_pkg "expat2"
install_freebsd_pkg "gmp"
install_freebsd_pkg "png"
install_freebsd_pkg "libjpeg-turbo"
install_freebsd_pkg "sdl12"
install_freebsd_pkg "sdl2_ttf"
install_freebsd_pkg "perl5.36"
install_freebsd_pkg "p5-HTML-Parser"
install_freebsd_pkg "libtool"
install_freebsd_pkg "m4"
install_freebsd_pkg "po4a"
install_freebsd_pkg "syslinux"
install_freebsd_pkg "ninja"
install_freebsd_pkg "meson"
install_freebsd_pkg "xdg-utils"
install_freebsd_pkg "zip"
install_freebsd_pkg "unzip"
install_freebsd_pkg "llvm"
install_freebsd_pkg "doxygen"
install_freebsd_pkg "patch"
install_freebsd_pkg "automake"
install_freebsd_pkg "scons"
install_freebsd_pkg "lua54"
install_freebsd_pkg "py-protobuf-compiler"
set +x
} }
############################################################################### ###############################################################################
# This function takes care of installing all dependencies for building Redox on # This function takes care of installing all dependencies for building redox on
# Arch Linux # Arch linux
# @params: $1 the emulator to install, "virtualbox" or "qemu" # @params: $1 the emulator to install, virtualbox or qemu
# $2 install non-interactively, boolean
############################################################################### ###############################################################################
archLinux() archLinux()
{ {
noninteractive=$2
pacman_install="pacman -S --needed"
if [ "$noninteractive" = true ]; then
pacman_install+=" --noconfirm"
fi
echo "Detected Arch Linux" echo "Detected Arch Linux"
packages="cmake \ packages="cmake fuse git gperf perl-html-parser nasm wget texinfo bison flex po4a"
fuse \
git \
gperf \
perl-html-parser \
nasm \
wget \
texinfo \
bison \
flex \
po4a \
autoconf \
curl \
file \
patch \
automake \
scons \
waf \
expat \
gmp \
libtool \
libpng \
libjpeg-turbo \
sdl12-compat \
m4 \
pkgconf \
po4a \
syslinux \
meson \
python \
python-mako \
make \
xdg-utils \
zip \
unzip \
llvm \
clang \
perl \
doxygen \
lua \
ant \
protobuf"
if [ "$1" == "qemu" ]; then if [ "$1" == "qemu" ]; then
packages="$packages qemu" packages="$packages qemu"
elif [ "$1" == "virtualbox" ]; then elif [ "$1" == "virtualbox" ]; then
packages="$packages virtualbox" packages="$packages virtualbox"
else
echo "Unknown emulator: $1"
exit 1
fi fi
# Scripts should not cause a system update in order to just install a couple # 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 # 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 # user will figure out the issues (without updating if required) and rerun
@ -368,362 +202,137 @@ archLinux()
#sudo pacman -Syu #sudo pacman -Syu
echo "Installing packages $packages..." echo "Installing packages $packages..."
sudo $pacman_install $packages sudo pacman -S --needed $packages
} }
############################################################################### ###############################################################################
# This function takes care of installing all dependencies for building Redox on # This function takes care of installing all dependencies for building redox on
# Debian-based Linux # debian based linux
# @params: $1 the emulator to install, "virtualbox" or "qemu" # @params: $1 the emulator to install, virtualbox or qemu
# $2 install non-interactively, boolean # $2 the package manager to use
# $3 the package manager to use
############################################################################### ###############################################################################
ubuntu() ubuntu()
{ {
noninteractive=$2
package_manager=$3
echo "Detected Ubuntu/Debian" echo "Detected Ubuntu/Debian"
echo "Updating system..." echo "Updating system..."
sudo $package_manager update sudo "$2" update
if [ $package_manager == "apt-get" ]; then
if [ "$noninteractive" = true ]; then
install_command+="DEBIAN_FRONTEND=noninteractive apt-get install --assume-yes --quiet"
else
install_command="apt-get install"
fi
else
install_command="$package_manager install"
fi
echo "Installing required packages..." echo "Installing required packages..."
pkgs="\ sudo "$2" install \
ant \
autoconf \ autoconf \
automake \
autopoint \ autopoint \
bison \ bison \
build-essential \ build-essential \
clang \
cmake \ cmake \
curl \ curl \
dos2unix \
doxygen \
file \ file \
flex \ flex \
fuse3 \ fuse \
g++ \
genisoimage \ genisoimage \
git \ git \
gperf \ gperf \
intltool \ libc6-dev-i386 \
libexpat-dev \ libexpat-dev \
libfuse-dev \ libfuse-dev \
libgmp-dev \ libgmp-dev \
libhtml-parser-perl \ libhtml-parser-perl \
libjpeg-dev \
libmpfr-dev \
libpng-dev \ libpng-dev \
libsdl1.2-dev \
libsdl2-ttf-dev \
libtool \ libtool \
llvm \
lua5.4 \
m4 \ m4 \
make \
meson \
nasm \ nasm \
ninja-build \
patch \
perl \
pkg-config \ pkg-config \
po4a \ po4a \
protobuf-compiler \ syslinux-utils \
python3 \ texinfo
python3-mako \
rsync \
scons \
texinfo \
unzip \
wget \
xdg-utils \
xxd \
zip \
zstd \
"
# Not availible for at least ARM hosts
case "$host_arch" in
x86*|i?86) pkgs="$pkgs libc6-dev-i386 syslinux-utils";;
esac
sudo $install_command $pkgs
if [ "$1" == "qemu" ]; then if [ "$1" == "qemu" ]; then
if [ -z "$(which qemu-system-x86_64)" ]; then if [ -z "$(which qemu-system-x86_64)" ]; then
echo "Installing QEMU..." echo "Installing QEMU..."
sudo $install_command qemu-system-x86 qemu-kvm sudo "$2" install qemu-system-x86 qemu-kvm
sudo $install_command qemu-efi-arm qemu-system-arm
else else
echo "QEMU already installed!" echo "QEMU already installed!"
fi fi
elif [ "$1" == "virtualbox" ]; then else
if [ -z "$(which virtualbox)" ]; then if [ -z "$(which virtualbox)" ]; then
echo "Installing Virtualbox..."
if grep '^ID=debian$' /etc/os-release > /dev/null; then sudo "$2" install virtualbox
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 else
echo "Installing VirtualBox..." echo "Virtualbox already installed!"
sudo $install_command virtualbox
fi fi
else
echo "VirtualBox already installed!"
fi
else
echo "Unknown emulator: $1"
exit 1
fi fi
} }
############################################################################### ###############################################################################
# This function takes care of installing all dependencies for building Redox on # This function takes care of installing all dependencies for building redox on
# Fedora Linux # fedora linux
# @params: $1 the emulator to install, "virtualbox" or "qemu" # @params: $1 the emulator to install, virtualbox or qemu
# $2 install non-interactively, boolean
############################################################################### ###############################################################################
fedora() fedora()
{ {
noninteractive=$2
dnf_install="dnf install"
if [ "$noninteractive" = true ]; then
dnf_install+=" --assumeyes --quiet"
fi
echo "Detected Fedora" echo "Detected Fedora"
if [ -z "$(which git)" ]; then if [ -z "$(which git)" ]; then
echo "Installing git..." echo "Installing git..."
sudo $dnf_install git-all sudo dnf install git-all
fi fi
if [ "$1" == "qemu" ]; then if [ "$1" == "qemu" ]; then
if [ -z "$(which qemu-system-x86_64)" ]; then if [ -z "$(which qemu-system-x86_64)" ]; then
echo "Installing QEMU..." echo "Installing QEMU..."
sudo $dnf_install qemu-system-x86 qemu-kvm sudo dnf install qemu-system-x86 qemu-kvm
else else
echo "QEMU already installed!" echo "QEMU already installed!"
fi fi
elif [ "$1" == "virtualbox" ]; then else
if [ -z "$(which virtualbox)" ]; then if [ -z "$(which virtualbox)" ]; then
echo "Please install VirtualBox and re-run this script," echo "Installing virtualbox..."
echo "or run with -e qemu" sudo dnf install virtualbox
exit 1
else else
echo "VirtualBox already installed!" echo "Virtualbox already installed!"
fi fi
else
echo "Unknown emulator: $1"
exit 1
fi fi
# Use rpm -q <package> to check if it's already installed # Use rpm -q <package> to check if it's already installed
PKGS=$(for pkg in file \ PKGS=$(for pkg in gcc gcc-c++ glibc-devel.i686 nasm make fuse-devel cmake texinfo gettext-devel bison flex perl-HTML-Parser po4a openssl patch automake libtool perl-Pod-Html perl-FindBin gperf libpng-devel; do rpm -q $pkg > /dev/null || echo $pkg; done)
autoconf \
vim \
bison \
flex \
genisoimage \
gperf \
glibc-devel.i686 \
expat \
expat-devel \
fuse-devel \
fuse3-devel \
gmp-devel \
libpng-devel \
perl \
perl-HTML-Parser \
libtool \
libjpeg-turbo-devel \
SDL2_ttf-devel \
sdl12-compat-devel \
m4 \
nasm \
po4a \
syslinux \
texinfo \
ninja-build \
meson \
waf \
python3-mako \
make \
gcc \
gcc-c++ \
openssl \
patch \
automake \
perl-Pod-Html \
perl-FindBin \
gperf \
curl \
gettext-devel \
perl-Pod-Xhtml \
pkgconf-pkg-config \
cmake \
llvm \
zip \
unzip \
lua \
luajit \
make \
clang \
doxygen \
ant \
protobuf-compiler \
zstd ; do rpm -q $pkg > /dev/null || echo $pkg; done)
# If the list of packages is not empty, install missing # If the list of packages is not empty, install missing
COUNT=$(echo $PKGS | wc -w) COUNT=$(echo $PKGS | wc -w)
if [ $COUNT -ne 0 ]; then if [ $COUNT -ne 0 ]; then
echo "Installing necessary build tools..." echo "Installing necessary build tools..."
sudo $dnf_install $PKGS sudo dnf install $PKGS
fi fi
} }
############################################################################### ###############################################################################
# This function takes care of installing all dependencies for building Redox on # This function takes care of installing all dependencies for building redox on
# *SUSE Linux # *suse linux
# @params: $1 the emulator to install, virtualbox or qemu
############################################################################### ###############################################################################
suse() suse()
{ {
echo "Detected SUSE Linux" echo "Detected SUSE Linux"
packages=(
"gcc"
"gcc-c++"
"glibc-devel-32bit"
"nasm"
"make"
"fuse-devel"
"cmake"
"openssl"
"automake"
"gettext-tools"
"libtool"
"po4a"
"patch"
"flex"
"gperf"
"autoconf"
"bison"
"curl"
"wget"
"file"
"libexpat-devel"
"gmp-devel"
"libpng16-devel"
"libjpeg8-devel"
"perl"
"perl-HTML-Parser"
"m4"
"patch"
"scons"
"pkgconf"
"syslinux-utils"
"ninja"
"meson"
"python-Mako"
"xdg-utils"
"zip"
"unzip"
"llvm"
"clang"
"doxygen"
"lua54"
"ant"
"protobuf"
)
if [ -z "$(which git)" ]; then if [ -z "$(which git)" ]; then
echo "Will install git ..." echo "Installing git..."
packages+=(git) zypper install git
fi fi
if [ "$1" == "qemu" ]; then if [ "$1" == "qemu" ]; then
if [ -z "$(which qemu-system-x86_64)" ]; then if [ -z "$(which qemu-system-x86_64)" ]; then
echo "Will install QEMU..." echo "Installing QEMU..."
packages+=(qemu-x86 qemu-kvm) sudo zypper install qemu-x86 qemu-kvm
else else
echo "QEMU already installed!" echo "QEMU already installed!"
fi fi
elif [ "$1" == "virtualbox" ]; then else
if [ -z "$(which virtualbox)" ]; then if [ -z "$(which virtualbox)" ]; then
echo "Please install VirtualBox and re-run this script," echo "Please install Virtualbox and re-run this script,"
echo "or run with -e qemu" echo "or run with -e qemu"
exit 1 exit
else else
echo "VirtualBox already installed!" echo "Virtualbox already installed!"
fi fi
else
echo "Unknown emulator: $1"
exit 1
fi fi
echo "Installing necessary build tools..." echo "Installing necessary build tools..."
sudo zypper install gcc gcc-c++ glibc-devel-32bit nasm make fuse-devel cmake openssl automake gettext-tools libtool po4a patch flex gperf
# 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 # This function takes care of installing all dependencies for building redox on
# Gentoo Linux # gentoo linux
# @params: $1 the emulator to install, "virtualbox" or "qemu" # @params: $1 the emulator to install, virtualbox or qemu
############################################################################## ##############################################################################
gentoo() gentoo()
{ {
@ -736,50 +345,33 @@ gentoo()
echo "Installing git..." echo "Installing git..."
sudo emerge dev-vcs/git sudo emerge dev-vcs/git
fi fi
if [ -z "$(which fusermount 2>/dev/null)" ] && [ -z "$(which fusermount3 2>/dev/null)" ]; then if [ -z "$(which fusermount)" ]; then
echo "Installing fuse..." echo "Installing fuse..."
sudo emerge sys-fs/fuse sudo emerge sys-fs/fuse
fi fi
if [ "$2" == "qemu" ]; then
if [ "$1" == "qemu" ]; then
if [ -z "$(which qemu-system-x86_64)" ]; then if [ -z "$(which qemu-system-x86_64)" ]; then
echo "Please install QEMU and re-run this script" echo "Please install QEMU and re-run this script"
echo "Step1. Add QEMU_SOFTMMU_TARGETS=\"x86_64\" to /etc/portage/make.conf" echo "Step1. Add QEMU_SOFTMMU_TARGETS=\"x86_64\" to /etc/portage/make.conf"
echo "Step2. Execute \"sudo emerge app-emulation/qemu\"" echo "Step2. Execute \"sudo emerge app-emulation/qemu\""
exit 1
else else
echo "QEMU already installed!" echo "QEMU already installed!"
fi 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 fi
else
echo "Unknown emulator: $1"
exit 1
fi
if [ -z "$(which cmake)" ]; then if [ -z "$(which cmake)" ]; then
echo "Installing cmake..." echo "Installing cmake..."
sudo emerge dev-util/cmake sudo emerge dev-util/cmake
fi fi
if [ -z "$(ldconfig -p | grep fontconfig)" ]; then
sudo emerge media-libs/fontconfig
fi
} }
############################################################################## ##############################################################################
# This function takes care of installing all dependencies for building Redox on # This function takes care of installing all dependencies for building redox on
# Solus # SolusOS
# @params: $1 the emulator to install, "virtualbox" or "qemu" # @params: $1 the emulator to install, virtualbox or qemu
############################################################################## ##############################################################################
solus() solus()
{ {
echo "Detected Solus" echo "Detected SolusOS"
if [ "$1" == "qemu" ]; then if [ "$1" == "qemu" ]; then
if [ -z "$(which qemu-system-x86_64)" ]; then if [ -z "$(which qemu-system-x86_64)" ]; then
@ -787,47 +379,19 @@ solus()
else else
echo "QEMU already installed!" echo "QEMU already installed!"
fi fi
elif [ "$1" == "virtualbox" ]; then else
if [ -z "$(which virtualbox)" ]; then if [ -z "$(which virtualbox)" ]; then
echo "Please install VirtualBox and re-run this script," echo "Please install Virtualbox and re-run this script,"
echo "or run with -e qemu" echo "or run with -e qemu"
exit 1 exit
else else
echo "VirtualBox already installed!" echo "Virtualbox already installed!"
fi fi
else
echo "Unknown emulator: $1"
exit 1
fi fi
echo "Installing necessary build tools..." echo "Installing necessary build tools..."
#if guards are not necessary with eopkg since it does nothing if latest version is already installed #if guards are not necessary with eopkg since it does nothing if latest version is already installed
sudo eopkg it fuse-devel \ sudo eopkg it fuse-devel git gcc g++ libgcc-32bit libstdc++-32bit nasm make cmake binutils-gold glibc-devel pkg-config fuse2-devel linux-headers rsync automake autoconf m4 libtool-devel po4a patch bison flex gperf libpng-devel perl-html-parser
git \
gcc \
g++ \
libgcc-32bit \
libstdc++-32bit \
nasm \
make \
cmake \
binutils-gold \
glibc-devel \
pkg-config \
fuse2-devel \
linux-headers \
rsync \
automake \
autoconf \
m4 \
libtool-devel \
po4a \
patch \
bison \
flex \
gperf \
libpng-devel \
perl-html-parser
} }
###################################################################### ######################################################################
@ -849,10 +413,6 @@ usage()
echo " -p [package Choose an Ubuntu package manager, apt-fast or" echo " -p [package Choose an Ubuntu package manager, apt-fast or"
echo " manager] aptitude" echo " manager] aptitude"
echo " -d Only install the dependencies, skip boot step" echo " -d Only install the dependencies, skip boot step"
echo " -y Install non-interactively. Answer \"yes\" or"
echo " select the default option for rustup and package"
echo " managers. Only the apt, dnf and pacman"
echo " package managers are supported."
echo "EXAMPLES:" echo "EXAMPLES:"
echo echo
echo "./bootstrap.sh -e qemu" echo "./bootstrap.sh -e qemu"
@ -875,10 +435,8 @@ cargoInstall() {
# This function takes care of everything associated to rust, and the version manager # 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 # 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 # sure that the correct version of rustc is selected by rustup
# @params: $1 install non-interactively, boolean
#################################################################################### ####################################################################################
rustInstall() { rustInstall() {
noninteractive=$1
# Check to see if multirust is installed, we don't want it messing with rustup # 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 # 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 if [ -e /usr/local/lib/rustlib/uninstall.sh ] ; then
@ -891,26 +449,20 @@ rustInstall() {
sudo /usr/local/lib/rustlib/uninstall.sh sudo /usr/local/lib/rustlib/uninstall.sh
else else
echo "Please manually uninstall multirust and any other versions of rust, then re-run bootstrap." echo "Please manually uninstall multirust and any other versions of rust, then re-run bootstrap."
exit 1 exit
fi fi
fi fi
# If rustup is not installed we should offer to install it for them # If rustup is not installed we should offer to install it for them
if [ -z "$(which rustup)" ]; then if [ -z "$(which rustup)" ]; then
rustup_options="--default-toolchain nightly"
echo "You do not have rustup installed." echo "You do not have rustup installed."
if [ "$noninteractive" = true ]; then
rustup="y"
rustup_options+=" -y"
else
echo "We HIGHLY recommend using rustup." echo "We HIGHLY recommend using rustup."
echo "Would you like to install it now?" echo "Would you like to install it now?"
echo "*WARNING* this involves a 'curl | sh' style command" echo "*WARNING* this involves a 'curl | sh' style command"
printf "(y/N): " printf "(y/N): "
read rustup read rustup
fi
if echo "$rustup" | grep -iq "^y" ;then if echo "$rustup" | grep -iq "^y" ;then
#install rustup #install rustup
curl https://sh.rustup.rs -sSf | sh -s -- $rustup_options curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly
# You have to add the rustup variables to the $PATH # You have to add the rustup variables to the $PATH
echo "export PATH=\"\$HOME/.cargo/bin:\$PATH\"" >> ~/.bashrc echo "export PATH=\"\$HOME/.cargo/bin:\$PATH\"" >> ~/.bashrc
# source the variables so that we can execute rustup commands in the current shell # source the variables so that we can execute rustup commands in the current shell
@ -925,9 +477,9 @@ rustInstall() {
echo "Please either run the script again, accepting rustup install" echo "Please either run the script again, accepting rustup install"
echo "or install rustc nightly manually (not recommended) via:" echo "or install rustc nightly manually (not recommended) via:"
echo "\#curl -sSf https://static.rust-lang.org/rustup.sh | sh -s -- --channel=nightly" echo "\#curl -sSf https://static.rust-lang.org/rustup.sh | sh -s -- --channel=nightly"
exit 1 exit
else else
echo "Your Rust install looks good!" echo "Your rust install looks good!"
fi fi
} }
@ -978,12 +530,12 @@ boot()
echo "Well it looks like you are ready to go!" echo "Well it looks like you are ready to go!"
echo "---------------------------------------" echo "---------------------------------------"
statusCheck statusCheck
echo "Run the following commands to build Redox:" echo "Run the following commands to build redox:"
echo "cd redox" echo "cd redox"
MAKE="make" MAKE="make"
if [[ "$(uname)" == "FreeBSD" ]]; then if [[ "$(uname)" == "FreeBSD" ]]; then
MAKE="gmake" MAKE="gmake"
echo "kldload fuse.ko # This loads the kernel module for FUSE" echo "kldload fuse.ko # This loads the kernel module for fuse"
fi fi
echo "$MAKE all" echo "$MAKE all"
echo "$MAKE virtualbox or qemu" echo "$MAKE virtualbox or qemu"
@ -1005,14 +557,11 @@ elif [ "$1" == "-s" ]; then
exit exit
fi fi
host_arch=$(uname -m)
emulator="qemu" emulator="qemu"
defpackman="apt-get" defpackman="apt-get"
dependenciesonly=false dependenciesonly=false
update=false update=false
noninteractive=false while getopts ":e:p:udhs" opt
while getopts ":e:p:udhys" opt
do do
case "$opt" in case "$opt" in
e) emulator="$OPTARG";; e) emulator="$OPTARG";;
@ -1020,15 +569,16 @@ do
d) dependenciesonly=true;; d) dependenciesonly=true;;
u) update=true;; u) update=true;;
h) usage;; h) usage;;
y) noninteractive=true;;
s) statusCheck && exit;; s) statusCheck && exit;;
\?) echo "I don't know what to do with that option, try -h for help"; exit 1;; \?) echo "I don't know what to do with that option, try -h for help"; exit;;
esac esac
done done
banner banner
rustInstall "$noninteractive" rustInstall
cargoInstall cargo-config 0.1.1
cargoInstall xargo 0.3.20
if [ "$update" == "true" ]; then if [ "$update" == "true" ]; then
git pull upstream master git pull upstream master
@ -1042,37 +592,33 @@ if [ "Darwin" == "$(uname -s)" ]; then
else else
# Here we will use package managers to determine which operating system the user is using. # Here we will use package managers to determine which operating system the user is using.
# SUSE and derivatives # Suse and derivatives
if hash 2>/dev/null zypper; then if hash 2>/dev/null zypper; then
suse "$emulator" suse "$emulator"
# Debian or any derivative of it # Debian or any derivative of it
elif hash 2>/dev/null apt-get; then elif hash 2>/dev/null apt-get; then
ubuntu "$emulator" "$noninteractive" "$defpackman" ubuntu "$emulator" "$defpackman"
# Fedora # Fedora
elif hash 2>/dev/null dnf; then elif hash 2>/dev/null dnf; then
fedora "$emulator" "$noninteractive" fedora "$emulator"
# Gentoo # Gentoo
elif hash 2>/dev/null emerge; then elif hash 2>/dev/null emerge; then
gentoo "$emulator" gentoo "$emulator"
# Solus # SolusOS
elif hash 2>/dev/null eopkg; then elif hash 2>/dev/null eopkg; then
solus "$emulator" solus "$emulator"
# Arch Linux # Arch linux
elif hash 2>/dev/null pacman; then elif hash 2>/dev/null pacman; then
archLinux "$emulator" "$noninteractive" archLinux "$emulator"
# FreeBSD # FreeBSD
elif hash 2>/dev/null pkg; then elif hash 2>/dev/null pkg; then
freebsd "$emulator" freebsd "$emulator"
# Unsupported platform # Unsupported platform
else else
printf "\e[31;1mFatal error: \e[0;31mUnsupported platform, please open an issue\e[0m\n" printf "\e[31;1mFatal error: \e[0;31mUnsupported platform, please open an issue\[0m"
fi fi
fi fi
cargoInstall cargo-config 0.1.1
cargoInstall just 1.16.0
cargoInstall cbindgen 0.26.0
if [ "$dependenciesonly" = false ]; then if [ "$dependenciesonly" = false ]; then
boot boot
fi fi

View File

@ -1,98 +0,0 @@
#!/usr/bin/env bash
###########################################################################
# #
# 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 | -6 | -a ARCH] [-c CONFIG] [-f FILESYSTEM_CONFIG] TARGET..."
echo " -X Equivalent to -a x86_64."
echo " -A Equivalent to -a aarch64."
echo " -6 Equivalent to -a i686."
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/livedisk.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";;
6) ARCH="i686";;
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) : ;;
i686) : ;;
\?) ARCH=""; echo "Unknown Architecture, please specify x86_64, aarch64 or i686";;
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

@ -12,50 +12,44 @@ atk = {}
audiod = {} audiod = {}
autoconf = {} autoconf = {}
automake = {} automake = {}
bash = {} #bash = {} # setrlimit
binutils = {} binutils = {}
bootloader = {} bootloader = {}
bootstrap = {}
ca-certificates = {} ca-certificates = {}
cairo = {} cairo = {}
cairodemo = {} #cairodemo = {} # multiple definition of __rust_alloc
#calculator = {} #cargo = {} # curl-config not found
cargo = {}
cleye = {} cleye = {}
#cmatrix = {} # needs ncursesw now cmatrix = {}
contain = {} contain = {}
coreutils = {} coreutils = {}
cosmic-edit = {}
cosmic-icons = {}
cosmic-text = {}
cpal = {} cpal = {}
curl = {} curl = {}
dash = {} dash = {}
diffutils = {} diffutils = {}
dosbox = {} dosbox = {}
drivers = {} drivers = {}
#drivers-041 = {}
drivers-initfs = {} drivers-initfs = {}
duktape = {} #duktape = {} # strptime
eduke32 = {} eduke32 = {}
escalated = {}
exampled = {} exampled = {}
expat = {} expat = {}
extrautils = {} extrautils = {}
#fal
#fd = {} # ctrlc-3.1.1 #fd = {} # ctrlc-3.1.1
#ffmpeg6 = {} # undefined references ffmpeg = {}
findutils = {} findutils = {}
fontconfig = {} fontconfig = {}
#freeciv = {} #freeciv = {}
freedoom = {} freedoom = {}
#freeglut = {} #freeglut = {}
freepats = {} freetype = {}
freetype2 = {}
#friar = {} # mio patch #friar = {} # mio patch
fribidi = {} fribidi = {}
#game-2048 = {} # rustc-serialize #game-2048 = {} # rustc-serialize
games = {}
#gawk = {} # langinfo.h #gawk = {} # langinfo.h
gcc13 = {} gcc = {}
gdbserver = {} gdbserver = {}
#gdk-pixbuf = {} # shared-mime-info #gdk-pixbuf = {} # shared-mime-info
gears = {} gears = {}
@ -73,10 +67,7 @@ gnu-make = {}
harfbuzz = {} harfbuzz = {}
#hematite = {} # needs crate patches for redox-unix #hematite = {} # needs crate patches for redox-unix
init = {} init = {}
initfs = {}
installer = {} installer = {}
installer-gui = {}
intel-one-mono = {}
ion = {} ion = {}
ipcd = {} ipcd = {}
jansson = {} jansson = {}
@ -96,13 +87,12 @@ libvorbis = {}
libxml2 = {} libxml2 = {}
llvm = {} llvm = {}
logd = {} logd = {}
lua54 = {} #lua = {} # tmpnam
#mdp = {} # ncursesw #mdp = {} # ncursesw
mesa = {} mesa = {}
mesa-glu = {} mesa_glu = {}
mgba = {} #mgba = {} # no longer builds binary
#miniserve = {} # actix #miniserve = {} # actix
nano = {}
nasm = {} nasm = {}
#ncdu = {} # fails to link with ncurses #ncdu = {} # fails to link with ncurses
ncurses = {} ncurses = {}
@ -111,12 +101,13 @@ netdb = {}
netstack = {} netstack = {}
netsurf = {} netsurf = {}
netutils = {} netutils = {}
neverball = {} #neverball = {} # error finding SDL includes
#newlib = {} # obsolete #newlib = {} # obsolete
#newlibtest = {} # obsolete #newlibtest = {} # obsolete
nghttp2 = {} nghttp2 = {}
nulld = {}
openjazz = {} openjazz = {}
openssl1 = {} openssl = {}
openttd = {} openttd = {}
openttd-opengfx = {} openttd-opengfx = {}
openttd-openmsx = {} openttd-openmsx = {}
@ -126,75 +117,68 @@ orbdata = {}
orbital = {} orbital = {}
orbterm = {} orbterm = {}
orbutils = {} orbutils = {}
#orbutils-background = {} # needs recipe update orbutils-background = {}
#orbutils-launcher = {} # needs recipe update orbutils-launcher = {}
#orbutils-orblogin = {} # needs recipe update orbutils-orblogin = {}
osdemo = {} osdemo = {}
#pango = {} # undefined references to std::__throw_system_error(int) pango = {}
#pastel = {} # needs crate patches for redox-unix #pastel = {} # needs crate patches for redox-unix
patch = {} patch = {}
#pathfinder = {} # servo-fontconfig #pathfinder = {} # servo-fontconfig
#pciids = {} #pciids = {}
pcre = {} pcre = {}
perg = {}
periodictable = {} periodictable = {}
#perl = {} # ctermid, tempnam, ttyname #perl = {} # ctermid, tempnam, ttyname
pixelcannon = {} pixelcannon = {}
pixman = {} pixman = {}
#pkgar = {} # uses virtual Cargo.toml, needs recipe update
pkg-config = {} pkg-config = {}
pkgutils = {} pkgutils = {}
pop-icon-theme = {}
#powerline = {} # dirs #powerline = {} # dirs
prboom = {} prboom = {}
procedural-wallpapers-rs = {}
ptyd = {} ptyd = {}
#python = {} # getaddrinfo #python = {} # getaddrinfo
#qemu = {} #qemu = {}
ramfs = {}
randd = {} randd = {}
ramfs = {}
readline = {} readline = {}
redoxerd = {} redoxerd = {}
redox-fatfs = {}
redoxfs = {} redoxfs = {}
redox-games = {} #redox-fatfs = {}
redox-ssh = {} #redox-ssh = {}
relibc = {} relibc = {}
#relibc-tests = {} # madvise link error #relibc-tests = {}
resist = {} resist = {}
#retroarch = {} # OS_TLSIndex not declared
ripgrep = {} ripgrep = {}
rodioplay = {} rodioplay = {}
rs-nes = {} rs-nes = {}
rust = {} #rust = {}
rust64 = {} rust64 = {}
rust-cairo = {} rust-cairo = {}
rust-cairo-demo = {} rust-cairo-demo = {}
rustual-boy = {} rustual-boy = {}
schismtracker = {} schismtracker = {}
scummvm = {} scummvm = {}
sdl-gfx = {} sdl = {}
#sdl-player = {} # wctype_t
sdl1 = {}
sdl1-image = {}
sdl1-mixer = {}
sdl1-ttf = {}
sdl2 = {} sdl2 = {}
sdl2-gears = {} sdl2_gears = {}
sdl2-image = {} sdl2_image = {}
sdl2-mixer = {} sdl2_mixer = {}
sdl2-ttf = {} sdl2_ttf = {}
sdl_gfx = {}
sdl_image = {}
sdl_mixer = {}
#sdl-player = {} # wctype_t
#sdl_ttf = {} # configure patch needs to be updated
sed = {} sed = {}
#servo = {} # some more crates to port #servo = {} # some more crates to port
#shared-mime-info = {} # intltool-update out of date #shared-mime-info = {} # intltool-update out of date
shellharden = {}
shellstorm = {} shellstorm = {}
smith = {} smith = {}
sodium = {} sodium = {}
sopwith = {} sopwith = {}
#ssh = {} #ssh = {}
strace = {} strace = {}
syobonaction = {} #syobonaction = {} # sdl_ttf errors
terminfo = {} terminfo = {}
#termplay = {} # backtrace cannot find link.h #termplay = {} # backtrace cannot find link.h
timidity = {} timidity = {}
@ -204,10 +188,8 @@ uutils = {}
vice = {} vice = {}
vim = {} vim = {}
vttest = {} vttest = {}
vvvvvv = {}
#webrender = {} # unwind #webrender = {} # unwind
#wesnoth = {} winit = {}
#winit = {} # tzset
xz = {} xz = {}
zerod = {} zerod = {}
zlib = {} zlib = {}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,20 +1,39 @@
# Configuration for using acid # Configuration for using acid
include = ["base.toml"]
# General settings # General settings
[general] [general]
# Filesystem size in MiB # Do not prompt if settings are not defined
filesystem_size = 256 prompt = false
# Package settings # Package settings
[packages] [packages]
acid = {} acid = {}
coreutils = {} coreutils = {}
ion = {} ion = {}
ipcd = {}
ptyd = {}
# User settings
[users.root]
password = "password"
uid = 0
gid = 0
name = "root"
home = "/root"
[users.user]
# Password is unset
password = ""
[[files]] [[files]]
path = "/usr/lib/init.d/10_acid" path = "/etc/init.d/00_base"
data = """
ipcd
ptyd
"""
[[files]]
path = "/etc/init.d/10_acid"
data = """ data = """
export RUST_BACKTRACE full export RUST_BACKTRACE full
acid acid
@ -24,3 +43,35 @@ acid tls
acid thread acid thread
shutdown shutdown
""" """
[[files]]
path = "/usr/bin"
data = "../bin"
symlink = true
[[files]]
path = "/usr/games"
data = "../games"
symlink = true
[[files]]
path = "/usr/include"
data = "../include"
symlink = true
[[files]]
path = "/usr/lib"
data = "../lib"
symlink = true
[[files]]
path = "/usr/share"
data = "../share"
symlink = true
[[files]]
path = "/tmp"
data = ""
directory= true
# 0o1777
mode = 1023

View File

@ -1,168 +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]
bootloader = {}
bootstrap = {}
escalated = {}
initfs = {}
ipcd = {}
kernel = {}
ptyd = {}
uutils = {}
## Configuration files
[[files]]
path = "/usr/lib/init.d/00_base"
data = """
# clear and recreate tmpdir with 0o1777 permission
rm -r /tmp
mkdir -m a=rwxt /tmp
ipcd
ptyd
escalated
"""
[[files]]
path = "/etc/hostname"
data = """
redox
"""
# https://www.freedesktop.org/software/systemd/man/latest/os-release.html
[[files]]
path = "/usr/lib/os-release"
data = """
PRETTY_NAME="Redox OS 0.8.0"
NAME="Redox OS"
VERSION_ID="0.8.0"
VERSION="0.8.0"
ID="redox-os"
HOME_URL="https://redox-os.org/"
DOCUMENTATION_URL="https://redox-os.org/docs/"
SUPPORT_URL="https://redox-os.org/community/"
"""
# FIXME maybe add VARIANT= and VARIANT_ID= keys depending on the chosen configuration?
[[files]]
path = "/etc/os-release"
data = "../usr/lib/os-release"
symlink = true
## 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/share"
data = ""
directory = true
mode = 0o755
[[files]]
path = "/share"
data = "usr/share"
symlink = true
## Device file symlinks
[[files]]
path = "/dev/null"
data = "null:"
symlink = true
[[files]]
path = "/dev/random"
data = "rand:"
symlink = true
[[files]]
path = "/dev/urandom"
data = "rand:"
symlink = true
[[files]]
path = "/dev/zero"
data = "zero:"
symlink = true
[[files]]
path = "/dev/tty"
data = "libc:tty"
symlink = true
[[files]]
path = "/dev/stdin"
data = "libc:stdin"
symlink = true
[[files]]
path = "/dev/stdout"
data = "libc:stdout"
symlink = true
[[files]]
path = "/dev/stderr"
data = "libc:stderr"
symlink = true
# User settings
[users.root]
password = "password"
uid = 0
gid = 0
name = "root"
home = "/root"
[users.user]
# Password is unset
password = ""
# Group settings
[groups.sudo]
gid = 1
members = ["user"]

View File

@ -1,30 +0,0 @@
# Default desktop configuration
include = ["server-minimal.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 128
# Package settings
[packages]
drivers = {}
orbdata = {}
orbital = {}
orbterm = {}
orbutils-background = {}
orbutils-launcher = {}
orbutils-orblogin = {}
[[files]]
path = "/usr/lib/init.d/00_drivers"
data = """
pcid /etc/pcid.d/
"""
[[files]]
path = "/usr/lib/init.d/20_orbital"
data = """
orbital orblogin launcher
"""

View File

@ -1,33 +1,187 @@
# Default desktop configuration # Default desktop configuration
include = ["server.toml"]
# General settings # General settings
[general] [general]
# Filesystem size in MiB # Do not prompt if settings are not defined
filesystem_size = 512 prompt = false
# Package settings # Package settings
[packages] [packages]
audiod = {} audiod = {}
installer-gui = {} ca-certificates = {}
contain = {}
coreutils = {}
dash = {}
diffutils = {}
drivers = {}
extrautils = {}
findutils = {}
gdbserver = {}
gnu-make = {}
installer = {}
ion = {}
ipcd = {}
netdb = {}
netstack = {}
netsurf = {} netsurf = {}
netutils = {}
orbdata = {} orbdata = {}
orbital = {} orbital = {}
orbterm = {} orbterm = {}
orbutils = {} orbutils = {}
pkgutils = {}
ptyd = {}
redoxfs = {}
resist = {}
smith = {}
strace = {}
terminfo = {}
userutils = {}
uutils = {}
vim = {}
# User settings
[users.root]
password = "password"
uid = 0
gid = 0
name = "root"
home = "/root"
[users.user]
# Password is unset
password = ""
[[files]] [[files]]
path = "/usr/lib/init.d/20_orbital" path = "/etc/init.d/00_base"
data = """
ipcd
ptyd
pcid /etc/pcid.d/
"""
[[files]]
path = "/etc/init.d/10_net"
data = """
smolnetd
dnsd
dhcpd -b
"""
[[files]]
path = "/etc/init.d/20_orbital"
data = """ data = """
audiod audiod
orbital orblogin launcher orbital display:3/activate orblogin launcher
""" """
# Override console config to not switch to VT 2
[[files]] [[files]]
path = "/usr/lib/init.d/30_console" path = "/etc/init.d/30_console"
data = """ data = """
getty 2 getty display:2
getty debug: -J 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/redox-release"
data = "0.7.0"
[[files]]
path = "/etc/group"
data = """
root;0;root
user;1000;user
sudo;1;user
"""
[[files]]
path = "/etc/hostname"
data = """
redox
"""
[[files]]
path = "/usr/bin"
data = "../bin"
symlink = true
[[files]]
path = "/usr/games"
data = "../games"
symlink = true
[[files]]
path = "/usr/include"
data = "../include"
symlink = true
[[files]]
path = "/usr/lib"
data = "../lib"
symlink = true
[[files]]
path = "/usr/share"
data = "../share"
symlink = true
[[files]]
path = "/tmp"
data = ""
directory= true
# 0o1777
mode = 1023
[[files]]
path = "/dev/null"
data = "null:"
symlink = true
[[files]]
path = "/dev/random"
data = "rand:"
symlink = true
[[files]]
path = "/dev/urandom"
data = "rand:"
symlink = true
[[files]]
path = "/dev/zero"
data = "zero:"
symlink = true

View File

@ -1,27 +0,0 @@
# Configuration for development, includes cargo and rustc
include = ["desktop.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 2048
# Do not prompt if settings are not defined
prompt = false
# Package settings
[packages]
cargo = {}
crates-io-index = {}
gcc13 = {}
gnu-binutils = {}
gnu-make = {}
rust = {}
[[files]]
path = "/home/user/example.rs"
data = """
fn main() {
println!("Hello, Redox!");
}
"""

View File

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

View File

@ -1,47 +0,0 @@
# This is the CI configuration file
# General settings
[general]
# Do not prompt if settings are not defined
prompt = false
# Package settings
[packages]
audiod = {}
bootloader = {}
bootstrap = {}
ca-certificates = {}
contain = {}
coreutils = {}
dash = {}
diffutils = {}
drivers = {}
escalated = {}
extrautils = {}
findutils = {}
initfs = {}
installer = {}
installer-gui = {}
ion = {}
ipcd = {}
kernel = {}
nano = {}
netdb = {}
netstack = {}
netsurf = {}
netutils = {}
orbdata = {}
orbital = {}
orbterm = {}
orbutils = {}
pkgutils = {}
ptyd = {}
redoxfs = {}
relibc = {}
resist = {}
smith = {}
userutils = {}
uutils = {}
vim = {}
#TODO: Add more packages

View File

@ -1,70 +0,0 @@
##############################################################################
# Redox Demo Configuration #
# #
# This file defines the setup of the Redox Demo system. #
# #
# The "[packages]" section specifies what packages are installed in the #
# filesystem prior to booting the system. During build, these packages must #
# have a recipe defined in the config folder (see the Redox Book, #
# Chapter 5.1). The first group of packages is mandatory for the system to #
# function, although some items can be removed for special builds, #
# e.g. The Orbital GUI is not required for a headless server. #
# #
# Items in the "Developer Tools" and "Games" section are optional. You can #
# add your own programs here. #
# #
# The "[users]" section creates user id's and passwords. Each user will have #
# a home directory at boot. #
# #
# The "[[files]]" section contains files needed by the system. If you need #
# create a file, e.g. a config file for a program you are adding, you can do #
# it here. #
# #
##############################################################################
include = ["../desktop.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 512
# 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 @@
# Default desktop configuration
include = ["../desktop-minimal.toml"]
# Override the default settings here
# General settings
[general]
# Filesystem size in MiB
# filesystem_size = 1024
# Package settings
[packages]
# example = {}

View File

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

View File

@ -1,14 +0,0 @@
# Configuration for development, includes cargo and rustc
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,40 +0,0 @@
# Jeremy's configuration
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 = {}
keyboard-sfx = {}
ttf-hack = {}

View File

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

View File

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

View File

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

287
config/jeremy.toml Normal file
View File

@ -0,0 +1,287 @@
# Jeremy's configuration
# General settings
[general]
# Do not prompt if settings are not defined
prompt = false
# Package settings
[packages]
acid = {}
atk = {}
audiod = {}
autoconf = {}
automake = {}
ca-certificates = {}
cairo = {}
cairodemo = {}
cleye = {}
cmatrix = {}
contain = {}
coreutils = {}
cpal = {}
curl = {}
dash = {}
diffutils = {}
dosbox = {}
drivers = {}
eduke32 = {}
expat = {}
extrautils = {}
ffmpeg = {}
findutils = {}
fontconfig = {}
freedoom = {}
freetype = {}
fribidi = {}
games = {}
gcc = {}
gdbserver = {}
gears = {}
generaluser-gs = {}
gettext = {}
gigalomania = {}
git = {}
glib = {}
glium = {}
glutin = {}
gnu-binutils = {}
gnu-grep = {}
gnu-make = {}
harfbuzz = {}
installer = {}
ion = {}
ipcd = {}
jansson = {}
jeremy = {}
keyboard-sfx = {}
lci = {}
libc-bench = {}
libffi = {}
libiconv = {}
libjpeg = {}
libogg = {}
liborbital = {}
libpng = {}
libsodium = {}
libvorbis = {}
libxml2 = {}
llvm = {}
mesa = {}
mesa_glu = {}
nasm = {}
ncurses = {}
netdb = {}
netstack = {}
netsurf = {}
netutils = {}
neverball = {}
nghttp2 = {}
openjazz = {}
openssl = {}
openttd = {}
openttd-opengfx = {}
openttd-openmsx = {}
openttd-opensfx = {}
orbclient = {}
orbdata = {}
orbital = {}
orbterm = {}
orbutils = {}
osdemo = {}
pango = {}
patch = {}
pcre = {}
periodictable = {}
pixelcannon = {}
pixman = {}
pkg-config = {}
pkgutils = {}
prboom = {}
ptyd = {}
readline = {}
redoxfs = {}
resist = {}
ripgrep = {}
rodioplay = {}
rs-nes = {}
rust = {}
rust64 = {}
rust-cairo = {}
rust-cairo-demo = {}
rustual-boy = {}
schismtracker = {}
scummvm = {}
sdl = {}
sdl2 = {}
sdl2_gears = {}
sdl2_image = {}
sdl2_mixer = {}
sdl2_ttf = {}
sdl_gfx = {}
sdl_image = {}
sdl_mixer = {}
sed = {}
smith = {}
sodium = {}
sopwith = {}
strace = {}
syobonaction = {}
terminfo = {}
timidity = {}
ttf-hack = {}
userutils = {}
uutils = {}
vice = {}
vim = {}
vttest = {}
vvvvvv = {}
winit = {}
xz = {}
zlib = {}
# User settings
[users.root]
password = "password"
uid = 0
gid = 0
name = "root"
home = "/root"
[users.user]
# Password is unset
password = ""
[[files]]
path = "/etc/init.d/00_base"
data = """
ipcd
ptyd
pcid /etc/pcid.d/
"""
[[files]]
path = "/etc/init.d/10_net"
data = """
smolnetd
dnsd
dhcpd -b
"""
[[files]]
path = "/etc/init.d/20_orbital"
data = """
audiod
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/redox-release"
data = "0.7.0"
[[files]]
path = "/etc/group"
data = """
root;0;root
user;1000;user
sudo;1;user
"""
[[files]]
path = "/etc/hostname"
data = """
redox
"""
[[files]]
path = "/usr/bin"
data = "../bin"
symlink = true
[[files]]
path = "/usr/games"
data = "../games"
symlink = true
[[files]]
path = "/usr/include"
data = "../include"
symlink = true
[[files]]
path = "/usr/lib"
data = "../lib"
symlink = true
[[files]]
path = "/usr/share"
data = "../share"
symlink = true
[[files]]
path = "/tmp"
data = ""
directory= true
# 0o1777
mode = 1023
[[files]]
path = "/dev/null"
data = "null:"
symlink = true
[[files]]
path = "/dev/random"
data = "rand:"
symlink = true
[[files]]
path = "/dev/urandom"
data = "rand:"
symlink = true
[[files]]
path = "/dev/zero"
data = "zero:"
symlink = true

331
config/maximal.toml Normal file
View File

@ -0,0 +1,331 @@
# Maximum configuration
# General settings
[general]
# Do not prompt if settings are not defined
prompt = false
# Package settings
[packages]
acid = {}
atk = {}
audiod = {}
autoconf = {}
automake = {}
#bash = {}
binutils = {}
ca-certificates = {}
cairo = {}
cairodemo = {}
#cargo = {}
cleye = {}
cmatrix = {}
contain = {}
coreutils = {}
cpal = {}
curl = {}
dash = {}
diffutils = {}
dosbox = {}
drivers = {}
#drivers-041 = {}
#duktape = {}
eduke32 = {}
exampled = {}
expat = {}
extrautils = {}
#fd = {}
ffmpeg = {}
findutils = {}
fontconfig = {}
#freeciv = {}
freedoom = {}
#freeglut = {}
freetype = {}
#friar = {} # mio patch
fribidi = {}
#game-2048 = {}
games = {}
#gawk = {}
gcc = {}
gdbserver = {}
#gdk-pixbuf = {}
gears = {}
generaluser-gs = {}
gettext = {}
gigalomania = {}
git = {}
glib = {}
glium = {}
glutin = {}
gnu-binutils = {}
gnu-grep = {}
gnu-make = {}
#gstreamer = {}
harfbuzz = {}
#hematite = {}
#init = {}
installer = {}
ion = {}
ipcd = {}
jansson = {}
keyboard-sfx = {}
lci = {}
libc-bench = {}
libffi = {}
libiconv = {}
libjpeg = {}
libogg = {}
liborbital = {}
libpng = {}
libsodium = {}
libvorbis = {}
libxml2 = {}
llvm = {}
#logd = {}
#lua = {}
#mdp = {}
mesa = {}
mesa_glu = {}
#mgba = {}
#miniserve = {}
nasm = {}
#ncdu = {}
ncurses = {}
#ncursesw = {}
netdb = {}
netstack = {}
netsurf = {}
netutils = {}
#neverball = {}
#newlib = {}
#newlibtest = {}
nghttp2 = {}
#nulld = {}
openjazz = {}
openssl = {}
openttd = {}
openttd-opengfx = {}
openttd-openmsx = {}
openttd-opensfx = {}
orbclient = {}
orbdata = {}
orbital = {}
orbterm = {}
orbutils = {}
osdemo = {}
pango = {}
#pastel = {}
patch = {}
#pathfinder = {}
#pciids = {}
pcre = {}
periodictable = {}
#perl = {}
pixelcannon = {}
pixman = {}
pkg-config = {}
pkgutils = {}
#powerline = {}
prboom = {}
ptyd = {}
#python = {}
#qemu = {}
randd = {}
readline = {} # ncurses
redoxfs = {}
#redox-fatfs = {}
#redox-ssh = {}
relibc = {}
#relibc-tests = {}
ripgrep = {}
rodioplay = {}
rs-nes = {}
#rust = {}
rust64 = {}
rust-cairo = {}
rust-cairo-demo = {}
rustual-boy = {}
schismtracker = {}
scummvm = {}
sdl = {}
sdl2 = {}
sdl2_gears = {}
sdl2_image = {}
sdl2_mixer = {}
sdl2_ttf = {}
sdl_gfx = {}
sdl_image = {}
sdl_mixer = {}
sdl-player = {}
#sdl_ttf = {}
sed = {}
#servo = {}
#shared-mime-info = {}
shellstorm = {}
smith = {}
sodium = {}
sopwith = {}
#ssh = {}
strace = {}
#syobonaction = {}
terminfo = {}
#termplay = {}
timidity = {}
ttf-hack = {}
userutils = {}
uutils = {}
vice = {}
#vim = {}
vttest = {}
#webrender = {}
winit = {}
xz = {}
#zerod = {}
zlib = {}
# User settings
[users.root]
password = "password"
uid = 0
gid = 0
name = "root"
home = "/root"
[users.user]
# Password is unset
password = ""
[[files]]
path = "/etc/init.d/00_base"
data = """
ipcd
ptyd
pcid /etc/pcid.d/
"""
[[files]]
path = "/etc/init.d/10_net"
data = """
smolnetd
dnsd
dhcpd -b
"""
[[files]]
path = "/etc/init.d/20_orbital"
data = """
audiod
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/redox-release"
data = "0.7.0"
[[files]]
path = "/etc/group"
data = """
root;0;root
user;1000;user
sudo;1;user
"""
[[files]]
path = "/etc/hostname"
data = """
redox
"""
[[files]]
path = "/usr/bin"
data = "../bin"
symlink = true
[[files]]
path = "/usr/games"
data = "../games"
symlink = true
[[files]]
path = "/usr/include"
data = "../include"
symlink = true
[[files]]
path = "/usr/lib"
data = "../lib"
symlink = true
[[files]]
path = "/usr/share"
data = "../share"
symlink = true
[[files]]
path = "/tmp"
data = ""
directory= true
# 0o1777
mode = 1023
[[files]]
path = "/dev/null"
data = "null:"
symlink = true
[[files]]
path = "/dev/random"
data = "rand:"
symlink = true
[[files]]
path = "/dev/urandom"
data = "rand:"
symlink = true
[[files]]
path = "/dev/zero"
data = "zero:"
symlink = true

62
config/minimal.toml Normal file
View File

@ -0,0 +1,62 @@
# Minimal configuration
# General settings
[general]
# Do not prompt if settings are not defined
prompt = false
# Package settings
[packages]
ipcd = {}
ptyd = {}
# User settings
[users.root]
password = "password"
uid = 0
gid = 0
name = "root"
home = "/root"
[users.user]
# Password is unset
password = ""
[[files]]
path = "/etc/init.d/00_base"
data = """
ipcd
ptyd
"""
[[files]]
path = "/usr/bin"
data = "../bin"
symlink = true
[[files]]
path = "/usr/games"
data = "../games"
symlink = true
[[files]]
path = "/usr/include"
data = "../include"
symlink = true
[[files]]
path = "/usr/lib"
data = "../lib"
symlink = true
[[files]]
path = "/usr/share"
data = "../share"
symlink = true
[[files]]
path = "/tmp"
data = ""
directory= true
# 0o1777
mode = 1023

View File

@ -1,51 +0,0 @@
# Net configuration: includes the base configuration and adds files required
# for networking
include = ["base.toml"]
# Package settings
[packages]
drivers = {}
netstack = {}
netutils = {}
## Driver init
[[files]]
path = "/usr/lib/init.d/00_drivers"
data = """
pcid /etc/pcid.d/
"""
## Network init
[[files]]
path = "/usr/lib/init.d/10_net"
data = """
smolnetd
dnsd
dhcpd -b
"""
## Default net configuration (optimized for QEMU)
[[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
"""

View File

@ -1,17 +0,0 @@
# Configuration for 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 = """
echo
echo ## running redoxer in orbital ##
orbital redoxerd
"""

View File

@ -1,53 +0,0 @@
# Configuration for redoxer image
include = ["net.toml"]
# Package settings
[packages]
bash = {}
ca-certificates = {}
coreutils = {}
extrautils = {}
findutils = {}
gcc13 = {}
gnu-binutils = {}
netdb = {}
pkgutils = {}
redoxerd = {}
relibc = {}
# Override to not background dhcpd
[[files]]
path = "/usr/lib/init.d/10_net"
data = """
smolnetd
dnsd
dhcpd
"""
[[files]]
path = "/usr/lib/init.d/20_env"
data = """
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
"""
[[files]]
path = "/usr/lib/init.d/30_redoxer"
data = """
echo
echo ## running redoxer ##
redoxerd
"""
[[files]]
path = "/etc/pkg.d/50_redox"
data = "https://static.redox-os.org/pkg"

View File

@ -1,29 +1,52 @@
# Configuration for using resist # Configuration for using resist
include = ["net.toml"]
# General settings # General settings
[general] [general]
# Filesystem size in MiB # Do not prompt if settings are not defined
filesystem_size = 256 prompt = false
# Package settings # Package settings
[packages] [packages]
bash = {}
coreutils = {} coreutils = {}
dash = {}
diffutils = {} diffutils = {}
drivers = {}
extrautils = {} extrautils = {}
findutils = {} findutils = {}
gcc13 = {} gcc = {}
gnu-binutils = {} gnu-binutils = {}
gnu-make = {} gnu-make = {}
ipcd = {}
netdb = {} netdb = {}
netstack = {}
netutils = {}
ptyd = {}
resist = {} resist = {}
userutils = {} userutils = {}
uutils = {}
# User settings
[users.root]
password = "password"
uid = 0
gid = 0
name = "root"
home = "/root"
[users.user]
# Password is unset
password = ""
# Override to not background dhcpd
[[files]] [[files]]
path = "/usr/lib/init.d/10_net" path = "/etc/init.d/00_base"
data = """
ipcd
ptyd
pcid /etc/pcid.d/
"""
[[files]]
path = "/etc/init.d/10_net"
data = """ data = """
smolnetd smolnetd
dnsd dnsd
@ -31,7 +54,7 @@ dhcpd
""" """
[[files]] [[files]]
path = "/usr/lib/init.d/20_resist" path = "/etc/init.d/20_resist"
data = """ data = """
export RUST_BACKTRACE full export RUST_BACKTRACE full
resist /share/resist/redox/spec.toml resist /share/resist/redox/spec.toml
@ -40,6 +63,106 @@ resist /share/resist/posix/shell.toml
shutdown shutdown
""" """
[[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]] [[files]]
path = "/etc/pkg.d/50_redox" path = "/etc/pkg.d/50_redox"
data = "https://static.redox-os.org/pkg" data = "https://static.redox-os.org/pkg"
[[files]]
path = "/etc/redox-release"
data = "0.7.0"
[[files]]
path = "/etc/group"
data = """
root;0;root
user;1000;user
sudo;1;user
"""
[[files]]
path = "/etc/hostname"
data = """
redox
"""
[[files]]
path = "/usr/bin"
data = "../bin"
symlink = true
[[files]]
path = "/usr/games"
data = "../games"
symlink = true
[[files]]
path = "/usr/include"
data = "../include"
symlink = true
[[files]]
path = "/usr/lib"
data = "../lib"
symlink = true
[[files]]
path = "/usr/share"
data = "../share"
symlink = true
[[files]]
path = "/tmp"
data = ""
directory= true
# 0o1777
mode = 1023
[[files]]
path = "/dev/null"
data = "null:"
symlink = true
[[files]]
path = "/dev/random"
data = "rand:"
symlink = true
[[files]]
path = "/dev/urandom"
data = "rand:"
symlink = true
[[files]]
path = "/dev/zero"
data = "zero:"
symlink = true

181
config/rustc.toml Normal file
View File

@ -0,0 +1,181 @@
# Configuration for using rustc
# General settings
[general]
# Do not prompt if settings are not defined
prompt = false
# Package settings
[packages]
ca-certificates = {}
contain = {}
coreutils = {}
dash = {}
diffutils = {}
drivers = {}
extrautils = {}
findutils = {}
gcc = {}
gnu-binutils = {}
gnu-make = {}
installer = {}
ion = {}
ipcd = {}
netdb = {}
netstack = {}
netutils = {}
pkgutils = {}
ptyd = {}
redoxfs = {}
relibc = {}
rust = {}
smith = {}
userutils = {}
uutils = {}
# User settings
[users.root]
password = "password"
uid = 0
gid = 0
name = "root"
home = "/root"
[users.user]
# Password is unset
password = ""
[[files]]
path = "/home/user/example.rs"
data = """
fn main() {
println!("Hello, Redox!");
}
"""
[[files]]
path = "/etc/init.d/00_base"
data = """
ipcd
ptyd
pcid /etc/pcid.d/
"""
[[files]]
path = "/etc/init.d/10_net"
data = """
smolnetd
dnsd
dhcpd -b
"""
[[files]]
path = "/etc/init.d/30_console"
data = """
getty display:2/activate
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/redox-release"
data = "0.7.0"
[[files]]
path = "/etc/group"
data = """
root;0;root
user;1000;user
sudo;1;user
"""
[[files]]
path = "/etc/hostname"
data = """
redox
"""
[[files]]
path = "/usr/bin"
data = "../bin"
symlink = true
[[files]]
path = "/usr/games"
data = "../games"
symlink = true
[[files]]
path = "/usr/include"
data = "../include"
symlink = true
[[files]]
path = "/usr/lib"
data = "../lib"
symlink = true
[[files]]
path = "/usr/share"
data = "../share"
symlink = true
[[files]]
path = "/tmp"
data = ""
directory= true
# 0o1777
mode = 1023
[[files]]
path = "/dev/null"
data = "null:"
symlink = true
[[files]]
path = "/dev/random"
data = "rand:"
symlink = true
[[files]]
path = "/dev/urandom"
data = "rand:"
symlink = true
[[files]]
path = "/dev/zero"
data = "zero:"
symlink = true

View File

@ -1,23 +0,0 @@
# Minimal configuration
include = ["base.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 128
# Package settings
[packages]
coreutils = {}
extrautils = {}
ion = {}
smith = {}
userutils = {}
[[files]]
path = "/usr/lib/init.d/30_console"
data = """
getty 2
getty debug: -J
"""

View File

@ -1,44 +1,170 @@
# Default server configuration # Default server configuration
include = ["net.toml"]
# General settings # General settings
[general] [general]
# Filesystem size in MiB # Do not prompt if settings are not defined
filesystem_size = 512 prompt = false
# Package settings # Package settings
[packages] [packages]
bash = {}
ca-certificates = {} ca-certificates = {}
contain = {} contain = {}
coreutils = {} coreutils = {}
curl = {} dash = {}
diffutils = {} diffutils = {}
drivers = {}
extrautils = {} extrautils = {}
findutils = {} findutils = {}
git = {} gnu-make = {}
installer = {} installer = {}
ion = {} ion = {}
nano = {} ipcd = {}
netdb = {} netdb = {}
netstack = {}
netutils = {}
pkgutils = {} pkgutils = {}
ptyd = {}
redoxfs = {} redoxfs = {}
relibc = {}
resist = {} resist = {}
smith = {} smith = {}
terminfo = {}
userutils = {} userutils = {}
vim = {} uutils = {}
# User settings
[users.root]
password = "password"
uid = 0
gid = 0
name = "root"
home = "/root"
[users.user]
# Password is unset
password = ""
[[files]] [[files]]
path = "/usr/lib/init.d/30_console" path = "/etc/init.d/00_base"
data = """ data = """
inputd -A 2 ipcd
getty 2 ptyd
pcid /etc/pcid.d/
"""
[[files]]
path = "/etc/init.d/10_net"
data = """
smolnetd
dnsd
dhcpd -b
"""
[[files]]
path = "/etc/init.d/30_console"
data = """
getty display:2/activate
getty debug: -J 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]] [[files]]
path = "/etc/pkg.d/50_redox" path = "/etc/pkg.d/50_redox"
data = "https://static.redox-os.org/pkg" data = "https://static.redox-os.org/pkg"
[[files]]
path = "/etc/redox-release"
data = "0.7.0"
[[files]]
path = "/etc/group"
data = """
root;0;root
user;1000;user
sudo;1;user
"""
[[files]]
path = "/etc/hostname"
data = """
redox
"""
[[files]]
path = "/usr/bin"
data = "../bin"
symlink = true
[[files]]
path = "/usr/games"
data = "../games"
symlink = true
[[files]]
path = "/usr/include"
data = "../include"
symlink = true
[[files]]
path = "/usr/lib"
data = "../lib"
symlink = true
[[files]]
path = "/usr/share"
data = "../share"
symlink = true
[[files]]
path = "/tmp"
data = ""
directory= true
# 0o1777
mode = 1023
[[files]]
path = "/dev/null"
data = "null:"
symlink = true
[[files]]
path = "/dev/random"
data = "rand:"
symlink = true
[[files]]
path = "/dev/urandom"
data = "rand:"
symlink = true
[[files]]
path = "/dev/zero"
data = "zero:"
symlink = true

View File

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

View File

@ -1,215 +0,0 @@
# This is the CI configuration file
# General settings
[general]
# Do not prompt if settings are not defined
prompt = false
# Package settings
[packages]
acid = {}
atk = {}
audiod = {}
autoconf = {}
automake = {}
bash = {}
binutils = {}
bootloader = {}
bootstrap = {}
ca-certificates = {}
cairo = {}
cairodemo = {}
#calculator = {}
cargo = {}
cleye = {}
#cmatrix = {} # needs ncursesw now
contain = {}
coreutils = {}
cosmic-edit = {}
cosmic-icons = {}
cosmic-text = {}
cpal = {}
curl = {}
dash = {}
diffutils = {}
dosbox = {}
drivers = {}
drivers-initfs = {}
duktape = {}
eduke32 = {}
escalated = {}
exampled = {}
expat = {}
extrautils = {}
#fal
#fd = {} # ctrlc-3.1.1
ffmpeg6 = {}
findutils = {}
fontconfig = {}
#freeciv = {}
freedoom = {}
#freeglut = {}
freepats = {}
freetype2 = {}
#friar = {} # mio patch
fribidi = {}
#game-2048 = {} # rustc-serialize
#gawk = {} # langinfo.h
gcc13 = {}
gdbserver = {}
#gdk-pixbuf = {} # shared-mime-info
gears = {}
generaluser-gs = {}
gettext = {}
gigalomania = {}
git = {}
glib = {}
glium = {}
glutin = {}
gnu-binutils = {}
gnu-grep = {}
gnu-make = {}
#gstreamer = {} # conflict with thread local errno
harfbuzz = {}
#hematite = {} # needs crate patches for redox-unix
init = {}
initfs = {}
installer = {}
installer-gui = {}
intel-one-mono = {}
ion = {}
ipcd = {}
#jansson = {} # needs config.sub update
kernel = {}
keyboard-sfx = {}
lci = {}
libc-bench = {}
libffi = {}
libgmp = {}
libiconv = {}
libjpeg = {}
libogg = {}
liborbital = {}
libpng = {}
libsodium = {}
libvorbis = {}
libxml2 = {}
llvm = {}
logd = {}
lua54 = {}
#mdp = {} # ncursesw
mednafen = {}
mesa = {}
mesa-glu = {}
mgba = {}
#miniserve = {} # actix
nano = {}
nasm = {}
#ncdu = {} # fails to link with ncurses
ncurses = {}
#ncursesw = {} # mkstemp configure hang
netdb = {}
netstack = {}
netsurf = {}
netutils = {}
neverball = {}
#newlib = {} # obsolete
#newlibtest = {} # obsolete
nghttp2 = {}
nushell = {}
openjazz = {}
openssl1 = {}
openttd = {}
openttd-opengfx = {}
openttd-openmsx = {}
openttd-opensfx = {}
orbclient = {}
orbdata = {}
orbital = {}
orbterm = {}
orbutils = {}
#orbutils-background = {} # needs recipe update
#orbutils-launcher = {} # needs recipe update
#orbutils-orblogin = {} # needs recipe update
osdemo = {}
#pango = {} # undefined references to std::__throw_system_error(int)
#pastel = {} # needs crate patches for redox-unix
patch = {}
#pathfinder = {} # servo-fontconfig
#pciids = {}
pcre = {}
perg = {}
periodictable = {}
#perl = {} # ctermid, tempnam, ttyname
pixelcannon = {}
pixman = {}
#pkgar = {} # uses virtual Cargo.toml, needs recipe update
pkg-config = {}
pkgutils = {}
pop-icon-theme = {}
#powerline = {} # dirs
prboom = {}
procedural-wallpapers-rs = {}
ptyd = {}
#python = {} # getaddrinfo
#qemu = {}
ramfs = {}
randd = {}
readline = {}
redoxerd = {}
redox-fatfs = {}
redoxfs = {}
redox-games = {}
redox-ssh = {}
relibc = {}
#relibc-tests = {} # madvise link error
resist = {}
#retroarch = {} # OS_TLSIndex not declared
ripgrep = {}
rodioplay = {}
rs-nes = {}
rust = {}
rust64 = {}
rust-cairo = {}
rust-cairo-demo = {}
rustual-boy = {}
schismtracker = {}
scummvm = {}
sdl-gfx = {}
#sdl-player = {} # wctype_t
sdl1 = {}
sdl1-image = {}
sdl1-mixer = {}
sdl1-ttf = {}
sdl2 = {}
sdl2-gears = {}
sdl2-image = {}
sdl2-mixer = {}
sdl2-ttf = {}
sed = {}
#servo = {} # some more crates to port
shared-mime-info = {}
shellharden = {}
shellstorm = {}
smith = {}
sodium = {}
sopwith = {}
#ssh = {}
strace = {}
syobonaction = {}
terminfo = {}
#termplay = {} # backtrace cannot find link.h
timidity = {}
ttf-hack = {}
userutils = {}
uutils = {}
#vice = {} # linker errors
vim = {}
vttest = {}
vvvvvv = {}
#webrender = {} # unwind
#wesnoth = {}
#winit = {} # tzset
xz = {}
zerod = {}
zlib = {}

View File

@ -1,97 +0,0 @@
##############################################################################
# Redox Demo Configuration #
# #
# This file defines the setup of the Redox Demo system. #
# #
# The "[packages]" section specifies what packages are installed in the #
# filesystem prior to booting the system. During build, these packages must #
# have a recipe defined in the config folder (see the Redox Book, #
# Chapter 5.1). The first group of packages is mandatory for the system to #
# function, although some items can be removed for special builds, #
# e.g. The Orbital GUI is not required for a headless server. #
# #
# Items in the "Developer Tools" and "Games" section are optional. You can #
# add your own programs here. #
# #
# The "[users]" section creates user id's and passwords. Each user will have #
# a home directory at boot. #
# #
# The "[[files]]" section contains files needed by the system. If you need #
# create a file, e.g. a config file for a program you are adding, you can do #
# it here. #
# #
##############################################################################
include = ["../desktop.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 1536
# Package settings
[packages]
# GUI Apps
cosmic-edit = {}
cosmic-files = {}
periodictable = {}
# GUI Data
cosmic-icons = {}
intel-one-mono = {}
pop-icon-theme = {}
shared-mime-info = {}
# Shell Apps
curl = {}
git = {}
gnu-grep = {}
ripgrep = {}
sodium = {}
vim = {}
# Games
dosbox = {}
freedoom = {}
neverball = {}
prboom = {}
redox-games = {}
sopwith = {}
syobonaction = {}
# Demos
acid = {}
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,41 +0,0 @@
# Default desktop configuration using contain
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 = """
audiod
orbital contain_orblogin launcher
"""
# Override console init to use contain
[[files]]
path = "/usr/lib/init.d/30_console"
data = """
getty --contain 2
getty --contain debug: -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,14 +0,0 @@
# Default desktop configuration
include = ["../desktop-minimal.toml"]
# Override the default settings here
# General settings
[general]
# Filesystem size in MiB
# filesystem_size = 1024
# Package settings
[packages]
# example = {}

View File

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

View File

@ -1,14 +0,0 @@
# Configuration for development, includes cargo and rustc
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,115 +0,0 @@
# Jeremy's configuration
include = ["../desktop.toml"]
# General settings
[general]
# Filesystem size in MiB
filesystem_size = 8192
# Package settings
[packages]
# apps
boxedwine = {}
cosmic-edit = {}
cosmic-files = {}
cosmic-term = {}
cosmic-text = {}
periodictable = {}
pixelcannon = {}
schismtracker = {}
sodium = {}
# cli
acid = {}
cleye = {}
ffmpeg6 = {}
gnu-grep = {}
lua54 = {}
nano = {}
nushell = {}
perg = {}
relibc-tests = {}
ripgrep = {}
sed = {}
shellharden = {}
xz = {}
# demos
cairodemo = {}
#cmatrix = {} # addwstr
cpal = {}
gears = {}
glium = {} # does not show anything
glutin = {}
hematite = {}
iced = {}
libcosmic = {}
orbclient = {}
osdemo = {} # does not show anything
pathfinder = {}
procedural-wallpapers-rs = {}
rodioplay = {}
rust-cairo = {}
rust-cairo-demo = {}
sdl2-gears = {}
vttest = {}
webrender = {}
winit = {}
# dev
autoconf = {}
automake = {}
#cargo = {} # openssl issues
#gcc13 = {} # libiberty errors
gnu-binutils = {}
gnu-make = {}
nasm = {}
patch = {}
pkg-config = {}
#rust = {} # takes too long to compile
rustpython = {}
# games
devilutionx = {}
dosbox = {}
eduke32 = {}
flycast = {}
freedoom = {}
gigalomania = {}
mednafen = {}
mgba = {}
neverball = {}
openjazz = {}
openjk = {}
openttd = {}
openttd-opengfx = {}
openttd-openmsx = {}
openttd-opensfx = {}
prboom = {}
redox-games = {}
#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 = {}
sopwith = {}
spacecadetpinball = {}
syobonaction = {}
#vice = {} # broken on new toolchain
vvvvvv = {}
# stuff
cosmic-icons = {}
freepats = {}
generaluser-gs = {}
intel-one-mono = {}
jeremy = {}
keyboard-sfx = {}
libc-bench = {}
noto-color-emoji = {}
pop-icon-theme = {}
shared-mime-info = {}
timidity = {}
ttf-hack = {}

View File

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

View File

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

View File

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

@ -1 +1 @@
Subproject commit d0378b5c485ef7943e744ebeda4ecc453c7cd7b7 Subproject commit c9e203a258b5e4733f2560a78c65d4b572a7042b

View File

@ -30,8 +30,8 @@ RUN set -ex; \
x86-64-unknown-redox-binutils \ x86-64-unknown-redox-binutils \
x86-64-unknown-redox-gcc \ x86-64-unknown-redox-gcc \
; \ ; \
cargo install xargo; \
cargo install cargo-config; \ cargo install cargo-config; \
cargo install just@1.16.0; \
apt-get autoremove -q -y; \ apt-get autoremove -q -y; \
apt-get clean -q -y; \ apt-get clean -q -y; \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*

1
filesystem.toml Symbolic link
View File

@ -0,0 +1 @@
config/desktop.toml

39
initfs.toml Normal file
View File

@ -0,0 +1,39 @@
# This is the default configuration file
# General settings
[general]
# Do not prompt if settings are not defined
prompt = false
# Package settings
[packages]
drivers-initfs = {}
init = {}
logd = {}
nulld = {}
#pciids = {}
ramfs = {}
randd = {}
redoxfs = {}
zerod = {}
[[files]]
path="/etc/init.rc"
data="""
export PATH /bin
export TMPDIR /tmp
nulld
zerod
randd
vesad T T G
logd debug: display:1
stdio log:
ps2d us
ramfs logging
acpid
pcid /etc/pcid/initfs.toml
redoxfs --uuid $REDOXFS_UUID file $REDOXFS_BLOCK
cd file:
export PATH file:/bin
run.d /etc/init.d
"""

@ -1 +1 @@
Subproject commit 1c30f4a3c1f55974aed694b478ff77c0552a1576 Subproject commit 0ed65d7d3dc0d9f1052833c90293a58473872581

1
isolinux Submodule

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

1
kernel Submodule

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

2
mk/bochs.mk Normal file
View File

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

39
mk/bootloader.mk Normal file
View File

@ -0,0 +1,39 @@
bootloader/build/$(BOOTLOADER_TARGET)/bootloader.bin: FORCE
env --unset=RUST_TARGET_PATH --unset=RUSTUP_TOOLCHAIN --unset=XARGO_RUST_SRC \
$(MAKE) -C bootloader build/$(BOOTLOADER_TARGET)/bootloader.bin TARGET=$(BOOTLOADER_TARGET)
build/bootloader.bin: bootloader/build/$(BOOTLOADER_TARGET)/bootloader.bin
mkdir -p build
cp -v $< $@
bootloader/build/$(BOOTLOADER_TARGET)/bootloader-live.bin: FORCE
env --unset=RUST_TARGET_PATH --unset=RUSTUP_TOOLCHAIN --unset=XARGO_RUST_SRC \
$(MAKE) -C bootloader build/$(BOOTLOADER_TARGET)/bootloader-live.bin TARGET=$(BOOTLOADER_TARGET)
build/bootloader-live.bin: bootloader/build/$(BOOTLOADER_TARGET)/bootloader-live.bin
mkdir -p build
cp -v $< $@
bootloader/build/$(EFI_TARGET)/bootloader.efi: FORCE
env --unset=RUST_TARGET_PATH --unset=RUSTUP_TOOLCHAIN --unset=XARGO_RUST_SRC \
$(MAKE) -C bootloader build/$(EFI_TARGET)/bootloader.efi TARGET=$(EFI_TARGET)
build/bootloader.efi: bootloader/build/$(EFI_TARGET)/bootloader.efi
mkdir -p build
cp -v $< $@
bootloader/build/$(EFI_TARGET)/bootloader-live.efi: FORCE
env --unset=RUST_TARGET_PATH --unset=RUSTUP_TOOLCHAIN --unset=XARGO_RUST_SRC \
$(MAKE) -C bootloader build/$(EFI_TARGET)/bootloader-live.efi TARGET=$(EFI_TARGET)
build/bootloader-live.efi: bootloader/build/$(EFI_TARGET)/bootloader-live.efi
mkdir -p build
cp -v $< $@
bootloader-coreboot/build/bootloader: build/kernel_coreboot
env --unset=RUST_TARGET_PATH --unset=RUSTUP_TOOLCHAIN --unset=XARGO_RUST_SRC \
$(MAKE) -C bootloader-coreboot clean build/bootloader KERNEL="$(ROOT)/$<"
build/coreboot.elf: bootloader-coreboot/build/bootloader
mkdir -p build
cp -v $< $@

View File

@ -1,42 +0,0 @@
IMG_TAG?=$(shell git describe --tags)
IMG_SEPARATOR?=_
IMG_DIR?=build/img/$(ARCH)
# CI image target - build desktop, server and demo 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) demo desktop server
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
desktop server demo: FORCE
rm -f "build/$(ARCH)/$@/harddrive.img" "build/$(ARCH)/$@/livedisk.iso"
$(MAKE) CONFIG_NAME=$@ build/$(ARCH)/$@/harddrive.img build/$(ARCH)/$@/livedisk.iso
cp "build/$(ARCH)/$@/harddrive.img" "$(IMG_DIR)/redox_$(@)$(IMG_SEPARATOR)$(IMG_TAG)_harddrive.img"
cp "build/$(ARCH)/$@/livedisk.iso" "$(IMG_DIR)/redox_$(@)$(IMG_SEPARATOR)$(IMG_TAG)_livedisk.iso"
# CI packaging target
ci-pkg: prefix FORCE
$(HOST_CARGO) build --manifest-path cookbook/Cargo.toml --release
$(HOST_CARGO) build --manifest-path installer/Cargo.toml --release
export PATH="$(PREFIX_PATH):$$PATH" && \
PACKAGES="$$($(INSTALLER) --list-packages -c config/$(ARCH)/ci.toml)" && \
cd cookbook && \
./fetch.sh "$${PACKAGES}" && \
./repo.sh $(REPO_NONSTOP) "$${PACKAGES}"
# CI toolchain
ci-toolchain: FORCE
$(MAKE) PREFIX_BINARY=0 \
"prefix/$(TARGET)/gcc-install.tar.gz" \
"prefix/$(TARGET)/relibc-install.tar.gz" \
"prefix/$(TARGET)/rust-install.tar.gz"
rm -rf "build/toolchain/$(TARGET)"
mkdir -p "build/toolchain/$(TARGET)"
cp "prefix/$(TARGET)/gcc-install.tar.gz" "build/toolchain/$(TARGET)/gcc-install.tar.gz"
cp "prefix/$(TARGET)/relibc-install.tar.gz" "build/toolchain/$(TARGET)/relibc-install.tar.gz"
cp "prefix/$(TARGET)/rust-install.tar.gz" "build/toolchain/$(TARGET)/rust-install.tar.gz"
cd "build/toolchain/$(TARGET)" && sha256sum -b * > SHA256SUM

View File

@ -1,89 +1,69 @@
-include .config -include .config
HOST_ARCH?=$(shell uname -m)
# Configuration # Configuration
## Architecture to build Redox for (aarch64, i686, or x86_64). Defaults to a host one ## Architecture to build Redox for (aarch64 or x86_64)
ARCH?=$(HOST_ARCH) ARCH?=x86_64
## Sub-device type for aarch64 if needed ## Flags to pass to the installer (empty to download binary packages)
BOARD?= INSTALLER_FLAGS?=--cookbook=cookbook
## Enable to use binary prefix (much faster) ## Enabled to use binary prefix (much faster)
PREFIX_BINARY?=1 PREFIX_BINARY?=1
## Enable to use binary packages (much faster) ## Filesystem size in MB (256 is the default)
REPO_BINARY?=0 FILESYSTEM_SIZE?=256
## Name of the configuration to include in the image name e.g. desktop or server
CONFIG_NAME?=desktop
## Ignore errors when building the repo, attempt to build every package
## REPO_NONSTOP?=--nonstop
REPO_NONSTOP?=
## Select filesystem config
ifeq ($(BOARD),)
FILESYSTEM_CONFIG?=config/$(ARCH)/$(CONFIG_NAME).toml
else
FILESYSTEM_CONFIG?=config/$(ARCH)/$(BOARD)/$(CONFIG_NAME).toml
endif
## Filesystem size in MB (default comes from filesystem_size in the FILESYSTEM_CONFIG)
FILESYSTEM_SIZE?=$(shell cargo run --release --manifest-path installer/Cargo.toml -- --filesystem-size -c $(FILESYSTEM_CONFIG))
## Flags to pass to redoxfs-mkfs. Add --encrypt to set up disk encryption ## Flags to pass to redoxfs-mkfs. Add --encrypt to set up disk encryption
REDOXFS_MKFS_FLAGS?= REDOXFS_MKFS_FLAGS?=
## Set to 1 to enable Podman build, any other value will disable it
PODMAN_BUILD?=0
## The containerfile to use for the Podman base image
CONTAINERFILE?=podman/redox-base-containerfile
# Per host variables # Per host variables
HOST_CARGO=env -u RUSTUP_TOOLCHAIN cargo
export NPROC=nproc
export REDOX_MAKE=make
HOST_TARGET := $(shell env -u RUSTUP_TOOLCHAIN rustc -vV | grep host | cut -d: -f2 | tr -d " ")
UNAME := $(shell uname) UNAME := $(shell uname)
ifeq ($(UNAME),Darwin) ifeq ($(UNAME),Darwin)
FUMOUNT=umount FUMOUNT=sudo umount
export NPROC=sysctl -n hw.ncpu export NPROC=sysctl -n hw.ncpu
export REDOX_MAKE=make
PREFIX_BINARY=0
VB_AUDIO=coreaudio VB_AUDIO=coreaudio
VBM=/Applications/VirtualBox.app/Contents/MacOS/VBoxManage VBM=/Applications/VirtualBox.app/Contents/MacOS/VBoxManage
HOST_TARGET ?= $(ARCH)-apple-darwin
else ifeq ($(UNAME),FreeBSD) else ifeq ($(UNAME),FreeBSD)
FUMOUNT=sudo umount FUMOUNT=sudo umount
export NPROC=sysctl -n hw.ncpu
export REDOX_MAKE=gmake export REDOX_MAKE=gmake
VB_AUDIO=pulse # To check, will probably be OSS on most setups PREFIX_BINARY=0
VB_AUDIO=pulse # To check, will probaly be OSS on most setups
VBM=VBoxManage VBM=VBoxManage
else HOST_TARGET ?= $(ARCH)-unknown-freebsd
# Detect which version of the fusermount binary is available.
ifneq (, $(shell which fusermount3))
FUMOUNT=fusermount3 -u
else else
FUMOUNT=fusermount -u FUMOUNT=fusermount -u
endif export NPROC=nproc
export REDOX_MAKE=make
VB_AUDIO=pulse VB_AUDIO=pulse
VBM=VBoxManage VBM=VBoxManage
endif HOST_TARGET ?= $(ARCH)-unknown-linux-gnu
ifneq ($(UNAME),Linux)
PREFIX_BINARY=0
endif
ifneq ($(HOST_ARCH),x86_64)
PREFIX_BINARY=0
endif endif
# Automatic variables # Automatic variables
ROOT=$(CURDIR) ROOT=$(CURDIR)
export RUST_COMPILER_RT_ROOT=$(ROOT)/rust/src/llvm-project/compiler-rt export RUST_COMPILER_RT_ROOT=$(ROOT)/rust/src/llvm-project/compiler-rt
export RUST_TARGET_PATH=$(ROOT)/kernel/targets
export XARGO_RUST_SRC=$(ROOT)/rust/src
## Kernel variables
KTARGET=$(ARCH)-unknown-kernel
KBUILD=build/kernel
## Userspace variables ## Userspace variables
export TARGET=$(ARCH)-unknown-redox export TARGET=$(ARCH)-unknown-redox
BUILD=build/$(ARCH)/$(CONFIG_NAME) BUILD=build/userspace
INSTALLER=installer/target/release/redox_installer INSTALLER=\
ifeq ($(REPO_BINARY),0) export PATH="$(PREFIX_PATH):$$PATH" && \
INSTALLER+=--cookbook=cookbook installer/target/release/redox_installer $(INSTALLER_FLAGS)
REPO_TAG=$(BUILD)/repo.tag
else
INSTALLER+=--cookbook=cookbook --repo-binary
REPO_TAG=$(BUILD)/repo.tag
endif
FSTOOLS_TAG=build/fstools.tag ## Bootloader variables
export BOARD ifeq ($(ARCH),x86_64)
BOOTLOADER_TARGET=x86-unknown-none
else
BOOTLOADER_TARGET=$(ARCH)-unknown-none
endif
EFI_TARGET=$(ARCH)-unknown-uefi
PARTED=/sbin/parted
## Cross compiler variables ## Cross compiler variables
AR=$(TARGET)-gcc-ar AR=$(TARGET)-gcc-ar
@ -102,11 +82,3 @@ STRIP=$(TARGET)-strip
export AR_$(subst -,_,$(TARGET))=$(TARGET)-ar export AR_$(subst -,_,$(TARGET))=$(TARGET)-ar
export CC_$(subst -,_,$(TARGET))=$(TARGET)-gcc export CC_$(subst -,_,$(TARGET))=$(TARGET)-gcc
export CXX_$(subst -,_,$(TARGET))=$(TARGET)-g++ export CXX_$(subst -,_,$(TARGET))=$(TARGET)-g++
## If Podman is being used, a container is required
ifeq ($(PODMAN_BUILD),1)
CONTAINER_TAG=build/container.tag
else
CONTAINER_TAG=
endif

View File

@ -1,27 +1,14 @@
# Dependencies # Dependencies
# Don't check for Rust/Cargo if you will be using Podman
ifneq ($(PODMAN_BUILD),1)
ifeq ($(shell which rustup),) ifeq ($(shell which rustup),)
$(error rustup not found, install from "https://rustup.rs/") $(error rustup not found, install from "https://rustup.rs/")
endif endif
ifeq ($(shell which cbindgen),)
$(error cbindgen not found, install from crates.io or from your package manager)
endif
ifeq ($(shell which nasm),) ifeq ($(shell which nasm),)
$(error nasm not found, install from your package manager) $(error nasm not found, install from your package manager)
endif endif
ifeq ($(shell which just),)
$(error just not found, install from crates.io or from your package manager)
endif
CARGO_CONFIG_VERSION=0.1.1 CARGO_CONFIG_VERSION=0.1.1
ifeq ($(shell env -u RUSTUP_TOOLCHAIN cargo install --list | grep '^cargo-config v$(CARGO_CONFIG_VERSION):$$'),) ifeq ($(shell env -u RUSTUP_TOOLCHAIN cargo install --list | grep '^cargo-config v$(CARGO_CONFIG_VERSION):$$'),)
$(error cargo-config $(CARGO_CONFIG_VERSION) not found, run "cargo install --force --version $(CARGO_CONFIG_VERSION) cargo-config") $(error cargo-config $(CARGO_CONFIG_VERSION) not found, run "cargo install --force --version $(CARGO_CONFIG_VERSION) cargo-config")
endif endif
endif

View File

@ -1,50 +1,79 @@
$(BUILD)/harddrive.img: $(FSTOOLS_TAG) $(REPO_TAG) build/harddrive.bin: build/bootloader.bin build/filesystem.bin
mkdir -p $(BUILD) dd if=/dev/zero of=$@.partial bs=1M count=$$(expr $$(du -m build/filesystem.bin | cut -f1) + 2)
rm -rf $@ $@.partial $(PARTED) -s -a minimal $@.partial mklabel msdos
-$(FUMOUNT) /tmp/redox_installer || true $(PARTED) -s -a minimal $@.partial mkpart primary 2048s $$(expr $$(du -m build/filesystem.bin | cut -f1) \* 2048 + 2048)s
truncate -s "$(FILESYSTEM_SIZE)m" $@.partial dd if=$< of=$@.partial bs=1 count=446 conv=notrunc
umask 002 && $(INSTALLER) -c $(FILESYSTEM_CONFIG) $@.partial dd if=$< of=$@.partial bs=512 skip=1 seek=1 conv=notrunc
dd if=build/filesystem.bin of=$@.partial bs=1M seek=1 conv=notrunc
mv $@.partial $@ mv $@.partial $@
$(BUILD)/livedisk.iso: $(FSTOOLS_TAG) $(REPO_TAG) build/livedisk.bin: build/bootloader-live.bin build/filesystem.bin
mkdir -p $(BUILD) dd if=/dev/zero of=$@.partial bs=1M count=$$(expr $$(du -m build/filesystem.bin | cut -f1) + 2)
rm -rf $@ $@.partial $(PARTED) -s -a minimal $@.partial mklabel msdos
-$(FUMOUNT) /tmp/redox_installer || true $(PARTED) -s -a minimal $@.partial mkpart primary 2048s $$(expr $$(du -m build/filesystem.bin | cut -f1) \* 2048 + 2048)s
truncate -s "$(FILESYSTEM_SIZE)m" $@.partial dd if=$< of=$@.partial bs=1 count=446 conv=notrunc
umask 002 && $(INSTALLER) -c $(FILESYSTEM_CONFIG) --live $@.partial dd if=$< of=$@.partial bs=512 skip=1 seek=1 conv=notrunc
dd if=build/filesystem.bin of=$@.partial bs=1M seek=1 conv=notrunc
mv $@.partial $@ mv $@.partial $@
$(BUILD)/filesystem.img: $(FSTOOLS_TAG) $(REPO_TAG) build/livedisk.iso: build/livedisk.bin.gz
mkdir -p $(BUILD) rm -rf build/iso/
-$(FUMOUNT) $(BUILD)/filesystem/ || true mkdir -p build/iso/
rm -rf $@ $@.partial $(BUILD)/filesystem/ cp -RL isolinux build/iso/
-$(FUMOUNT) /tmp/redox_installer || true cp $< build/iso/livedisk.gz
truncate -s "$(FILESYSTEM_SIZE)m" $@.partial genisoimage -o $@ -b isolinux/isolinux.bin -c isolinux/boot.cat \
redoxfs/target/release/redoxfs-mkfs $(REDOXFS_MKFS_FLAGS) $@.partial -no-emul-boot -boot-load-size 4 -boot-info-table \
mkdir -p $(BUILD)/filesystem/ build/iso/
redoxfs/target/release/redoxfs $@.partial $(BUILD)/filesystem/ isohybrid $@
sleep 1
pgrep redoxfs
umask 002 && $(INSTALLER) -c $(FILESYSTEM_CONFIG) $(BUILD)/filesystem/
sync
-$(FUMOUNT) $(BUILD)/filesystem/ || true
rm -rf $(BUILD)/filesystem/
mv $@.partial $@
mount: $(FSTOOLS_TAG) FORCE build/harddrive-efi.bin: build/bootloader.efi build/filesystem.bin
mkdir -p $(BUILD)/filesystem/ # TODO: Validate the correctness of this \
redoxfs/target/release/redoxfs $(BUILD)/harddrive.img $(BUILD)/filesystem/ # Populate an EFI system partition \
sleep 2 dd if=/dev/zero of=$@.esp bs=1048576 count=$$(expr $$(du -m $< | cut -f1) + 1) && \
pgrep redoxfs mkfs.vfat $@.esp && \
mmd -i $@.esp efi && \
mmd -i $@.esp efi/boot && \
mcopy -i $@.esp $< ::efi/boot/bootx64.efi && \
# Create the disk \
dd if=/dev/zero of=$@ bs=1048576 count=$$(expr $$(du -m $< | cut -f1) + 2 + $$(du -m build/filesystem.bin | cut -f1)) && \
# Create partition table \
$(PARTED) -s -a minimal $@ mklabel gpt && \
efi_disk_size=$$(du -m $< | cut -f1) && \
efi_disk_blkcount=$$(expr $$efi_disk_size \* $$(expr 1048576 / 512)) && \
efi_end=$$(expr 2048 + $$efi_disk_blkcount) && \
efi_last=$$(expr $$efi_end - 1) && \
$(PARTED) -s -a minimal $@ mkpart EFI fat32 2048s "$${efi_last}s" && \
fs_disk_size=$$(du -m build/filesystem.bin | cut -f1) && \
fs_disk_blkcount=$$(expr $$fs_disk_size \* $$(expr 1048576 / 512)) && \
$(PARTED) -s -a minimal $@ mkpart redox ext4 "$${efi_end}s" $$(expr $$efi_end + $$fs_disk_blkcount)s && \
$(PARTED) -s -a minimal $@ set 1 boot on && \
$(PARTED) -s -a minimal $@ set 1 esp on && \
# Write the partitions \
dd if=$@.esp bs=512 seek=2048 conv=notrunc count=$$efi_disk_blkcount of=$@ && \
dd if=build/filesystem.bin seek=$$efi_end bs=512 conv=notrunc of=$@ count=$$fs_disk_blkcount
mount_extra: $(FSTOOLS_TAG) FORCE build/livedisk-efi.bin: build/bootloader-live.efi build/filesystem.bin
mkdir -p $(BUILD)/filesystem/ # TODO: Validate the correctness of this \
redoxfs/target/release/redoxfs $(BUILD)/extra.img $(BUILD)/filesystem/ # Populate an EFI system partition \
sleep 2 dd if=/dev/zero of=$@.esp bs=1048576 count=$$(expr $$(du -m $< | cut -f1) + 1) && \
pgrep redoxfs mkfs.vfat $@.esp && \
mmd -i $@.esp efi && \
unmount: FORCE mmd -i $@.esp efi/boot && \
sync mcopy -i $@.esp $< ::efi/boot/bootx64.efi && \
-$(FUMOUNT) $(BUILD)/filesystem/ || true # Create the disk \
rm -rf $(BUILD)/filesystem/ dd if=/dev/zero of=$@ bs=1048576 count=$$(expr $$(du -m $< | cut -f1) + 2 + $$(du -m build/filesystem.bin | cut -f1)) && \
-$(FUMOUNT) /tmp/redox_installer || true # Create partition table \
$(PARTED) -s -a minimal $@ mklabel gpt && \
efi_disk_size=$$(du -m $< | cut -f1) && \
efi_disk_blkcount=$$(expr $$efi_disk_size \* $$(expr 1048576 / 512)) && \
efi_end=$$(expr 2048 + $$efi_disk_blkcount) && \
efi_last=$$(expr $$efi_end - 1) && \
$(PARTED) -s -a minimal $@ mkpart EFI fat32 2048s "$${efi_last}s" && \
fs_disk_size=$$(du -m build/filesystem.bin | cut -f1) && \
fs_disk_blkcount=$$(expr $$fs_disk_size \* $$(expr 1048576 / 512)) && \
$(PARTED) -s -a minimal $@ mkpart redox ext4 "$${efi_end}s" $$(expr $$efi_end + $$fs_disk_blkcount)s && \
$(PARTED) -s -a minimal $@ set 1 boot on && \
$(PARTED) -s -a minimal $@ set 1 esp on && \
# Write the partitions \
dd if=$@.esp bs=512 seek=2048 conv=notrunc count=$$efi_disk_blkcount of=$@ && \
dd if=build/filesystem.bin seek=$$efi_end bs=512 conv=notrunc of=$@ count=$$fs_disk_blkcount

47
mk/filesystem.mk Normal file
View File

@ -0,0 +1,47 @@
build/filesystem.bin: prefix filesystem.toml build/bootloader.bin build/kernel build/initfs.img
cargo build --manifest-path cookbook/Cargo.toml --release
cargo build --manifest-path installer/Cargo.toml --release
cargo build --manifest-path redoxfs/Cargo.toml --release
-$(FUMOUNT) build/filesystem/ || true
rm -rf $@ $@.partial build/filesystem/
fallocate --posix --length "$(FILESYSTEM_SIZE)MiB" $@.partial
cargo run --release \
--manifest-path redoxfs/Cargo.toml \
--bin redoxfs-mkfs \
-- $(REDOXFS_MKFS_FLAGS) $@.partial
mkdir -p build/filesystem/
redoxfs/target/release/redoxfs $@.partial build/filesystem/
sleep 2
pgrep redoxfs
cp -v filesystem.toml build/filesystem/filesystem.toml
cp -v build/bootloader.bin build/filesystem/bootloader
cp -v build/kernel build/filesystem/kernel
mkdir -v build/filesystem/pkg
cp -v cookbook/build/id_ed25519.pub.toml build/filesystem/pkg/id_ed25519.pub.toml
#TODO cp -r $(ROOT)/$(PREFIX_INSTALL)/$(TARGET)/include build/filesystem/include
#TODO cp -r $(ROOT)/$(PREFIX_INSTALL)/$(TARGET)/lib build/filesystem/lib
$(INSTALLER) -c filesystem.toml build/filesystem/
cp build/initfs.img build/filesystem/initfs
sync
-$(FUMOUNT) build/filesystem/ || true
rm -rf build/filesystem/
mv $@.partial $@
mount: FORCE
mkdir -p build/filesystem/
cargo build --manifest-path redoxfs/Cargo.toml --release --bin redoxfs
redoxfs/target/release/redoxfs build/harddrive.bin build/filesystem/
sleep 2
pgrep redoxfs
mount_extra: FORCE
mkdir -p build/filesystem/
cargo build --manifest-path redoxfs/Cargo.toml --release --bin redoxfs
redoxfs/target/release/redoxfs build/extra.bin build/filesystem/
sleep 2
pgrep redoxfs
unmount: FORCE
sync
-$(FUMOUNT) build/filesystem/ || true
rm -rf build/filesystem/

View File

@ -1,22 +0,0 @@
fstools: $(FSTOOLS_TAG)
$(FSTOOLS_TAG): cookbook installer redoxfs $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) $(MAKE) $@
else
$(HOST_CARGO) build --manifest-path cookbook/Cargo.toml --release
$(HOST_CARGO) build --manifest-path installer/Cargo.toml --release
$(HOST_CARGO) build --manifest-path redoxfs/Cargo.toml --release --bin redoxfs --bin redoxfs-mkfs
mkdir -p build
touch $@
endif
fstools_clean: FORCE $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) $(MAKE) $@
else
$(HOST_CARGO) clean --manifest-path cookbook/Cargo.toml
$(HOST_CARGO) clean --manifest-path installer/Cargo.toml
$(HOST_CARGO) clean --manifest-path redoxfs/Cargo.toml
rm -f $(FSTOOLS_TAG)
endif

16
mk/initfs.mk Normal file
View File

@ -0,0 +1,16 @@
INITFS_RM_BINS=\
redoxfs-ar \
redoxfs-mkfs
build/initfs.img: initfs.toml prefix
cargo build --manifest-path cookbook/Cargo.toml --release
cargo build --manifest-path installer/Cargo.toml --release
rm -rf build/initfs
mkdir -p build/initfs
$(INSTALLER) -c $< build/initfs/
#TODO: HACK FOR SMALLER INITFS, FIX IN PACKAGING
rm -rf build/initfs/pkg
for bin in $(INITFS_RM_BINS); do \
rm -f build/initfs/bin/$$bin; \
done
cargo run --manifest-path redox-initfs/tools/Cargo.toml --bin redox-initfs-ar -- build/initfs -o $@

10
mk/kernel.mk Normal file
View File

@ -0,0 +1,10 @@
build/libkernel.a: kernel/Cargo.lock kernel/Cargo.toml kernel/src/* kernel/src/*/* kernel/src/*/*/* kernel/src/*/*/*/*
export PATH="$(PREFIX_PATH):$$PATH" && \
cd kernel && \
cargo rustc --lib --target=$(ROOT)/kernel/targets/$(KTARGET).json --release -- -C soft-float -C debuginfo=2 -C lto --emit link=../$@
build/kernel: kernel/linkers/$(ARCH).ld mk/kernel_ld.sh build/libkernel.a
export PATH="$(PREFIX_PATH):$$PATH" && \
$(ROOT)/mk/kernel_ld.sh $(LD) --gc-sections -z max-page-size=0x1000 -T $< -o $@.all build/libkernel.a && \
$(OBJCOPY) --only-keep-debug $@.all $@.sym && \
$(OBJCOPY) --strip-debug $@.all $@

17
mk/kernel_ld.sh Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -ex
LD="$1"
shift
if "${LD}" -z use-gs-for-tls 2>&1 |
grep "warning: -z use-gs-for-tls ignored" &> /dev/null
then
echo "Please update your prefix:" >&2
echo " rm -rf prefix" >&2
echo " make prefix" >&2
exit 1
fi
exec "${LD}" -z use-gs-for-tls "$@"

View File

@ -1,65 +0,0 @@
##############################################
# podman.mk - Use Podman to build components #
##############################################
# 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
## Podman Home Directory
PODMAN_HOME?=$(ROOT)/build/podman
## Podman command with its many arguments
PODMAN_VOLUMES?=--volume $(ROOT):$(CONTAINER_WORKDIR):Z --volume $(PODMAN_HOME):/home:Z
PODMAN_ENV?=--env PATH=/home/poduser/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin --env PODMAN_BUILD=0
PODMAN_CONFIG?=--env ARCH=$(ARCH) --env CONFIG_NAME=$(CONFIG_NAME) --env FILESYSTEM_CONFIG=$(FILESYSTEM_CONFIG)
PODMAN_OPTIONS?=--rm --workdir $(CONTAINER_WORKDIR) --userns keep-id --user `id -u` --interactive --tty --env TERM=$(TERM)
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 $(PODMAN_VOLUMES) $(PODMAN_OPTIONS) $(PODMAN_ENV) --tty $(IMAGE_TAG) bash
else
@echo PODMAN_BUILD=$(PODMAN_BUILD), please set it to 1 in mk/config.mk
endif
container_su: FORCE
podman exec --user=0 --latest --interactive --tty bash
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 build/container.tag
@echo "If podman_home dir cannot be removed, remove with \"sudo rm\"."
-rm -rf $(PODMAN_HOME) || true
-podman image rm --force $(IMAGE_TAG) || true
mkdir -p $(PODMAN_HOME)
@echo "Building Podman image. This may take some time."
sed s/_UID_/`id -u`/ $(CONTAINERFILE) | podman build --file - $(PODMAN_VOLUMES) --tag $(IMAGE_TAG)
@echo "Mapping Podman user space. Please wait."
$(PODMAN_RUN) bash -e podman/rustinstall.sh
mkdir -p build
touch $@
@echo "Podman ready!"
else
@echo PODMAN_BUILD=$(PODMAN_BUILD), container not required.
endif

View File

@ -3,16 +3,10 @@ PREFIX=prefix/$(TARGET)
PREFIX_INSTALL=$(PREFIX)/relibc-install PREFIX_INSTALL=$(PREFIX)/relibc-install
PREFIX_PATH=$(ROOT)/$(PREFIX_INSTALL)/bin PREFIX_PATH=$(ROOT)/$(PREFIX_INSTALL)/bin
BINUTILS_BRANCH=redox-2.41
GCC_BRANCH=redox-13.2.0
export PREFIX_RUSTFLAGS=-L $(ROOT)/$(PREFIX_INSTALL)/$(TARGET)/lib export PREFIX_RUSTFLAGS=-L $(ROOT)/$(PREFIX_INSTALL)/$(TARGET)/lib
export RUSTUP_TOOLCHAIN=$(ROOT)/$(PREFIX_INSTALL) export RUSTUP_TOOLCHAIN=$(ROOT)/$(PREFIX_INSTALL)
export REDOXER_TOOLCHAIN=$(RUSTUP_TOOLCHAIN) export REDOXER_TOOLCHAIN=$(RUSTUP_TOOLCHAIN)
export CC=
export CXX=
prefix: $(PREFIX_INSTALL) prefix: $(PREFIX_INSTALL)
PREFIX_STRIP=\ PREFIX_STRIP=\
@ -22,31 +16,23 @@ PREFIX_STRIP=\
-exec strip --strip-unneeded {} ';' \ -exec strip --strip-unneeded {} ';' \
2> /dev/null 2> /dev/null
$(PREFIX)/relibc: $(ROOT)/relibc $(PREFIX)/relibc-install: $(ROOT)/relibc | $(PREFIX)/rust-install
mkdir -p "$(@D)"
rm -rf "$@.partial" "$@"
cp -r "$^" "$@.partial"
mv "$@.partial" "$@"
$(PREFIX)/relibc-install: $(PREFIX)/relibc | $(PREFIX)/rust-install $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) $(MAKE) $@
else
rm -rf "$@.partial" "$@" rm -rf "$@.partial" "$@"
cp -r "$(PREFIX)/rust-install" "$@.partial" cp -r "$(PREFIX)/rust-install" "$@.partial"
rm -rf "$@.partial/$(TARGET)/include/"* rm -rf "$@.partial/$(TARGET)/include/"*
cp -r "$(PREFIX)/rust-install/$(TARGET)/include/c++" "$@.partial/$(TARGET)/include/c++" cp -r "$(PREFIX)/rust-install/$(TARGET)/include/c++" "$@.partial/$(TARGET)/include/c++"
cp -r "$(PREFIX)/rust-install/lib/rustlib/$(HOST_TARGET)/lib/" "$@.partial/lib/rustlib/$(HOST_TARGET)/" cp -r "$(PREFIX)/rust-install/lib/rustlib/$(HOST_TARGET)/lib/" "$@.partial/lib/rustlib/$(HOST_TARGET)/"
rm -rf $@.partial/lib/rustlib/src
mkdir $@.partial/lib/rustlib/src
ln -s $(ROOT)/rust $@.partial/lib/rustlib/src
cd "$<" && \ cd "$<" && \
export PATH="$(ROOT)/$@.partial/bin:$$PATH" && \ export PATH="$(ROOT)/$@.partial/bin:$$PATH" && \
export CARGO="env -u CARGO cargo" && \ export CARGO="env -u CARGO cargo" && \
$(MAKE) clean && \
$(MAKE) -j `$(NPROC)` all && \ $(MAKE) -j `$(NPROC)` all && \
$(MAKE) -j `$(NPROC)` install DESTDIR="$(ROOT)/$@.partial/$(TARGET)" $(MAKE) -j `$(NPROC)` install DESTDIR="$(ROOT)/$@.partial/$(TARGET)"
cd "$@.partial" && $(PREFIX_STRIP) cd "$@.partial" && $(PREFIX_STRIP)
touch "$@.partial" touch "$@.partial"
mv "$@.partial" "$@" mv "$@.partial" "$@"
endif
$(PREFIX)/relibc-install.tar.gz: $(PREFIX)/relibc-install $(PREFIX)/relibc-install.tar.gz: $(PREFIX)/relibc-install
tar \ tar \
@ -73,32 +59,25 @@ $(PREFIX)/rust-install: $(PREFIX)/rust-install.tar.gz
else else
$(ROOT)/rust:
git submodule update --init --recursive --checkout rust
PREFIX_BASE_INSTALL=$(PREFIX)/rust-freestanding-install PREFIX_BASE_INSTALL=$(PREFIX)/rust-freestanding-install
PREFIX_FREESTANDING_INSTALL=$(PREFIX)/gcc-freestanding-install PREFIX_FREESTANDING_INSTALL=$(PREFIX)/gcc-freestanding-install
PREFIX_BASE_PATH=$(ROOT)/$(PREFIX_BASE_INSTALL)/bin PREFIX_BASE_PATH=$(ROOT)/$(PREFIX_BASE_INSTALL)/bin
PREFIX_FREESTANDING_PATH=$(ROOT)/$(PREFIX_FREESTANDING_INSTALL)/bin PREFIX_FREESTANDING_PATH=$(ROOT)/$(PREFIX_FREESTANDING_INSTALL)/bin
$(PREFIX)/binutils-$(BINUTILS_BRANCH).tar.bz2: $(PREFIX)/binutils.tar.bz2:
mkdir -p "$(@D)" mkdir -p "$(@D)"
rm -fv $(PREFIX)/binutils*.tar.bz2* wget -O $@.partial "https://gitlab.redox-os.org/redox-os/binutils-gdb/-/archive/redox/binutils-gdb-redox.tar.bz2"
wget -O $@.partial "https://gitlab.redox-os.org/redox-os/binutils-gdb/-/archive/$(BINUTILS_BRANCH)/binutils-gdb-$(BINUTILS_BRANCH).tar.bz2"
mv $@.partial $@ mv $@.partial $@
$(PREFIX)/binutils: $(PREFIX)/binutils-$(BINUTILS_BRANCH).tar.bz2 $(PREFIX)/binutils: $(PREFIX)/binutils.tar.bz2
rm -rf "$@.partial" "$@" rm -rf "$@.partial" "$@"
mkdir -p "$@.partial" mkdir -p "$@.partial"
tar --extract --file "$<" --directory "$@.partial" --strip-components=1 tar --extract --file "$<" --directory "$@.partial" --strip-components=1
touch "$@.partial" touch "$@.partial"
mv "$@.partial" "$@" mv "$@.partial" "$@"
$(PREFIX)/binutils-install: $(PREFIX)/binutils $(CONTAINER_TAG) $(PREFIX)/binutils-install: $(PREFIX)/binutils
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) $(MAKE) $@
else
rm -rf "$<-build" "$@.partial" "$@" rm -rf "$<-build" "$@.partial" "$@"
mkdir -p "$<-build" "$@.partial" mkdir -p "$<-build" "$@.partial"
cd "$<-build" && \ cd "$<-build" && \
@ -114,25 +93,20 @@ else
cd "$@.partial" && $(PREFIX_STRIP) cd "$@.partial" && $(PREFIX_STRIP)
touch "$@.partial" touch "$@.partial"
mv "$@.partial" "$@" mv "$@.partial" "$@"
endif
$(PREFIX)/gcc-$(GCC_BRANCH).tar.bz2: $(PREFIX)/gcc.tar.bz2:
mkdir -p "$(@D)" mkdir -p "$(@D)"
rm -fv $(PREFIX)/gcc*.tar.bz2* wget -O $@.partial "https://gitlab.redox-os.org/redox-os/gcc/-/archive/redox/gcc-redox.tar.bz2"
wget -O $@.partial "https://gitlab.redox-os.org/redox-os/gcc/-/archive/$(GCC_BRANCH)/gcc-$(GCC_BRANCH).tar.bz2"
mv "$@.partial" "$@" mv "$@.partial" "$@"
$(PREFIX)/gcc: $(PREFIX)/gcc-$(GCC_BRANCH).tar.bz2 $(PREFIX)/gcc: $(PREFIX)/gcc.tar.bz2
mkdir -p "$@.partial" mkdir -p "$@.partial"
tar --extract --file "$<" --directory "$@.partial" --strip-components=1 tar --extract --file "$<" --directory "$@.partial" --strip-components=1
cd "$@.partial" && ./contrib/download_prerequisites cd "$@.partial" && ./contrib/download_prerequisites
touch "$@.partial" touch "$@.partial"
mv "$@.partial" "$@" mv "$@.partial" "$@"
$(PREFIX)/gcc-freestanding-install: $(PREFIX)/gcc | $(PREFIX)/binutils-install $(CONTAINER_TAG) $(PREFIX)/gcc-freestanding-install: $(PREFIX)/gcc | $(PREFIX)/binutils-install
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) $(MAKE) $@
else
rm -rf "$<-freestanding-build" "$@.partial" "$@" rm -rf "$<-freestanding-build" "$@.partial" "$@"
mkdir -p "$<-freestanding-build" mkdir -p "$<-freestanding-build"
cp -r "$(PREFIX)/binutils-install" "$@.partial" cp -r "$(PREFIX)/binutils-install" "$@.partial"
@ -152,12 +126,8 @@ else
cd "$@.partial" && $(PREFIX_STRIP) cd "$@.partial" && $(PREFIX_STRIP)
touch "$@.partial" touch "$@.partial"
mv "$@.partial" "$@" mv "$@.partial" "$@"
endif
$(PREFIX)/rust-freestanding-install: $(ROOT)/rust | $(PREFIX)/binutils-install $(CONTAINER_TAG) $(PREFIX)/rust-freestanding-install: $(ROOT)/rust | $(PREFIX)/binutils-install
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) $(MAKE) $@
else
rm -rf "$(PREFIX)/rust-freestanding-build" "$@.partial" "$@" rm -rf "$(PREFIX)/rust-freestanding-build" "$@.partial" "$@"
mkdir -p "$(PREFIX)/rust-freestanding-build" mkdir -p "$(PREFIX)/rust-freestanding-build"
cp -r "$(PREFIX)/binutils-install" "$@.partial" cp -r "$(PREFIX)/binutils-install" "$@.partial"
@ -166,47 +136,37 @@ else
"$</configure" \ "$</configure" \
--prefix="/" \ --prefix="/" \
--disable-docs \ --disable-docs \
--disable-download-ci-llvm \
--enable-cargo-native-static \ --enable-cargo-native-static \
--enable-extended \ --enable-extended \
--enable-lld \
--enable-llvm-static-stdcpp \ --enable-llvm-static-stdcpp \
--set 'llvm.targets=AArch64;X86' \ --set 'llvm.targets=AArch64;X86' \
--set 'llvm.experimental-targets=' \ --set 'llvm.experimental-targets=' \
--tools=cargo,src \ --tools=cargo \
&& \ && \
$(MAKE) -j `$(NPROC)` && \ $(MAKE) -j `$(NPROC)` && \
$(MAKE) -j `$(NPROC)` install DESTDIR="$(ROOT)/$@.partial" $(MAKE) -j `$(NPROC)` install DESTDIR="$(ROOT)/$@.partial"
rm -rf "$(PREFIX)/rust-freestanding-build" rm -rf "$(PREFIX)/rust-freestanding-build"
mkdir -p "$@.partial/lib/rustlib/$(HOST_TARGET)/bin" mkdir -p "$@.partial/lib/rustlib/x86_64-unknown-linux-gnu/bin"
mkdir -p "$@.partial/lib/rustlib/$(HOST_TARGET)/lib"
cd "$@.partial" && $(PREFIX_STRIP) cd "$@.partial" && $(PREFIX_STRIP)
touch "$@.partial" touch "$@.partial"
mv "$@.partial" "$@" mv "$@.partial" "$@"
endif mkdir $@/lib/rustlib/src
ln -s $(ROOT)/rust $@/lib/rustlib/src
$(PREFIX)/relibc-freestanding-install: $(ROOT)/relibc | $(PREFIX_BASE_INSTALL) $(PREFIX_FREESTANDING_INSTALL) $(CONTAINER_TAG) $(PREFIX)/relibc-freestanding-install: $(ROOT)/relibc | $(PREFIX_BASE_INSTALL) $(PREFIX_FREESTANDING_INSTALL)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) $(MAKE) $@
else
rm -rf "$@.partial" "$@" rm -rf "$@.partial" "$@"
mkdir -p "$@.partial" mkdir -p "$@.partial"
cd "$<" && \ cd "$<" && \
export PATH="$(PREFIX_BASE_PATH):$(PREFIX_FREESTANDING_PATH):$$PATH" && \ export PATH="$(PREFIX_BASE_PATH):$(PREFIX_FREESTANDING_PATH):$$PATH" && \
export CARGO="env -u CARGO -u RUSTUP_TOOLCHAIN cargo" && \ export CARGO="env -u CARGO -u RUSTUP_TOOLCHAIN cargo" && \
export CC_$(subst -,_,$(TARGET))="$(TARGET)-gcc -isystem $(ROOT)/$@.partial/$(TARGET)/include" && \ export CC_$(subst -,_,$(TARGET))="$(TARGET)-gcc -isystem $(ROOT)/$@.partial/$(TARGET)/include" && \
$(MAKE) clean && \
$(MAKE) -j `$(NPROC)` all && \ $(MAKE) -j `$(NPROC)` all && \
$(MAKE) -j `$(NPROC)` install DESTDIR="$(ROOT)/$@.partial/$(TARGET)" $(MAKE) -j `$(NPROC)` install DESTDIR="$(ROOT)/$@.partial/$(TARGET)"
cd "$@.partial" && $(PREFIX_STRIP) cd "$@.partial" && $(PREFIX_STRIP)
touch "$@.partial" touch "$@.partial"
mv "$@.partial" "$@" mv "$@.partial" "$@"
endif
$(PREFIX)/gcc-install: $(PREFIX)/gcc | $(PREFIX)/relibc-freestanding-install $(CONTAINER_TAG) $(PREFIX)/gcc-install: $(PREFIX)/gcc | $(PREFIX)/relibc-freestanding-install
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) $(MAKE) $@
else
rm -rf "$<-build" "$@.partial" "$@" rm -rf "$<-build" "$@.partial" "$@"
mkdir -p "$<-build" mkdir -p "$<-build"
cp -r "$(PREFIX_BASE_INSTALL)" "$@.partial" cp -r "$(PREFIX_BASE_INSTALL)" "$@.partial"
@ -233,7 +193,6 @@ else
cd "$@.partial" && $(PREFIX_STRIP) cd "$@.partial" && $(PREFIX_STRIP)
touch "$@.partial" touch "$@.partial"
mv "$@.partial" "$@" mv "$@.partial" "$@"
endif
$(PREFIX)/gcc-install.tar.gz: $(PREFIX)/gcc-install $(PREFIX)/gcc-install.tar.gz: $(PREFIX)/gcc-install
tar \ tar \
@ -243,10 +202,7 @@ $(PREFIX)/gcc-install.tar.gz: $(PREFIX)/gcc-install
--directory="$<" \ --directory="$<" \
. .
$(PREFIX)/rust-install: $(ROOT)/rust | $(PREFIX)/gcc-install $(PREFIX)/relibc-freestanding-install $(CONTAINER_TAG) $(PREFIX)/rust-install: $(ROOT)/rust | $(PREFIX)/gcc-install $(PREFIX)/relibc-freestanding-install
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) $(MAKE) $@
else
rm -rf "$(PREFIX)/rust-build" "$@.partial" "$@" rm -rf "$(PREFIX)/rust-build" "$@.partial" "$@"
mkdir -p "$(PREFIX)/rust-build" mkdir -p "$(PREFIX)/rust-build"
cp -r "$(PREFIX)/gcc-install" "$@.partial" cp -r "$(PREFIX)/gcc-install" "$@.partial"
@ -256,25 +212,20 @@ else
"$</configure" \ "$</configure" \
--prefix="/" \ --prefix="/" \
--disable-docs \ --disable-docs \
--disable-download-ci-llvm \
--enable-cargo-native-static \ --enable-cargo-native-static \
--enable-dist-src \
--enable-extended \ --enable-extended \
--enable-lld \
--enable-llvm-static-stdcpp \ --enable-llvm-static-stdcpp \
--tools=cargo,src \ --tools=cargo \
--target="$(HOST_TARGET),$(TARGET)" \ --target="$(HOST_TARGET),$(TARGET)" \
&& \ && \
$(MAKE) -j `$(NPROC)` && \ $(MAKE) -j `$(NPROC)` && \
rm -rf $(ROOT)/$@.partial/lib/rustlib/{components,install.log,rust-installer-version,uninstall.sh,manifest-*} "$(ROOT)/$@.partial/share/doc/rust" && \ rm -rf "$(ROOT)/$@.partial/lib/rustlib" "$(ROOT)/$@.partial/share/doc/rust" && \
$(MAKE) -j `$(NPROC)` install DESTDIR="$(ROOT)/$@.partial" $(MAKE) -j `$(NPROC)` install DESTDIR="$(ROOT)/$@.partial"
rm -rf "$(PREFIX)/rust-build" rm -rf "$(PREFIX)/rust-build"
mkdir -p "$@.partial/lib/rustlib/$(HOST_TARGET)/bin" mkdir -p "$@.partial/lib/rustlib/x86_64-unknown-linux-gnu/bin"
mkdir -p "$@.partial/lib/rustlib/$(HOST_TARGET)/lib"
cd "$@.partial" && find . -name *.old -exec rm {} ';' && $(PREFIX_STRIP) cd "$@.partial" && find . -name *.old -exec rm {} ';' && $(PREFIX_STRIP)
touch "$@.partial" touch "$@.partial"
mv "$@.partial" "$@" mv "$@.partial" "$@"
endif
$(PREFIX)/rust-install.tar.gz: $(PREFIX)/rust-install $(PREFIX)/rust-install.tar.gz: $(PREFIX)/rust-install
tar \ tar \

View File

@ -1,98 +1,23 @@
QEMU=SDL_VIDEO_X11_DGAMOUSE=0 qemu-system-$(QEMU_ARCH) QEMU=SDL_VIDEO_X11_DGAMOUSE=0 qemu-system-$(ARCH)
QEMUFLAGS=-d guest_errors -name "Redox OS $(ARCH)" QEMUFLAGS=-d cpu_reset
ifeq ($(ARCH),i686)
audio?=ac97
efi=no
QEMU_ARCH=i386
QEMU_MACHINE?=pc
QEMU_CPU?=pentium2
QEMUFLAGS+=-smp 1 -m 1024
# Default to using kvm when arch is i686 and host is x86_64
ifeq ($(HOST_ARCH),x86_64)
kvm?=yes
endif
else ifeq ($(ARCH),x86_64)
QEMU_ARCH=x86_64
QEMU_MACHINE?=q35
QEMU_CPU?=core2duo
QEMU_EFI=/usr/share/OVMF/OVMF_CODE.fd
QEMUFLAGS+=-smp 4 -m 2048 QEMUFLAGS+=-smp 4 -m 2048
else ifeq ($(ARCH),aarch64) QEMU_EFI=/usr/share/OVMF/OVMF_CODE.fd
efi=yes
live=yes
QEMU_ARCH=aarch64
QEMU_MACHINE=virt
QEMU_CPU=max
ifeq ($(BOARD),raspi3bp)
QEMU_EFI=https://gitlab.redox-os.org/Ivan/redox_firmware/-/raw/main/platform/raspberry_pi/rpi3/u-boot-rpi-3-b-plus.bin
else
QEMU_EFI=https://gitlab.redox-os.org/Ivan/redox_firmware/-/raw/main/platform/qemu/qemu_arm64/u-boot-qemu-arm64.bin
endif
QEMUFLAGS+=-smp 1 -m 2048
ifneq ($(vga),no)
QEMUFLAGS+=-device ramfb
endif
ifneq ($(usb),no)
QEMUFLAGS+=-device usb-ehci -device usb-kbd -device usb-mouse
endif
else
$(error Unsupported ARCH for QEMU "$(ARCH)"))
endif
# If host and target arch do not match, disable kvm
# (unless overridden above or by environment)
ifneq ($(ARCH),$(HOST_ARCH))
kvm?=no
endif
ifeq ($(efi),yes)
FIRMWARE=$(BUILD)/firmware.rom
QEMUFLAGS+=-bios $(BUILD)/firmware.rom
else
FIRMWARE=
endif
ifeq ($(live),yes)
DISK=$(BUILD)/livedisk.iso
else
DISK=$(BUILD)/harddrive.img
endif
ifeq ($(serial),no) ifeq ($(serial),no)
QEMUFLAGS+=-chardev stdio,id=debug -device isa-debugcon,iobase=0x402,chardev=debug QEMUFLAGS+=-chardev stdio,id=debug -device isa-debugcon,iobase=0x402,chardev=debug
else else
QEMUFLAGS+=-chardev stdio,id=debug,signal=off,mux=on,"$(if $(qemu_serial_logfile),logfile=$(qemu_serial_logfile))" QEMUFLAGS+=-chardev stdio,id=debug,signal=off,mux=on,"$(if $(qemu_serial_logfile),logfile=$(qemu_serial_logfile))"
QEMUFLAGS+=-serial chardev:debug -mon chardev=debug QEMUFLAGS+=-serial chardev:debug -mon chardev=debug
endif endif
ifeq ($(iommu),yes) ifeq ($(iommu),yes)
QEMUFLAGS+=-machine $(QEMU_MACHINE),iommu=on QEMUFLAGS+=-machine q35,iommu=on
else else
QEMUFLAGS+=-machine $(QEMU_MACHINE) QEMUFLAGS+=-machine q35
endif endif
ifneq ($(audio),no)
ifeq ($(audio),no) QEMUFLAGS+=-device ich9-intel-hda -device hda-duplex
# No audio
else ifeq ($(audio),ac97)
# AC'97
QEMUFLAGS+=-device AC97
else
# Intel High Definition Audio
QEMUFLAGS+=-device ich9-intel-hda -device hda-output
endif endif
ifeq ($(net),no) ifeq ($(net),no)
QEMUFLAGS+=-net none QEMUFLAGS+=-net none
else ifeq ($(net),rtl8139)
# RTL8139
QEMUFLAGS+=-netdev user,id=net0 -device rtl8139,netdev=net0 \
-object filter-dump,id=f1,netdev=net0,file=$(BUILD)/network.pcap
else ifeq ($(net),virtio)
# virtio-net
QEMUFLAGS+=-netdev user,id=net0 -device virtio-net,netdev=net0 \
-object filter-dump,id=f1,netdev=net0,file=$(BUILD)/network.pcap
else else
ifneq ($(bridge),) ifneq ($(bridge),)
QEMUFLAGS+=-netdev bridge,br=$(bridge),id=net0 -device e1000,netdev=net0,id=nic0 QEMUFLAGS+=-netdev bridge,br=$(bridge),id=net0 -device e1000,netdev=net0,id=nic0
@ -103,94 +28,127 @@ else
QEMUFLAGS+=-netdev user,id=net0,hostfwd=tcp::8080-:8080,hostfwd=tcp::8083-:8083,hostfwd=tcp::64126-:64126 -device e1000,netdev=net0,id=nic0 QEMUFLAGS+=-netdev user,id=net0,hostfwd=tcp::8080-:8080,hostfwd=tcp::8083-:8083,hostfwd=tcp::64126-:64126 -device e1000,netdev=net0,id=nic0
else else
QEMUFLAGS+=-netdev user,id=net0 -device e1000,netdev=net0 \ QEMUFLAGS+=-netdev user,id=net0 -device e1000,netdev=net0 \
-object filter-dump,id=f1,netdev=net0,file=$(BUILD)/network.pcap -object filter-dump,id=f1,netdev=net0,file=build/network.pcap
endif endif
endif endif
endif endif
ifeq ($(vga),no) ifeq ($(vga),no)
QEMUFLAGS+=-nographic -vga none QEMUFLAGS+=-nographic -vga none
else ifeq ($(vga),multi)
QEMUFLAGS+=-display sdl -vga std -device secondary-vga
else ifeq ($(vga),virtio)
QEMUFLAGS+=-vga virtio
endif endif
ifneq ($(usb),no) ifneq ($(usb),no)
QEMUFLAGS+=-device nec-usb-xhci,id=xhci QEMUFLAGS+=-device nec-usb-xhci,id=xhci
endif endif
ifeq ($(gdb),yes) ifeq ($(gdb),yes)
QEMUFLAGS+=-d cpu_reset -s -S QEMUFLAGS+=-s
endif endif
ifeq ($(UNAME),Linux) ifeq ($(UNAME),Linux)
ifneq ($(kvm),no) ifneq ($(kvm),no)
QEMUFLAGS+=-enable-kvm -cpu host QEMUFLAGS+=-enable-kvm -cpu host
else else
QEMUFLAGS+=-cpu $(QEMU_CPU) QEMUFLAGS+=-cpu max
endif endif
endif endif
#,int,pcall
#-device intel-iommu
ifeq ($(UNAME),Darwin) ifeq ($(UNAME),Linux)
QEMUFLAGS+=-cpu $(QEMU_CPU) build/extra.bin:
endif fallocate --posix --length 1G $@
$(BUILD)/extra.img:
truncate -s 1g $@
$(BUILD)/firmware.rom:
ifeq ($(ARCH),aarch64)
wget -O $@ $(QEMU_EFI)
else else
cp $(QEMU_EFI) $@ build/extra.bin:
truncate -s 1g $@
endif endif
qemu: $(DISK) $(FIRMWARE) $(BUILD)/extra.img qemu: build/harddrive.bin build/extra.bin
$(QEMU) $(QEMUFLAGS) \ $(QEMU) $(QEMUFLAGS) \
-drive file=$(DISK),format=raw \ -drive file=build/harddrive.bin,format=raw \
-drive file=$(BUILD)/extra.img,format=raw -drive file=build/extra.bin,format=raw
qemu_no_build: $(FIRMWARE) $(BUILD)/extra.img qemu_no_build: build/extra.bin
$(QEMU) $(QEMUFLAGS) \ $(QEMU) $(QEMUFLAGS) \
-drive file=$(DISK),format=raw \ -drive file=build/harddrive.bin,format=raw \
-drive file=$(BUILD)/extra.img,format=raw -drive file=build/extra.bin,format=raw
qemu_cdrom: $(DISK) $(FIRMWARE) $(BUILD)/extra.img qemu_efi: build/harddrive-efi.bin build/extra.bin
$(QEMU) $(QEMUFLAGS) \ $(QEMU) $(QEMUFLAGS) \
-boot d -cdrom $(DISK) \ -bios $(QEMU_EFI) \
-drive file=$(BUILD)/extra.img,format=raw -drive file=build/harddrive-efi.bin,format=raw \
-drive file=build/extra.bin,format=raw
qemu_cdrom_no_build: $(FIRMWARE) $(BUILD)/extra.img qemu_efi_no_build: build/extra.bin
$(QEMU) $(QEMUFLAGS) \ $(QEMU) $(QEMUFLAGS) \
-boot d -cdrom $(DISK) \ -bios $(QEMU_EFI) \
-drive file=$(BUILD)/extra.img,format=raw -drive file=build/harddrive-efi.bin,format=raw \
-drive file=build/extra.bin,format=raw
qemu_nvme: $(DISK) $(FIRMWARE) $(BUILD)/extra.img qemu_nvme: build/harddrive.bin build/extra.bin
$(QEMU) $(QEMUFLAGS) \ $(QEMU) $(QEMUFLAGS) \
-drive file=$(DISK),format=raw,if=none,id=drv0 -device nvme,drive=drv0,serial=NVME_SERIAL \ -drive file=build/harddrive.bin,format=raw,if=none,id=drv0 -device nvme,drive=drv0,serial=NVME_SERIAL \
-drive file=$(BUILD)/extra.img,format=raw,if=none,id=drv1 -device nvme,drive=drv1,serial=NVME_EXTRA -drive file=build/extra.bin,format=raw,if=none,id=drv1 -device nvme,drive=drv1,serial=NVME_EXTRA
qemu_nvme_no_build: $(FIRMWARE) $(BUILD)/extra.img qemu_nvme_no_build: build/extra.bin
$(QEMU) $(QEMUFLAGS) \ $(QEMU) $(QEMUFLAGS) \
-drive file=$(DISK),format=raw,if=none,id=drv0 -device nvme,drive=drv0,serial=NVME_SERIAL \ -drive file=build/harddrive.bin,format=raw,if=none,id=drv0 -device nvme,drive=drv0,serial=NVME_SERIAL \
-drive file=$(BUILD)/extra.img,format=raw,if=none,id=drv1 -device nvme,drive=drv1,serial=NVME_EXTRA -drive file=build/extra.bin,format=raw,if=none,id=drv1 -device nvme,drive=drv1,serial=NVME_EXTRA
qemu_usb: $(DISK) $(FIRMWARE) qemu_nvme_efi: build/harddrive-efi.bin build/extra.bin
$(QEMU) $(QEMUFLAGS) \ $(QEMU) $(QEMUFLAGS) \
-drive if=none,id=usbstick,format=raw,file=$(DISK) \ -bios $(QEMU_EFI) \
-device usb-storage,drive=usbstick -drive file=build/harddrive-efi.bin,format=raw,if=none,id=drv0 -device nvme,drive=drv0,serial=NVME_SERIAL \
-drive file=build/extra.bin,format=raw,if=none,id=drv1 -device nvme,drive=drv1,serial=NVME_EXTRA
qemu_extra: $(FIRMWARE) $(BUILD)/extra.img qemu_nvme_efi_no_build: build/extra.bin
$(QEMU) $(QEMUFLAGS) \ $(QEMU) $(QEMUFLAGS) \
-drive file=$(BUILD)/extra.img,format=raw -bios $(QEMU_EFI) \
-drive file=build/harddrive-efi.bin,format=raw,if=none,id=drv0 -device nvme,drive=drv0,serial=NVME_SERIAL \
-drive file=build/extra.bin,format=raw,if=none,id=drv1 -device nvme,drive=drv1,serial=NVME_EXTRA
qemu_nvme_extra: $(FIRMWARE) $(BUILD)/extra.img qemu_nvme_live: build/livedisk.bin build/extra.bin
$(QEMU) $(QEMUFLAGS) \ $(QEMU) $(QEMUFLAGS) \
-drive file=$(BUILD)/extra.img,format=raw,if=none,id=drv1 -device nvme,drive=drv1,serial=NVME_EXTRA -drive file=build/livedisk.bin,format=raw,if=none,id=drv0 -device nvme,drive=drv0,serial=NVME_SERIAL \
-drive file=build/extra.bin,format=raw,if=none,id=drv1 -device nvme,drive=drv1,serial=NVME_EXTRA
#additional steps for $(DISK) are required!!! qemu_nvme_live_no_build: build/extra.bin
qemu_raspi: $(FIRMWARE) $(DISK) $(QEMU) $(QEMUFLAGS) \
$(QEMU) -M raspi3b -smp 4,cores=1 \ -drive file=build/livedisk.bin,format=raw,if=none,id=drv0 -device nvme,drive=drv0,serial=NVME_SERIAL \
-kernel $(FIRMWARE) \ -drive file=build/extra.bin,format=raw,if=none,id=drv1 -device nvme,drive=drv1,serial=NVME_EXTRA
-serial stdio -display none -sd $(DISK)
qemu_live: build/livedisk.bin build/extra.bin
$(QEMU) $(QEMUFLAGS) \
-drive file=build/livedisk.bin,format=raw \
-drive file=build/extra.bin,format=raw
qemu_live_no_build: build/extra.bin
$(QEMU) $(QEMUFLAGS) \
-drive file=build/livedisk.bin,format=raw \
-drive file=build/extra.bin,format=raw
qemu_live_efi: build/livedisk-efi.bin build/extra.bin
$(QEMU) $(QEMUFLAGS) \
-bios $(QEMU_EFI) \
-drive file=build/livedisk-efi.bin,format=raw \
-drive file=build/extra.bin,format=raw
qemu_live_efi_no_build: build/extra.bin
$(QEMU) $(QEMUFLAGS) \
-bios $(QEMU_EFI) \
-drive file=build/livedisk-efi.bin,format=raw \
-drive file=build/extra.bin,format=raw
qemu_iso: build/livedisk.iso build/extra.bin
$(QEMU) $(QEMUFLAGS) \
-boot d -cdrom build/livedisk.iso \
-drive file=build/extra.bin,format=raw
qemu_iso_no_build: build/extra.bin
$(QEMU) $(QEMUFLAGS) \
-boot d -cdrom build/livedisk.iso \
-drive file=build/extra.bin,format=raw
qemu_extra: build/extra.bin
$(QEMU) $(QEMUFLAGS) \
-drive file=build/extra.bin,format=raw
qemu_nvme_extra: build/extra.bin
$(QEMU) $(QEMUFLAGS) \
-drive file=build/extra.bin,format=raw,if=none,id=drv1 -device nvme,drive=drv1,serial=NVME_EXTRA

View File

@ -1,82 +0,0 @@
$(BUILD)/fetch.tag: prefix $(FSTOOLS_TAG) $(FILESYSTEM_CONFIG) $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) $(MAKE) $@
else
PACKAGES="$$($(INSTALLER) --list-packages -c $(FILESYSTEM_CONFIG))" && \
cd cookbook && \
./fetch.sh "$${PACKAGES}"
mkdir -p $(BUILD)
touch $@
endif
$(BUILD)/repo.tag: $(BUILD)/fetch.tag $(FSTOOLS_TAG) $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) $(MAKE) $@
else
export PATH="$(PREFIX_PATH):$$PATH" && \
PACKAGES="$$($(INSTALLER) --list-packages -c $(FILESYSTEM_CONFIG))" && \
cd cookbook && \
./repo.sh $(REPO_NONSTOP) "$${PACKAGES}"
mkdir -p $(BUILD)
# make sure fetch.tag is newer than the things repo modifies
touch $<
touch $@
endif
# Invoke clean.sh for a single target
c.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) $(MAKE) $@
else
export PATH="$(PREFIX_PATH):$$PATH" && \
cd cookbook && \
./clean.sh $*
endif
# Invoke fetch.sh for a single target
f.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) $(MAKE) $@
else
export PATH="$(PREFIX_PATH):$$PATH" && \
cd cookbook && \
./fetch.sh $*
endif
# Invoke repo.sh for a single target
r.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) $(MAKE) $@
else
export PATH="$(PREFIX_PATH):$$PATH" && \
cd cookbook && \
./repo.sh $*
endif
# Invoke unfetch.sh for a single target
u.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) $(MAKE) $@
else
export PATH="$(PREFIX_PATH):$$PATH" && \
cd cookbook && \
./unfetch.sh $*
endif
# Invoke clean.sh, and repo.sh for a single target
cr.%: $(FSTOOLS_TAG) FORCE
$(MAKE) c.$*
$(MAKE) r.$*
# Invoke unfetch.sh, clean.sh, and repo.sh for a single target
ucr.%: $(FSTOOLS_TAG) FORCE
$(MAKE) u.$*
$(MAKE) cr.$*
uc.%: $(FSTOOLS_TAG) FORCE
$(MAKE) u.$*
$(MAKE) c.$*
ucf.%: (FSTOOLS_TAG) FORCE
$(MAKE) uc.$*
$(MAKE) f.$*

View File

@ -1,4 +1,4 @@
virtualbox: $(BUILD)/harddrive.img virtualbox: build/harddrive.bin
echo "Delete VM" echo "Delete VM"
-$(VBM) unregistervm Redox --delete; \ -$(VBM) unregistervm Redox --delete; \
if [ $$? -ne 0 ]; \ if [ $$? -ne 0 ]; \
@ -31,12 +31,11 @@ virtualbox: $(BUILD)/harddrive.img
$(VBM) modifyvm Redox --mouse ps2 $(VBM) modifyvm Redox --mouse ps2
$(VBM) modifyvm Redox --audio $(VB_AUDIO) $(VBM) modifyvm Redox --audio $(VB_AUDIO)
$(VBM) modifyvm Redox --audiocontroller hda $(VBM) modifyvm Redox --audiocontroller hda
$(VBM) modifyvm Redox --audioout on
$(VBM) modifyvm Redox --nestedpaging on $(VBM) modifyvm Redox --nestedpaging on
echo "Create Disk" echo "Create Disk"
$(VBM) convertfromraw $< $(BUILD)/harddrive.vdi $(VBM) convertfromraw $< build/harddrive.vdi
echo "Attach Disk" echo "Attach Disk"
$(VBM) storagectl Redox --name ATA --add sata --controller IntelAHCI --bootable on --portcount 1 $(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" echo "Run VM"
$(VBM) startvm Redox $(VBM) startvm Redox

View File

@ -1,61 +0,0 @@
FROM ubuntu:latest
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
autoconf \
automake \
autopoint \
bison \
build-essential \
ca-certificates \
cmake \
curl \
file \
flex \
fuse3 \
genisoimage \
git \
gperf \
libc6-dev-i386 \
libexpat-dev \
libfuse-dev \
libfuse3-dev \
libgmp-dev \
libhtml-parser-perl \
libtool \
libfontconfig1-dev \
libpng-dev \
libjpeg-dev \
libsdl2-ttf-dev \
libsdl1.2-dev \
m4 \
nasm \
pkg-config \
po4a \
syslinux-utils \
texinfo \
ninja-build \
meson \
python3-mako \
xxd \
rsync \
wget \
python3 \
make \
xdg-utils \
zip \
unzip \
llvm \
clang \
perl \
doxygen \
ant \
protobuf-compiler \
intltool
# _UID_ must be replaced with the user's uid on host
# podman root is mapped to your user id on host during build,
# poduser is mapped to your user id during podman run
RUN useradd --create-home --no-log-init --uid _UID_ poduser && \
chown -R root:root /home

View File

@ -1,8 +0,0 @@
#/usr/bin/env bash
# Install Rust in Podman, after the image has been built
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly
cargo install --force --version 0.1.1 cargo-config
cargo install --force --version 1.16.0 just
cargo install --force --version 0.26.0 cbindgen

View File

@ -1,639 +0,0 @@
#!/usr/bin/env bash
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"
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
install_macports_pkg "osxfuse"
install_macports_pkg "podman"
}
###############################################################################
# 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"
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
install_brew_pkg "make"
install_brew_pkg "podman"
}
###############################################################################
# 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"
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
install_freebsd_pkg "gmake"
install_freebsd_pkg "podman"
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 podman fuse"
if [ "$1" == "qemu" ]; then
packages="$packages qemu"
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 libfuse-dev
if [ "$1" == "qemu" ]; then
if [ -z "$(which qemu-system-x86_64)" ]; then
echo "Installing QEMU..."
sudo "$2" install qemu-system-x86 qemu-kvm
sudo "$2" install qemu-efi-arm qemu-system-arm
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-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
# Use rpm -q <package> to check if it's already installed
PKGS=$(for pkg in podman; 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=(
"make"
"fuse-devel"
"podman"
)
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 " -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 "./podman_bootstrap.sh -e qemu"
exit
}
#############################################################
# Looks for and installs a cargo-managed binary or subcommand
#############################################################
cargoInstall() {
if [[ "`cargo install --list`" != *"$1 v$2"* ]]; then
cargo install --force --version "$2" "$1"
else
echo "You have $1 version $2 installed already!"
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 gitlab"
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 dependent packages
###########################################################################
boot()
{
echo "Cloning gitlab repo..."
git clone https://gitlab.redox-os.org/redox-os/redox.git --origin upstream --recursive
echo "Creating .config with PODMAN_BUILD=1"
echo 'PODMAN_BUILD?=1' > redox/.config
echo "Cleaning up..."
rm podman_bootstrap.sh
echo
echo "---------------------------------------"
echo "Well it looks like you are ready to go!"
echo "---------------------------------------"
statusCheck
echo "The file redox/.config was created with PODMAN_BUILD=1."
echo "Run the following commands to build redox using Podman:"
echo
echo "cd redox"
MAKE="make"
if [[ "$(uname)" == "FreeBSD" ]]; then
MAKE="gmake"
echo "kldload fuse.ko # This loads the kernel module for FUSE"
fi
echo "$MAKE all"
echo "$MAKE virtualbox or qemu"
echo
echo " Good luck!"
exit
}
if [ "$1" == "-h" ] || [ "$1" == "--help" ]; 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
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;;
s) statusCheck && exit;;
\?) echo "I don't know what to do with that option, try -h for help"; exit 1;;
esac
done
banner
if [ "$update" == "true" ]; then
git pull upstream master
git submodule update --recursive --init
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"
# 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"
# 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!"

1
redox-initfs Submodule

@ -0,0 +1 @@
Subproject commit 89b8fb8984cf96c418880b7dcd9ce3d6afc3f71c

@ -1 +1 @@
Subproject commit 14a07dc268ec41db87d4f453022ac8805b918d20 Subproject commit 0e0ae520c5e94d9a29a79f8a4d9d207d0d9c3a92

2
relibc

@ -1 +1 @@
Subproject commit 65589f9c935a7eaaa2d1d8db4875fbb458b29edd Subproject commit 8576b997596788ad3fd18d2c7231886de274a2cb

2
rust

@ -1 +1 @@
Subproject commit e9ed31b0540da8c7eae71de353a741294139ae8b Subproject commit 3a291a347c6f2a88435e5cbbe2af3997c2afca1f

1
rust-toolchain Normal file
View File

@ -0,0 +1 @@
nightly-2022-03-18

View File

@ -1,3 +0,0 @@
[toolchain]
channel = "nightly-2023-09-07"
components = ["rust-src"]

View File

@ -1,75 +0,0 @@
#!/usr/bin/env bash
usage()
{
echo "Usage: $0 -r recipe [ -e command_name ] [ -R ] [ -X | -6 | -A ] [[ -b backtracefile ] | [ addr1 ... ]]"
echo
echo "Print the backtrace contained in the backtracefile."
echo "Symbols are taken from the executable for the given recipe."
echo "If no backtracefile is given, decode the given addresses instead."
echo "This command must be run in the 'redox' directory."
echo
echo "-X for x86_64, -6 for i686, -A for aarch64 (x86_64 is the default)."
echo "To read from stdin, use '-b -'"
echo "The name of the executable must match what Cargo believes it to be."
echo "If the executalbe is named 'recipe_command', just use 'command' as the name."
echo "The debug version of the executable is used if available."
echo "The release version is used if no debug version exists."
echo "-R to force the use of the 'release' version of the executable."
echo "Make sure the executable is the one that produced the backtrace."
exit 1
}
ARCH="x86_64"
while getopts ":b:e:r:hRXA6" opt
do
case "$opt" in
X) ARCH="x86_64";;
A) ARCH="aarch64";;
6) ARCH="i686";;
b) INFILE="$OPTARG";;
e) COMMAND="$OPTARG";;
i) INST="$OPTARG";;
r) RECIPE_NAME="$OPTARG";;
R) RELEASE=true;;
h) usage;;
\?) echo "Unknown option -$OPTARG, try -h for help"; exit;;
:) echo "-$OPTARG requires a value"; exit;;
esac
done
shift $((OPTIND -1))
if [ -z "$RECIPE_NAME" ]
then
usage
fi
if [ -z "$INFILE" -a $# = 0 ]
then
usage
fi
# if no command name is given, assume it's the same as the recipe name
RECIPE_DIR="$(cd cookbook; target/release/find_recipe $RECIPE_NAME)"
if [ -z "$COMMAND" ]
then
COMMAND="$RECIPE_NAME"
fi
# look for the debug version of the command
EXECUTABLE=cookbook/"$RECIPE_DIR"/target/"$ARCH"-unknown-redox/build/target/"$ARCH"-unknown-redox/debug/"$COMMAND"
# try the release version next
if [ ! -f "$EXECUTABLE" -o ! -z "$RELEASE" ]
then
EXECUTABLE=cookbook/"$RECIPE_DIR"/target/"$ARCH"-unknown-redox/build/target/"$ARCH"-unknown-redox/release/"$COMMAND"
fi
if [ $# -ne 0 ]
then
addr2line --demangle=rust --inlines --pretty-print --functions --exe="$EXECUTABLE" $@
else
sed '/^\s*$/d; s/^.*0x\([0-9a-f]*\).*$/\1/g' "$INFILE" | addr2line --demangle=rust --inlines --pretty-print --functions --exe="$EXECUTABLE"
fi

View File

@ -1,20 +0,0 @@
#!/usr/bin/env bash
if [ -z "$1" ] || [ -z "$2" ]
then
echo "Build or clean all recipe directories in a category" >&2
echo Usage: $0 "<action>" "<recipe-category>" >&2
echo "<action>" can be f, r, c, u, or combinations that \"make\" understands >&2
exit 1
fi
set -x
action="${1#-}"
for recipe in `find cookbook/recipes/"$2" -name "recipe.*"`
do
recipe_folder=`dirname "$recipe"`
recipe_name=`basename "$recipe_folder"`
make "$action"."$recipe_name"
done

View File

@ -1,49 +0,0 @@
#!/usr/bin/env bash
set -e
LAST_RELEASE_TAG="$(git describe --tags --abbrev=0)"
LAST_RELEASE_TIMESTAMP="$(git log --format="%ct" -1 "${LAST_RELEASE_TAG}")"
echo "Last release: ${LAST_RELEASE_TAG} at ${LAST_RELEASE_TIMESTAMP}"
REPOS=(
redox=.
cookbook=cookbook
rust=rust
)
for package in $(installer/target/release/redox_installer --list-packages -c config/$(uname -m)/desktop.toml)
do
REPOS+=("${package}=cookbook/recipes/${package}/source")
done
# TODO: resolve dependencies instead of manually adding these initfs packages
for package in init logd nulld ramfs randd zerod
do
REPOS+=("${package}=cookbook/recipes/${package}/source")
done
for name_repo in "${REPOS[@]}"
do
name="$(echo "${name_repo}" | cut -d "=" -f 1)"
repo="$(echo "${name_repo}" | cut -d "=" -f 2-)"
echo -en "\x1B[1m${name}:\x1B[0m "
if [ -e "${repo}/.git" ]
then
remote="$(git -C "${repo}" remote get-url origin)"
website="${remote%.*}"
before="$(git -C "${repo}" log --until="${LAST_RELEASE_TIMESTAMP}" --format="%h" -1)"
after="$(git -C "${repo}" log --since="${LAST_RELEASE_TIMESTAMP}" --format="%h" -1)"
if [ -z "${before}" ]
then
echo "New repository at ${website}"
elif [ -z "${after}" ]
then
echo "No changes"
else
echo "${website}/-/compare/${before}...${after}"
fi
else
echo "Not a git repository"
fi
done

View File

@ -1,14 +0,0 @@
#!/usr/bin/env bash
if [ $# -ne 1 ]
then
echo "Usage: $0 recipe_name"
echo " Print the commit hash for recipe_name"
exit 1
fi
cd cookbook
recipe_path="$(target/release/find_recipe $1)"
cd "$recipe_path"/source
git branch -v

View File

@ -1,53 +0,0 @@
#!/usr/bin/env bash
set -e
if [ -n "$1" ]
then
DISK="$1"
else
DISK=/dev/disk/by-partlabel/REDOX_INSTALL
fi
if [ ! -b "${DISK}" ]
then
echo "$0: '${DISK}' is not a block device" >&2
exit 1
fi
if [ -z "${ARCH}" ]
then
export ARCH=x86_64
fi
if [ -z "${CONFIG_NAME}" ]
then
export CONFIG_NAME=demo
fi
IMAGE="build/${ARCH}/${CONFIG_NAME}/filesystem.img"
set -x
make "${IMAGE}"
sudo popsicle "${IMAGE}" "${DISK}"
set +x
ESP="$(bootctl --print-esp-path)"
if [ -z "${ESP}" ]
then
echo "$0: no ESP found" >&2
exit 1
fi
BOOTLOADER="cookbook/recipes/core/bootloader/target/${ARCH}-unknown-redox/stage/boot/bootloader.efi"
set -x
sudo mkdir -pv "${ESP}/EFI" "${ESP}/loader/entries"
sudo cp -v "${BOOTLOADER}" "${ESP}/EFI/redox.efi"
sudo tee "${ESP}/loader/entries/redox.conf" <<EOF
title Redox OS
efi /EFI/redox.efi
EOF
set +x
sync
echo "Finished installing Redox OS dual boot"

View File

@ -1,42 +0,0 @@
#!/usr/bin/env bash
# Ensure arch and config are set as desired, we use these to find the build dir
export ARCH=$(uname -m)
export CONFIG_NAME=desktop
# Make sure to unmount the image first
make unmount &>/dev/null || true
# Mount the image
make mount >/dev/null
# Find all files
find "build/${ARCH}/${CONFIG_NAME}/" -type f | cut -d / -f5- |\
sort |\
uniq |\
while read path
do
# Skip empty paths
if [ -z "${path}" ]
then
continue
fi
# Find all packages providing this file
pkgs="$(
find cookbook/recipes/*"/target/${ARCH}-unknown-redox/stage/${path}" 2>/dev/null |
cut -d/ -f3 |
tr '\n' ' ' |
sort |
uniq
)"
if [ -n "${pkgs}" ]
then
echo "$path: ${pkgs}"
else
echo "$path: no packages, see config/${ARCH}/${CONFIG_NAME}.toml"
fi
done
# Make sure to unmount the image
make unmount &>/dev/null || true

View File

@ -1,23 +0,0 @@
#!/usr/bin/env bash
# Given a string, find recipe.toml files containing that string.
# Create a list that can be copy/pasted into a filesystem config.
if [ -z "$*" ]
then
echo "Find matching recipes, and format for inclusion in config"
echo "Usage: $0 \"pattern\""
echo "Must be run from 'redox' directory"
echo "e.g. $0 \"TODO.*error\""
exit 1
fi
cookbook_recipes="cookbook/recipes"
recipe_paths=$(grep -rl "$*" "$cookbook_recipes" --include recipe.toml)
for recipe_path in $recipe_paths
do
recipe_dir="$(dirname $recipe_path)"
recipe_name="$(basename $recipe_dir)"
echo "$recipe_name = {} # " $(grep "$*" $recipe_path)
done

View File

@ -1,27 +0,0 @@
#!/usr/bin/env bash
if [ $# = 0 ]
then
find cookbook/recipes \( -name stage.pkgar -o -name stage.tar.gz \) -exec ls -hs {} \;
exit 0
fi
for recipe in $@
do
if [ "$recipe" = "-h" ] || [ "$recipe" = "--help" ]
then
echo "Usage: $0 [recipe] ..."
echo " For the recipe(s), prints the size of 'stage.pkgar' and 'stage.tar.gz'."
echo " If no recipe is given, then all packages are listed."
exit 0
fi
recipe_paths=$(find cookbook/recipes -name $recipe)
for recipe_path in $recipe_paths
do
if [ -f "$recipe_path/recipe.toml" ] || [ -f "$recipe_path/recipe.sh" ]
then
find "$recipe_path" \( -name stage.pkgar -o -name stage.tar.gz \) -exec ls -hs {} \;
fi
done
done

View File

@ -1,26 +0,0 @@
#!/usr/bin/env bash
# Show the contents of the stage and sysroot folders in some recipe
if [ -z "$*" ]
then
echo "Show the contents of the stage and sysroot folders in recipe(s)"
echo "Usage: $0 recipe1 ..."
echo "Must be run from the 'redox' directory"
echo "e.g. $0 kernel"
exit 1
fi
find_recipe="target/release/find_recipe"
if [ ! -x "cookbook/$find_recipe" ]
then
echo "$find_recipe not found."
echo "Please run 'make fstools' and try again."
exit 1
fi
for recipe in $*
do
recipe_dir="$(cd cookbook; "$find_recipe" "$recipe")"
ls -1 "cookbook/$recipe_dir/target"/*/{stage,sysroot}
done

View File

@ -1,33 +0,0 @@
#!/usr/bin/env bash
set -e
ARCHS=(
i686
x86_64
)
CONFIGS=(
demo
desktop
)
VENTOY="/media/${USER}/Ventoy"
if [ ! -d "${VENTOY}" ]
then
echo "Ventoy not mounted" >&2
exit 1
fi
for ARCH in "${ARCHS[@]}"
do
for CONFIG_NAME in "${CONFIGS[@]}"
do
IMAGE="build/${ARCH}/${CONFIG_NAME}/livedisk.iso"
make ARCH="${ARCH}" CONFIG_NAME="${CONFIG_NAME}" "${IMAGE}"
cp -v "${IMAGE}" "${VENTOY}/redox-${CONFIG_NAME}-${ARCH}.iso"
done
done
sync
echo "Finished copying configs (${CONFIGS[@]}) for archs (${ARCHS[@]})"