From f6e7dbfa7683029531bb15909aa9857ec2b85520 Mon Sep 17 00:00:00 2001 From: Kohei Watanabe Date: Mon, 30 May 2022 22:19:04 +0900 Subject: [PATCH] Revert "feat: megabit mode" This reverts commit eefb903a28c1ecf3143975786e9c2189d397abf7. --- apkovl/etc/apk/world | 1 - apkovl/etc/init.d/megabit | 4 ---- apkovl/etc/init.d/megabit-sync | 11 ----------- apkovl/etc/modprobe.d/g_mass_storage.conf | 1 + apkovl/etc/modules-load.d/g_mass_storage.conf | 1 + apkovl/etc/runlevels/default/megabit | 1 - apkovl/etc/runlevels/default/megabit-sync | 1 - apkovl/usr/local/bin/megabit | 4 ---- apkovl/usr/local/bin/megabit-sync | 3 --- compose.yml | 7 +++---- 10 files changed, 5 insertions(+), 29 deletions(-) delete mode 100755 apkovl/etc/init.d/megabit delete mode 100755 apkovl/etc/init.d/megabit-sync create mode 100644 apkovl/etc/modprobe.d/g_mass_storage.conf create mode 100644 apkovl/etc/modules-load.d/g_mass_storage.conf delete mode 120000 apkovl/etc/runlevels/default/megabit delete mode 120000 apkovl/etc/runlevels/default/megabit-sync delete mode 100755 apkovl/usr/local/bin/megabit delete mode 100755 apkovl/usr/local/bin/megabit-sync diff --git a/apkovl/etc/apk/world b/apkovl/etc/apk/world index 222f2dc..5534b63 100644 --- a/apkovl/etc/apk/world +++ b/apkovl/etc/apk/world @@ -1,5 +1,4 @@ alpine-base i2c-tools openssh -rsync wpa_supplicant diff --git a/apkovl/etc/init.d/megabit b/apkovl/etc/init.d/megabit deleted file mode 100755 index 93e0760..0000000 --- a/apkovl/etc/init.d/megabit +++ /dev/null @@ -1,4 +0,0 @@ -#!/sbin/openrc-run -name=megabit -command="/usr/local/bin/megabit" -pidfile="/var/run/megabit.pid" diff --git a/apkovl/etc/init.d/megabit-sync b/apkovl/etc/init.d/megabit-sync deleted file mode 100755 index 38a6785..0000000 --- a/apkovl/etc/init.d/megabit-sync +++ /dev/null @@ -1,11 +0,0 @@ -#!/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_acm_ms - modprobe g_acm_ms file=/usr/share/megabit/tmp.img -} diff --git a/apkovl/etc/modprobe.d/g_mass_storage.conf b/apkovl/etc/modprobe.d/g_mass_storage.conf new file mode 100644 index 0000000..cf8ee44 --- /dev/null +++ b/apkovl/etc/modprobe.d/g_mass_storage.conf @@ -0,0 +1 @@ +options g_mass_storage file=/dev/mmcblk0p1 diff --git a/apkovl/etc/modules-load.d/g_mass_storage.conf b/apkovl/etc/modules-load.d/g_mass_storage.conf new file mode 100644 index 0000000..fd5ae93 --- /dev/null +++ b/apkovl/etc/modules-load.d/g_mass_storage.conf @@ -0,0 +1 @@ +g_mass_storage diff --git a/apkovl/etc/runlevels/default/megabit b/apkovl/etc/runlevels/default/megabit deleted file mode 120000 index fb1ac2b..0000000 --- a/apkovl/etc/runlevels/default/megabit +++ /dev/null @@ -1 +0,0 @@ -/etc/init.d/megabit \ No newline at end of file diff --git a/apkovl/etc/runlevels/default/megabit-sync b/apkovl/etc/runlevels/default/megabit-sync deleted file mode 120000 index e38d827..0000000 --- a/apkovl/etc/runlevels/default/megabit-sync +++ /dev/null @@ -1 +0,0 @@ -/etc/init.d/megabit-sync \ No newline at end of file diff --git a/apkovl/usr/local/bin/megabit b/apkovl/usr/local/bin/megabit deleted file mode 100755 index 1e20220..0000000 --- a/apkovl/usr/local/bin/megabit +++ /dev/null @@ -1,4 +0,0 @@ -#!/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 diff --git a/apkovl/usr/local/bin/megabit-sync b/apkovl/usr/local/bin/megabit-sync deleted file mode 100755 index 9aa4cc3..0000000 --- a/apkovl/usr/local/bin/megabit-sync +++ /dev/null @@ -1,3 +0,0 @@ -#!/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 diff --git a/compose.yml b/compose.yml index adbe6de..c5b98a2 100644 --- a/compose.yml +++ b/compose.yml @@ -15,9 +15,8 @@ services: - ./dist/overlay.img:/overlay.img privileged: true command: | - sh -exc ' + sh -c ' mkdir -p /mnt/overlay - mount -a - apk add g++ linux-headers make nodejs npm python3 - npm install -g megabit nodemon + mount -a \ + && apk add g++ linux-headers make nodejs npm python3 '