Skip to content

Commit 1a78824

Browse files
committed
Add move-logs-to-opt (#821)
* Add move-logs-to-opt
1 parent aa55100 commit 1a78824

File tree

3 files changed

+73
-2
lines changed

3 files changed

+73
-2
lines changed

package/move-logs-to-opt/package

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2023 The Toltec Contributors
3+
# SPDX-License-Identifier: MIT
4+
5+
pkgnames=(move-logs-to-opt)
6+
pkgdesc="Move log files to /opt to save space on the root partition"
7+
url=https://github.com/toltec-dev/toltec
8+
pkgver=0.0.1-1
9+
timestamp=2024-01-07T23:55Z
10+
section="utils"
11+
maintainer="Eeems <[email protected]>"
12+
license=MIT
13+
14+
source=(var-log.mount)
15+
sha256sums=(SKIP)
16+
17+
package() {
18+
mkdir -p "$pkgdir"/opt/var/log
19+
install -D -m 644 -t "$pkgdir"/lib/systemd/system/ "$srcdir"/var-log.mount
20+
}
21+
22+
configure() {
23+
systemctl daemon-reload
24+
if is-active systemd-journald.service; then
25+
journalctl --sync --flush
26+
systemctl stop systemd-journald.service
27+
fi
28+
if ! mountpoint -q /var/log; then
29+
echo "Moving log files to new location"
30+
local target_path=/home/root/.entware/var/log
31+
mkdir -p "$target_path"
32+
cp -af "/var/log/." "$target_path"
33+
rm -rf "/var/log/"*
34+
fi
35+
if ! is-enabled "var-log.mount"; then
36+
systemctl enable "var-log.mount"
37+
fi
38+
systemctl restart "var-log.mount"
39+
systemctl start systemd-journald.service
40+
}
41+
42+
preremove() {
43+
if is-active systemd-journald.service; then
44+
journalctl --sync --flush
45+
systemctl stop systemd-journald.service
46+
fi
47+
disable-unit "var-log.mount"
48+
}
49+
50+
postremove() {
51+
systemctl daemon-reload
52+
systemctl start systemd-journald.service
53+
if mountpoint -q /var/log; then
54+
umount -l /var/log
55+
fi
56+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[Unit]
2+
Description=Bind mount '/home/root/.entware/var/log' over '/var/log'
3+
DefaultDependencies=no
4+
Conflicts=umount.target
5+
Before=local-fs.target umount.target systemd-journald.service
6+
After=home.mount
7+
8+
[Mount]
9+
What=/home/root/.entware/var/log
10+
Where=/var/log
11+
Type=none
12+
Options=bind
13+
14+
[Install]
15+
WantedBy=local-fs.target

package/rm2-suspend-fix/package

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ archs=(rm2)
66
pkgnames=(rm2-suspend-fix)
77
pkgdesc="Fix issue where suspend breaks networking on the reMarkable 2"
88
url=https://toltec-dev.org/
9-
pkgver=0.0.0-2
9+
pkgver=0.0.0-3
1010
timestamp=2021-01-04T22:40Z
11-
section="devel"
11+
section="utils"
1212
maintainer="Eeems <[email protected]>"
1313
license=MIT
1414

0 commit comments

Comments
 (0)