Initial commit

This commit is contained in:
Nasir Hossain 2024-02-16 03:41:09 +06:00
commit 5a7c2d425c
5 changed files with 6675 additions and 0 deletions

30
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,30 @@
name: Build
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Run build.bash
run: ./build.bash
- name: Create release
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref }}
release_name: Build Number\:${{ github.ref }}
draft: false
prerelease: false
files: |
dist/boot/boot.img

56
build.bash Normal file
View File

@ -0,0 +1,56 @@
#!/bin/bash
. config/config.bash
set -e
# Install the required packages
apt-get update
apt-get install -y\
curl\
xz-utils\
bzip2\
fakeroot\
build-essential\
ncurses-dev\
libssl-dev\
bc\
flex\
libelf-dev\
bison\
autoconf\
libtool\
libpng-dev\
libfreetype-dev\
git
# Create the dist directory
mkdir -p dist/boot
# Download the kernel source
wget https://www.kernel.org/pub/linux/kernel/v${LINUX_MAJOR}.x/linux-${LINUX_MAJOR}.${LINUX_MINOR}.${LINUX_PATCH}.tar.xz
tar -xvf linux-${LINUX_MAJOR}.${LINUX_MINOR}.${LINUX_PATCH}.tar.xz
cd linux-${LINUX_MAJOR}.${LINUX_MINOR}.${LINUX_PATCH}
cp ../config/linux.config .config
make -j$(nproc)
echo $PWD
cp arch/x86/boot/bzImage ../dist/boot/.
cd ..
# Download the busybox source
wget https://busybox.net/downloads/busybox-${BUSYBOX_MAJOR}.${BUSYBOX_MINOR}.${BUSYBOX_PATCH}.tar.bz2
tar -xvf busybox-${BUSYBOX_MAJOR}.${BUSYBOX_MINOR}.${BUSYBOX_PATCH}.tar.bz2
cd busybox-${BUSYBOX_MAJOR}.${BUSYBOX_MINOR}.${BUSYBOX_PATCH}
cp ../config/busybox.config .config
make -j$(nproc)
make CONFIG_PREFIX=../dist install
cd ..
# Create the bootable image
dd if=/dev/zero of=dist/boot/boot.img bs=1M count=64
mkfs.ext4 dist/boot/boot.img
mkdir -p dist/mnt
mount dist/boot/boot.img dist/mnt
cp -r dist/* dist/mnt/.
umount dist/mnt
rmdir dist/mnt

1231
config/busybox.config Normal file

File diff suppressed because it is too large Load Diff

9
config/config.bash Normal file
View File

@ -0,0 +1,9 @@
#!/bin/bash
LINUX_MAJOR=6
LINUX_MINOR=7
LINUX_PATCH=4
BUSYBOX_MAJOR=1
BUSYBOX_MINOR=36
BUSYBOX_PATCH=1

5349
config/linux.config Normal file

File diff suppressed because it is too large Load Diff