Update to use the new repo bin

This commit is contained in:
Wildan M 2025-10-28 00:29:54 +07:00
parent 4786eaf7e3
commit 5382f39857
3 changed files with 26 additions and 88 deletions

View File

@ -32,7 +32,7 @@ clean: $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1) ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@ $(PODMAN_RUN) make $@
else else
cd cookbook && ./clean.sh $(MAKE) c,--all
-rm -rf cookbook/repo -rm -rf cookbook/repo
$(MAKE) fstools_clean $(MAKE) fstools_clean
$(HOST_CARGO) clean --manifest-path relibc/Cargo.toml $(HOST_CARGO) clean --manifest-path relibc/Cargo.toml
@ -45,8 +45,8 @@ distclean: $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1) ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@ $(PODMAN_RUN) make $@
else else
$(MAKE) u,--all
$(MAKE) clean $(MAKE) clean
cd cookbook && ./unfetch.sh
endif endif
pull: pull:

View File

@ -1,60 +1,36 @@
# Configuration file for recipe commands # Configuration file for recipe commands
$(BUILD)/fetch.tag: prefix $(FSTOOLS_TAG) $(FILESYSTEM_CONFIG) $(CONTAINER_TAG) $(REPO_TAG): $(FSTOOLS_TAG) $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1) ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@ $(PODMAN_RUN) make $@
else else
export PATH="$(PREFIX_PATH):$$PATH" && \ export PATH="$(PREFIX_PATH):$$PATH" && \
PACKAGES="$$($(LIST_PACKAGES) $(LIST_PACKAGES_OPTS) --short -c $(FILESYSTEM_CONFIG))" && \
export COOKBOOK_HOST_SYSROOT="$(ROOT)/$(PREFIX_INSTALL)" && \ export COOKBOOK_HOST_SYSROOT="$(ROOT)/$(PREFIX_INSTALL)" && \
cd cookbook && \ PACKAGES="$$($(LIST_PACKAGES) $(LIST_PACKAGES_OPTS) --short -c $(FILESYSTEM_CONFIG))" && \
./fetch.sh $(REPO_NONSTOP) $(REPO_OFFLINE) "$${PACKAGES}" ./cookbook/repo.sh $(REPO_NONSTOP) $(REPO_OFFLINE) --with-package-deps "$${PACKAGES}"
mkdir -p $(BUILD) mkdir -p $(BUILD)
# make sure fstools.tag are newer than the things repo modifies
touch $(FSTOOLS_TAG)
touch $@ touch $@
endif endif
$(REPO_TAG): $(BUILD)/fetch.tag $(FSTOOLS_TAG) $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1) comma := ,
$(PODMAN_RUN) make $@
else
export PATH="$(PREFIX_PATH):$$PATH" && \
export COOKBOOK_HOST_SYSROOT="$(ROOT)/$(PREFIX_INSTALL)" && \
PACKAGES="$$($(LIST_PACKAGES) $(LIST_PACKAGES_OPTS) --short -c $(FILESYSTEM_CONFIG))" && \
cd cookbook && \
./repo.sh $(REPO_NONSTOP) $(REPO_OFFLINE) --with-package-deps "$${PACKAGES}"
mkdir -p $(BUILD)
# make sure fstools.tag and fetch.tag are newer than the things repo modifies
touch $(FSTOOLS_TAG)
touch $(BUILD)/fetch.tag
touch $@
endif
# Find recipe # Find recipe
find.%: $(FSTOOLS_TAG) FORCE find.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1) ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@ $(PODMAN_RUN) make $@
else else
export PATH="$(PREFIX_PATH):$$PATH" && \ @cd ./cookbook && ./target/release/repo find $(foreach f,$(subst $(comma), ,$*),$(f))
export COOKBOOK_HOST_SYSROOT="$(ROOT)/$(PREFIX_INSTALL)" && \
cd cookbook && \
target/release/find_recipe $*
endif endif
comma := ,
# Invoke clean.sh for one or more targets separated by comma # Invoke clean.sh for one or more targets separated by comma
c.%: $(FSTOOLS_TAG) FORCE c.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1) ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@ $(PODMAN_RUN) make $@
else else
@if echo "$*" | grep -q ','; then \ cd ./cookbook && ./target/release/repo clean $(foreach f,$(subst $(comma), ,$*),$(f))
$(MAKE) $(foreach f,$(subst $(comma), ,$*),c.$(f)); \
else \
export PATH="$(PREFIX_PATH):$$PATH" && \
export COOKBOOK_HOST_SYSROOT="$(ROOT)/$(PREFIX_INSTALL)" && \
cd cookbook && \
./clean.sh $*; \
fi
endif endif
# Invoke fetch.sh for one or more targets separated by comma # Invoke fetch.sh for one or more targets separated by comma
@ -62,14 +38,9 @@ f.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1) ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@ $(PODMAN_RUN) make $@
else else
@if echo "$*" | grep -q ','; then \ export PATH="$(PREFIX_PATH):$$PATH" && \
$(MAKE) $(foreach f,$(subst $(comma), ,$*),f.$(f)); \ export COOKBOOK_HOST_SYSROOT="$(ROOT)/$(PREFIX_INSTALL)" && \
else \ cd ./cookbook && ./target/release/repo fetch $(foreach f,$(subst $(comma), ,$*),$(f))
export PATH="$(PREFIX_PATH):$$PATH" && \
export COOKBOOK_HOST_SYSROOT="$(ROOT)/$(PREFIX_INSTALL)" && \
cd cookbook && \
./fetch.sh $*; \
fi
endif endif
# Invoke repo.sh for one or more targets separated by comma # Invoke repo.sh for one or more targets separated by comma
@ -77,14 +48,9 @@ r.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1) ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@ $(PODMAN_RUN) make $@
else else
@if echo "$*" | grep -q ','; then \ export PATH="$(PREFIX_PATH):$$PATH" && \
$(MAKE) $(foreach f,$(subst $(comma), ,$*),r.$(f)); \ export COOKBOOK_HOST_SYSROOT="$(ROOT)/$(PREFIX_INSTALL)" && \
else \ ./cookbook/repo.sh $(REPO_OFFLINE) $(foreach f,$(subst $(comma), ,$*),$(f))
export PATH="$(PREFIX_PATH):$$PATH" && \
export COOKBOOK_HOST_SYSROOT="$(ROOT)/$(PREFIX_INSTALL)" && \
cd cookbook && \
./repo.sh $*; \
fi
endif endif
MOUNTED_TAG=$(MOUNT_DIR)~ MOUNTED_TAG=$(MOUNT_DIR)~
@ -100,34 +66,23 @@ p.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1) ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@ $(PODMAN_RUN) make $@
else else
@if echo "$*" | grep -q ','; then \ cd ./cookbook && ./target/release/repo push $(foreach f,$(subst $(comma), ,$*),$(f)) "--sysroot=../$(MOUNT_DIR)"
$(MAKE) $(foreach f,$(subst $(comma), ,$*),p.$(f)); \
else \
export RECIPE_PATH=cookbook/$(shell make find.$* | grep ^recipes) && \
export RECIPE_STAGE=$$RECIPE_PATH/target/$(TARGET)/stage.pkgar && \
./cookbook/pkgar/target/release/pkgar extract $(MOUNT_DIR)/ --archive $$RECIPE_STAGE \
--pkey ./cookbook/build/id_ed25519.pub.toml && \
echo "extracted $$RECIPE_PATH"; \
fi
endif endif
@if [ -f $(MOUNTED_TAG) ]; then \ @if [ -f $(MOUNTED_TAG) ]; then \
$(MAKE) unmount && rm -f $(MOUNTED_TAG); \ $(MAKE) unmount && rm -f $(MOUNTED_TAG); \
else echo "Not unmounting by ourself, don't forget to do it"; \ else echo "Not unmounting by ourself, don't forget to do it"; \
fi fi
# Push compiled package with their package dependencies
pp.%: $(FSTOOLS_TAG) FORCE
$(MAKE) p.$*,--with-package-deps
# Invoke unfetch.sh for one or more targets separated by comma # Invoke unfetch.sh for one or more targets separated by comma
u.%: $(FSTOOLS_TAG) FORCE u.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1) ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@ $(PODMAN_RUN) make $@
else else
@if echo "$*" | grep -q ','; then \ cd ./cookbook && ./target/release/repo unfetch $(foreach f,$(subst $(comma), ,$*),$(f))
$(MAKE) $(foreach f,$(subst $(comma), ,$*),u.$(f)); \
else \
export PATH="$(PREFIX_PATH):$$PATH" && \
export COOKBOOK_HOST_SYSROOT="$(ROOT)/$(PREFIX_INSTALL)" && \
cd cookbook && \
./unfetch.sh $*; \
fi
endif endif
# Invoke clean.sh, and repo.sh for one of more targets separated by comma # Invoke clean.sh, and repo.sh for one of more targets separated by comma

View File

@ -6,26 +6,9 @@ if [ -z "$1" ] || [ -z "$2" ]
then then
echo "Build or clean all recipe directories in a category" >&2 echo "Build or clean all recipe directories in a category" >&2
echo Usage: $0 "<action>" "<recipe-category>" >&2 echo Usage: $0 "<action>" "<recipe-category>" >&2
echo "<action>" can be f, r, c, u, or combinations that \"make\" understands >&2 echo "<action>" can be f, r, c, u, p, or combinations that \"make\" understands >&2
echo "<category>" can be path of category you want to run e.g. \"core\", \"wip\", \"wip/dev\" >&2
exit 1 exit 1
fi fi
action="${1#-}" make "${1#-}"."--category-$2"
recipe_list=""
first=1
for recipe in `find cookbook/recipes/"$2" -name "recipe.*"`
do
recipe_folder=`dirname "$recipe"`
recipe_name=`basename "$recipe_folder"`
if [ "$first" -eq 1 ]; then
recipe_list="$recipe_name"
first=0
else
recipe_list="$recipe_list,$recipe_name"
fi
done
set -x
make "$action"."$recipe_list"