mirror of
https://github.com/kou029w/yama.git
synced 2025-01-18 16:08:11 +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
|
||||
on:
|
||||
push: { branches: [main] }
|
||||
push:
|
||||
branches: [main]
|
||||
release:
|
||||
types: [published]
|
||||
jobs:
|
||||
|
@ -10,6 +11,7 @@ jobs:
|
|||
- uses: actions/checkout@v2
|
||||
- run: sudo apt-get update
|
||||
- run: sudo apt-get install -y qemu-user-static
|
||||
- run: sudo bin/overlay-gen
|
||||
- run: bin/build
|
||||
- run: sudo bin/img-gen
|
||||
- uses: actions/upload-artifact@v2
|
||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,5 +1,6 @@
|
|||
/apkovl/
|
||||
/cache/
|
||||
/dist/
|
||||
/overlay.img.gz
|
||||
/yama-armhf.tar.gz
|
||||
/yama-armhf.img.gz
|
||||
|
|
|
@ -9,6 +9,7 @@ Raspberry Pi Zero 向け OS のビルドするためのツール群
|
|||
## ビルド
|
||||
|
||||
```sh
|
||||
bin/overlay-gen
|
||||
bin/build
|
||||
bin/img-gen
|
||||
```
|
||||
|
@ -20,7 +21,7 @@ bin/img-gen
|
|||
- Docker
|
||||
- Docker Compose
|
||||
- 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 の設定
|
||||
|
||||
|
|
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