Skip to content
This repository was archived by the owner on Sep 19, 2024. It is now read-only.

Commit 8d52d22

Browse files
committed
generate new files
1 parent 3e51900 commit 8d52d22

File tree

9 files changed

+61
-16
lines changed

9 files changed

+61
-16
lines changed

packages/pg-wasm/README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@
88
1. Run `npx serve` and go to `http://localhost:3000`
99
2. There is no step 2
1010

11+
## :hammer_and_wrench: Update the filesystem
12+
13+
1. Run the build process in the [buildroot](/packages/buildroot/README.md#getting-started) package
14+
15+
2. Synchronize the new filesystem using:
16+
17+
```bash
18+
./scritps/sync.sh
19+
```
20+
21+
3. [Cold boot and save a new snapshot](#cold-boot-and-saving-a-new-snapshot)
22+
1123
## :snowflake: Cold boot and saving a new snapshot
1224

1325
1. Go the `http://localhost:3000?boot=true`
@@ -16,22 +28,11 @@
1628

1729
3. Save the state to a file clicking the `Save state to file` button
1830

19-
4. Put the state file into the `state` folder and compress it:
31+
4. Put the state file into the `state` folder and compress it using [zstd](https://github.com/facebook/zstd):
2032

2133
```bash
22-
zstd --ultra -22 state/state.bin && rm state/state.bin
34+
zstd --ultra -22 state/v86state.bin && rm state/v86state.bin
2335
```
2436

2537
5. Go to `http://localhost:3000`, instant boot!
2638

27-
## :hammer_and_wrench: Update the filesystem
28-
29-
1. Run the build process in the [buildroot](/packages/buildroot/README.md#getting-started) package
30-
31-
2. Synchronize the new filesystem using:
32-
33-
```bash
34-
./scritps/sync.sh
35-
```
36-
37-
3. [Cold boot and save a new snapshot](#cold-boot-and-saving-a-new-snapshot)
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/sh
2+
#
3+
# start postgresql
4+
#
5+
6+
umask 077
7+
8+
if [ ! -f /var/lib/pgsql/PG_VERSION ]; then
9+
echo "Initializing postgresql data base..."
10+
su - postgres -c '/usr/bin/pg_ctl initdb -D /var/lib/pgsql'
11+
echo "done"
12+
fi
13+
14+
start() {
15+
printf "Starting postgresql: "
16+
su - postgres -c '/usr/bin/pg_ctl start -w -D /var/lib/pgsql -l logfile'
17+
echo "OK"
18+
}
19+
stop() {
20+
printf "Stopping postgresql: "
21+
su - postgres -c '/usr/bin/pg_ctl stop -D /var/lib/pgsql -m fast'
22+
echo "OK"
23+
}
24+
restart() {
25+
stop
26+
start
27+
}
28+
29+
case "$1" in
30+
start)
31+
start
32+
;;
33+
stop)
34+
stop
35+
;;
36+
restart|reload)
37+
restart
38+
;;
39+
*)
40+
echo "Usage: $0 {start|stop|restart}"
41+
exit 1
42+
esac
43+
44+
exit $?

packages/pg-wasm/filesystem/filesystem.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

packages/pg-wasm/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
document.getElementById("terminal").style = '';
3333
}
3434

35-
const bzimageUrl = "./filesystem/919db13e.bin";
35+
const bzimageUrl = "./filesystem/123ccf58.bin";
3636
const options = {
3737
...baseOptions,
3838
...(boot ? {
@@ -49,7 +49,7 @@
4949
vga_bios: {
5050
url: "./bios/vgabios.bin",
5151
},
52-
} : { initial_state: { url: "./state/state.bin.zst" } })
52+
} : { initial_state: { url: "./state/v86state.bin.zst" } })
5353
};
5454

5555
var emulator = new V86Starter(options);

packages/pg-wasm/state/state.bin.zst

-8.94 MB
Binary file not shown.
12.4 MB
Binary file not shown.

0 commit comments

Comments
 (0)