mirror of
https://github.com/kou029w/megabit-os.git
synced 2025-01-18 08:05:00 +00:00
feat: megabit mode
This commit is contained in:
parent
683c5f5a62
commit
eefb903a28
13 changed files with 33 additions and 8 deletions
|
@ -1,4 +1,4 @@
|
||||||
# Yama
|
# Megabit OS
|
||||||
|
|
||||||
Raspberry Pi 向け OS のビルドするためのツール群
|
Raspberry Pi 向け OS のビルドするためのツール群
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
alpine-base
|
alpine-base
|
||||||
i2c-tools
|
i2c-tools
|
||||||
openssh
|
openssh
|
||||||
|
rsync
|
||||||
wpa_supplicant
|
wpa_supplicant
|
||||||
|
|
4
apkovl/etc/init.d/megabit
Executable file
4
apkovl/etc/init.d/megabit
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/sbin/openrc-run
|
||||||
|
name=megabit
|
||||||
|
command="/usr/local/bin/megabit"
|
||||||
|
pidfile="/var/run/megabit.pid"
|
11
apkovl/etc/init.d/megabit-sync
Executable file
11
apkovl/etc/init.d/megabit-sync
Executable file
|
@ -0,0 +1,11 @@
|
||||||
|
#!/sbin/openrc-run
|
||||||
|
name=megabit-sync
|
||||||
|
command="/usr/local/bin/megabit-sync"
|
||||||
|
pidfile="/var/run/megabit-sync.pid"
|
||||||
|
|
||||||
|
start_pre() {
|
||||||
|
mkdir -p /mnt/tmp
|
||||||
|
mount /usr/share/megabit/tmp.img /mnt/tmp
|
||||||
|
modprobe -r g_mass_storage
|
||||||
|
modprobe g_mass_storage file=/usr/share/megabit/tmp.img
|
||||||
|
}
|
|
@ -1 +0,0 @@
|
||||||
options g_mass_storage file=/dev/mmcblk0p1
|
|
|
@ -1 +0,0 @@
|
||||||
g_mass_storage
|
|
1
apkovl/etc/runlevels/default/megabit
Symbolic link
1
apkovl/etc/runlevels/default/megabit
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
/etc/init.d/megabit
|
1
apkovl/etc/runlevels/default/megabit-sync
Symbolic link
1
apkovl/etc/runlevels/default/megabit-sync
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
/etc/init.d/megabit-sync
|
4
apkovl/usr/local/bin/megabit
Executable file
4
apkovl/usr/local/bin/megabit
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
|
export NODE_PATH=$(npm root -g)
|
||||||
|
nodemon --delay 1 --watch /tmp --signal SIGTERM --exec 'node /tmp/index.js || true' &
|
||||||
|
echo $! > /var/run/megabit.pid
|
3
apkovl/usr/local/bin/megabit-sync
Executable file
3
apkovl/usr/local/bin/megabit-sync
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
nodemon --delay 1 --watch /usr/share/megabit/tmp.img --signal SIGTERM --exec 'umount /mnt/tmp; mount /usr/share/megabit/tmp.img /mnt/tmp; rsync -a --delete --exclude=node_modules/ /mnt/tmp/ /tmp/' &
|
||||||
|
echo $! > /var/run/megabit-sync.pid
|
|
@ -16,7 +16,9 @@ services:
|
||||||
- ./dist/overlay.img:/overlay.img
|
- ./dist/overlay.img:/overlay.img
|
||||||
privileged: true
|
privileged: true
|
||||||
command: |
|
command: |
|
||||||
sh -c '
|
sh -exc '
|
||||||
mount -a \
|
mkdir -p /mnt/overlay
|
||||||
&& apk add g++ linux-headers make nodejs npm python3
|
mount -a
|
||||||
|
apk add g++ linux-headers make nodejs npm python3
|
||||||
|
npm install -g megabit nodemon
|
||||||
'
|
'
|
||||||
|
|
4
fstab
4
fstab
|
@ -1,2 +1,2 @@
|
||||||
/overlay.img /mnt ext4 rw,relatime,errors=remount-ro 0 0
|
/overlay.img /mnt/overlay ext4 rw,relatime,errors=remount-ro 0 0
|
||||||
overlay /usr overlay lowerdir=/usr,upperdir=/mnt/upper/usr,workdir=/mnt/work/usr 0 0
|
overlay /usr overlay lowerdir=/usr,upperdir=/mnt/overlay/upper/usr,workdir=/mnt/overlay/work/usr 0 0
|
||||||
|
|
BIN
overlay.img.gz
BIN
overlay.img.gz
Binary file not shown.
Loading…
Add table
Reference in a new issue