diff --git a/bootstrap.sh b/bootstrap.sh index 2769a8f..c924f67 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -311,8 +311,7 @@ ubuntu() echo "Updating system..." sudo "$2" update echo "Installing required packages..." - sudo "$2" install \ - autoconf \ + pkgs="autoconf \ autopoint \ bison \ build-essential \ @@ -324,7 +323,6 @@ ubuntu() genisoimage \ git \ gperf \ - libc6-dev-i386 \ libexpat-dev \ libfuse-dev \ libgmp-dev \ @@ -341,7 +339,6 @@ ubuntu() scons \ pkg-config \ po4a \ - syslinux-utils \ texinfo \ ninja-build \ meson \ @@ -354,7 +351,12 @@ ubuntu() llvm \ clang \ perl \ - doxygen + doxygen" + # Not availible for at least ARM hosts + case "$host_arch" in + x86*|i?86) pkgs="$pkgs libc6-dev-i386 syslinux-utils";; + esac + sudo "$2" install $pkgs if [ "$1" == "qemu" ]; then if [ -z "$(which qemu-system-x86_64)" ]; then echo "Installing QEMU..." @@ -713,6 +715,7 @@ elif [ "$1" == "-s" ]; then exit fi +host_arch=$(uname -m) emulator="qemu" defpackman="apt-get" dependenciesonly=false diff --git a/config/aarch64/server.toml b/config/aarch64/server.toml new file mode 100644 index 0000000..6e1b1e1 --- /dev/null +++ b/config/aarch64/server.toml @@ -0,0 +1,181 @@ +# Default server configuration + +# General settings +[general] +# Filesystem size in MiB +filesystem_size = 256 +# Do not prompt if settings are not defined +prompt = false + +# Package settings +[packages] +bootloader = {} +bootstrap = {} +ca-certificates = {} +contain = {} +coreutils = {} +dash = {} +diffutils = {} +# FIXME: failed to build +# drivers = {} +# FIXME: failed to build +# escalated = {} +extrautils = {} +findutils = {} +initfs = {} +# FIXME: failed to build +# installer = {} +ion = {} +ipcd = {} +kernel = {} +netdb = {} +netstack = {} +netutils = {} +# FIXME: failed to build +# pkgutils = {} +ptyd = {} +redoxfs = {} +resist = {} +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 = "/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/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.8.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/mk/config.mk b/mk/config.mk index 0756ca4..b9e256b 100644 --- a/mk/config.mk +++ b/mk/config.mk @@ -1,8 +1,10 @@ -include .config +HOST_ARCH?=$(shell uname -m) + # Configuration -## Architecture to build Redox for (aarch64, i686, or x86_64) -ARCH?=x86_64 +## Architecture to build Redox for (aarch64, i686, or x86_64). Defaults to a host one +ARCH?=$(HOST_ARCH) ## Enable to use binary prefix (much faster) PREFIX_BINARY?=1 ## Enable to use binary packages (much faster) @@ -21,15 +23,12 @@ PODMAN_BUILD?=0 CONTAINERFILE?=podman/redox-base-containerfile # Per host variables -# TODO: get host arch automatically -HOST_ARCH=x86_64 HOST_CARGO=env -u RUSTUP_TOOLCHAIN cargo UNAME := $(shell uname) ifeq ($(UNAME),Darwin) FUMOUNT=umount export NPROC=sysctl -n hw.ncpu export REDOX_MAKE=make - PREFIX_BINARY=0 VB_AUDIO=coreaudio VBM=/Applications/VirtualBox.app/Contents/MacOS/VBoxManage HOST_TARGET ?= $(HOST_ARCH)-apple-darwin @@ -38,7 +37,6 @@ else ifeq ($(UNAME),FreeBSD) FUMOUNT=sudo umount export NPROC=sysctl -n hw.ncpu export REDOX_MAKE=gmake - PREFIX_BINARY=0 VB_AUDIO=pulse # To check, will probaly be OSS on most setups VBM=VBoxManage HOST_TARGET ?= $(HOST_ARCH)-unknown-freebsd @@ -59,6 +57,13 @@ else ALLOC_FILE=fallocate --posix --length "$(FILESYSTEM_SIZE)MiB" endif +ifneq ($(UNAME),Linux) + PREFIX_BINARY=0 +endif +ifneq ($(HOST_ARCH),x86_64) + PREFIX_BINARY=0 +endif + # Automatic variables ROOT=$(CURDIR) export RUST_COMPILER_RT_ROOT=$(ROOT)/rust/src/llvm-project/compiler-rt diff --git a/mk/qemu.mk b/mk/qemu.mk index 308d1d0..1c3adfd 100644 --- a/mk/qemu.mk +++ b/mk/qemu.mk @@ -16,7 +16,6 @@ else ifeq ($(ARCH),x86_64) QEMUFLAGS+=-smp 4 -m 2048 else ifeq ($(ARCH),aarch64) efi=yes - kvm=no live=yes QEMU_ARCH=aarch64 QEMU_MACHINE=virt @@ -33,6 +32,10 @@ else $(error Unsupported ARCH for QEMU "$(ARCH)")) endif +ifneq ($(ARCH),$(HOST_ARCH)) + kvm=no +endif + ifeq ($(efi),yes) FIRMWARE=$(BUILD)/firmware.rom QEMUFLAGS+=-bios $(BUILD)/firmware.rom diff --git a/scripts/changelog.sh b/scripts/changelog.sh index 10348a8..0475665 100755 --- a/scripts/changelog.sh +++ b/scripts/changelog.sh @@ -12,7 +12,7 @@ REPOS=( rust=rust ) -for package in $(installer/target/release/redox_installer --list-packages -c config/x86_64/desktop.toml) +for package in $(installer/target/release/redox_installer --list-packages -c config/$(uname -m)/desktop.toml) do REPOS+=("${package}=cookbook/recipes/${package}/source") done diff --git a/scripts/find-recipe.sh b/scripts/find-recipe.sh index aa371b0..61fb277 100755 --- a/scripts/find-recipe.sh +++ b/scripts/find-recipe.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Ensure arch and config are set as desired, we use these to find the build dir -export ARCH=x86_64 +export ARCH=$(uname -m) export CONFIG_NAME=desktop # Make sure to unmount the image first