From 5b4526ff204b9e07c0c4d1fadedaf58f87024498 Mon Sep 17 00:00:00 2001 From: Kohei Watanabe Date: Mon, 30 May 2022 23:57:09 +0900 Subject: [PATCH] add overlay-gen --- .github/workflows/build.yml | 4 +++- .gitignore | 1 + README.md | 3 ++- bin/overlay-gen | 20 ++++++++++++++++++++ overlay.img.gz | Bin 590970 -> 0 bytes 5 files changed, 26 insertions(+), 2 deletions(-) create mode 100755 bin/overlay-gen delete mode 100644 overlay.img.gz diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f8cd43b..0e57388 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/.gitignore b/.gitignore index 96bf745..2d69006 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /apkovl/ /cache/ /dist/ +/overlay.img.gz /yama-armhf.tar.gz /yama-armhf.img.gz diff --git a/README.md b/README.md index c6d4467..cfee0f3 100644 --- a/README.md +++ b/README.md @@ -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 の設定 diff --git a/bin/overlay-gen b/bin/overlay-gen new file mode 100755 index 0000000..6ea1854 --- /dev/null +++ b/bin/overlay-gen @@ -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" diff --git a/overlay.img.gz b/overlay.img.gz deleted file mode 100644 index 84846eff317b2418ac2adb8cf001fbd93099877c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 590970 zcmeI&dwkCY|NrrIROvvyO9&sJ-@lx6OSIRuVqqrkhUW&3-xT zx^8{i_vrje|FUm%=@@o==h9L2Un!VtfBB{Fwl9#<^~DZ_yT4Ik^5~a;Ec;Qt2V3rV z@15JafAZeX(|6aH`ss()zHrM&@6>#^&iq>nPdtBJo`s)}>AvrY(Y?q2`az!9Zt=-Pis^m zX28B?!|N@+*kN(@p(bOt?b^F*$Ma=Jt^54e<|8J@rT?5#7 z18=4Mx-_#?+d+%lEFWB<^&@?kr+oRx8-HaiUHE;%sYP+ugq=^XIBsXN4jsqGBtF|| z;;aYvul($r%-6eQuj$1LKLgwksEl#X`w@>+ z`t3$FgIr-@L%v#H|LW7FuReYJ>eKO8pFaHUmG>PJbM+HwbM+IraP^`5S08Hm<<*B? zxcbnls}E&f{kV_Rz4CDvR=DzUUyQ!`bo;AMkDY$yi1Oul+{o62#bI(=S|dXwhf%l?UFq z@<8xsR%FglrfO7rkn{H+k5^lN33J8V5fy?ghk$By{+A0PYNmscKWeC2_SS00GJ`oM%M5461UK-!fD23>t%{FMiqUwI(u z$^+R~AGrEC#D*Q;9ntBorwfMdulwrX9}WvIRkLQ3nOQdsuJCrLGEE*G^ZqB-pSbV+ z{KH?GI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