Bring in some coreutils
This commit is contained in:
parent
5721582f81
commit
9ce5628fa4
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -13,3 +13,6 @@
|
|||
[submodule "openlibm"]
|
||||
path = openlibm
|
||||
url = https://github.com/JuliaLang/openlibm.git
|
||||
[submodule "programs/coreutils"]
|
||||
path = programs/coreutils
|
||||
url = https://github.com/redox-os/coreutils.git
|
||||
|
|
15
Makefile
15
Makefile
|
@ -145,12 +145,26 @@ initfs/bin/%: programs/%/Cargo.toml programs/%/src/** $(BUILD)/libstd.rlib
|
|||
strip $@
|
||||
rm $@.d
|
||||
|
||||
initfs/bin/%: programs/coreutils/Cargo.toml programs/coreutils/src/bin/%.rs $(BUILD)/libstd.rlib
|
||||
mkdir -p initfs/bin
|
||||
$(CARGO) rustc --manifest-path $< --bin $* $(CARGOFLAGS) -o $@
|
||||
strip $@
|
||||
rm $@.d
|
||||
|
||||
initfs/bin/%: schemes/%/Cargo.toml schemes/%/src/** $(BUILD)/libstd.rlib
|
||||
mkdir -p initfs/bin
|
||||
$(CARGO) rustc --manifest-path $< $(CARGOFLAGS) -o $@
|
||||
strip $@
|
||||
rm $@.d
|
||||
|
||||
coreutils: \
|
||||
initfs/bin/cat \
|
||||
initfs/bin/echo \
|
||||
initfs/bin/env \
|
||||
initfs/bin/ls \
|
||||
initfs/bin/printenv \
|
||||
initfs/bin/pwd
|
||||
|
||||
$(BUILD)/initfs.rs: \
|
||||
initfs/bin/pcid \
|
||||
initfs/bin/ps2d \
|
||||
|
@ -158,6 +172,7 @@ $(BUILD)/initfs.rs: \
|
|||
initfs/bin/init \
|
||||
initfs/bin/ion \
|
||||
initfs/bin/login \
|
||||
coreutils \
|
||||
initfs/bin/example
|
||||
echo 'use collections::BTreeMap;' > $@
|
||||
echo 'pub fn gen() -> BTreeMap<&'"'"'static [u8], &'"'"'static [u8]> {' >> $@
|
||||
|
|
|
@ -129,7 +129,7 @@ pub fn cpu_id() -> usize {
|
|||
}
|
||||
|
||||
pub extern fn userspace_init() {
|
||||
assert_eq!(syscall::chdir(b"initfs:"), Ok(0));
|
||||
assert_eq!(syscall::chdir(b"initfs:bin/"), Ok(0));
|
||||
|
||||
assert_eq!(syscall::open(b"debug:", 0), Ok(0));
|
||||
assert_eq!(syscall::open(b"debug:", 0), Ok(1));
|
||||
|
|
|
@ -22,8 +22,9 @@ impl EnvScheme {
|
|||
pub fn new() -> EnvScheme {
|
||||
let mut files: BTreeMap<&'static [u8], &'static [u8]> = BTreeMap::new();
|
||||
|
||||
files.insert(b"HOME", b"initfs:");
|
||||
files.insert(b"PWD", b"initfs:");
|
||||
files.insert(b"HOME", b"initfs:bin/");
|
||||
files.insert(b"PWD", b"initfs:bin/");
|
||||
files.insert(b"PATH", b"initfs:bin/");
|
||||
files.insert(b"COLUMNS", b"80");
|
||||
files.insert(b"LINES", b"30");
|
||||
|
||||
|
|
1
programs/coreutils
Submodule
1
programs/coreutils
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 648a0d119aaed8f4cf8c856e05e47da421c4074a
|
|
@ -1 +1 @@
|
|||
Subproject commit 4d87d44273ce1a408e833c7bc44312ad30c779ee
|
||||
Subproject commit cbb3c3003f654d09cd3b3cf1a179469bb1b558b3
|
Loading…
Reference in a new issue