Merge branch 'patch-make-macos' into 'master'

Fix macos podman build

Closes #1425

See merge request redox-os/redox!1581
This commit is contained in:
Wildan Mubarok 2025-08-25 14:14:07 +00:00
commit a4361fce6f
5 changed files with 32 additions and 17 deletions

View File

@ -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) $(BUILD)/filesystem/ || true
rm -rf $@ $@.partial $(BUILD)/filesystem/
@ -45,6 +56,7 @@ $(BUILD)/filesystem.img: $(HOST_FSTOOLS) $(REPO_TAG)
-$(FUMOUNT) $(BUILD)/filesystem/ || true
rm -rf $(BUILD)/filesystem/
mv $@.partial $@
endif
mount: $(HOST_FSTOOLS) FORCE
mkdir -p $(BUILD)/filesystem/

View File

@ -16,12 +16,16 @@ endif
## The installer and redoxfs run on the host, even when using Podman build
$(HOST_FSTOOLS): installer redoxfs
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
rm -rf $@ $@.partial
mkdir -p $@.partial
$(HOST_CARGO) install --root $@.partial --path installer --bin redox_installer
$(HOST_CARGO) install --root $@.partial --path redoxfs --bin redoxfs --bin redoxfs-mkfs
mv $@.partial $@
touch $@
endif
fstools_clean: FORCE $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)

View File

@ -17,15 +17,15 @@ 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)
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
ifeq ($(PODMAN_BUILD),1)
podman run $(PODMAN_VOLUMES) $(PODMAN_OPTIONS) $(PODMAN_ENV) --tty $(IMAGE_TAG) bash
podman run $(PODMAN_VOLUMES) $(PODMAN_OPTIONS) $(PODMAN_ENV) $(IMAGE_TAG) bash
else
@echo PODMAN_BUILD=$(PODMAN_BUILD), please set it to 1 in mk/config.mk
endif
@ -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

View File

@ -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)/$</configure" \
--target="$(TARGET)" \
--prefix=$(abspath $(PREFIX)/sysroot) && \

View File

@ -2,13 +2,8 @@
FROM debian:trixie
# _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 \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ant \
appstream \
appstream-compose \
@ -36,7 +31,6 @@ RUN useradd --create-home --no-log-init --uid _UID_ poduser \
gtk-doc-tools \
help2man \
intltool \
libc6-dev-i386 \
libexpat-dev \
libfontconfig1-dev \
libfuse3-dev \
@ -72,7 +66,6 @@ RUN useradd --create-home --no-log-init --uid _UID_ poduser \
ruby \
scons \
ssh \
syslinux-utils \
texinfo \
unifdef \
unzip \
@ -84,4 +77,6 @@ RUN useradd --create-home --no-log-init --uid _UID_ poduser \
xxd \
zip \
zlib1g-dev \
zstd
zstd; \
if [ "$(dpkg --print-architecture)" = "amd64" ]; then \
apt-get install -y --no-install-recommends libc6-dev-i386 syslinux-utils; fi