diff --git a/README.md b/README.md index 68d514a..1c7e7c8 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ rsync -a dist/ /path/to/sd/ - Docker Compose - curl - grep +- gzip - jq - ruby - ssh-keygen diff --git a/apkovl/etc/fstab b/apkovl/etc/fstab new file mode 100644 index 0000000..ce7b968 --- /dev/null +++ b/apkovl/etc/fstab @@ -0,0 +1,4 @@ +/dev/usbdisk /media/usb vfat noauto 0 0 +/dev/mmcblk0p1 /media/mmcblk0p1 vfat rw,remount 0 0 +/media/mmcblk0p1/overlay.img /media/overlay ext4 rw,relatime,errors=remount-ro 0 0 +overlay /usr overlay lowerdir=/usr,upperdir=/media/overlay/upper/usr,workdir=/media/overlay/work/usr 0 0 diff --git a/bin/build b/bin/build index 20d98f5..1b2eef5 100755 --- a/bin/build +++ b/bin/build @@ -12,4 +12,6 @@ bin/download "${version}" dist docker-compose run --rm minirootfs sh -c 'apk update && apk add' ssh-keygen -A -f apkovl cp -a usercfg.txt cache -t dist +gzip -cdk overlay.img.gz > dist/overlay.img +docker-compose run --rm builder tar czf dist/localhost.apkovl.tar.gz --owner=0 --group=0 -C apkovl . diff --git a/docker-compose.yml b/docker-compose.yml index 3857524..f59e17d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,3 +6,17 @@ services: - ./cache:/etc/apk/cache - ./apkovl/etc/apk/repositories:/etc/apk/repositories - ./apkovl/etc/apk/world:/etc/apk/world + builder: + image: ghcr.io/kou029w/yama/minirootfs + volumes: + - ./cache:/etc/apk/cache + - ./apkovl/etc/apk/repositories:/etc/apk/repositories + - ./apkovl/etc/apk/world:/etc/apk/world + - ./fstab:/etc/fstab + - ./dist/overlay.img:/overlay.img + privileged: true + command: | + sh -c ' + mount -a \ + && apk add g++ linux-headers make nodejs npm python3 + ' diff --git a/fstab b/fstab new file mode 100644 index 0000000..5618065 --- /dev/null +++ b/fstab @@ -0,0 +1,2 @@ +/overlay.img /mnt ext4 rw,relatime,errors=remount-ro 0 0 +overlay /usr overlay lowerdir=/usr,upperdir=/mnt/upper/usr,workdir=/mnt/work/usr 0 0 diff --git a/overlay.img.gz b/overlay.img.gz new file mode 100644 index 0000000..1b6992b Binary files /dev/null and b/overlay.img.gz differ