Skip to content
Open
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
37 changes: 37 additions & 0 deletions .github/workflows/cloud-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: cloud-build

on:
workflow_dispatch: {}

concurrency:
group: cloud-build-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build sysroot with Dockerfile
run: |
docker buildx build \
--target artifact \
--output type=local,dest=./build-out \
.

- name: Package sysroot
run: |
cd build-out
tar -czf ../sysroot.tar.gz opt/sysroot

- name: Upload sysroot artifact
uses: actions/upload-artifact@v4
with:
name: sysroot
path: sysroot.tar.gz
retention-days: 7
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# syntax=docker/dockerfile:1.6
FROM debian:buster AS builder

ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /opt

# Base tools for fetching sources; the main build dependencies are installed by the script itself
RUN echo "deb http://archive.debian.org/debian buster main contrib non-free" > /etc/apt/sources.list \
&& echo "deb http://archive.debian.org/debian-security buster/updates main contrib non-free" >> /etc/apt/sources.list \
&& echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/99no-check-valid-until \
&& apt-get update \
&& apt-get install -y git

COPY . /opt/linux.base
RUN mkdir -p /opt/sysroot

# Run the existing build script to assemble the sysroot
RUN bash /opt/linux.base/create.sh

FROM scratch AS artifact
COPY --from=builder /opt/sysroot/ /
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,18 @@ Linux Kernel 3.18 (64bit) + Drivers + Busybox + GCC + glibc + wpa_supplicant (fo

## BUILD INSTRUCTIONS

mkdir /opt/sysroot
- **docker run (legacy manual run)**
- `mkdir /opt/sysroot`
- `docker run -it --mount type=bind,source=/opt/sysroot,target=/opt/sysroot --rm debian:buster /bin/bash -c "apt-get update; apt-get install -y git; cd /opt; git clone https://github.com/buzzy/linux.base.git; bash"`
- `time bash linux.base/create.sh`

docker run -it --mount type=bind,source=/opt/sysroot,target=/opt/sysroot --rm debian:buster /bin/bash -c "apt-get update; apt-get install -y git; cd /opt; git clone https://github.com/buzzy/linux.base.git; bash"
- **docker build (recommended)**
- `docker buildx build --target artifact --output type=local,dest=/opt/sysroot .`

- **cloud build (GitHub Actions)**
- Run the workflow `cloud-build` (workflow_dispatch) in GitHub Actions.
- Output artifact: download `sysroot` artifact containing `/opt/sysroot`.

time bash linux.base/create.sh

## ENABLE USB BOOT

Expand Down
12 changes: 6 additions & 6 deletions create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ rm -rf /opt/sysroot/tmp/*

#BINUTILS
cd /opt
wget https://ftp.yzu.edu.tw/gnu/binutils/binutils-2.32.tar.xz
wget https://ftp.gnu.org/gnu/binutils/binutils-2.32.tar.xz
tar xfv binutils-2.32.tar.xz
cd binutils-2.32

Expand All @@ -126,7 +126,7 @@ make tooldir=/opt/sysroot/usr install

#GCC
cd /opt
wget http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-8.3.0/gcc-8.3.0.tar.xz
wget https://ftp.gnu.org/gnu/gcc/gcc-8.3.0/gcc-8.3.0.tar.xz
tar xfv gcc-8.3.0.tar.xz
cd gcc-8.3.0
./contrib/download_prerequisites
Expand Down Expand Up @@ -164,7 +164,7 @@ ln -s arm-linux-gnueabihf-gcc /opt/sysroot/usr/bin/cc

#bison
cd /opt
wget http://ftp.twaren.net/Unix/GNU/gnu/bison/bison-3.4.1.tar.xz
wget https://ftp.gnu.org/gnu/bison/bison-3.4.1.tar.xz
tar xfv bison-3.4.1.tar.xz
cd bison-3.4.1
./configure \
Expand Down Expand Up @@ -199,7 +199,7 @@ rm -fr /opt/sysroot/tmp/*

#make
cd /opt
wget http://ftp.twaren.net/Unix/GNU/gnu/make/make-4.2.1.tar.gz
wget https://ftp.gnu.org/gnu/make/make-4.2.1.tar.gz
tar xfv make-4.2.1.tar.gz
cd make-4.2.1
sed -i '211,217 d; 219,229 d; 232 d' glob/glob.c
Expand Down Expand Up @@ -282,7 +282,7 @@ rm -fr /tmp/iw

#zlib
cd /opt
wget https://zlib.net/zlib-1.2.11.tar.gz
wget https://sourceforge.net/projects/libpng/files/zlib/1.2.11/zlib-1.2.11.tar.gz
tar xfv zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure \
Expand Down Expand Up @@ -352,7 +352,7 @@ rm -fr /tmp/openssl

#ncurses
cd /opt
wget https://ftp.gnu.org/pub/gnu/ncurses/ncurses-6.1.tar.gz
wget https://ftp.gnu.org/gnu/ncurses/ncurses-6.1.tar.gz
tar xfv ncurses-6.1.tar.gz
cd ncurses-6.1
./configure \
Expand Down