From 154c7bf4bf39cd3ff518fb093ac50871e3f7907a Mon Sep 17 00:00:00 2001 From: Wildan M Date: Mon, 10 Nov 2025 13:22:42 +0700 Subject: [PATCH 1/8] Move installer behind podman --- mk/config.mk | 8 ++++---- mk/disk.mk | 28 ++++++++++++++++++++++++++++ mk/fstools.mk | 24 +++++++++++++----------- mk/podman.mk | 10 +++++----- mk/prefix.mk | 6 +++++- podman/redox-base-containerfile | 7 +------ 6 files changed, 56 insertions(+), 27 deletions(-) diff --git a/mk/config.mk b/mk/config.mk index 8cc578d4b..e310ecc01 100644 --- a/mk/config.mk +++ b/mk/config.mk @@ -132,13 +132,13 @@ else endif BUILD=build/$(ARCH)/$(CONFIG_NAME) MOUNT_DIR=$(BUILD)/filesystem -HOST_FSTOOLS=build/fstools -INSTALLER=$(HOST_FSTOOLS)/bin/redox_installer +FSTOOLS=build/fstools +INSTALLER=$(FSTOOLS)/bin/redox_installer +REDOXFS=$(FSTOOLS)/bin/redoxfs +REDOXFS_MKFS=$(FSTOOLS)/bin/redoxfs-mkfs INSTALLER_OPTS= LIST_PACKAGES=installer/target/release/list_packages LIST_PACKAGES_OPTS= -REDOXFS=$(HOST_FSTOOLS)/bin/redoxfs -REDOXFS_MKFS=$(HOST_FSTOOLS)/bin/redoxfs-mkfs ifeq ($(REPO_BINARY),0) INSTALLER_OPTS+=--cookbook=cookbook else diff --git a/mk/disk.mk b/mk/disk.mk index 7cbae0d9e..092862d57 100644 --- a/mk/disk.mk +++ b/mk/disk.mk @@ -1,6 +1,9 @@ # Configuration file with the commands configuration of the Redox image $(BUILD)/harddrive.img: $(HOST_FSTOOLS) $(REPO_TAG) +ifeq ($(PODMAN_BUILD),1) + $(PODMAN_RUN) make $@ +else mkdir -p $(BUILD) rm -rf $@ $@.partial -$(FUMOUNT) /tmp/redox_installer || true @@ -11,8 +14,12 @@ $(BUILD)/harddrive.img: $(HOST_FSTOOLS) $(REPO_TAG) truncate -s "$$FILESYSTEM_SIZE"m $@.partial umask 002 && $(INSTALLER) $(INSTALLER_OPTS) -c $(FILESYSTEM_CONFIG) $@.partial mv $@.partial $@ +endif $(BUILD)/redox-live.iso: $(HOST_FSTOOLS) $(REPO_TAG) redox.ipxe +ifeq ($(PODMAN_BUILD),1) + $(PODMAN_RUN) make $@ +else mkdir -p $(BUILD) rm -rf $@ $@.partial -$(FUMOUNT) /tmp/redox_installer || true @@ -24,8 +31,12 @@ $(BUILD)/redox-live.iso: $(HOST_FSTOOLS) $(REPO_TAG) redox.ipxe umask 002 && $(INSTALLER) $(INSTALLER_OPTS) -c $(FILESYSTEM_CONFIG) --write-bootloader="$(BUILD)/bootloader-live.efi" --live $@.partial mv $@.partial $@ cp redox.ipxe $(BUILD)/redox.ipxe +endif $(BUILD)/filesystem.img: $(HOST_FSTOOLS) $(REPO_TAG) +ifeq ($(PODMAN_BUILD),1) + $(PODMAN_RUN) make $@ +else mkdir -p $(BUILD) -$(FUMOUNT) $(MOUNT_DIR) || true rm -rf $@ $@.partial $(MOUNT_DIR) @@ -45,27 +56,44 @@ $(BUILD)/filesystem.img: $(HOST_FSTOOLS) $(REPO_TAG) -$(FUMOUNT) $(MOUNT_DIR) || true rm -rf $(MOUNT_DIR) mv $@.partial $@ +endif mount: $(HOST_FSTOOLS) FORCE +ifeq ($(PODMAN_BUILD),1) + $(PODMAN_RUN) make $@ +else mkdir -p $(MOUNT_DIR) $(REDOXFS) $(BUILD)/harddrive.img $(MOUNT_DIR) sleep 2 pgrep redoxfs +endif mount_extra: $(HOST_FSTOOLS) FORCE +ifeq ($(PODMAN_BUILD),1) + $(PODMAN_RUN) make $@ +else mkdir -p $(MOUNT_DIR) $(REDOXFS) $(BUILD)/extra.img $(MOUNT_DIR) sleep 2 pgrep redoxfs +endif mount_live: $(HOST_FSTOOLS) FORCE +ifeq ($(PODMAN_BUILD),1) + $(PODMAN_RUN) make $@ +else mkdir -p $(MOUNT_DIR) $(REDOXFS) $(BUILD)/redox-live.iso $(MOUNT_DIR) sleep 2 pgrep redoxfs +endif unmount: FORCE +ifeq ($(PODMAN_BUILD),1) + $(PODMAN_RUN) make $@ +else sync -$(FUMOUNT) $(MOUNT_DIR) || true rm -rf $(MOUNT_DIR) -$(FUMOUNT) /tmp/redox_installer || true +endif diff --git a/mk/fstools.mk b/mk/fstools.mk index 325c3a863..d983c811a 100644 --- a/mk/fstools.mk +++ b/mk/fstools.mk @@ -3,25 +3,27 @@ fstools: $(FSTOOLS_TAG) $(HOST_FSTOOLS) # These tools run inside Podman if it is used, or on the host if Podman is not used -$(FSTOOLS_TAG): cookbook installer $(CONTAINER_TAG) +$(FSTOOLS): cookbook installer $(CONTAINER_TAG) ifeq ($(PODMAN_BUILD),1) $(PODMAN_RUN) make $@ else - $(HOST_CARGO) build --manifest-path cookbook/Cargo.toml --release - $(HOST_CARGO) build --manifest-path cookbook/pkgar/Cargo.toml --release - $(HOST_CARGO) build --manifest-path installer/Cargo.toml --bin list_packages --release - mkdir -p build - touch $@ -endif - -## The installer and redoxfs run on the host, even when using Podman build -$(HOST_FSTOOLS): installer redoxfs rm -rf $@ $@.partial mkdir -p $@.partial + $(HOST_CARGO) build --manifest-path cookbook/Cargo.toml --release + $(HOST_CARGO) build --manifest-path cookbook/pkgar/Cargo.toml --release $(HOST_CARGO) install --root $@.partial --path installer --bin redox_installer $(HOST_CARGO) install --root $@.partial --path redoxfs --bin redoxfs --bin redoxfs-mkfs --bin redoxfs-resize mv $@.partial $@ touch $@ +endif + +## TODO: remove this +$(FSTOOLS_TAG): $(FSTOOLS) +ifeq ($(PODMAN_BUILD),1) + $(PODMAN_RUN) make $@ +else + touch $@ +endif fstools_clean: FORCE $(CONTAINER_TAG) ifeq ($(PODMAN_BUILD),1) @@ -31,6 +33,6 @@ else $(HOST_CARGO) clean --manifest-path cookbook/pkgar/Cargo.toml $(HOST_CARGO) clean --manifest-path installer/Cargo.toml $(HOST_CARGO) clean --manifest-path redoxfs/Cargo.toml - rm -rf $(HOST_FSTOOLS) + rm -rf $(FSTOOLS) rm -f $(FSTOOLS_TAG) endif diff --git a/mk/podman.mk b/mk/podman.mk index 74364d5ee..489491449 100644 --- a/mk/podman.mk +++ b/mk/podman.mk @@ -17,10 +17,10 @@ endif ## Podman Home Directory PODMAN_HOME?=$(ROOT)/build/podman ## Podman command with its many arguments -PODMAN_VOLUMES?=--volume $(ROOT):$(CONTAINER_WORKDIR)$(PODMAN_VOLUME_FLAG) --volume $(PODMAN_HOME):/home$(PODMAN_VOLUME_FLAG) -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_VOLUMES?=--volume $(ROOT):$(CONTAINER_WORKDIR)$(PODMAN_VOLUME_FLAG) --volume $(PODMAN_HOME):/root$(PODMAN_VOLUME_FLAG) +PODMAN_ENV?=--env PATH=/root/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin --env PODMAN_BUILD=0 PODMAN_CONFIG?=--env ARCH=$(ARCH) --env BOARD=$(BOARD) --env CONFIG_NAME=$(CONFIG_NAME) --env FILESYSTEM_CONFIG=$(FILESYSTEM_CONFIG) --env REPO_APPSTREAM=$(REPO_APPSTREAM) --env REPO_NONSTOP=$(REPO_NONSTOP) --env REPO_OFFLINE=$(REPO_OFFLINE) --env CI=$(CI) -PODMAN_OPTIONS?=--rm --workdir $(CONTAINER_WORKDIR) --userns keep-id --user `id -u` --interactive --tty --env TERM=$(TERM) +PODMAN_OPTIONS?=--rm --workdir $(CONTAINER_WORKDIR) --interactive --tty --cap-add SYS_ADMIN --device /dev/fuse --env TERM=$(TERM) PODMAN_RUN?=podman run $(PODMAN_OPTIONS) $(PODMAN_VOLUMES) $(PODMAN_ENV) $(PODMAN_CONFIG) $(IMAGE_TAG) container_shell: build/container.tag @@ -56,12 +56,12 @@ container_kill: FORCE 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\"." + -chmod -R 0700 $(PODMAN_HOME) || true -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) + cat $(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 diff --git a/mk/prefix.mk b/mk/prefix.mk index 561572113..51ccfd663 100644 --- a/mk/prefix.mk +++ b/mk/prefix.mk @@ -71,6 +71,9 @@ $(PREFIX)/relibc-install.tar.gz: $(PREFIX)/relibc-install . $(PREFIX)/libtool: +ifeq ($(PODMAN_BUILD),1) + $(PODMAN_RUN) make $@ +else rm -rf "$@.partial" "$@" mkdir -p "$@.partial" @@ -85,6 +88,7 @@ $(PREFIX)/libtool: touch "$@.partial" echo $(LIBTOOL_VERSION) > $@.partial/.tarball-version mv "$@.partial" "$@" +endif $(PREFIX)/libtool-build: $(PREFIX)/libtool $(PREFIX)/rust-install ifeq ($(PODMAN_BUILD),1) @@ -100,7 +104,7 @@ else --gnulib-srcdir=./gnulib PATH="$(ROOT)/$(PREFIX)/rust-install/bin:$$PATH" && \ cd "$@.partial" && \ - cp -rp $(abspath $<)/. ./ && \ + cp -r $(abspath $<)/. ./ && \ "$(ROOT)/$ Date: Mon, 10 Nov 2025 14:00:51 +0700 Subject: [PATCH 2/8] Do not rebuild container on make clean --- Makefile | 24 ++++++++++++++++-------- mk/fstools.mk | 14 +++++--------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index b3b788031..2a22ff2e5 100644 --- a/Makefile +++ b/Makefile @@ -28,26 +28,34 @@ rebuild: rm -rf $(BUILD)/repo.tag $(BUILD)/harddrive.img $(BUILD)/redox-live.iso $(MAKE) all -clean: $(CONTAINER_TAG) +clean: ifeq ($(PODMAN_BUILD),1) +ifneq ("$(wildcard $(CONTAINER_TAG))","") $(PODMAN_RUN) make $@ +else + $(info will not run cookbook clean as container is not built) +endif else $(MAKE) c.--all - -rm -rf cookbook/repo - $(MAKE) fstools_clean - $(HOST_CARGO) clean --manifest-path relibc/Cargo.toml -endif -$(FUMOUNT) $(BUILD)/filesystem/ || true -$(FUMOUNT) /tmp/redox_installer/ || true +endif + rm -rf cookbook/repo + rm -rf relibc/target rm -rf $(BUILD) $(PREFIX) + $(MAKE) fstools_clean -distclean: $(CONTAINER_TAG) +distclean: ifeq ($(PODMAN_BUILD),1) +ifneq ("$(wildcard $(CONTAINER_TAG))","") $(PODMAN_RUN) make $@ else - $(MAKE) u.--all - $(MAKE) clean + $(info will not run cookbook unfetch as container is not built) endif +else + $(MAKE) u.--all +endif + $(MAKE) clean pull: git pull diff --git a/mk/fstools.mk b/mk/fstools.mk index d983c811a..b7c231fc4 100644 --- a/mk/fstools.mk +++ b/mk/fstools.mk @@ -25,14 +25,10 @@ else 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 cookbook/pkgar/Cargo.toml - $(HOST_CARGO) clean --manifest-path installer/Cargo.toml - $(HOST_CARGO) clean --manifest-path redoxfs/Cargo.toml +fstools_clean: FORCE + rm -rf cookbook/target + rm -rf cookbook/pkgar/target + rm -rf installer/target + rm -rf redoxfs/target rm -rf $(FSTOOLS) rm -f $(FSTOOLS_TAG) -endif From f7a3ddecf2c266a42c9fe4f6823d46d8e90bd958 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Mon, 10 Nov 2025 21:11:48 +0700 Subject: [PATCH 3/8] Use network host --- mk/podman.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/podman.mk b/mk/podman.mk index 489491449..1b50024d0 100644 --- a/mk/podman.mk +++ b/mk/podman.mk @@ -20,7 +20,7 @@ PODMAN_HOME?=$(ROOT)/build/podman PODMAN_VOLUMES?=--volume $(ROOT):$(CONTAINER_WORKDIR)$(PODMAN_VOLUME_FLAG) --volume $(PODMAN_HOME):/root$(PODMAN_VOLUME_FLAG) PODMAN_ENV?=--env PATH=/root/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin --env PODMAN_BUILD=0 PODMAN_CONFIG?=--env ARCH=$(ARCH) --env BOARD=$(BOARD) --env CONFIG_NAME=$(CONFIG_NAME) --env FILESYSTEM_CONFIG=$(FILESYSTEM_CONFIG) --env REPO_APPSTREAM=$(REPO_APPSTREAM) --env REPO_NONSTOP=$(REPO_NONSTOP) --env REPO_OFFLINE=$(REPO_OFFLINE) --env CI=$(CI) -PODMAN_OPTIONS?=--rm --workdir $(CONTAINER_WORKDIR) --interactive --tty --cap-add SYS_ADMIN --device /dev/fuse --env TERM=$(TERM) +PODMAN_OPTIONS?=--rm --workdir $(CONTAINER_WORKDIR) --interactive --tty --cap-add SYS_ADMIN --device /dev/fuse --network=host --env TERM=$(TERM) PODMAN_RUN?=podman run $(PODMAN_OPTIONS) $(PODMAN_VOLUMES) $(PODMAN_ENV) $(PODMAN_CONFIG) $(IMAGE_TAG) container_shell: build/container.tag From 6f8925ce5ebd96226d2149a1b01cf10957b24104 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Tue, 11 Nov 2025 14:21:09 +0700 Subject: [PATCH 4/8] Avoid installing rust --- mk/config.mk | 2 + mk/prefix.mk | 8 +++ podman_bootstrap.sh | 130 ++------------------------------------------ 3 files changed, 15 insertions(+), 125 deletions(-) diff --git a/mk/config.mk b/mk/config.mk index e310ecc01..1d9afaa7a 100644 --- a/mk/config.mk +++ b/mk/config.mk @@ -46,6 +46,7 @@ CONTAINERFILE?=podman/redox-base-containerfile export NPROC=nproc export REDOX_MAKE=make +ifeq ($(PODMAN_BUILD),1) HOST_TARGET := $(shell env -u RUSTUP_TOOLCHAIN rustc -vV | grep host | cut -d: -f2 | tr -d " ") # x86_64 linux hosts have all toolchains ifneq ($(HOST_TARGET),x86_64-unknown-linux-gnu) @@ -60,6 +61,7 @@ ifneq ($(HOST_TARGET),x86_64-unknown-linux-gnu) PREFIX_BINARY=0 endif endif +endif ifeq ($(SCCACHE_BUILD),1) ifeq (,$(shell command -v sccache)) diff --git a/mk/prefix.mk b/mk/prefix.mk index 51ccfd663..a286ab4a2 100644 --- a/mk/prefix.mk +++ b/mk/prefix.mk @@ -130,17 +130,25 @@ endif ifeq ($(PREFIX_BINARY),1) $(PREFIX)/rust-install.tar.gz: +ifeq ($(PODMAN_BUILD),1) + $(PODMAN_RUN) make $@ +else mkdir -p "$(@D)" #TODO: figure out why rust-install.tar.gz is missing /lib/rustlib/$(HOST_TARGET)/lib wget -O $@.partial "https://static.redox-os.org/toolchain/$(HOST_TARGET)/$(TARGET)/relibc-install.tar.gz" mv $@.partial $@ +endif $(PREFIX)/rust-install: $(PREFIX)/rust-install.tar.gz +ifeq ($(PODMAN_BUILD),1) + $(PODMAN_RUN) make $@ +else rm -rf "$@.partial" "$@" mkdir -p "$@.partial" tar --extract --file "$<" --directory "$@.partial" --strip-components=1 touch "$@.partial" mv "$@.partial" "$@" +endif else diff --git a/podman_bootstrap.sh b/podman_bootstrap.sh index 2cfc492a4..f842136f3 100644 --- a/podman_bootstrap.sh +++ b/podman_bootstrap.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # This script setup the Redox build system with Podman -# It install the Podman dependencies, Rustup, recipes dependencies for cross-compilation +# It install the Podman dependencies for cross-compilation # and download the build system configuration files set -e @@ -100,7 +100,6 @@ osx_macports() install_macports_pkg "git" install_macports_pkg "gmake" install_macports_pkg "curl" - install_macports_pkg "osxfuse" install_macports_pkg "podman" install_macports_pkg "gdb +multiarch" @@ -129,8 +128,6 @@ osx_homebrew() install_brew_pkg "git" install_brew_pkg "make" install_brew_pkg "curl" - install_brew_pkg "osxfuse" - install_brew_pkg "fuse-overlayfs" install_brew_pkg "slirp4netns" install_brew_pkg "podman" install_brew_pkg "gdb" @@ -159,7 +156,6 @@ freebsd() install_freebsd_pkg "git" install_freebsd_pkg "gmake" install_freebsd_pkg "curl" - install_freebsd_pkg "fusefs-libs3" install_freebsd_pkg "podman" install_freebsd_pkg "gdb" @@ -486,7 +482,6 @@ usage() 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" @@ -497,111 +492,6 @@ usage() 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 takes care of everything associated to rust, and the version -# manager that controls it, it can install rustup and uninstall multirust as -# well as making sure that the correct version of rustc is selected by rustup -# @params: $1 install non-interactively, boolean -############################################################################# -rustInstall() -{ - noninteractive=$1 - # Check to see if multirust is installed, we don't want it messing with rustup - # In the future we can probably remove this but I believe it's good to have for now - if [ -e /usr/local/lib/rustlib/uninstall.sh ] ; then - echo "It appears that multirust is installed on your system." - echo "This tool has been deprecated by the maintainer, and will cause issues." - echo "This script can remove multirust from your system if you wish." - printf "Uninstall multirust (y/N):" - read multirust - if echo "$multirust" | grep -iq "^y" ;then - sudo /usr/local/lib/rustlib/uninstall.sh - else - echo "Please manually uninstall multirust and any other versions of rust, then re-run bootstrap." - exit 1 - fi - fi - # If rustup is not installed we should offer to install it for them - if [ -z "$(which rustup)" ]; then - rustup_options="--default-toolchain stable" - echo "You do not have rustup installed." - if [ "$noninteractive" = true ]; then - rustup="y" - rustup_options+=" -y" - else - echo "We HIGHLY recommend using rustup." - echo "Would you like to install it now?" - echo "*WARNING* this involves a 'curl | sh' style command" - printf "(y/N): " - read rustup - fi - if echo "$rustup" | grep -iq "^y" ;then - #install rustup - curl https://sh.rustup.rs -sSf | sh -s -- $rustup_options - # You have to add the rustup variables to the $PATH - echo "export PATH=\"\$HOME/.cargo/bin:\$PATH\"" >> ~/.bashrc - # source the variables so that we can execute rustup commands in the current shell - source ~/.cargo/env - else - echo "Rustup will not be installed!" - fi - fi - if [ -z "$(which rustc)" ]; then - echo "Rust is not installed" - echo "Please either run the script again, accepting rustup install" - echo "or install rustc stable manually (not recommended) via:" - echo "\#curl -sSf https://static.rust-lang.org/rustup.sh | sh -s -- --channel=stable" - exit 1 - else - echo "Your Rust install looks good!" - fi -} - -#################################################################### -# This function 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 @@ -618,22 +508,19 @@ boot() 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 "If you need a much quicker installation, run: " + echo " echo REPO_BINARY=1 >> redox/.config" echo - echo "** Be sure to update your path to include Rust - run the following command: **" - echo 'source $HOME/.cargo/env' - echo - echo "Run the following commands to build redox using Podman:" + 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 "$MAKE $emulator" echo echo " Good luck!" @@ -645,10 +532,6 @@ if [ "$1" == "-h" ] || [ "$1" == "--help" ]; then elif [ "$1" == "-u" ]; then git pull upstream master git submodule update --recursive --init - rustup update nightly - exit -elif [ "$1" == "-s" ]; then - statusCheck exit fi @@ -664,15 +547,12 @@ do 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 -rustInstall "$noninteractive" - if [ "$update" == "true" ]; then git pull upstream master git submodule update --recursive --init From ac7ffbfafa443c23af6fe6c46d0836ef3aecbb16 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Tue, 11 Nov 2025 14:23:45 +0700 Subject: [PATCH 5/8] Make podman bootstrap executable --- podman_bootstrap.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 podman_bootstrap.sh diff --git a/podman_bootstrap.sh b/podman_bootstrap.sh old mode 100644 new mode 100755 From 025ec35791af5ec0419f0168e2c9de2c67b76170 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Tue, 11 Nov 2025 14:27:09 +0700 Subject: [PATCH 6/8] Typo --- mk/config.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/config.mk b/mk/config.mk index 1d9afaa7a..44c20a484 100644 --- a/mk/config.mk +++ b/mk/config.mk @@ -46,7 +46,7 @@ CONTAINERFILE?=podman/redox-base-containerfile export NPROC=nproc export REDOX_MAKE=make -ifeq ($(PODMAN_BUILD),1) +ifneq ($(PODMAN_BUILD),1) HOST_TARGET := $(shell env -u RUSTUP_TOOLCHAIN rustc -vV | grep host | cut -d: -f2 | tr -d " ") # x86_64 linux hosts have all toolchains ifneq ($(HOST_TARGET),x86_64-unknown-linux-gnu) From ab74947f2c3ffe8da37c2d13a8de80b519c53e4d Mon Sep 17 00:00:00 2001 From: Wildan M Date: Tue, 11 Nov 2025 14:34:38 +0700 Subject: [PATCH 7/8] Fix depends on container tag --- mk/prefix.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mk/prefix.mk b/mk/prefix.mk index a286ab4a2..f4e3860ab 100644 --- a/mk/prefix.mk +++ b/mk/prefix.mk @@ -70,7 +70,7 @@ $(PREFIX)/relibc-install.tar.gz: $(PREFIX)/relibc-install --directory="$<" \ . -$(PREFIX)/libtool: +$(PREFIX)/libtool: | $(CONTAINER_TAG) ifeq ($(PODMAN_BUILD),1) $(PODMAN_RUN) make $@ else @@ -90,7 +90,7 @@ else mv "$@.partial" "$@" endif -$(PREFIX)/libtool-build: $(PREFIX)/libtool $(PREFIX)/rust-install +$(PREFIX)/libtool-build: $(PREFIX)/libtool $(PREFIX)/rust-install $(CONTAINER_TAG) ifeq ($(PODMAN_BUILD),1) $(PODMAN_RUN) make $@ else @@ -129,7 +129,7 @@ endif ifeq ($(PREFIX_BINARY),1) -$(PREFIX)/rust-install.tar.gz: +$(PREFIX)/rust-install.tar.gz: | $(CONTAINER_TAG) ifeq ($(PODMAN_BUILD),1) $(PODMAN_RUN) make $@ else @@ -139,7 +139,7 @@ else mv $@.partial $@ endif -$(PREFIX)/rust-install: $(PREFIX)/rust-install.tar.gz +$(PREFIX)/rust-install: $(PREFIX)/rust-install.tar.gz $(CONTAINER_TAG) ifeq ($(PODMAN_BUILD),1) $(PODMAN_RUN) make $@ else From 9f04c92c4a5e7518ce60b458d35edd170103c82a Mon Sep 17 00:00:00 2001 From: Wildan M Date: Tue, 11 Nov 2025 16:16:33 +0700 Subject: [PATCH 8/8] Don't execute rm twice on clean --- Makefile | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 2a22ff2e5..019a671d8 100644 --- a/Makefile +++ b/Makefile @@ -28,22 +28,29 @@ rebuild: rm -rf $(BUILD)/repo.tag $(BUILD)/harddrive.img $(BUILD)/redox-live.iso $(MAKE) all +# To tell that it's not safe +# to execute the cookbook binary +NOT_ON_PODMAN?=0 + clean: ifeq ($(PODMAN_BUILD),1) ifneq ("$(wildcard $(CONTAINER_TAG))","") $(PODMAN_RUN) make $@ else $(info will not run cookbook clean as container is not built) -endif + $(MAKE) clean PODMAN_BUILD=0 NOT_ON_PODMAN=1 +endif # CONTAINER_TAG else +ifneq ($(NOT_ON_PODMAN),1) $(MAKE) c.--all -$(FUMOUNT) $(BUILD)/filesystem/ || true -$(FUMOUNT) /tmp/redox_installer/ || true -endif +endif # NOT_ON_PODMAN rm -rf cookbook/repo rm -rf relibc/target rm -rf $(BUILD) $(PREFIX) $(MAKE) fstools_clean +endif # PODMAN_BUILD distclean: ifeq ($(PODMAN_BUILD),1) @@ -51,11 +58,14 @@ ifneq ("$(wildcard $(CONTAINER_TAG))","") $(PODMAN_RUN) make $@ else $(info will not run cookbook unfetch as container is not built) -endif + $(MAKE) distclean PODMAN_BUILD=0 NOT_ON_PODMAN=1 +endif # CONTAINER_TAG else +ifneq ($(NOT_ON_PODMAN),1) $(MAKE) u.--all -endif - $(MAKE) clean +endif # NOT_ON_PODMAN + $(MAKE) clean NOT_ON_PODMAN=1 +endif # PODMAN_BUILD pull: git pull