Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
d453916
add poky
xavgru12 Jun 14, 2025
8ab2cb1
update meta swift
xavgru12 Jun 14, 2025
61f6359
copy files from nxp swift
xavgru12 Jun 14, 2025
e95ecc4
cleanup
xavgru12 Jun 14, 2025
0825539
update meta-swift
xavgru12 Jun 14, 2025
806a6b2
add readme
xavgru12 Jun 14, 2025
86c6281
update readme
xavgru12 Jun 14, 2025
cbac409
readme
xavgru12 Jun 14, 2025
33ee748
Set poky revision to Dunfell
xtremekforever Jun 14, 2025
7dfec8b
Update poky and meta-swift again:
xtremekforever Jun 14, 2025
63cadf8
Use Ubuntu 20.04 for dunfell build to avoid issues
xtremekforever Jun 14, 2025
1b5ea87
update meta-swift
xavgru12 Jun 14, 2025
40929a1
Add a few improvements for the Dunfell layer
xtremekforever Jun 14, 2025
cedba0a
update meta-swift
xavgru12 Jun 15, 2025
5bb6756
Update meta-swift to latest dunfell-destupify branch
xtremekforever Jun 19, 2025
7425b5c
set the submodule correctly
xavgru12 Jun 19, 2025
cf1a2c1
update readme
xavgru12 Jun 24, 2025
37c29b1
add iproute2 to dockerfile
xavgru12 Jun 24, 2025
f6bb3e8
add tun to docker run
xavgru12 Jun 24, 2025
dde7ca5
add necessary packages for qemuarm
xavgru12 Jun 24, 2025
65cdee0
runs on self hosted github runner
xavgru12 Jun 24, 2025
0e7de2e
do checkout
xavgru12 Jun 24, 2025
11eb6c4
fix file
xavgru12 Jun 24, 2025
89a997c
clean false
xavgru12 Jun 24, 2025
61127ea
actions 3
xavgru12 Jun 24, 2025
2ec1f02
execute
xavgru12 Jun 24, 2025
bd4aa98
interact on
xavgru12 Jun 24, 2025
526aeea
simplify CI
xavgru12 Jun 25, 2025
3b2dd55
workflow dispatch as trigger
xavgru12 Jun 25, 2025
a917317
improve expect script
xavgru12 Jun 25, 2025
7fa6176
build docker
xavgru12 Jun 25, 2025
00bd4fd
run
xavgru12 Jun 25, 2025
3d89dd1
runqemu
xavgru12 Jun 25, 2025
bd1643d
server run
xavgru12 Jun 25, 2025
799bcd6
permissions
xavgru12 Jun 25, 2025
dc877b7
recursive checkout
xavgru12 Jun 26, 2025
23a40ad
update meta-swift
xavgru12 Jun 26, 2025
cc40ceb
improve run docker
xavgru12 Jun 26, 2025
05254e1
build docker step added
xavgru12 Jun 26, 2025
03073c2
do same with server run docker
xavgru12 Jun 26, 2025
4dab586
update meta-swift
xavgru12 Jun 26, 2025
c134584
rename to scarthgap
xavgru12 Jun 26, 2025
d8fbd01
adjust
xavgru12 Jun 27, 2025
af8d321
merge with scarthgap
xavgru12 Jun 27, 2025
e5a87b8
Merge remote-tracking branch 'origin/setup' into dunfell
xavgru12 Jun 27, 2025
5533203
dunfell ci
xavgru12 Jun 27, 2025
821bd68
update meta-swift
xavgru12 Jun 27, 2025
b22e895
set timeout to 180
xavgru12 Jun 27, 2025
cbb5b47
:wMerge remote-tracking branch 'origin/setup' into dunfell
xavgru12 Jun 27, 2025
fa7961c
update meta-swift
xavgru12 Jun 27, 2025
53335a9
establish build.sh
xavgru12 Jun 27, 2025
020a8fd
Merge remote-tracking branch 'origin/setup' into dunfell
xavgru12 Jun 27, 2025
0c4ab10
update meta-swift
xavgru12 Jun 27, 2025
0672c9d
remove unnecessary echo
xavgru12 Jun 27, 2025
686138d
Merge remote-tracking branch 'origin/setup' into dunfell_setup
xavgru12 Jun 27, 2025
b3aac29
update README
xavgru12 Jun 27, 2025
e3be230
Merge remote-tracking branch 'origin/setup' into dunfell_setup
xavgru12 Jun 27, 2025
c8f9fc5
use .bbappend to install the hello world application
xavgru12 Jul 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: dunfell

on:
workflow_dispatch:

jobs:
runqemu:
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v3
with:
clean: false
submodules: recursive
- name: build Docker
run: ./build-docker.sh
- name: build Yocto
run: ./server-run-docker.sh ./build.sh
- name: runqemu swift hello world
run: ./server-run-docker.sh ./execute.exp

106 changes: 106 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Prerequisites
*.d

# Object files
*.o
*.ko
*.obj
*.elf

# Linker output
*.ilk
*.map
*.exp

# Precompiled Headers
*.gch
*.pch

# Libraries
*.lib
*.a
*.la
*.lo

# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib

# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex

# Debug files
*.dSYM/
*.su
*.idb
*.pdb

# Kernel Module Compile Results
*.mod*
*.cmd
.tmp_versions/
modules.order
Module.symvers
Mkfile.old
dkms.conf

# Ignore build directories
build*/
tmp/
sstate-cache/
cache/
deploy/
downloads/

# Ignore BitBake temporary files
bitbake.lock
*.run
*.lock
*.log
*.sigdata
*.siginfo
*.done
*.failed
*.conf.old

# Ignore editor/IDE files
.vscode/
.idea/
*.swp
*.swo
*~
.DS_Store

# Ignore output files
*.tar.gz
*.bin
*.wic*
*.ext4
*.rootfs.*

# Ignore user-specific config
conf/local.conf
conf/site.conf
conf/bblayers.conf

# Ignore custom scripts and artifacts
*.pyc
*.pyo
*.o
*.a
*.so
*.la
*.lo
*.rej
*.orig

# Ignore Git submodule locks
.gitmodules.lock
.repo
5 changes: 4 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "meta-swift"]
path = meta-swift
url = [email protected]:xavgru12/meta-swift.git
url = [email protected]:jeremy-prater/meta-swift.git
[submodule "poky"]
path = poky
url = https://github.com/MillerTechnologyPeru/poky.git
49 changes: 49 additions & 0 deletions Dockerfile-Ubuntu-20.04
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
FROM ubuntu:20.04

# Update system and install required packages
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt upgrade -y && \
apt install -y gawk wget git-core diffstat unzip texinfo \
gcc-multilib build-essential chrpath socat file cpio python3 \
python3-pip python3-pexpect xz-utils debianutils iputils-ping \
libsdl1.2-dev xterm tar locales net-tools rsync sudo vim curl zstd \
liblz4-tool libssl-dev bc lzop libgnutls28-dev efitools git-lfs \
keychain pipx make ninja-build tmux xclip xsel iproute2 \
bridge-utils iptables expect

# Install Neovim
COPY neovim-installer.sh /neovim-installer.sh
RUN chmod +x /neovim-installer.sh && \
/neovim-installer.sh && \
rm -f /neovim-installer.sh

# Set up locales
RUN locale-gen en_US.UTF-8 && \
update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8

# Ensure /bin/sh points to bash (Yocto requires this)
RUN ln -sf bash /bin/sh

# Install repo
ADD https://storage.googleapis.com/git-repo-downloads/repo /usr/local/bin/repo
RUN chmod 755 /usr/local/bin/repo

ARG USER
# Create the user with a home directory and set Bash as the default shell
RUN useradd -m -s /bin/bash ${USER} && \
echo "${USER} ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/${USER} && \
chmod 0440 /etc/sudoers.d/${USER}


# Ensure user has the correct UID/GID for volume-mounted builds
ARG USER
RUN usermod -u $(id -u ${USER}) -g $(id -g ${USER}) ${USER}

# Set working directory
ARG DOCKER_WORKDIR
WORKDIR ${DOCKER_WORKDIR}

# Switch to the Yocto user
USER ${USER}
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Clone

```
git clone [email protected]:xavgru12/meta-swift-project.git --recurse-submodules
```

# Build

```
./build-docker.sh
```

```
./run-docker.sh
```

```
./build.sh
```

# Execution

```
./execute.exp
```

# Github Actions

Start runner and trigger job via Github API:

https://github.com/xavgru12/github-self-hosted-runner

28 changes: 28 additions & 0 deletions build-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
#
# This script creates the yocto-ready docker image.
# The --build-arg options are used to pass data about the current user.
# Also, a tag is used for easy identification of the generated image.
#

# source the common variables
. ./env.sh

if [[ $PWD != $HOME* && $(whoami) != "root" ]]; then
echo "Error: Current directory is outside $HOME"
exit 1
fi

USERNAME=$(whoami)
if [[ $USERNAME == "root" ]]; then
USERNAME=yocto
fi

docker build --tag "${DOCKER_IMAGE_TAG}" \
--build-arg "DOCKER_WORKDIR=${DOCKER_WORKDIR}" \
--build-arg "USER=$USERNAME" \
--build-arg "host_uid=$(id -u)" \
--build-arg "host_gid=$(id -g)" \
-f Dockerfile-Ubuntu-20.04 \
.

37 changes: 37 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash
set -e

# Configuration
SRC_ROOT="${SRC_ROOT:=$(pwd)}"
POKY_DIR="${POKY_DIR:=$SRC_ROOT/poky}"
META_SWIFT_DIR="${META_SWIFT_DIR:=$SRC_ROOT/meta-swift}"

MACHINE="${MACHINE:=qemuarm}"

# Build Yocto Poky
cd $POKY_DIR

BBLAYERS_FILE=${POKY_DIR}/build/conf/bblayers.conf
if [ -e "$BBLAYERS_FILE" ]; then
rm -rf "$BBLAYERS_FILE"
fi

source oe-init-build-env
bitbake-layers add-layer $META_SWIFT_DIR
echo "BBFILES += \"${SRC_ROOT}/meta-swift-overrides/*.bbappend\"" >> $BBLAYERS_FILE

# Customize build
touch conf/sanity.conf
CONF_FILE=./conf/local.conf
rm -rf $CONF_FILE
echo "# Swift for Yocto" >> $CONF_FILE
echo "MACHINE=\"${MACHINE}\"" >> $CONF_FILE
echo 'IMAGE_FEATURES += "debug-tweaks"' >> $CONF_FILE
echo 'IMAGE_INSTALL:append = " swift-hello-world"' >> $CONF_FILE


#echo 'SSTATE_MIRRORS ?= "file://.* http://sstate.yoctoproject.org/all/PATH;downloadfilename=PATH"' >> $CONF_FILE
#echo "USER_CLASSES += \"buildstats buildstats-summary\"" >> $CONF_FILE

# build Swift
bitbake core-image-minimal
13 changes: 13 additions & 0 deletions env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
# Here are some default settings.
# Make sure DOCKER_WORKDIR is created and owned by current user.

# Docker

DOCKER_IMAGE_TAG="meta-swift-project"
DOCKER_WORKDIR="$PWD"

# Yocto

YOCTO_DIR="$PWD"

41 changes: 41 additions & 0 deletions execute.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/expect -f

spawn bash -c "cd poky && source oe-init-build-env && runqemu qemuarm nographic"

set timeout 180

expect {
-re ".*login: " {
send "root\r"
}
timeout {
puts "ERROR: Login prompt not received"
exit 1
}
}

expect {
-re {root@.*# } {
# got shell prompt after login
}
timeout {
puts "ERROR: Timeout waiting for root shell prompt after login"
exit 1
}
}

send "hello-world\r"

expect {
-re {root@.*# } {
# got shell prompt after command
}
timeout {
puts "ERROR: Timeout waiting for shell prompt after command"
exit 1
}
}

# Optional: interact to keep session open
#interact

5 changes: 5 additions & 0 deletions meta-swift-overrides/swift-hello-world.bbappend
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
do_install() {
install -d ${D}${bindir}
cp -rf ${B}/release/hello-world ${D}${bindir}/
}

36 changes: 36 additions & 0 deletions neovim-installer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

# Set the version of Neovim you want to install
NEOVIM_VERSION="v0.9.5" # Change this to the desired version

# Set the download URL based on the version
DOWNLOAD_URL="https://github.com/neovim/neovim/releases/download/$NEOVIM_VERSION/nvim-linux64.tar.gz"

# Set installation directory
INSTALL_DIR="/opt/nvim"

# Download the specific version of Neovim
echo "Downloading Neovim version $NEOVIM_VERSION..."
curl -LO $DOWNLOAD_URL

# Extract the tarball
echo "Extracting Neovim..."
tar -xvzf "nvim-linux64.tar.gz"

# Move the extracted files to the installation directory
echo "Installing Neovim to $INSTALL_DIR..."
sudo mv nvim-linux64 $INSTALL_DIR

# Create a symbolic link for easy access
echo "Creating symbolic link to /usr/local/bin/nvim..."
sudo ln -sf $INSTALL_DIR/bin/nvim /usr/local/bin/nvim

# Verify the installation
#echo "Neovim version:"
#nvim --version

# Clean up downloaded files
echo "Cleaning up..."
rm -f "nvim-linux64.tar.gz"

echo "Neovim $NEOVIM_VERSION installation completed!"
1 change: 1 addition & 0 deletions poky
Submodule poky added at 4d84b5
Loading