3 # Porteus Kiosk initialization script.
4 # Author: T.Jokiel <http://porteus-kiosk.org>
6 # 2021 longpanda admin@ventoy.net
10 /bin
/busybox
--install -s
11 mount
-nt proc proc
/proc
12 grep -q -w debug
/proc
/cmdline
|| { echo 0 >/proc
/sys
/kernel
/printk
2>/dev
/null
; clear; }
13 mount
-nt sysfs sysfs
/sys
14 mount
-nt devtmpfs none
/dev
15 mkdir -p /dev
/shm
; chmod 1777 /dev
/shm
17 grep -q -w debug
/proc
/cmdline
&& touch /tmp
/lspci
|| quiet
=yes
20 mount
-nt tmpfs
-o size
=75% tmpfs
/memory
21 mkdir -p /memory
/xino
/memory
/changes
/memory
/images
/memory
/copy2ram
24 mount
-nt aufs
-o nowarn_perm
,xino
=/memory
/xino
/.aufs.xino
,br
:/memory
/changes
=rw aufs
/union
28 if [ -z "$quiet" ]; then
29 echo "##################################################"
30 echo "Starting Ventoy Live GUI <https://www.ventoy.net>"
31 echo "##################################################"
33 mkdir -p /lib
/opt
/000 /opt
/001; lspci
>/tmp
/lspci
34 mount
-o loop
/000-kernel.xzm
/opt
/000
35 mount
-o loop
/001-core.xzm
/opt
/001
36 [ `uname -m` = x86_64
] && prefix
="-x86-64"
37 ln -sf /opt
/000/lib
/firmware
/lib
/firmware
38 ln -sf /opt
/000/lib
/modules
/lib
/modules
39 ln -sf /opt
/001/lib
64/libc.so
.6 /lib
/libc.so
.6
40 ln -sf /opt
/001/lib
64/ld
-linux"$prefix".so
.2 /lib
/ld
-linux"$prefix".so
.2
41 ln -s /opt
/001/bin
/kmod
/bin
/modprobe
43 vga
=`lspci | grep 0300: | head -n1 | cut -d: -f3-4 | sed s/:/d0000/g`; [ "$vga" ] && driver
="$(grep -i $vga /lib/modules/`uname -r`/modules.alias 2>/dev/null | head -n1 | rev | cut -d" " -f1 | rev)"
46 [ "$driver" ] || { lspci
| grep 0300: | head -n1 | cut
-d: -f3 | grep -q "10de" && driver
=nouveau
; }
49 [ "$driver" = vboxvideo
] || modprobe
$driver 2>/dev
/null
50 test -e /dev
/fb0
|| { cp /opt
/001/sbin
/v86d
/sbin
; modprobe uvesafb mode_option
=1024x768
-32; }
51 if test -e /dev
/fb0
; then
52 rm -r /lib
; ln -sf /opt
/001/lib64
/lib
; ln -sf /opt
/001/usr
/lib64
/usr
/lib
53 /opt
/001/usr
/bin
/fbv
-a -c -u -i -k -e -r /VTOY
/background.png
2>/dev
/null
&
58 cp -a /*.xzm
/memory
/copy
2ram
/
60 # Populate aufs with modules:
61 for x
in `ls -1 /memory/copy2ram/ | grep \\.xzm$`; do
62 mkdir -p /memory
/images
/$x
63 mount
-nt squashfs
-o loop
/memory
/copy
2ram
/$x /memory
/images
/$x 2>/dev
/null
65 mount
-no remount
,add
:1:/memory
/images
/$x=rr aufs
/union
73 if [ -n "$quiet" ]; then
74 while [ "`pidof fbv`" ]; do
77 umount
/opt
/000 /opt
/001 2>/dev
/null
83 mkdir -p /union
/opt
/scripts
/
84 echo 123 > /union
/opt
/scripts
/extras
85 rm -f /union
/lib
64/udev
/rules.d
/10-kiosk-auto_mount.rules
86 cp -a /VTOY
/autostart
/union
/etc
/xdg
/openbox
/autostart
87 cp -a /VTOY
/*.png
/union
/ventoy
/
89 cp -a /bin
/busybox
/union
/bin
; ln -sf /union
/lib
/lib
90 cp -a /VTOY
/wallpaper.png
/union
/usr
/share
/wallpapers
/ 2>/dev
/null
92 #to suppress error message
93 mkdir -p /mnt
/fake
/docs
94 echo 11 > /mnt
/fake
/docs
/kiosk.sgn
97 exec /sbin
/switch_root
/union
/sbin
/init