Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
138 changes: 137 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,143 @@ on:
required: true
type: string

jobs:
jobs:
build-image-minimal-uclibc:
runs-on: ubuntu-22.04
env:
FORCE_UNSAFE_CONFIGURE: 1
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@v10
with:
overprovision-lvm: true
remove-dotnet: true
remove-android: true
remove-haskell: true
remove-codeql: true
remove-docker-images: true

- uses: actions/checkout@v4
with:
fetch-depth: 0
- if: inputs.submodule
run: git submodule update --init -- ${{ inputs.submodule }}

- name: retrieve ccache
uses: actions/cache@v4
with:
path: ~/.buildroot-ccache
key: ${{ inputs.submodule }}-uclibc-minimal-ccache-${{ github.sha }}
restore-keys: |
${{ inputs.submodule }}-uclibc-minimal-ccache-

- name: generate cfw hash & iteration count
run: |
git config --global --add safe.directory /__w/buildroot/buildroot
echo "cfw_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
if test $(git tag | wc -l) -ne 0; then \
echo "cfw_tag=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT; \
echo "cfw_iteration=$(git rev-list --count $(git describe --tags --abbrev=0)..HEAD)" >> $GITHUB_OUTPUT; \
fi
id: cfwsha

- name: build
run: |
cd ${{ inputs.submodule || '.' }}
sudo apt-get update && sudo apt-get install -y gsfonts
board/miyoo/minconfig/mini_config.sh miyoo_uclibc_defconfig
CPU_N=$(getconf _NPROCESSORS_ONLN)
set -o pipefail
if ! ( \
make -j $CPU_N MINIMAL="yes" \
CFW_HASH="${{ steps.cfwsha.outputs.cfw_sha }}" CFW_TAG="${{ steps.cfwsha.outputs.cfw_tag }}" CFW_ITERATION="${{ steps.cfwsha.outputs.cfw_iteration }}" \
APPEND_VERSION="-Dev_build$(echo ${{ github.ref_name != 'master' && github.ref_name || '' }} | sed 's/\//-/g' | sed '/./ s/^/-/')" 2>&1 \
| tee build.log \
| grep --line-buffered "^>>>" \
); then tail -n100 build.log && exit 1
fi

- name: Archive build logs (uClibc) - minimal
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: build-logs (uClibc) - minimal
path: ${{ inputs.submodule || '.' }}/build.log

- uses: actions/upload-artifact@v4
with:
name: build image (uClibc) - minimal
path: ${{ inputs.submodule || '.' }}/output/images/miyoo-*.img
if-no-files-found: error # 'error', 'warn', 'ignore'; defaults to `warn`

build-image-minimal-musl:
runs-on: ubuntu-22.04
env:
FORCE_UNSAFE_CONFIGURE: 1
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@v10
with:
overprovision-lvm: true
remove-dotnet: true
remove-android: true
remove-haskell: true
remove-codeql: true
remove-docker-images: true

- uses: actions/checkout@v4
with:
fetch-depth: 0
- if: inputs.submodule
run: git submodule update --init -- ${{ inputs.submodule }}

- name: retrieve ccache
uses: actions/cache@v4
with:
path: ~/.buildroot-ccache
key: ${{ inputs.submodule }}-musl-minimal-ccache-${{ github.sha }}
restore-keys: |
${{ inputs.submodule }}-musl-minimal-ccache-

- name: generate cfw hash & iteration count
run: |
git config --global --add safe.directory /__w/buildroot/buildroot
echo "cfw_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
if test $(git tag | wc -l) -ne 0; then \
echo "cfw_tag=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT; \
echo "cfw_iteration=$(git rev-list --count $(git describe --tags --abbrev=0)..HEAD)" >> $GITHUB_OUTPUT; \
fi
id: cfwsha

- name: build
run: |
cd ${{ inputs.submodule || '.' }}
sudo apt-get update && sudo apt-get install -y gsfonts
board/miyoo/minconfig/mini_config.sh miyoo_musl_defconfig
CPU_N=$(getconf _NPROCESSORS_ONLN)
set -o pipefail
if ! ( \
make -j $CPU_N MINIMAL="yes" \
CFW_HASH="${{ steps.cfwsha.outputs.cfw_sha }}" CFW_TAG="${{ steps.cfwsha.outputs.cfw_tag }}" CFW_ITERATION="${{ steps.cfwsha.outputs.cfw_iteration }}" \
APPEND_VERSION="-Dev_build$(echo ${{ github.ref_name != 'master' && github.ref_name || '' }} | sed 's/\//-/g' | sed '/./ s/^/-/')" 2>&1 \
| tee build.log \
| grep --line-buffered "^>>>" \
); then tail -n100 build.log && exit 1
fi

- name: Archive build logs (musl) - minimal
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: build-logs (musl) - minimal
path: ${{ inputs.submodule || '.' }}/build.log

- uses: actions/upload-artifact@v4
with:
name: build image (musl) - minimal
path: ${{ inputs.submodule || '.' }}/output/images/miyoo-*.img
if-no-files-found: error # 'error', 'warn', 'ignore'; defaults to `warn`

build-image-uclibc:
runs-on: ubuntu-22.04
env:
Expand Down
42 changes: 38 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,24 @@ It is assumed you're using Debian based distro, others like Arch or Fedora may b
sudo apt install -y wget unzip build-essential git bc swig libncurses-dev libpython3-dev libssl-dev cpio rsync subversion python3 mercurial imagemagick btrfs-progs
```

### Download BSP
### Download BSP & cd to BR2's $TOPDIR

```shell
git clone https://github.com/MiyooCFW/buildroot
cd buildroot
```

## Make the first build

### Apply defconfig uClibc

```shell
cd buildroot
make miyoo_uclibc_defconfig
```

### Or apply defconfig musl

```shell
cd buildroot
make miyoo_musl_defconfig
```

Expand All @@ -41,12 +40,47 @@ make miyoo_musl_defconfig
make
```

- image & sdk
- image & sdk (shared)

```shell
make sdk
```

## Make "minimal" build

### Apply minimal setup with regular uclibc/musl libc defconfig

```shell
./board/miyoo/minconfig/mini_config.sh miyoo_<libc>_defconfig
```

### Minimal build

- image (mininal)

```shell
make MINIMAL="yes"
```

## Make "static" SDK build

### apply static defconfig musl/uclibc
```shell
make miyoo_uclibc_static_defconfig
```
-- or --

```shell
make miyoo_musl_static_defconfig
```
### build SDK (staticly linked)
- sdk (static)
```shell
make sdk
```



## Speed up build progress

### Compile speed
Expand Down
127 changes: 127 additions & 0 deletions board/miyoo/minconfig/min-pkgs-fragment.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# no ffmpeg
BR2_PACKAGE_FFMPEG=n
BR2_PACKAGE_FFMPEG_GPL=n
BR2_PACKAGE_FFMPEG_FFPLAY=n
BR2_PACKAGE_FFMPEG_FFPROBE=n
BR2_PACKAGE_FFMPEG_AVRESAMPLE=n
BR2_PACKAGE_FFMPEG_POSTPROC=n
BR2_PACKAGE_FFMPEG_ENCODERS=""
BR2_PACKAGE_FFMPEG_DECODERS=""
BR2_PACKAGE_FFMPEG_MUXERS=""
BR2_PACKAGE_FFMPEG_DEMUXERS=""
BR2_PACKAGE_FFMPEG_PARSERS=""
BR2_PACKAGE_FFMPEG_BSFS=""
BR2_PACKAGE_FFMPEG_PROTOCOLS=""
BR2_PACKAGE_FFMPEG_EXTRACONF=""

# no gstreamer1 (musl)
BR2_PACKAGE_GSTREAMER1=n
BR2_PACKAGE_GST1_PLUGINS_BASE_INSTALL_TOOLS=n
BR2_PACKAGE_GST1_PLUGINS_BASE_PLUGIN_VIDEOCONVERT=n
BR2_PACKAGE_GST1_PLUGINS_BASE_PLUGIN_VIDEORATE=n
BR2_PACKAGE_GST1_PLUGINS_BASE_PLUGIN_ALSA=n
BR2_PACKAGE_GST1_PLUGINS_GOOD=n
BR2_PACKAGE_GST1_PLUGINS_GOOD_PLUGIN_AUTODETECT=n
BR2_PACKAGE_GST1_PLUGINS_GOOD_PLUGIN_MATROSKA=n
BR2_PACKAGE_GST1_PLUGINS_GOOD_PLUGIN_VIDEOFILTER=n
BR2_PACKAGE_GST1_PLUGINS_BAD=n
BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_AUTOCONVERT=n
BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_RAWPARSE=n
BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_VIDEOPARSERS=n
BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_VIDEOSIGNAL=n
BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_FBDEV=n
BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_FDK_AAC=n
BR2_PACKAGE_GST_FBDEV2_PLUGINS=n
BR2_PACKAGE_GST_OMX=n

# no libcedarc (musl)
BR2_PACKAGE_LIBCEDARC=n
BR2_PACKAGE_LIBCEDARC_ARCHLIB=""
BR2_PACKAGE_LIBCEDARC_DECODER=n
BR2_PACKAGE_LIBCEDARC_OPENMAX=n

# no libretro
BR2_PACKAGE_RETROARCH=n
BR2_PACKAGE_LIBRETRO_CORE_INFO=n
BR2_PACKAGE_LIBRETRO_2048=n
BR2_PACKAGE_LIBRETRO_81=n
BR2_PACKAGE_LIBRETRO_A5200=n
BR2_PACKAGE_LIBRETRO_ARDUOUS=n
BR2_PACKAGE_LIBRETRO_ATARI800=n
BR2_PACKAGE_LIBRETRO_BK_EMULATOR=n
BR2_PACKAGE_LIBRETRO_BLUEMSX=n
BR2_PACKAGE_LIBRETRO_CANNONBALL=n
BR2_PACKAGE_LIBRETRO_CAP32=n
BR2_PACKAGE_LIBRETRO_CHAILOVE=n
BR2_PACKAGE_LIBRETRO_DINOTHAWR=n
BR2_PACKAGE_LIBRETRO_ECWOLF=n
BR2_PACKAGE_LIBRETRO_FAKE08=n
BR2_PACKAGE_LIBRETRO_FCEUMM=n
BR2_PACKAGE_LIBRETRO_FMSX=n
BR2_PACKAGE_LIBRETRO_FREECHAF=n
BR2_PACKAGE_LIBRETRO_FREEINTV=n
BR2_PACKAGE_LIBRETRO_FUSE=n
BR2_PACKAGE_LIBRETRO_GAMBATTE=n
BR2_PACKAGE_LIBRETRO_GEARBOY=n
BR2_PACKAGE_LIBRETRO_GEARCOLECO=n
BR2_PACKAGE_LIBRETRO_GEARSYSTEM=n
BR2_PACKAGE_LIBRETRO_GENESISPLUSGX=n
BR2_PACKAGE_LIBRETRO_GENESISPLUSGXWIDE=n
BR2_PACKAGE_LIBRETRO_GME=n
BR2_PACKAGE_LIBRETRO_GONG=n
BR2_PACKAGE_LIBRETRO_GPSP=n
BR2_PACKAGE_LIBRETRO_GW=n
BR2_PACKAGE_LIBRETRO_HANDY=n
BR2_PACKAGE_LIBRETRO_JAXE=n
BR2_PACKAGE_LIBRETRO_JUMPNBUMP=n
BR2_PACKAGE_LIBRETRO_LOWRES_NX=n
BR2_PACKAGE_LIBRETRO_LUTRO=n
BR2_PACKAGE_LIBRETRO_MAME2000=n
BR2_PACKAGE_LIBRETRO_MAME2003=n
BR2_PACKAGE_LIBRETRO_MAME2003_PLUS=n
BR2_PACKAGE_LIBRETRO_MEDNAFEN_PCE_FAST=n
BR2_PACKAGE_LIBRETRO_MEDNAFEN_SUPERGRAFX=n
BR2_PACKAGE_LIBRETRO_MEDNAFEN_WSWAN=n
BR2_PACKAGE_LIBRETRO_MGBA=n
BR2_PACKAGE_LIBRETRO_MINIVMAC=n
BR2_PACKAGE_LIBRETRO_MRBOOM=n
BR2_PACKAGE_LIBRETRO_NUMERO=n
BR2_PACKAGE_LIBRETRO_NXENGINE=n
BR2_PACKAGE_LIBRETRO_O2EM=n
BR2_PACKAGE_LIBRETRO_PCSX_REARMED=n
BR2_PACKAGE_LIBRETRO_PICODRIVE=n
BR2_PACKAGE_LIBRETRO_POCKETCDG=n
BR2_PACKAGE_LIBRETRO_POKEMINI=n
BR2_PACKAGE_LIBRETRO_POTATOR=n
BR2_PACKAGE_LIBRETRO_PRBOOM=n
BR2_PACKAGE_LIBRETRO_PROSYSTEM=n
BR2_PACKAGE_LIBRETRO_QUASI88=n
BR2_PACKAGE_LIBRETRO_QUICKNES=n
BR2_PACKAGE_LIBRETRO_RACE=n
BR2_PACKAGE_LIBRETRO_REMINISCENCE=n
BR2_PACKAGE_LIBRETRO_RETRO8=n
BR2_PACKAGE_LIBRETRO_SCUMMVM=n
BR2_PACKAGE_LIBRETRO_SCUMMVM_LEGACY=n
BR2_PACKAGE_LIBRETRO_SMSPLUS=n
BR2_PACKAGE_LIBRETRO_SNES9X2002=n
BR2_PACKAGE_LIBRETRO_SNES9X2005=n
BR2_PACKAGE_LIBRETRO_STELLA2014=n
BR2_PACKAGE_LIBRETRO_THEODORE=n
BR2_PACKAGE_LIBRETRO_TIC80=n
BR2_PACKAGE_LIBRETRO_TYRQUAKE=n
BR2_PACKAGE_LIBRETRO_UAE4ALL=n
BR2_PACKAGE_LIBRETRO_UW8=n
BR2_PACKAGE_LIBRETRO_VAPORSPEC=n
BR2_PACKAGE_LIBRETRO_VECX=n
BR2_PACKAGE_LIBRETRO_VEMULATOR=n
BR2_PACKAGE_LIBRETRO_WASM4=n
BR2_PACKAGE_LIBRETRO_X1=n
BR2_PACKAGE_LIBRETRO_XRICK=n

# no sdlbook (with selected depends)
BR2_PACKAGE_SDLBOOK=n

# no skins&fonts
BR2_PACKAGE_GMENU2X_SKINS=n
BR2_PACKAGE_DEJAVU=n
BR2_PACKAGE_LIBERATION=n
40 changes: 40 additions & 0 deletions board/miyoo/minconfig/mini_config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

# NOTES:
# - run this script from $TOPDIR
# - `merge_config.sh` allows up to 2 extra fragment configs.

usage() {
echo "Usage: $0 [DEFCONFIG]"
echo " -h display this help text"
echo
echo " NOTES: Run this script from BR2's \$TOPDIR. After successfull run,
execute \"make MINIMAL=yes\" for down-sized image."
echo
}

while true; do
case $1 in
"-h")
usage
exit
;;
*)
break
;;
esac
done

if [ "$#" -lt 1 ] ; then
usage
exit
fi

DEFCONFIGS_RPATH="configs"
FRAGMENTS_RPATH="board/miyoo/minconfig"
FRAGMENT_CONFIG1=${FRAGMENTS_RPATH}/rootfs-size-fragment.config
FRAGMENT_CONFIG2=${FRAGMENTS_RPATH}/min-pkgs-fragment.config

support/kconfig/merge_config.sh ${DEFCONFIGS_RPATH="configs"}/"${1}" "${FRAGMENT_CONFIG1}" "${FRAGMENT_CONFIG2}"

# RUN: make MINIMAL="yes"
1 change: 1 addition & 0 deletions board/miyoo/minconfig/rootfs-size-fragment.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BR2_TARGET_ROOTFS_EXT2_SIZE="160M"
Loading