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

Update Dockerfile to Buildroot 2022.08 #26

Merged
merged 6 commits into from
Sep 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/buildroot/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM rastasheep/ubuntu-sshd:18.04

# Buildroot version to use
ARG BUILD_ROOT_RELEASE=2022.08-rc1
ARG BUILD_ROOT_RELEASE=2022.08

# Root password for SSH
ARG ROOT_PASSWORD=browser-vm
Expand Down
4 changes: 2 additions & 2 deletions packages/buildroot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The goal of this build process is to produce a `filesystem` folder containing a
# Launch menuconfig
make menuconfig
# Save the changes back to the host
cp .config /pg-browser/.config
cp .config /config/.config

# Linux kernel config
# IMPORTANT: If it's the first time you run this command,
Expand All @@ -35,7 +35,7 @@ The goal of this build process is to produce a `filesystem` folder containing a
# Launch menuconfig
make linux-menuconfig
# Save the changes back to the host
cp output/build/linux-5.17.15/.config /pg-browser/board/pg-browser/linux.conf
cp output/build/linux-5.17.15/.config /config/board/pg-browser/linux.conf
```

2. Build the `filesystem` folder:
Expand Down
2 changes: 1 addition & 1 deletion packages/buildroot/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ docker run \
--rm \
-v $PWD/tools:/tools \
-v $PWD/build:/build \
-v $PWD/config/config \
-v $PWD/config:/config \
-ti \
--platform linux/amd64 \
buildroot
49 changes: 19 additions & 30 deletions packages/buildroot/config/.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Automatically generated file; DO NOT EDIT.
# Buildroot 2022.08-rc1 Configuration
# Buildroot 2022.08 Configuration
#
BR2_HAVE_DOT_CONFIG=y
BR2_HOST_GCC_AT_LEAST_4_9=y
Expand Down Expand Up @@ -684,7 +684,6 @@ BR2_PACKAGE_GOOGLE_BREAKPAD_ARCH_SUPPORTS=y
#
# google-breakpad requires a glibc or uClibc toolchain w/ wchar, thread, C++, gcc >= 4.8
#
# BR2_PACKAGE_HYPERFINE is not set
# BR2_PACKAGE_IOZONE is not set
# BR2_PACKAGE_KEXEC is not set
BR2_PACKAGE_KVM_UNIT_TESTS_ARCH_SUPPORTS=y
Expand Down Expand Up @@ -811,7 +810,6 @@ BR2_PACKAGE_PROVIDES_HOST_GETTEXT="host-gettext-tiny"
# BR2_PACKAGE_MAKE is not set
# BR2_PACKAGE_MAWK is not set
# BR2_PACKAGE_PKGCONF is not set
# BR2_PACKAGE_RIPGREP is not set
# BR2_PACKAGE_SUBVERSION is not set
# BR2_PACKAGE_TREE is not set
# BR2_PACKAGE_YASM is not set
Expand All @@ -835,7 +833,6 @@ BR2_PACKAGE_PROVIDES_HOST_GETTEXT="host-gettext-tiny"
# davfs2 needs a glibc or uClibc toolchain
#
# BR2_PACKAGE_DOSFSTOOLS is not set
# BR2_PACKAGE_DUST is not set
# BR2_PACKAGE_E2FSPROGS is not set
# BR2_PACKAGE_E2TOOLS is not set
# BR2_PACKAGE_ECRYPTFS_UTILS is not set
Expand Down Expand Up @@ -1137,7 +1134,7 @@ BR2_PACKAGE_QT6_ARCH_SUPPORTS=y
# BR2_PACKAGE_BRLTTY is not set

#
# cc-tool needs a toolchain w/ C++, threads, wchar, gcc >= 4.9
# cc-tool needs a toolchain w/ C++, threads, wchar, gcc >= 4.9
#
# BR2_PACKAGE_CDRKIT is not set
# BR2_PACKAGE_CRUCIBLE is not set
Expand Down Expand Up @@ -1319,7 +1316,7 @@ BR2_PACKAGE_SEDUTIL_ARCH_SUPPORTS=y
# BR2_PACKAGE_USB_MODESWITCH_DATA is not set

#
# usbguard needs a toolchain w/ C++, threads, dynamic library, gcc >= 7
# usbguard needs a toolchain w/ C++, threads, dynamic library, gcc >= 8
#

#
Expand Down Expand Up @@ -1829,10 +1826,6 @@ BR2_PACKAGE_ROCKSDB_ARCH_SUPPORTS=y
#
# libraw needs a toolchain w/ C++
#

#
# librsvg needs a toolchain w/ wchar, threads, C++, gcc >= 4.9
#
# BR2_PACKAGE_LIBSVG is not set
# BR2_PACKAGE_LIBSVG_CAIRO is not set
# BR2_PACKAGE_LIBSVGTINY is not set
Expand Down Expand Up @@ -2164,11 +2157,11 @@ BR2_PACKAGE_MRAA_ARCH_SUPPORTS=y
BR2_PACKAGE_LIBCAMERA_ARCH_SUPPORTS=y

#
# libcamera needs a toolchain w/ C++, threads, wchar, dynamic library, gcc >= 7
# libcamera needs a toolchain w/ C++, threads, wchar, dynamic library, gcc >= 8
#

#
# libcamera-apps needs a toolchain w/ C++, threads, wchar, dynamic library, gcc >= 7
# libcamera-apps needs a toolchain w/ C++, threads, wchar, dynamic library, gcc >= 8
#
# BR2_PACKAGE_LIBDCADEC is not set
# BR2_PACKAGE_LIBDVBCSA is not set
Expand Down Expand Up @@ -2546,12 +2539,12 @@ BR2_PACKAGE_LIBOPENH264_ARCH_SUPPORTS=y
#

#
# clang needs a toolchain w/ wchar, threads, C++, gcc >= 5, dynamic library
# clang needs a toolchain w/ wchar, threads, C++, gcc >= 5, dynamic library, host gcc >= 5
#
# BR2_PACKAGE_CMOCKA is not set

#
# compiler-rt requires llvm to be enabled and a glibc toolchain
# compiler-rt requires llvm to be enabled, a glibc toolchain, host gcc >= 5
#

#
Expand Down Expand Up @@ -2755,7 +2748,7 @@ BR2_PACKAGE_LLVM_ARCH_SUPPORTS=y
BR2_PACKAGE_LLVM_TARGET_ARCH="X86"

#
# llvm needs a toolchain w/ wchar, threads, C++, gcc >= 5, dynamic library
# llvm needs a toolchain w/ wchar, threads, C++, gcc >= 5, dynamic library, host gcc >= 5
#
# BR2_PACKAGE_LTTNG_LIBUST is not set
# BR2_PACKAGE_MATIO is not set
Expand Down Expand Up @@ -2874,7 +2867,8 @@ BR2_PACKAGE_NCURSES_ADDITIONAL_TERMINFO=""
#
# re2 needs a toolchain w/ C++, threads, gcc >= 4.8
#
# BR2_PACKAGE_READLINE is not set
BR2_PACKAGE_READLINE=y
BR2_PACKAGE_READLINE_BRACKETED_PASTE=y
# BR2_PACKAGE_SLANG is not set

#
Expand Down Expand Up @@ -3293,7 +3287,6 @@ BR2_PACKAGE_IFUPDOWN_SCRIPTS=y
# BR2_PACKAGE_SSLH is not set
# BR2_PACKAGE_STRONGSWAN is not set
# BR2_PACKAGE_STUNNEL is not set
# BR2_PACKAGE_SURICATA is not set
# BR2_PACKAGE_TCPDUMP is not set
# BR2_PACKAGE_TCPING is not set
# BR2_PACKAGE_TCPREPLAY is not set
Expand Down Expand Up @@ -3344,7 +3337,7 @@ BR2_PACKAGE_IFUPDOWN_SCRIPTS=y
#

#
# zeek needs a toolchain w/ C++, wchar, threads, dynamic library
# zeek needs a toolchain w/ C++, wchar, threads, dynamic library, gcc >= 7, host gcc >= 7
#

#
Expand All @@ -3360,35 +3353,35 @@ BR2_PACKAGE_IFUPDOWN_SCRIPTS=y
#

#
# Please note:
# Please note:
#

#
# - Buildroot does *not* generate binary packages,
# - Buildroot does *not* generate binary packages,
#

#
# - Buildroot does *not* install any package database.
# - Buildroot does *not* install any package database.
#

#
# *
# *
#

#
# It is up to you to provide those by yourself if you
# It is up to you to provide those by yourself if you
#

#
# want to use any of those package managers.
# want to use any of those package managers.
#

#
# *
# *
#

#
# See the manual:
# See the manual:
#

#
Expand Down Expand Up @@ -3507,7 +3500,6 @@ BR2_PACKAGE_AUDIT_ARCH_SUPPORTS=y
# ddrescue needs a toolchain w/ C++
#
# BR2_PACKAGE_DOCKER_CLI is not set
# BR2_PACKAGE_DOCKER_COMPOSE is not set
# BR2_PACKAGE_DOCKER_ENGINE is not set
# BR2_PACKAGE_DOCKER_PROXY is not set
# BR2_PACKAGE_EARLYOOM is not set
Expand Down Expand Up @@ -3599,7 +3591,6 @@ BR2_PACKAGE_OPENVMTOOLS_ARCH_SUPPORTS=y
# BR2_PACKAGE_SWUPDATE is not set
BR2_PACKAGE_SYSTEMD_ARCH_SUPPORTS=y
BR2_PACKAGE_SYSTEMD_BOOTCHART_ARCH_SUPPORTS=y
# BR2_PACKAGE_TEALDEER is not set

#
# thermald needs a toolchain w/ C++, wchar, threads
Expand Down Expand Up @@ -3698,7 +3689,6 @@ BR2_PACKAGE_UTIL_LINUX_LIBUUID=y
#
# Text editors and viewers
#
# BR2_PACKAGE_BAT is not set
# BR2_PACKAGE_ED is not set
# BR2_PACKAGE_JOE is not set
# BR2_PACKAGE_MC is not set
Expand Down Expand Up @@ -3865,7 +3855,6 @@ BR2_PACKAGE_HOST_QEMU_USER_ARCH_SUPPORTS=y
# BR2_PACKAGE_HOST_RUNC is not set
BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS=y
BR2_PACKAGE_HOST_RUSTC_TARGET_TIER2_PLATFORMS=y
BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS=y
BR2_PACKAGE_HOST_RUSTC_ARCH="i686"
# BR2_PACKAGE_HOST_RUSTC is not set
BR2_PACKAGE_PROVIDES_HOST_RUSTC="host-rust-bin"
Expand Down
3 changes: 3 additions & 0 deletions packages/runtime/filesystem/02dae4f7.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
ip route get 1 | awk '{print $7}' &> /addr.txt
sync
Binary file removed packages/runtime/filesystem/05634c44.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added packages/runtime/filesystem/13973963.bin
Binary file not shown.
Binary file removed packages/runtime/filesystem/163961a1.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added packages/runtime/filesystem/348626d0.bin
Binary file not shown.
Binary file not shown.
5 changes: 5 additions & 0 deletions packages/runtime/filesystem/3c014c7b.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mkdir -p /inbox
while true; do
find /inbox -type f -name "*.sh" -exec chmod +x "{}" \; -exec /bin/sh -c "{}" \; -exec rm "{}" \;
sleep 2
done
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed packages/runtime/filesystem/4afdc5ff.bin
Binary file not shown.
Binary file not shown.
Binary file added packages/runtime/filesystem/4f71c6f6.bin
Binary file not shown.
Binary file added packages/runtime/filesystem/4f9385ec.bin
Binary file not shown.
Binary file added packages/runtime/filesystem/51a2aa52.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added packages/runtime/filesystem/571812ef.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions packages/runtime/filesystem/5fec1997.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# kill -9 `pidof exe` &> /dev/null
/usr/bin/watcher.sh &> /dev/null &
Binary file removed packages/runtime/filesystem/6092b8d2.bin
Binary file not shown.
Binary file not shown.
5 changes: 0 additions & 5 deletions packages/runtime/filesystem/6f944efa.bin

This file was deleted.

Binary file added packages/runtime/filesystem/7512118e.bin
Binary file not shown.
Binary file not shown.
Binary file added packages/runtime/filesystem/7b90e9d5.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
44 changes: 44 additions & 0 deletions packages/runtime/filesystem/8fa60adb.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# /etc/inputrc - global inputrc for libreadline
# See readline(3readline) and `info readline' for more information.

# Be 8 bit clean.
set input-meta on
set output-meta on
set bell-style visible

# To allow the use of 8bit-characters like the german umlauts, comment out
# the line below. However this makes the meta key not work as a meta key,
# which is annoying to those which don't need to type in 8-bit characters.

# set convert-meta off

"\e0d": backward-word
"\e0c": forward-word
"\e[h": beginning-of-line
"\e[f": end-of-line
"\e[1~": beginning-of-line
"\e[4~": end-of-line
#"\e[5~": beginning-of-history
#"\e[6~": end-of-history
"\e[3~": delete-char
"\e[2~": quoted-insert

# Common standard keypad and cursor
# (codes courtsey Werner Fink, <werner@suse.de>)
#"\e[1~": history-search-backward
"\e[2~": yank
"\e[3~": delete-char
#"\e[4~": set-mark
"\e[5~": history-search-backward
"\e[6~": history-search-forward
# Normal keypad and cursor of xterm
"\e[F": end-of-line
"\e[H": beginning-of-line
# Application keypad and cursor of xterm
"\eOA": previous-history
"\eOC": forward-char
"\eOB": next-history
"\eOD": backward-char
"\eOF": end-of-line
"\eOH": beginning-of-line

Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,6 @@ host all all ::1/128 trust
local replication all trust
host replication all 127.0.0.1/32 trust
host replication all ::1/128 trust
# Allow connections from the outside world
host all all 0.0.0.0/0 md5
host all all ::/0 md5
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed packages/runtime/filesystem/a618a43c.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 3 additions & 0 deletions packages/runtime/filesystem/b674ac2d.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
echo "" &> /addr.txt
sync
Binary file not shown.
5 changes: 5 additions & 0 deletions packages/runtime/filesystem/bd470a3f.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
NAME=Buildroot
VERSION=2022.08
ID=buildroot
VERSION_ID=2022.08
PRETTY_NAME="Buildroot 2022.08"
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

# - Connection Settings -

#listen_addresses = 'localhost' # what IP address(es) to listen on;
listen_addresses = '*' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# (change requires restart)
Expand Down
Binary file not shown.
Binary file removed packages/runtime/filesystem/cbfc1645.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed packages/runtime/filesystem/dd1e314d.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added packages/runtime/filesystem/ea1f007e.bin
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/runtime/filesystem/filesystem.json

Large diffs are not rendered by default.

37 changes: 17 additions & 20 deletions packages/runtime/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
document.getElementById("terminal").style = '';
}

const bzimageUrl = "./filesystem/123ccf58.bin";
const bzimageUrl = "./filesystem/27d6e559.bin";
const options = {
...baseOptions,
...(boot ? {
Expand All @@ -56,30 +56,27 @@

var emulator = new V86Starter(options);

function initTerm() {
const fitAddon = new FitAddon.FitAddon();
emulator.serial_adapter.term.loadAddon(fitAddon);
fitAddon.fit();
window.addEventListener("resize", () => fitAddon.fit());
}

function sendBackgroundCommands(commands) {
const filename = `${(Math.random() + 1).toString(36).substring(7)}.sh`
emulator.create_file(`/inbox/${filename}`, (new TextEncoder('UTF-8')).encode(commands.join("\n")));
}

if (!boot) {
emulator.add_listener("emulator-ready", function () {
const fitAddon = new FitAddon.FitAddon();
emulator.serial_adapter.term.loadAddon(fitAddon);
fitAddon.fit();
window.addEventListener("resize", () => fitAddon.fit());
// emulator.serial_adapter.term.setOption("allowTransparency", true);
// emulator.serial_adapter.term.setOption("theme", { background: "transparent" });
initTerm();
setTimeout(() => {
emulator.serial0_send('/etc/init.d/S40network restart\n');
emulator.serial0_send('psql -U postgres\n');
emulator.serial0_send('\\! echo "boot_completed"; reset\n');
sendBackgroundCommands(["/etc/init.d/S40network restart"]);
emulator.serial0_send('\\! reset\n');
emulator.serial_adapter.term.focus();
}, 0);
});

function handleBoot(line) {
if (line.startsWith("postgres=# boot_completed")) {
emulator.remove_listener(handleBoot);
setTimeout(() => {
emulator.serial_adapter.term.focus();
}, 300);
}
}
emulator.add_listener("serial0-output-line", handleBoot);
}

var state;
Expand Down
Binary file modified packages/runtime/state/v86state.bin.zst
Binary file not shown.