mirror of
https://github.com/brain-hackers/buildbrain
synced 2024-12-22 04:00:11 +09:00
Minimal build for the magazine
This commit is contained in:
parent
ee93757ff1
commit
688826f176
241
.github/workflows/build.yml
vendored
241
.github/workflows/build.yml
vendored
@ -37,199 +37,6 @@ jobs:
|
||||
draft: false
|
||||
prerelease: true
|
||||
|
||||
build-linux:
|
||||
runs-on: ubuntu-20.04
|
||||
needs: [create_release]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
- name: Workaround for apt update failure
|
||||
run: sudo rm /etc/apt/sources.list.d/github_git-lfs.*
|
||||
- name: Install deps
|
||||
run: sudo apt update && sudo apt install build-essential bison flex libncurses5-dev gcc-arm-linux-gnueabi qemu-user-static debootstrap python3-pip
|
||||
- name: Upgrade pip and setuptools
|
||||
run: pip3 install -U pip setuptools
|
||||
- name: Install listconfig
|
||||
run: pip3 install listconfig
|
||||
- name: Configure for Linux
|
||||
run: make ldefconfig
|
||||
- name: Build Linux
|
||||
run: make lbuild
|
||||
- name: Setup releases
|
||||
id: release_name
|
||||
run: |
|
||||
mkdir release
|
||||
cp ./linux-brain/arch/arm/boot/dts/imx28-pwsh*.dtb release/
|
||||
cp ./linux-brain/arch/arm/boot/zImage release/zImage
|
||||
zip -r release.zip release/
|
||||
- name: Generate archive name
|
||||
id: archive_name
|
||||
run: echo ::set-output name=name::linux-${GITHUB_REF/refs\/*s\//}
|
||||
- name: Upload release.zip
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ needs.create_release.outputs.upload_url }}
|
||||
asset_path: release.zip
|
||||
asset_name: ${{ steps.archive_name.outputs.name }}.zip
|
||||
asset_content_type: application/zip
|
||||
- name: Generate listconfig
|
||||
run: listconfig ./linux-brain/Kconfig ./linux-brain/.config > listconfig
|
||||
- name: Upload listconfig
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ needs.create_release.outputs.upload_url }}
|
||||
asset_path: listconfig
|
||||
asset_name: listconfig
|
||||
asset_content_type: text/plain
|
||||
|
||||
build-linux-x1:
|
||||
runs-on: ubuntu-20.04
|
||||
needs: [create_release]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
- name: Workaround for apt update failure
|
||||
run: sudo rm /etc/apt/sources.list.d/github_git-lfs.*
|
||||
- name: Install deps
|
||||
run: sudo apt update && sudo apt install build-essential bison flex libncurses5-dev gcc-arm-linux-gnueabihf libssl-dev lzop qemu-user-static debootstrap
|
||||
- name: Configure for Linux
|
||||
run: make ldefconfig-x1
|
||||
- name: Build Linux
|
||||
run: make lbuild
|
||||
- name: Setup releases
|
||||
id: release_name
|
||||
run: |
|
||||
mkdir release
|
||||
cp ./linux-brain/arch/arm/boot/dts/imx7ulp-pwh*.dtb release/
|
||||
cp ./linux-brain/arch/arm/boot/zImage release/zImage
|
||||
zip -r release.zip release/
|
||||
- name: Generate archive name
|
||||
id: archive_name
|
||||
run: echo ::set-output name=name::linux-x1-${GITHUB_REF/refs\/*s\//}
|
||||
- name: Upload release.zip
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ needs.create_release.outputs.upload_url }}
|
||||
asset_path: release.zip
|
||||
asset_name: ${{ steps.archive_name.outputs.name }}.zip
|
||||
asset_content_type: application/zip
|
||||
|
||||
build-uboot:
|
||||
runs-on: ubuntu-20.04
|
||||
needs: [create_release]
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- model: a7200
|
||||
nk: edna3exe.bin
|
||||
lilo: gen2.bin
|
||||
- model: sh1
|
||||
nk: edsa1exe.bin
|
||||
lilo: gen3_1.bin
|
||||
- model: sh2
|
||||
nk: edsa2exe.bin
|
||||
lilo: gen3_2.bin
|
||||
- model: sh3
|
||||
nk: edsa3exe.bin
|
||||
lilo: gen3_3.bin
|
||||
- model: sh4
|
||||
nk: edsh4exe.bin
|
||||
lilo: gen3_4.bin
|
||||
- model: sh5
|
||||
nk: edsh5exe.bin
|
||||
lilo: gen3_5.bin
|
||||
- model: sh6
|
||||
nk: edsh6exe.bin
|
||||
lilo: gen3_6.bin
|
||||
- model: sh7
|
||||
nk: edsh7exe.bin
|
||||
lilo: gen3_7.bin
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
- name: Workaround for apt update failure
|
||||
run: sudo rm /etc/apt/sources.list.d/github_git-lfs.*
|
||||
- name: Install deps
|
||||
run: sudo apt update && sudo apt install build-essential bison flex libncurses5-dev gcc-arm-linux-gnueabi qemu-user-static debootstrap
|
||||
- name: Build nkbin-maker
|
||||
run: make nkbin-maker
|
||||
- name: Configure for U-Boot
|
||||
run: make udefconfig-${{ matrix.model }}
|
||||
- name: Build U-Boot
|
||||
run: make ubuild
|
||||
- name: Generate NK.bin
|
||||
run: make nk.bin
|
||||
- name: Setup releases
|
||||
id: release_name
|
||||
run: |
|
||||
mkdir release
|
||||
cp ./u-boot-brain/u-boot.bin release/u-boot.bin
|
||||
cp ./u-boot-brain/u-boot.bin release/${{ matrix.lilo }}
|
||||
cp ./u-boot-brain/u-boot.sb release/u-boot.sb
|
||||
cp ./nk.bin release/${{ matrix.nk }}
|
||||
zip -r release.zip release/
|
||||
- name: Generate archive name
|
||||
id: archive_name
|
||||
run: echo ::set-output name=name::uboot-${{ matrix.model }}-${GITHUB_REF/refs\/*s\//}
|
||||
- name: Upload release.zip
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ needs.create_release.outputs.upload_url }}
|
||||
asset_path: release.zip
|
||||
asset_name: ${{ steps.archive_name.outputs.name }}.zip
|
||||
asset_content_type: application/zip
|
||||
|
||||
build-uboot-x1:
|
||||
runs-on: ubuntu-20.04
|
||||
needs: [create_release]
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- model: h1
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
- name: Workaround for apt update failure
|
||||
run: sudo rm /etc/apt/sources.list.d/github_git-lfs.*
|
||||
- name: Install deps
|
||||
run: sudo apt update && sudo apt install build-essential bison flex libncurses5-dev gcc-arm-linux-gnueabihf libssl-dev lzop qemu-user-static debootstrap
|
||||
- name: Configure for U-Boot
|
||||
run: make udefconfig-${{ matrix.model }}
|
||||
- name: Build U-Boot
|
||||
run: make ubuild
|
||||
- name: Setup releases
|
||||
id: release_name
|
||||
run: |
|
||||
mkdir release
|
||||
cp ./u-boot-brain/u-boot.bin release/u-boot.bin
|
||||
zip -r release.zip release/
|
||||
- name: Generate archive name
|
||||
id: archive_name
|
||||
run: echo ::set-output name=name::uboot-${{ matrix.model }}-${GITHUB_REF/refs\/*s\//}
|
||||
- name: Upload release.zip
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ needs.create_release.outputs.upload_url }}
|
||||
asset_path: release.zip
|
||||
asset_name: ${{ steps.archive_name.outputs.name }}.zip
|
||||
asset_content_type: application/zip
|
||||
|
||||
build-sd:
|
||||
runs-on: ubuntu-20.04
|
||||
needs: [create_release]
|
||||
@ -253,9 +60,7 @@ jobs:
|
||||
- name: Build Linux
|
||||
run: make lbuild
|
||||
- name: Build Debian Root
|
||||
run: make brainux
|
||||
- name: Build bsd-ce
|
||||
run: make -C nkbin_maker bsd-ce
|
||||
run: make minimal
|
||||
- name: Generate image name
|
||||
id: image_name
|
||||
run: echo ::set-output name=name::sdimage-${GITHUB_REF/refs\/*s\//}
|
||||
@ -272,47 +77,3 @@ jobs:
|
||||
asset_path: ${{ steps.image_name.outputs.name }}.zip
|
||||
asset_name: ${{ steps.image_name.outputs.name }}.zip
|
||||
asset_content_type: application/zip
|
||||
|
||||
build-sd-x1:
|
||||
runs-on: ubuntu-20.04
|
||||
needs: [create_release]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
- name: Workaround for apt update failure
|
||||
run: sudo rm /etc/apt/sources.list.d/github_git-lfs.*
|
||||
- name: Install deps
|
||||
run: sudo apt update && sudo apt install kpartx build-essential bison flex libncurses5-dev gcc-arm-linux-gnueabihf libssl-dev lzop qemu-user-static debootstrap
|
||||
- name: Upgrade pip and setuptools
|
||||
run: pip3 install -U pip setuptools
|
||||
- name: Install pyelftools
|
||||
run: pip3 install pyelftools
|
||||
- name: Build Boot4u
|
||||
run: make boot4ubuild
|
||||
- name: Configure for U-Boot
|
||||
run: make udefconfig-h1
|
||||
- name: Build U-Boot
|
||||
run: make ubuild
|
||||
- name: Configure for Linux
|
||||
run: make ldefconfig-x1
|
||||
- name: Build Linux
|
||||
run: make lbuild
|
||||
- name: Build Debian Root
|
||||
run: make brainux
|
||||
- name: Generate image name
|
||||
id: image_name
|
||||
run: echo ::set-output name=name::sdimage-x1-${GITHUB_REF/refs\/*s\//}
|
||||
- name: Build SD image
|
||||
run: make image/sd_x1.img && mv image/sd_x1.img ${{ steps.image_name.outputs.name }}.img
|
||||
- name: Compress
|
||||
run: zip ${{ steps.image_name.outputs.name }}.zip ${{ steps.image_name.outputs.name }}.img
|
||||
- name: Upload the image
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ needs.create_release.outputs.upload_url }}
|
||||
asset_path: ${{ steps.image_name.outputs.name }}.zip
|
||||
asset_name: ${{ steps.image_name.outputs.name }}.zip
|
||||
asset_content_type: application/zip
|
||||
|
12
Makefile
12
Makefile
@ -154,6 +154,18 @@ brainux:
|
||||
sudo rm brainux/setup_brainux.sh
|
||||
sudo ./os-brainux/override.sh ./os-brainux/override ./brainux
|
||||
|
||||
minimal:
|
||||
@if [ "$(shell uname)" != "Linux" ]; then \
|
||||
echo "Debootstrap is only available in Linux!"; \
|
||||
exit 1; \
|
||||
fi
|
||||
sudo mkdir -p brainux
|
||||
sudo debootstrap --arch=$(ROOTFS_CROSS) --foreign bullseye brainux/; \
|
||||
sudo cp /usr/bin/qemu-arm-static brainux/usr/bin/
|
||||
sudo cp ./os-minimal/setup_brainux.sh brainux/
|
||||
sudo -E chroot brainux /setup_brainux.sh
|
||||
sudo rm brainux/setup_brainux.sh
|
||||
|
||||
image/sd.img: clean_work
|
||||
./image/build_image.sh
|
||||
|
||||
|
@ -16,17 +16,13 @@ for i in "a7200" "sh1" "sh2" "sh3" "sh4" "sh5" "sh6" "sh7"; do
|
||||
|
||||
make -C ${REPO}/u-boot-brain distclean pw${i}_defconfig
|
||||
make -j${JOBS} -C ${REPO}/u-boot-brain u-boot.bin
|
||||
${REPO}/nkbin_maker/bsd-ce ${REPO}/u-boot-brain/u-boot.bin
|
||||
|
||||
case $i in
|
||||
"a7200")
|
||||
mv ${REPO}/nk.bin ${WORK}/edna3exe.bin
|
||||
mv ${REPO}/u-boot-brain/u-boot.bin ${WORK}/lilobin/gen2.bin;;
|
||||
"sh1" | "sh2" | "sh3")
|
||||
mv ${REPO}/nk.bin ${WORK}/edsa${NUM}exe.bin
|
||||
mv ${REPO}/u-boot-brain/u-boot.bin ${WORK}/lilobin/gen3_${NUM}.bin;;
|
||||
"sh4" | "sh5" | "sh6" | "sh7")
|
||||
mv ${REPO}/nk.bin ${WORK}/edsh${NUM}exe.bin
|
||||
mv ${REPO}/u-boot-brain/u-boot.bin ${WORK}/lilobin/gen3_${NUM}.bin;;
|
||||
*)
|
||||
echo "WTF: $i"
|
||||
@ -60,8 +56,6 @@ sudo mount /dev/mapper/${LOOPDEV}p2 ${WORK}/p2
|
||||
|
||||
sudo cp ${LINUX}/arch/arm/boot/zImage ${WORK}/p1/
|
||||
sudo cp ${LINUX}/arch/arm/boot/dts/imx28-pw*.dtb ${WORK}/p1/
|
||||
sudo mkdir -p ${WORK}/p1/nk
|
||||
sudo cp ${WORK}/*.bin ${WORK}/p1/nk/
|
||||
|
||||
make -C ${REPO}/brainlilo
|
||||
|
||||
|
49
os-minimal/setup_brainux.sh
Executable file
49
os-minimal/setup_brainux.sh
Executable file
@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
set -uex -o pipefail
|
||||
|
||||
/debootstrap/debootstrap --second-stage
|
||||
|
||||
# cat <<EOF > /etc/apt/sources.list
|
||||
# deb http://deb.debian.org/debian bullseye main contrib non-free
|
||||
# deb-src http://deb.debian.org/debian bullseye main contrib non-free
|
||||
# deb http://deb.debian.org/debian bullseye-updates main contrib non-free
|
||||
# deb-src http://deb.debian.org/debian bullseye-updates main contrib non-free
|
||||
# deb http://deb.debian.org/debian-security bullseye-security/updates main contrib non-free
|
||||
# deb-src http://deb.debian.org/debian-security bullseye-security/updates main contrib non-free
|
||||
# EOF
|
||||
|
||||
# cat <<EOF > /etc/apt/apt.conf.d/90-norecommend
|
||||
# APT::Install-Recommends "0";
|
||||
# APT::Install-Suggests "0";
|
||||
# EOF
|
||||
|
||||
# locales: locale has to be set before going any further
|
||||
apt update -y
|
||||
DEBIAN_FRONTEND=noninteractive \
|
||||
apt install -y locales bash
|
||||
|
||||
echo "Asia/Tokyo" > /etc/timezone
|
||||
rm /etc/localtime
|
||||
dpkg-reconfigure -f noninteractive tzdata
|
||||
sed -i -e 's/# en_US.UTF-8/en_US.UTF-8/' /etc/locale.gen
|
||||
echo 'LANG="en_US.UTF-8"' > /etc/default/locale
|
||||
dpkg-reconfigure -f noninteractive locales
|
||||
update-locale LANG=en_US.UTF-8
|
||||
|
||||
LANG=en_US.UTF-8
|
||||
|
||||
echo "brain" > /etc/hostname
|
||||
|
||||
# apt install -y sudo
|
||||
|
||||
# Network
|
||||
# apt install -y ca-certificates fake-hwclock systemd-timesyncd net-tools ssh avahi-daemon network-manager
|
||||
# systemctl enable fake-hwclock
|
||||
|
||||
# Setup users
|
||||
# adduser --gecos "" --disabled-password --home /home/user user
|
||||
# echo user:brain | chpasswd
|
||||
# echo "user ALL=(ALL:ALL) ALL" > /etc/sudoers.d/user
|
||||
echo -e "127.0.1.1\tbrain" >> /etc/hosts
|
||||
|
||||
echo root:root | chpasswd
|
Loading…
Reference in New Issue
Block a user