Skip to content

Instantly share code, notes, and snippets.

@reubenmiller
Created July 21, 2025 14:55
Show Gist options
  • Save reubenmiller/62136cda1081dc79e2cf5ce0d7c22b38 to your computer and use it in GitHub Desktop.
Save reubenmiller/62136cda1081dc79e2cf5ce0d7c22b38 to your computer and use it in GitHub Desktop.
Yocto setup script

Install Yocto and dependencies

sudo apt-get update
sudo apt install -y build-essential chrpath cpio debianutils diffstat file gawk gcc git iputils-ping libacl1 liblz4-tool locales python3 python3-git python3-jinja2 python3-pexpect python3-pip python3-subunit socat texinfo unzip wget xz-utils zstd kas

if ! locale --all-locales | grep -q en_US.utf8; then
    echo "en_US.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen
    sudo locale-gen
fi

# sudo -H pip3 install kas --break-system-packages
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | sudo bash -s -- --to /usr/bin/

export PATH="$HOME/.local/bin:$PATH"

(type -p wget >/dev/null || (sudo apt update && sudo apt install wget -y)) \
	&& sudo mkdir -p -m 755 /etc/apt/keyrings \
	&& out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \
	&& cat $out | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
	&& sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
	&& sudo mkdir -p -m 755 /etc/apt/sources.list.d \
	&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
	&& sudo apt update \
	&& sudo apt install gh -y

source <(just --completions bash)

# on ubuntu, disable the user namespace. see https://lists.yoctoproject.org/g/poky/topic/problem_run_bitbake_on/111656575
echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns

# and change permanently
echo "kernel.apparmor_restrict_unprivileged_userns=0" | sudo tee -a /etc/sysctl.d/60-apparmor-namespace.conf

gh auth login
gh repo clone reubenmiller/meta-tedge
cd meta-tedge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment