mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-06-22 12:54:20 +08:00
Improve host vs container separation of fstools
This commit is contained in:
parent
9473acbd62
commit
cf9a0085be
@ -84,12 +84,13 @@ else
|
||||
export GNU_TARGET=$(TARGET)
|
||||
endif
|
||||
BUILD=build/$(ARCH)/$(CONFIG_NAME)
|
||||
INSTALLER=build/fstools/bin/redox_installer
|
||||
HOST_FSTOOLS=build/fstools
|
||||
INSTALLER=$(HOST_FSTOOLS)/bin/redox_installer
|
||||
INSTALLER_OPTS=
|
||||
LIST_PACKAGES=installer/target/release/list_packages
|
||||
LIST_PACKAGES_OPTS=
|
||||
REDOXFS=build/fstools/bin/redoxfs
|
||||
REDOXFS_MKFS=build/fstools/bin/redoxfs-mkfs
|
||||
REDOXFS=$(HOST_FSTOOLS)/bin/redoxfs
|
||||
REDOXFS_MKFS=$(HOST_FSTOOLS)/bin/redoxfs-mkfs
|
||||
ifeq ($(REPO_BINARY),0)
|
||||
INSTALLER_OPTS+=--cookbook=cookbook
|
||||
else
|
||||
|
||||
10
mk/disk.mk
10
mk/disk.mk
@ -1,6 +1,6 @@
|
||||
# Configuration file with the commands configuration of the Redox image
|
||||
|
||||
$(BUILD)/harddrive.img: $(FSTOOLS_TAG) $(REPO_TAG)
|
||||
$(BUILD)/harddrive.img: $(HOST_FSTOOLS) $(REPO_TAG)
|
||||
mkdir -p $(BUILD)
|
||||
rm -rf $@ $@.partial
|
||||
-$(FUMOUNT) /tmp/redox_installer || true
|
||||
@ -12,7 +12,7 @@ $(BUILD)/harddrive.img: $(FSTOOLS_TAG) $(REPO_TAG)
|
||||
umask 002 && $(INSTALLER) $(INSTALLER_OPTS) -c $(FILESYSTEM_CONFIG) $@.partial
|
||||
mv $@.partial $@
|
||||
|
||||
$(BUILD)/livedisk.iso: $(FSTOOLS_TAG) $(REPO_TAG)
|
||||
$(BUILD)/livedisk.iso: $(HOST_FSTOOLS) $(REPO_TAG)
|
||||
mkdir -p $(BUILD)
|
||||
rm -rf $@ $@.partial
|
||||
-$(FUMOUNT) /tmp/redox_installer || true
|
||||
@ -24,7 +24,7 @@ $(BUILD)/livedisk.iso: $(FSTOOLS_TAG) $(REPO_TAG)
|
||||
umask 002 && $(INSTALLER) $(INSTALLER_OPTS) -c $(FILESYSTEM_CONFIG) --live $@.partial
|
||||
mv $@.partial $@
|
||||
|
||||
$(BUILD)/filesystem.img: $(FSTOOLS_TAG) $(REPO_TAG)
|
||||
$(BUILD)/filesystem.img: $(HOST_FSTOOLS) $(REPO_TAG)
|
||||
mkdir -p $(BUILD)
|
||||
-$(FUMOUNT) $(BUILD)/filesystem/ || true
|
||||
rm -rf $@ $@.partial $(BUILD)/filesystem/
|
||||
@ -45,13 +45,13 @@ $(BUILD)/filesystem.img: $(FSTOOLS_TAG) $(REPO_TAG)
|
||||
rm -rf $(BUILD)/filesystem/
|
||||
mv $@.partial $@
|
||||
|
||||
mount: $(FSTOOLS_TAG) FORCE
|
||||
mount: $(HOST_FSTOOLS) FORCE
|
||||
mkdir -p $(BUILD)/filesystem/
|
||||
$(REDOXFS) $(BUILD)/harddrive.img $(BUILD)/filesystem/
|
||||
sleep 2
|
||||
pgrep redoxfs
|
||||
|
||||
mount_extra: $(FSTOOLS_TAG) FORCE
|
||||
mount_extra: $(HOSST_FSTOOLS) FORCE
|
||||
mkdir -p $(BUILD)/filesystem/
|
||||
$(REDOXFS) $(BUILD)/extra.img $(BUILD)/filesystem/
|
||||
sleep 2
|
||||
|
||||
@ -3,19 +3,19 @@
|
||||
fstools: $(FSTOOLS_TAG)
|
||||
|
||||
# These tools run inside Podman if it is used, or on the host if Podman is not used
|
||||
$(FSTOOLS_TAG): cookbook installer build/fstools $(CONTAINER_TAG)
|
||||
$(FSTOOLS_TAG): 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
|
||||
$(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
|
||||
build/fstools: installer redoxfs
|
||||
$(HOST_FSTOOLS): installer redoxfs
|
||||
rm -rf $@ $@.partial
|
||||
mkdir -p $@.partial
|
||||
$(HOST_CARGO) install --root $@.partial --path installer --bin redox_installer
|
||||
@ -31,6 +31,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 build/fstools
|
||||
rm -rf $(HOST_FSTOOLS)
|
||||
rm -f $(FSTOOLS_TAG)
|
||||
endif
|
||||
|
||||
Loading…
Reference in New Issue
Block a user