From f0b7214a0788fd5b758dcd84a44b236b8f95981e Mon Sep 17 00:00:00 2001 From: ProgrammerIn-wonderland <3838shah@gmail.com> Date: Tue, 15 Oct 2024 18:23:37 -0400 Subject: [PATCH] working persistence --- src/emulator/image/rootfs/bin/puter-restore | 5 +++-- src/emulator/image/rootfs/etc/init.d/network-service | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/emulator/image/rootfs/bin/puter-restore b/src/emulator/image/rootfs/bin/puter-restore index 8f22c000..1aa6de53 100644 --- a/src/emulator/image/rootfs/bin/puter-restore +++ b/src/emulator/image/rootfs/bin/puter-restore @@ -1,7 +1,8 @@ #!/bin/bash PUTERUSERNAME=$( cat /proc/cmdline | sed -n 's/.*puterusername=\(.*\)/\1/p' ) -echo > /tmp/restore-in-progress +touch /tmp/restore-in-progress tar -C / -zxvf /puter/$PUTERUSERNAME/emulatorstate.apkovl.tar.gz # no worries if this errors, its just the first boot apk add --no-cache $(cat /etc/apk/world) -rm /tmp/restore-in-progress \ No newline at end of file +rm /tmp/restore-in-progress +touch /tmp/puter-restore-done \ No newline at end of file diff --git a/src/emulator/image/rootfs/etc/init.d/network-service b/src/emulator/image/rootfs/etc/init.d/network-service index c93aea40..1b699280 100755 --- a/src/emulator/image/rootfs/etc/init.d/network-service +++ b/src/emulator/image/rootfs/etc/init.d/network-service @@ -9,6 +9,7 @@ start() { ip link set lo up echo "nameserver 192.168.86.1" > /etc/resolv.conf echo "puter.local" > /etc/hostname + puter-restore & eend $? }