Skip to content

Commit

Permalink
feat: support calling init from docker qemu
Browse files Browse the repository at this point in the history
  • Loading branch information
edubart committed Mar 28, 2024
1 parent f5f8034 commit bb36f23
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions sys-utils/cartesi-init/cartesi-init
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
#!/bin/busybox sh

# path
export PATH=/usr/sbin:/usr/bin:/sbin:/bin

# disable terminal translation from nl to cr nl
busybox stty -onlcr

# mount
busybox mkdir -p /dev/pts /dev/shm
busybox mount -o nosuid,nodev,noexec -t proc proc /proc
busybox mount -o nosuid,noexec,mode=620,gid=5 -t devpts devpts /dev/pts
busybox mount -o nosuid,nodev,mode=1777 -t tmpfs tmpfs /dev/shm
busybox mount -o nosuid,nodev,noexec -t sysfs sys /sys
[ -d /tmp ] && busybox mount -o nosuid,nodev,mode=1777 -t tmpfs tmpfs /tmp
[ -d /run ] && busybox mount -o nosuid,nodev,mode=0755 -t tmpfs tmpfs /run
busybox mkdir -p /proc /sys /dev/pts /dev/shm /run
[ -f /proc/mounts ] || busybox mount -o nosuid,nodev,noexec -t proc proc /proc
[ -c /dev/pts/ptmx ] || busybox mount -o nosuid,noexec,mode=620,gid=5 -t devpts devpts /dev/pts
busybox grep -Fq "/dev/shm " /proc/mounts || busybox mount -o nosuid,nodev,mode=1777 -t tmpfs tmpfs /dev/shm
[ -d /sys/class ] || busybox mount -o nosuid,nodev,noexec -t sysfs sys /sys
busybox grep -Fq "/tmp " /proc/mounts || busybox mount -o nosuid,nodev,mode=1777 -t tmpfs tmpfs /tmp
busybox grep -Fq "/run " /proc/mounts || busybox mount -o nosuid,nodev,mode=0755 -t tmpfs tmpfs /run

# system config
[ -f /etc/sysctl.conf ] && busybox sysctl -pq
Expand Down

0 comments on commit bb36f23

Please sign in to comment.