mirror of
https://github.com/kou029w/yama.git
synced 2025-01-19 00:18:06 +00:00
add overlay-gen
This commit is contained in:
parent
3cbba72990
commit
5b4526ff20
5 changed files with 26 additions and 2 deletions
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
|
@ -1,6 +1,7 @@
|
||||||
name: build
|
name: build
|
||||||
on:
|
on:
|
||||||
push: { branches: [main] }
|
push:
|
||||||
|
branches: [main]
|
||||||
release:
|
release:
|
||||||
types: [published]
|
types: [published]
|
||||||
jobs:
|
jobs:
|
||||||
|
@ -10,6 +11,7 @@ jobs:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- run: sudo apt-get update
|
- run: sudo apt-get update
|
||||||
- run: sudo apt-get install -y qemu-user-static
|
- run: sudo apt-get install -y qemu-user-static
|
||||||
|
- run: sudo bin/overlay-gen
|
||||||
- run: bin/build
|
- run: bin/build
|
||||||
- run: sudo bin/img-gen
|
- run: sudo bin/img-gen
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,5 +1,6 @@
|
||||||
/apkovl/
|
/apkovl/
|
||||||
/cache/
|
/cache/
|
||||||
/dist/
|
/dist/
|
||||||
|
/overlay.img.gz
|
||||||
/yama-armhf.tar.gz
|
/yama-armhf.tar.gz
|
||||||
/yama-armhf.img.gz
|
/yama-armhf.img.gz
|
||||||
|
|
|
@ -9,6 +9,7 @@ Raspberry Pi Zero 向け OS のビルドするためのツール群
|
||||||
## ビルド
|
## ビルド
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
bin/overlay-gen
|
||||||
bin/build
|
bin/build
|
||||||
bin/img-gen
|
bin/img-gen
|
||||||
```
|
```
|
||||||
|
@ -20,7 +21,7 @@ bin/img-gen
|
||||||
- Docker
|
- Docker
|
||||||
- Docker Compose
|
- Docker Compose
|
||||||
- qemu-user-static
|
- qemu-user-static
|
||||||
- awk, bash, curl, fallocate, grep, gzip, losetup, mkfs.fat, parted, python3, ssh-keygen, tar, xargs
|
- awk, bash, curl, fallocate, grep, gzip, losetup, mkfs.ext4, mkfs.fat, parted, python3, ssh-keygen, tar, xargs
|
||||||
|
|
||||||
### WiFi の設定
|
### WiFi の設定
|
||||||
|
|
||||||
|
|
20
bin/overlay-gen
Executable file
20
bin/overlay-gen
Executable file
|
@ -0,0 +1,20 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# オーバーレイイメージファイルの生成
|
||||||
|
# Usage: bin/overlay-gen
|
||||||
|
# Required: fallocate losetup mkfs.ext4 gzip
|
||||||
|
cd -- "$(dirname -- "$0")/.."
|
||||||
|
set -eux
|
||||||
|
size=512m
|
||||||
|
fallocate -l "${size}" overlay.img
|
||||||
|
mkfs.ext4 overlay.img
|
||||||
|
dev="$(losetup -f)"
|
||||||
|
finally="losetup -d '${dev}'"
|
||||||
|
trap 'sh -c "${finally}"' EXIT
|
||||||
|
losetup "${dev}" overlay.img
|
||||||
|
tmp="$(mktemp -d)"
|
||||||
|
finally="rmdir '${tmp}'; ${finally}"
|
||||||
|
mount "${dev}" "${tmp}"
|
||||||
|
finally="umount '${tmp}'; ${finally}"
|
||||||
|
mkdir -p "${tmp}/work/usr"
|
||||||
|
mkdir -p "${tmp}/upper/usr"
|
||||||
|
finally="${finally}; gzip -f overlay.img"
|
BIN
overlay.img.gz
BIN
overlay.img.gz
Binary file not shown.
Loading…
Add table
Reference in a new issue