Rockbox Development > Starting Development and Compiling

rockboxdev.sh doesn't seem to run on Mac OS?

(1/3) > >>

Mudb0y:
When I try to run tools/rockboxdev.sh on my M2 MacBook Pro running Senoma, I get no output from my terminal. I ran it both as sudo and a normal user. I seem to have all the dependencies installed. Is there any recent Mac OS build issues I should be aware of?

speachy:
to be honest, I don't expect rockoxdev.sh (or compiling rockbox even after a toolchain is present) to work on Macs; they have some pretty major differences in their environments from modern-ish Linux system and none of the active developers even have access to a mac, much less are able to test things out there.

But the fact you saw no output at all to be surprising, at minumum there should be _some_ output, even if only an error message.

Try running it with 'bash -x rockboxdev.sh' instead and see where it stops.

chris_s:
You can replace readlink with greadlink and it should output something at least, but actually compiling the cross compiler will still fail on Apple Silicon at least.

chris_s:
I would recommend spinning up either the latest ARM server versions of Debian or Ubuntu in VMWare Fusion (which is free for personal use) and you'll be up and running in no time. You can ssh into the VM or just use Fusion's own file sharing mechanism to transfer files back and forth.  Optionally install a desktop environment as well, if you intend to use the simulator on Linux.

https://blogs.vmware.com/teamfusion/2023/07/vmware-fusion-2023-tech-preview.html

rockbox_dev123:
I made the greadlink changes myself and then gave up when I patched everything and realised as chris said, that the cross compilation fails. I went down the rabbit hole and tried different compilers but eventually got out of my depth.

There is a Docker image for compiling rockbox called which can be used ("built1n/rbclient").

However, this container is using a very old version of Debian and it actually ships the wrong version of the cross compilation binaries for arm targets anyway...

Here is my docker-compose setup for building rockbox:

--- Code: ---  rockbox_build:
    image: debian
    container_name: rockbox_build
    entrypoint: /bin/bash
    command: "-c 'while true; do sleep 60; done'"
    volumes:
      - ${docker_config_path}/rockbox_build:/config
    restart: unless-stopped

--- End code ---

This container will then happily idle forever until you run:

--- Code: ---docker exec -it rockbox_build bash
--- End code ---

Once inside the debian container, you can run this script to build rockbox for you:


--- Code: ---#!/usr/bin/env bash

github_user_name="rockbox"
github_repo_name="rockbox"
#target="ipod6g"
arm_targets=("ipodvideo" "ipod6g")
rockbox_dir="/config/rockbox"
build_dir="${rockbox_dir}/build"

cd /config || exit

install_dependencies()
{
    apt update

    apt-get install -y \
        build-essential \
        git \
        perl \
        curl \
        texinfo \
        flex \
        bison \
        bzip2 \
        gzip \
        zip \
        patch \
        automake \
        libtool \
        libtool-bin \
        autoconf \
        libmpc-dev \
        gawk \
        python3 \
        python3-lzo \
        python3-setuptools \
        mtd-utils \
        xorriso \
        wget \
        subversion \
        libncurses5-dev \
        texlive-latex-base \
        texlive-binaries \
        texlive-latex-extra \
        tex4ht \
        texlive-fonts-recommended \
        lmodern \
        texlive-base \
        libsdl1.2-dev \
        libsdl1.2debian
        #latex-xcolor \
}

update_git_repo()
{
    if [[ ! -d "$rockbox_dir" ]]
    then
        git clone "https://github.com/${github_user_name}/${github_repo_name}.git"
    else
        cd "$rockbox_dir" || exit
        #git pull origin master
        git remote update
        if git status | grep -q 'Your branch is behind'
        then
            git pull origin master
            cd /config || exit
        fi
    fi
}

check_gcc_version()
{
    if ! command -v arm-elf-eabi-gcc >/dev/null || ! arm-elf-eabi-gcc -v 2>&1 | grep -q 'version 4.9.4'; then return 1; fi
}

initialise_toolchain()
{
    cd "$rockbox_dir" || exit
    #shellcheck disable=SC2016
    sed -i 's/tool="$tool -fLo "/tool="$tool -fLko "/' ./tools/rockboxdev.sh ## patch curl to allow invalid certs
    #shellcheck disable=SC2016
    sed -i 's/tool="$tool-T 60 -O "/tool="$tool --no-check-certificate -T 60 -O "/' ./tools/rockboxdev.sh ## patch wget to allow invalid certs

    mkdir -p "$rockbox_cross_compiler_dir"
    ./tools/rockboxdev.sh --target="a" "--prefix=$rockbox_cross_compiler_dir"
}

verify_toolchain()
{
    ## Check if the cross compilation binary exists, and if it is the right version.
    ## The rbclient docker image supplies the older version of 4.4.4 instead of 4.9.4
    ## 1) Check if the image has the right version (with default PATH)
    ## 2) Check if we have previously compiled the toolchain to a dir
    ## 3) Finally, compile the toolchain if necessary.
    if ! check_gcc_version
    then
        rockbox_cross_compiler_dir="/config/toolchain"
        export PATH="${rockbox_cross_compiler_dir}/bin:$PATH"
        if ! check_gcc_version
        then
            initialise_toolchain
        fi
    fi
}

build_rockbox()
{
    target="$1"
    mkdir -p "$build_dir" && cd "$build_dir" || exit

    ## Build rockbox
    ../tools/configure --target="$target" --type="n"
    make clean
    make -j"$(nproc)"

    ## Make the zip
    zip_name="rockbox-full.zip"
    make fullzip
    custom_zip_name="$(basename "$zip_name" .zip)-$target-$github_user_name-$(date +'%Y%m%d').zip"
    cp "$zip_name" "/config/$custom_zip_name"
}

build_bootloader()
{
    target="$1"
    mkdir -p "$build_dir" && cd "$build_dir" || exit

    ## Make the bootloader
    ../tools/configure --target="$target" --type="b"
    make clean
    make -j"$(nproc)"
    cp "bootloader-$target.ipod" "/config/bootloader-$target-$github_user_name-$(date +'%Y%m%d').ipod"
}

install_dependencies
update_git_repo
verify_toolchain

for build_target in "${arm_targets[@]}"
do
    build_rockbox "$build_target"
    build_bootloader "$build_target"
done

--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version