From 1f339004d6b13fce60d87e0597ed3fc0e1e1fb0b Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Fri, 26 Aug 2022 11:26:05 -0600 Subject: [PATCH] Support distinct filesystem configs for each architecture --- Makefile | 4 +- config/i686/desktop.toml | 194 +++++++++++++++++++++++++++++++ config/{ => x86_64}/acid.toml | 0 config/{ => x86_64}/desktop.toml | 0 config/{ => x86_64}/jeremy.toml | 0 config/{ => x86_64}/resist.toml | 0 config/{ => x86_64}/rustc.toml | 0 config/{ => x86_64}/server.toml | 0 filesystem.toml | 1 - mk/config.mk | 2 + mk/filesystem.mk | 6 +- 11 files changed, 201 insertions(+), 6 deletions(-) create mode 100644 config/i686/desktop.toml rename config/{ => x86_64}/acid.toml (100%) rename config/{ => x86_64}/desktop.toml (100%) rename config/{ => x86_64}/jeremy.toml (100%) rename config/{ => x86_64}/resist.toml (100%) rename config/{ => x86_64}/rustc.toml (100%) rename config/{ => x86_64}/server.toml (100%) delete mode 120000 filesystem.toml diff --git a/Makefile b/Makefile index 2d1ebea..1970547 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ pull: update: cd cookbook && ./update.sh \ - "$$(cargo run --manifest-path ../installer/Cargo.toml -- --list-packages -c ../filesystem.toml)" + "$$(cargo run --manifest-path ../installer/Cargo.toml -- --list-packages -c ../$(FILESYSTEM_CONFIG))" cargo update --manifest-path cookbook/pkgutils/Cargo.toml cargo update --manifest-path installer/Cargo.toml cargo update --manifest-path redoxfs/Cargo.toml @@ -41,7 +41,7 @@ update: fetch: cargo build --manifest-path cookbook/Cargo.toml --release cd cookbook && ./fetch.sh \ - "$$(cargo run --manifest-path ../installer/Cargo.toml -- --list-packages -c ../filesystem.toml)" + "$$(cargo run --manifest-path ../installer/Cargo.toml -- --list-packages -c ../$(FILESYSTEM_CONFIG))" # Cross compiler recipes include mk/prefix.mk diff --git a/config/i686/desktop.toml b/config/i686/desktop.toml new file mode 100644 index 0000000..f28d537 --- /dev/null +++ b/config/i686/desktop.toml @@ -0,0 +1,194 @@ +# Default desktop configuration + +# General settings +[general] +# Do not prompt if settings are not defined +prompt = false + +# Package settings +[packages] +audiod = {} +bootloader = {} +bootstrap = {} +ca-certificates = {} +contain = {} +coreutils = {} +#dash = {} # relibc issues? +diffutils = {} +drivers = {} +escalated = {} +extrautils = {} +findutils = {} +#gdbserver = {} # needs updated redox_syscall +gnu-make = {} +initfs = {} +installer = {} +ion = {} +ipcd = {} +kernel = {} +netdb = {} +netstack = {} +#netsurf = {} # openssl issues +netutils = {} +orbdata = {} +orbital = {} +orbterm = {} +orbutils = {} +pkgutils = {} +ptyd = {} +redoxfs = {} +relibc = {} +resist = {} +smith = {} +#strace = {} # needs updated redox_syscall +terminfo = {} +userutils = {} +uutils = {} +#vim = {} # relibc issues? + +# 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/ +escalated +""" + +[[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 diff --git a/config/acid.toml b/config/x86_64/acid.toml similarity index 100% rename from config/acid.toml rename to config/x86_64/acid.toml diff --git a/config/desktop.toml b/config/x86_64/desktop.toml similarity index 100% rename from config/desktop.toml rename to config/x86_64/desktop.toml diff --git a/config/jeremy.toml b/config/x86_64/jeremy.toml similarity index 100% rename from config/jeremy.toml rename to config/x86_64/jeremy.toml diff --git a/config/resist.toml b/config/x86_64/resist.toml similarity index 100% rename from config/resist.toml rename to config/x86_64/resist.toml diff --git a/config/rustc.toml b/config/x86_64/rustc.toml similarity index 100% rename from config/rustc.toml rename to config/x86_64/rustc.toml diff --git a/config/server.toml b/config/x86_64/server.toml similarity index 100% rename from config/server.toml rename to config/x86_64/server.toml diff --git a/filesystem.toml b/filesystem.toml deleted file mode 120000 index 1b8536b..0000000 --- a/filesystem.toml +++ /dev/null @@ -1 +0,0 @@ -config/desktop.toml \ No newline at end of file diff --git a/mk/config.mk b/mk/config.mk index 73fd8ff..dc1431b 100644 --- a/mk/config.mk +++ b/mk/config.mk @@ -7,6 +7,8 @@ ARCH?=x86_64 INSTALLER_FLAGS?=--cookbook=cookbook ## Enabled to use binary prefix (much faster) PREFIX_BINARY?=1 +## Select filesystem config +FILESYSTEM_CONFIG?=config/$(ARCH)/desktop.toml ## Filesystem size in MB (256 is the default) FILESYSTEM_SIZE?=256 ## Flags to pass to redoxfs-mkfs. Add --encrypt to set up disk encryption diff --git a/mk/filesystem.mk b/mk/filesystem.mk index 8b3e247..1841d9f 100644 --- a/mk/filesystem.mk +++ b/mk/filesystem.mk @@ -1,4 +1,4 @@ -build/filesystem.bin: prefix filesystem.toml +build/filesystem.bin: prefix $(FILESYSTEM_CONFIG) $(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 @@ -13,8 +13,8 @@ build/filesystem.bin: prefix filesystem.toml redoxfs/target/release/redoxfs $@.partial build/filesystem/ sleep 2 pgrep redoxfs - $(INSTALLER) -c filesystem.toml build/filesystem/ - cp -v filesystem.toml build/filesystem/filesystem.toml + $(INSTALLER) -c $(FILESYSTEM_CONFIG) build/filesystem/ + cp -v $(FILESYSTEM_CONFIG) build/filesystem/filesystem.toml mkdir -pv build/filesystem/pkg cp -v cookbook/build/id_ed25519.pub.toml build/filesystem/pkg/id_ed25519.pub.toml sync