From 3349b5618475e901695b58394c50dfd62ae2702f Mon Sep 17 00:00:00 2001 From: Ojus Chugh Date: Sun, 30 Nov 2025 16:19:32 +0530 Subject: [PATCH 1/3] Added Redox target with package manager support to native_bootstrap.sh Signed-off-by: Ojus Chugh --- native_bootstrap.sh | 83 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 82 insertions(+), 1 deletion(-) diff --git a/native_bootstrap.sh b/native_bootstrap.sh index 3c89dc87b..fb3f0e5b8 100755 --- a/native_bootstrap.sh +++ b/native_bootstrap.sh @@ -872,6 +872,84 @@ solus() perl-html-parser } +# Function to detect if the OS is Redox +is_os_redox() +{ + [ "$(uname -s)" = "Redox" ] +} + +# Function to detect what packages are installed on Redox OS +# This is a utility function that can be used to check installed packages +# Usage: detect_installed_packages +# Returns: List of installed packages via 'pkg list' +detect_installed_packages() +{ + pkg list +} + +############################################################################### +# This function takes care of installing all dependencies for building Redox on +# Redox OS +# @params: $1 the emulator to install, "virtualbox" or "qemu" +############################################################################### +redox() +{ + echo "Detected Redox OS" + + if [ "$1" == "qemu" ]; then + echo "QEMU is not available on Redox OS yet, but it is mandatory for running the built system." + echo "Please install QEMU manually on a compatible host or use another machine to run the emulator." + elif [ "$1" == "virtualbox" ]; then + echo "VirtualBox is not supported on Redox OS." + exit 1 + else + echo "Unknown emulator: $1" + exit 1 + fi + + echo "Installing missing packages..." + + # Package list + # Note: Some packages may not be available yet on Redox OS + packages="rust \ + cargo \ + gcc \ + gnu-make \ + bison \ + cmake \ + wget \ + file \ + flex \ + gperf \ + expat \ + libgmp \ + libpng \ + libjpeg \ + sdl \ + sdl2-ttf \ + html-parser-perl \ + libtool \ + m4 \ + nasm \ + patch \ + automake \ + autoconf \ + scons \ + pkg-config \ + po4a \ + texinfo \ + ninja-build \ + meson \ + python \ + python3-mako \ + xdg-utils \ + vim \ + perl \ + doxygen" + + sudo pkg install $packages +} + ###################################################################### # This function outlines the different options available for bootstrap ###################################################################### @@ -1097,8 +1175,11 @@ if [ "Darwin" == "$(uname -s)" ]; then else # Here we will use package managers to determine which operating system the user is using. + # Redox OS + if is_os_redox; then + redox "$emulator" # SUSE and derivatives - if hash 2>/dev/null zypper; then + elif hash 2>/dev/null zypper; then suse "$emulator" # Debian or any derivative of it elif hash 2>/dev/null apt-get; then From 74aa25171503bb1a1375c047b4cfb4c9ed3dd1d0 Mon Sep 17 00:00:00 2001 From: Ojus Chugh Date: Sun, 30 Nov 2025 17:54:27 +0530 Subject: [PATCH 2/3] Refine Redox OS support in native_bootstrap.sh - Removed unused detect_installed_packages function - Added git installation check before other packages - Improved package installation with individual checking - Made package list more conservative with core essentials only - Added better error handling that warns instead of failing - Improved comments and messaging for clarity - Added note about experimental nature of building on Redox itself Addresses feedback on issue #1699 Signed-off-by: Ojus Chugh --- native_bootstrap.sh | 95 ++++++++++++++++++++++----------------------- 1 file changed, 47 insertions(+), 48 deletions(-) diff --git a/native_bootstrap.sh b/native_bootstrap.sh index fb3f0e5b8..561a9b798 100755 --- a/native_bootstrap.sh +++ b/native_bootstrap.sh @@ -872,33 +872,34 @@ solus() perl-html-parser } -# Function to detect if the OS is Redox +############################################################################### +# Helper function to detect if we're running on Redox OS +# This needs to be checked before FreeBSD since both use 'pkg' package manager +############################################################################### is_os_redox() { [ "$(uname -s)" = "Redox" ] } -# Function to detect what packages are installed on Redox OS -# This is a utility function that can be used to check installed packages -# Usage: detect_installed_packages -# Returns: List of installed packages via 'pkg list' -detect_installed_packages() -{ - pkg list -} - ############################################################################### # This function takes care of installing all dependencies for building Redox on -# Redox OS +# Redox OS itself (bootstrapping Redox on Redox) # @params: $1 the emulator to install, "virtualbox" or "qemu" ############################################################################### redox() { echo "Detected Redox OS" + + # Check if git is installed + if [ -z "$(which git)" ]; then + echo "Installing git..." + sudo pkg install git + fi + # Handle emulator selection if [ "$1" == "qemu" ]; then - echo "QEMU is not available on Redox OS yet, but it is mandatory for running the built system." - echo "Please install QEMU manually on a compatible host or use another machine to run the emulator." + echo "Note: QEMU is not yet available as a native package on Redox OS." + echo "Cross-compilation or building on another system is recommended for running the built system." elif [ "$1" == "virtualbox" ]; then echo "VirtualBox is not supported on Redox OS." exit 1 @@ -907,47 +908,45 @@ redox() exit 1 fi - echo "Installing missing packages..." - - # Package list - # Note: Some packages may not be available yet on Redox OS - packages="rust \ - cargo \ - gcc \ - gnu-make \ - bison \ + echo "Installing necessary build tools..." + + # Core development packages that are likely available on Redox + # This list is conservative and only includes essentials + PKGS="gcc \ + make \ cmake \ - wget \ - file \ - flex \ - gperf \ - expat \ - libgmp \ - libpng \ - libjpeg \ - sdl \ - sdl2-ttf \ - html-parser-perl \ - libtool \ - m4 \ nasm \ + pkg-config \ patch \ automake \ autoconf \ - scons \ - pkg-config \ - po4a \ - texinfo \ - ninja-build \ - meson \ - python \ - python3-mako \ - xdg-utils \ - vim \ + bison \ + flex \ + curl \ + wget \ perl \ - doxygen" - - sudo pkg install $packages + python \ + file \ + libtool \ + m4" + + # Try to install packages, but don't fail if some are unavailable + # since Redox package ecosystem is still developing + for pkg in $PKGS; do + if ! pkg list | grep -q "^${pkg}"; then + echo "Attempting to install ${pkg}..." + if ! sudo pkg install ${pkg} 2>/dev/null; then + echo "Warning: ${pkg} could not be installed. It may not be available yet." + fi + else + echo "${pkg} is already installed." + fi + done + + echo "" + echo "Note: Building Redox on Redox itself is experimental." + echo "Some dependencies may not be available yet in the Redox package repository." + echo "For the best build experience, consider using podman_bootstrap.sh on another system." } ###################################################################### From 0be3a313f543f526a79a6a152bae066e9ad6a0e8 Mon Sep 17 00:00:00 2001 From: Ojus Chugh Date: Sun, 30 Nov 2025 18:28:15 +0530 Subject: [PATCH 3/3] Updated the comment message and depencies list Signed-off-by: Ojus Chugh --- native_bootstrap.sh | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/native_bootstrap.sh b/native_bootstrap.sh index 561a9b798..ce1013a12 100755 --- a/native_bootstrap.sh +++ b/native_bootstrap.sh @@ -898,8 +898,9 @@ redox() # Handle emulator selection if [ "$1" == "qemu" ]; then - echo "Note: QEMU is not yet available as a native package on Redox OS." - echo "Cross-compilation or building on another system is recommended for running the built system." + echo "QEMU is not available on Redox OS yet, but it is mandatory for running the built system." + echo "Please install QEMU manually on a compatible host or use another machine to run the emulator." + exit 1 elif [ "$1" == "virtualbox" ]; then echo "VirtualBox is not supported on Redox OS." exit 1 @@ -912,23 +913,23 @@ redox() # Core development packages that are likely available on Redox # This list is conservative and only includes essentials - PKGS="gcc \ - make \ - cmake \ - nasm \ - pkg-config \ - patch \ + packages=""autoconf \ automake \ - autoconf \ - bison \ - flex \ - curl \ - wget \ - perl \ - python \ - file \ - libtool \ - m4" + expat \ + gcc13 \ + gnu-make \ + libgmp \ + libjpeg \ + libpng \ + nasm \ + patch \ + pkg-config \ + rust \ + rustpython \ + sdl1 \ + sdl2-ttf \ + vim" + # Try to install packages, but don't fail if some are unavailable # since Redox package ecosystem is still developing