Replace cookbook submodule

This commit is contained in:
Jeremy Soller 2025-11-20 13:54:40 -07:00
parent e4776da297
commit 542106d01a
No known key found for this signature in database
GPG Key ID: 670FDFB5428E05CA
23 changed files with 53 additions and 111 deletions

View File

@ -47,55 +47,4 @@ img:
artifacts:
paths:
- build/img/
expire_in: 1 week
.update-submodule:
stage: retag
rules:
- if: '$CI_PIPELINE_SOURCE == "push"'
when: manual
allow_failure: true
- when: never
image:
name: alpine/git:latest
entrypoint: [""] # force an empty entrypoint
script:
- |
if [ -z "$CI_PUSH_TOKEN" ]; then
echo "Error: CI_PUSH_TOKEN CI/CD variable is not set."
echo "Please configure CI_PUSH_TOKEN in your project's CI/CD settings -> Variables."
exit 1
fi
- git config user.email $GITLAB_USER_EMAIL
- git config user.name "$GITLAB_USER_NAME (CI)"
- git submodule update --remote $SUBMODULE_DIR
- |
if git diff --quiet $SUBMODULE_DIR; then
echo "No changes detected for $SUBMODULE_DIR submodule. Exiting."
else
echo "Changes detected for $SUBMODULE_DIR submodule. Committing and pushing..."
git add $SUBMODULE_DIR
git commit -m "CI: Update $SUBMODULE_DIR submodule to latest $CI_COMMIT_BRANCH"
git push https://:${CI_PUSH_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git HEAD:$CI_COMMIT_BRANCH
echo "Pushed! View the branch at: ${CI_SERVER_URL}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/-/tree/${CI_COMMIT_BRANCH}"
fi
update_cookbook:
extends: .update-submodule
variables:
SUBMODULE_DIR: cookbook
update_installer:
extends: .update-submodule
variables:
SUBMODULE_DIR: installer
update_redoxfs:
extends: .update-submodule
variables:
SUBMODULE_DIR: redoxfs
update_relibc:
extends: .update-submodule
variables:
SUBMODULE_DIR: relibc
expire_in: 1 week

4
.gitmodules vendored
View File

@ -1,7 +1,3 @@
[submodule "cookbook"]
path = cookbook
url = https://gitlab.redox-os.org/redox-os/cookbook.git
branch = master
[submodule "pkgar"]
path = pkgar
url = https://gitlab.redox-os.org/redox-os/pkgar.git

View File

@ -102,7 +102,6 @@ You can contribute to the Redox documentation and code on the following reposito
- [Website](https://gitlab.redox-os.org/redox-os/website)
- [Book](https://gitlab.redox-os.org/redox-os/book) - High-level documentation
- [Build System Configuration](https://gitlab.redox-os.org/redox-os/redox) - Our main repository
- [Cookbook](https://gitlab.redox-os.org/redox-os/cookbook) - Software Ports System
- [Orbital](https://gitlab.redox-os.org/redox-os/orbital) - Display Server and Window Manager
- [pkgutils](https://gitlab.redox-os.org/redox-os/pkgutils) - Package Manager
- [resist](https://gitlab.redox-os.org/redox-os/resist) - Redox System Interface Specifications and Tests (also has POSIX tests)
@ -132,7 +131,7 @@ If you don't know how to code in Rust but know other programming languages:
- Web development on the website (we only accept minimal JavaScript code to preserve performance)
- Write unit tests (may require minimal knowledge of Rust)
- Port C/C++ programs to Redox (read the `TODO`s of the recipes on the [WIP category](https://gitlab.redox-os.org/redox-os/cookbook/-/tree/master/recipes/wip))
- Port C/C++ programs to Redox (read the `TODO`s of the recipes on the [WIP category](https://gitlab.redox-os.org/redox-os/redox/-/tree/master/recipes/wip))
- Port programs to Redox
If you know how to code in Rust but don't know operating system development:

View File

@ -46,7 +46,7 @@ ifneq ($(NOT_ON_PODMAN),1)
-$(FUMOUNT) $(BUILD)/filesystem/ || true
-$(FUMOUNT) /tmp/redox_installer/ || true
endif # NOT_ON_PODMAN
rm -rf cookbook/repo
rm -rf repo
rm -rf relibc/target
rm -rf $(BUILD) $(PREFIX)
$(MAKE) fstools_clean
@ -105,7 +105,7 @@ else
endif
export RUST_GDB=gdb-multiarch # Necessary when debugging for another architecture than the host
GDB_KERNEL_FILE=cookbook/recipes/core/kernel/target/$(TARGET)/build/kernel.sym
GDB_KERNEL_FILE=recipes/core/kernel/target/$(TARGET)/build/kernel.sym
gdb: FORCE
rust-gdb $(GDB_KERNEL_FILE) --eval-command="target remote :1234"

View File

@ -46,8 +46,7 @@ Some of the key repositories on the Redox GitLab:
| [netstack (network stack)](https://gitlab.redox-os.org/redox-os/netstack) | **@jackpot51**
| [pkgutils (current package manager)](https://gitlab.redox-os.org/redox-os/pkgutils) | **@jackpot51**
| [Orbital (display server and window manager)](https://gitlab.redox-os.org/redox-os/orbital) | **@jackpot51**
| This repo - the root of the Build System | **@jackpot51**
| [Cookbook (build system for system components and programs)](https://gitlab.redox-os.org/redox-os/cookbook) | **@jackpot51** **@hatred_45**
| This repo - the root of the Build System | **@jackpot51** **@hatred_45**
| [Redoxer (tool for easy Redox development on Linux)](https://gitlab.redox-os.org/redox-os/redoxer) | **@jackpot51**
| [The Redox Book](https://gitlab.redox-os.org/redox-os/book) | **@jackpot51** **@hatred_45**
| [Website](https://gitlab.redox-os.org/redox-os/website) | **@jackpot51** **@hatred_45**

@ -1 +0,0 @@
Subproject commit 889332811917ca94e5256376bbd70b3a61ebb83a

View File

@ -26,10 +26,10 @@ ci-pkg: prefix $(FSTOOLS_TAG) $(CONTAINER_TAG) FORCE
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 Cargo.toml --release
$(HOST_CARGO) build --manifest-path pkgar/Cargo.toml --release
export CI=1 COOKBOOK_LOGS=true PATH="$(PREFIX_PATH):$$PATH" COOKBOOK_HOST_SYSROOT="$(ROOT)/$(PREFIX_INSTALL)" && \
./cookbook/repo.sh $(REPO_APPSTREAM) $(REPO_NONSTOP) --with-package-deps "--filesystem=../config/$(ARCH)/ci.toml"
./repo.sh $(REPO_APPSTREAM) $(REPO_NONSTOP) --with-package-deps "--filesystem=../config/$(ARCH)/ci.toml"
endif
# CI toolchain

View File

@ -144,9 +144,9 @@ REDOXFS_MKFS=$(FSTOOLS)/bin/redoxfs-mkfs
INSTALLER_OPTS=
COOKBOOK_OPTS="--filesystem=../$(FILESYSTEM_CONFIG)"
ifeq ($(REPO_BINARY),0)
INSTALLER_OPTS+=--cookbook=cookbook
INSTALLER_OPTS+=--cookbook=.
else
INSTALLER_OPTS+=--cookbook=cookbook --repo-binary
INSTALLER_OPTS+=--cookbook=. --repo-binary
COOKBOOK_OPTS+=" --repo-binary"
endif

View File

@ -3,7 +3,7 @@
fstools: $(FSTOOLS_TAG) $(FSTOOLS)
# These tools run inside Podman if it is used, or on the host if Podman is not used
$(FSTOOLS): cookbook $(CONTAINER_TAG)
$(FSTOOLS): $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
ifeq ($(FSTOOLS_IN_PODMAN),1)
$(PODMAN_RUN) make $@
@ -13,34 +13,34 @@ endif
else
rm -rf $@ $@.partial
mkdir -p $@.partial
ln -sr cookbook/recipes $@.partial/recipes
ln -sr recipes $@.partial/recipes
# Install cookbook, installer, and redoxfs for host (may be outside of podman container)
#TODO: Build and install installer and redoxfs using cookbook?
export CARGO_TARGET_DIR=$@-target && \
$(HOST_CARGO) install --root $@.partial --path cookbook && \
$(HOST_CARGO) install --root $@.partial --path . && \
cd $@.partial && \
./bin/repo fetch installer redoxfs && \
cd ../.. && \
$(HOST_CARGO) install --root $@.partial --path cookbook/recipes/core/installer/source && \
$(HOST_CARGO) install --root $@.partial --path cookbook/recipes/core/redoxfs/source
$(HOST_CARGO) install --root $@.partial --path recipes/core/installer/source && \
$(HOST_CARGO) install --root $@.partial --path recipes/core/redoxfs/source
mv $@.partial $@
touch $@
endif
$(FSTOOLS_TAG): cookbook $(FSTOOLS)
$(FSTOOLS_TAG): $(FSTOOLS)
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 Cargo.toml --release
$(HOST_CARGO) build --manifest-path pkgar/Cargo.toml --release
touch $@
endif
fstools_clean: FORCE
rm -rf cookbook/target
rm -rf cookbook/pkgar/target
rm -rf target
rm -rf pkgar/target
rm -rf $(FSTOOLS)
rm -rf $(FSTOOLS)-target
rm -f $(FSTOOLS_TAG)

View File

@ -73,7 +73,7 @@ else
@echo PODMAN_BUILD=$(PODMAN_BUILD), container not required.
endif
KERNEL_PATH := cookbook/recipes/core/kernel
KERNEL_PATH := recipes/core/kernel
KERNEL_PATH_SOURCE := $(ROOT)/$(KERNEL_PATH)/source
KERNEL_PATH_TARGET := $(ROOT)/$(KERNEL_PATH)/target/$(TARGET)

View File

@ -4,7 +4,7 @@ PREFIX=prefix/$(TARGET)
PREFIX_INSTALL=$(PREFIX)/sysroot/
PREFIX_PATH=$(ROOT)/$(PREFIX_INSTALL)/bin
RELIBC_SOURCE=cookbook/recipes/core/relibc/source
RELIBC_SOURCE=recipes/core/relibc/source
BINUTILS_BRANCH=redox-2.43.1
GCC_BRANCH=redox-13.2.0
@ -37,7 +37,7 @@ PREFIX_STRIP=\
2> /dev/null
$(RELIBC_SOURCE): $(FSTOOLS_TAG)
cd ./cookbook && ./target/release/repo fetch relibc
./target/release/repo fetch relibc
touch $(RELIBC_SOURCE)
$(PREFIX)/relibc: $(RELIBC_SOURCE)

View File

@ -6,7 +6,7 @@ ifeq ($(PODMAN_BUILD),1)
else
export PATH="$(PREFIX_PATH):$$PATH" && \
export COOKBOOK_HOST_SYSROOT="$(ROOT)/$(PREFIX_INSTALL)" && \
./cookbook/repo.sh $(REPO_APPSTREAM) $(REPO_NONSTOP) $(REPO_OFFLINE) $(COOKBOOK_OPTS) --with-package-deps
./repo.sh $(REPO_APPSTREAM) $(REPO_NONSTOP) $(REPO_OFFLINE) $(COOKBOOK_OPTS) --with-package-deps
mkdir -p $(BUILD)
# make sure fstools.tag are newer than the things repo modifies
touch $(FSTOOLS_TAG)
@ -20,7 +20,7 @@ tree: $(FSTOOLS_TAG) $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
@cd ./cookbook && ./target/release/repo tree $(COOKBOOK_OPTS) --with-package-deps
@./target/release/repo tree $(COOKBOOK_OPTS) --with-package-deps
endif
# Find recipe for one or more targets separated by comma
@ -28,7 +28,7 @@ find.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
@cd ./cookbook && ./target/release/repo find $(foreach f,$(subst $(comma), ,$*),$(f))
@./target/release/repo find $(foreach f,$(subst $(comma), ,$*),$(f))
endif
# Invoke clean for one or more targets separated by comma
@ -36,7 +36,7 @@ c.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
cd ./cookbook && ./target/release/repo clean $(foreach f,$(subst $(comma), ,$*),$(f))
./target/release/repo clean $(foreach f,$(subst $(comma), ,$*),$(f))
endif
# Invoke fetch for one or more targets separated by comma
@ -46,7 +46,7 @@ ifeq ($(PODMAN_BUILD),1)
else
export PATH="$(PREFIX_PATH):$$PATH" && \
export COOKBOOK_HOST_SYSROOT="$(ROOT)/$(PREFIX_INSTALL)" && \
cd ./cookbook && ./target/release/repo fetch $(foreach f,$(subst $(comma), ,$*),$(f)) $(COOKBOOK_OPTS)
./target/release/repo fetch $(foreach f,$(subst $(comma), ,$*),$(f)) $(COOKBOOK_OPTS)
endif
# Invoke repo.sh for one or more targets separated by comma
@ -56,7 +56,7 @@ ifeq ($(PODMAN_BUILD),1)
else
export PATH="$(PREFIX_PATH):$$PATH" && \
export COOKBOOK_HOST_SYSROOT="$(ROOT)/$(PREFIX_INSTALL)" && \
./cookbook/repo.sh $(REPO_OFFLINE) $(foreach f,$(subst $(comma), ,$*),$(f)) $(COOKBOOK_OPTS)
./repo.sh $(REPO_OFFLINE) $(foreach f,$(subst $(comma), ,$*),$(f)) $(COOKBOOK_OPTS)
endif
MOUNTED_TAG=$(MOUNT_DIR)~
@ -72,7 +72,7 @@ else
$(MAKE) mount; \
touch $(MOUNTED_TAG); \
fi
$(if $(findstring nonstop,$(REPO_NONSTOP)),export COOKBOOK_NONSTOP=true && ,) cd ./cookbook && \
$(if $(findstring nonstop,$(REPO_NONSTOP)),export COOKBOOK_NONSTOP=true && ,) \
./target/release/repo push $(foreach f,$(subst $(comma), ,$*),$(f)) "--sysroot=../$(MOUNT_DIR)"
@if [ -f $(MOUNTED_TAG) ]; then \
$(MAKE) unmount && rm -f $(MOUNTED_TAG); \
@ -94,7 +94,7 @@ else
$(MAKE) mount; \
touch $(MOUNTED_TAG); \
fi
$(if $(findstring nonstop,$(REPO_NONSTOP)),export COOKBOOK_NONSTOP=true && ,) cd ./cookbook && \
$(if $(findstring nonstop,$(REPO_NONSTOP)),export COOKBOOK_NONSTOP=true && ,) \
./target/release/repo push $(COOKBOOK_OPTS) --with-package-deps "--sysroot=../$(MOUNT_DIR)"
@if [ -f $(MOUNTED_TAG) ]; then \
$(MAKE) unmount && rm -f $(MOUNTED_TAG); \
@ -107,7 +107,7 @@ u.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
cd ./cookbook && ./target/release/repo unfetch $(foreach f,$(subst $(comma), ,$*),$(f))
./target/release/repo unfetch $(foreach f,$(subst $(comma), ,$*),$(f))
endif
# Invoke clean, and repo.sh for one of more targets separated by comma
@ -181,7 +181,7 @@ export DEBUG_BIN?=
# Experimental, may not work if ARCH is different with what host is running
debug.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
@cd cookbook/$(shell make find.$* | grep ^recipes) && \
@cd $(shell make find.$* | grep ^recipes) && \
export RECIPE_STAGE=target/$(TARGET)/stage && \
export BIN_PATH=$$(find $$RECIPE_STAGE -type f -name "$(DEBUG_BIN)" -or -type f -name "$*") && \
file $$BIN_PATH 2> /dev/null || ( echo "Binary is not found, please set DEBUG_BIN" && exit 1 ) && \
@ -194,7 +194,7 @@ ifeq ($(PODMAN_BUILD),1)
-ex 'add-symbol-file /binary' \
-ex 'target remote host.containers.internal:1234'"
else
@cd cookbook/$(shell make find.$* | grep ^recipes) && \
@cd $(shell make find.$* | grep ^recipes) && \
export RECIPE_STAGE=target/$(TARGET)/stage && \
export BIN_PATH=$$(find $$RECIPE_STAGE -type f -name "$(DEBUG_BIN)" -or -type f -name "$*") && \
file $$BIN_PATH 2> /dev/null || ( echo "Binary is not found, please set DEBUG_BIN" && exit 1 ) && \

View File

@ -1,5 +1,5 @@
[source]
git = "https://gitlab.redox-os.org/redox-os/cookbook.git"
git = "https://gitlab.redox-os.org/redox-os/redox.git"
[build]
template = "custom"

View File

@ -54,19 +54,19 @@ then
fi
# if no command name is given, assume it's the same as the recipe name
RECIPE_DIR="$(cd cookbook; target/release/find_recipe $RECIPE_NAME)"
RECIPE_DIR="$(target/release/find_recipe $RECIPE_NAME)"
if [ -z "$COMMAND" ]
then
COMMAND="$RECIPE_NAME"
fi
# look for the debug version of the command
EXECUTABLE=cookbook/"$RECIPE_DIR"/target/"$ARCH"-unknown-redox/build/target/"$ARCH"-unknown-redox/debug/"$COMMAND"
EXECUTABLE="$RECIPE_DIR"/target/"$ARCH"-unknown-redox/build/target/"$ARCH"-unknown-redox/debug/"$COMMAND"
# try the release version next
if [ ! -f "$EXECUTABLE" -o ! -z "$RELEASE" ]
then
EXECUTABLE=cookbook/"$RECIPE_DIR"/target/"$ARCH"-unknown-redox/build/target/"$ARCH"-unknown-redox/release/"$COMMAND"
EXECUTABLE="$RECIPE_DIR"/target/"$ARCH"-unknown-redox/build/target/"$ARCH"-unknown-redox/release/"$COMMAND"
fi
if [ $# -ne 0 ]

View File

@ -3,7 +3,7 @@
# This script runs "make f.recipe" and "cargo update" in the specified recipe
recipe_name="$1"
recipe_path=$(find cookbook/recipes -name "$recipe_name" -maxdepth 4)
recipe_path=$(find recipes -name "$recipe_name" -maxdepth 4)
make f."$recipe_name"
cd "$recipe_path"/source

View File

@ -24,15 +24,15 @@ fi
for package in $(installer/target/release/redox_installer --list-packages -c config/$(uname -m)/desktop.toml)
do
package_source="$(cd cookbook; target/release/find_recipe ${package})"
REPOS+=("${package}=cookbook/${package_source}/source")
package_source="$(target/release/find_recipe ${package})"
REPOS+=("${package}=${package_source}/source")
done
# TODO: resolve dependencies instead of manually adding these initfs packages
for package in init logd ramfs randd zerod
do
package_source="$(cd cookbook; target/release/find_recipe ${package})"
REPOS+=("${package}=cookbook/${package_source}/source")
package_source="$(target/release/find_recipe ${package})"
REPOS+=("${package}=${package_source}/source")
done
for name_repo in "${REPOS[@]}"

View File

@ -42,7 +42,7 @@ then
exit 1
fi
BOOTLOADER="cookbook/recipes/core/bootloader/target/${ARCH}-unknown-redox/stage/boot/bootloader.efi"
BOOTLOADER="recipes/core/bootloader/target/${ARCH}-unknown-redox/stage/boot/bootloader.efi"
set -x
sudo mkdir -pv "${ESP}/EFI" "${ESP}/loader/entries"
sudo cp -v "${BOOTLOADER}" "${ESP}/EFI/redox.efi"

View File

@ -26,7 +26,7 @@ do
# Find all packages providing this file
pkgs="$(
find cookbook/recipes/*"/target/${ARCH}-unknown-redox/stage/${path}" 2>/dev/null |
find recipes/*"/target/${ARCH}-unknown-redox/stage/${path}" 2>/dev/null |
cut -d/ -f3 |
tr '\n' ' ' |
sort |

View File

@ -16,7 +16,7 @@ then
exit 1
fi
cookbook_recipes="cookbook/recipes"
cookbook_recipes="recipes"
recipe_paths=$(grep -rl "$*" "$cookbook_recipes" --include recipe.toml)
for recipe_path in $recipe_paths

View File

@ -5,7 +5,7 @@
if [ $# = 0 ]
then
find cookbook/recipes \( -name stage.pkgar -o -name stage.tar.gz \) -exec ls -hs {} \;
find recipes \( -name stage.pkgar -o -name stage.tar.gz \) -exec ls -hs {} \;
exit 0
fi
@ -19,7 +19,7 @@ do
exit 0
fi
recipe_paths=$(find cookbook/recipes -name $recipe)
recipe_paths=$(find recipes -name $recipe)
for recipe_path in $recipe_paths
do
if [ -f "$recipe_path/recipe.toml" ] || [ -f "$recipe_path/recipe.sh" ]

View File

@ -2,4 +2,4 @@
# This script print the recipe configuration files with determined text
bat --decorations=always $(rg "$1" -li --sort=path cookbook/recipes)
bat --decorations=always $(rg "$1" -li --sort=path recipes)

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
FIND_RECIPE="find cookbook/recipes -maxdepth 4 -name"
FIND_RECIPE="find recipes -maxdepth 4 -name"
for recipe in $*
do

View File

@ -12,7 +12,7 @@ then
fi
find_recipe="target/release/find_recipe"
if [ ! -x "cookbook/$find_recipe" ]
if [ ! -x "$find_recipe" ]
then
echo "$find_recipe not found."
echo "Please run 'make fstools' and try again."
@ -21,6 +21,6 @@ fi
for recipe in $*
do
recipe_dir="$(cd cookbook; "$find_recipe" "$recipe")"
ls -1 "cookbook/$recipe_dir/target"/*/{stage,sysroot}
recipe_dir="$("$find_recipe" "$recipe")"
ls -1 "$recipe_dir/target"/*/{stage,sysroot}
done