]> glassweightruler.freedombox.rocks Git - Ventoy.git/commitdiff
Add GUI LiveCD
authorlongpanda <admin@ventoy.net>
Wed, 29 Sep 2021 11:26:50 +0000 (19:26 +0800)
committerlongpanda <admin@ventoy.net>
Wed, 29 Sep 2021 11:26:50 +0000 (19:26 +0800)
19 files changed:
Dockerfile
INSTALL/ventoy_pack.sh
License/license-PorteusKiosk.txt [new file with mode: 0644]
LiveCDGUI/EXT/README.txt [new file with mode: 0644]
LiveCDGUI/GRUB/boot_hybrid.img [new file with mode: 0644]
LiveCDGUI/GRUB/bootx64.efi [new file with mode: 0644]
LiveCDGUI/GRUB/cdrom.img [new file with mode: 0644]
LiveCDGUI/GRUB/embed.cfg [new file with mode: 0644]
LiveCDGUI/ISO/EFI/VentoyLiveCD [new file with mode: 0644]
LiveCDGUI/ISO/EFI/boot/grub.cfg [new file with mode: 0644]
LiveCDGUI/VTOY/autostart [new file with mode: 0644]
LiveCDGUI/VTOY/background.png [new file with mode: 0644]
LiveCDGUI/VTOY/init [new file with mode: 0644]
LiveCDGUI/VTOY/refresh.png [new file with mode: 0644]
LiveCDGUI/VTOY/secure.png [new file with mode: 0644]
LiveCDGUI/VTOY/wallpaper.png [new file with mode: 0644]
LiveCDGUI/download_ext.sh [new file with mode: 0644]
LiveCDGUI/initrd.sh [new file with mode: 0644]
LiveCDGUI/livecd.sh [new file with mode: 0644]

index 4a6bf56948f9d3947e1b473192b558ea6fe04587..8ae66b3b3e241df7c32341dbf0808acb491f0350 100644 (file)
@@ -5,6 +5,6 @@ RUN yum -y -q install \
         mpfr.i686 mpfr-devel.i686 rsync autogen autoconf automake libtool gettext* bison binutils \
         flex device-mapper-devel SDL libpciaccess libusb freetype freetype-devel gnu-free-* qemu-* virt-* \
         libvirt* vte* NetworkManager-bluetooth brlapi fuse-devel dejavu* gnu-efi* pesign shim \
         mpfr.i686 mpfr-devel.i686 rsync autogen autoconf automake libtool gettext* bison binutils \
         flex device-mapper-devel SDL libpciaccess libusb freetype freetype-devel gnu-free-* qemu-* virt-* \
         libvirt* vte* NetworkManager-bluetooth brlapi fuse-devel dejavu* gnu-efi* pesign shim \
-        iscsi-initiator-utils grub2-tools zip nasm acpica-tools glibc-static zlib-static xorriso
+        iscsi-initiator-utils grub2-tools zip nasm acpica-tools glibc-static zlib-static xorriso lz4 squashfs-tools
 
 CMD cd /ventoy/INSTALL && ls -la && sh docker_ci_build.sh    
 
 CMD cd /ventoy/INSTALL && ls -la && sh docker_ci_build.sh    
index 4fe7be7aa10f10b39249ff94fdcd7c70cb5cb274..501a6d53e15225ad8595f9f578e6b4379e64c6fe 100644 (file)
@@ -179,11 +179,11 @@ zip -r ventoy-${curver}-windows.zip $tmpdir/
 rm -rf $tmpdir
 
 echo "=============== run livecd.sh ==============="
 rm -rf $tmpdir
 
 echo "=============== run livecd.sh ==============="
-cd ../LiveCD
+cd ../LiveCDGUI
 sh livecd.sh $1
 cd $CurDir
 
 sh livecd.sh $1
 cd $CurDir
 
-mv ../LiveCD/ventoy*.iso ./
+mv ../LiveCDGUI/ventoy*.iso ./
 
 if [ -e ventoy-${curver}-windows.zip ] && [ -e ventoy-${curver}-linux.tar.gz ]; then
     echo -e "\n ============= SUCCESS =================\n"
 
 if [ -e ventoy-${curver}-windows.zip ] && [ -e ventoy-${curver}-linux.tar.gz ]; then
     echo -e "\n ============= SUCCESS =================\n"
diff --git a/License/license-PorteusKiosk.txt b/License/license-PorteusKiosk.txt
new file mode 100644 (file)
index 0000000..ecc0ce2
--- /dev/null
@@ -0,0 +1,3 @@
+Porteus Kiosk follows GPL license (see gpl-3.0.txt)\r
+\r
+Ventoy does not modify its source code, only its library is used.\r
diff --git a/LiveCDGUI/EXT/README.txt b/LiveCDGUI/EXT/README.txt
new file mode 100644 (file)
index 0000000..f01fc31
--- /dev/null
@@ -0,0 +1,11 @@
+\r
+All the files here are from Porteus-Kiosk-5.2.0-x86_64.iso (https://porteus-kiosk.org/public/5.2/)\r
+\r
+MD5SUM:\r
+42857b439725a0e1adb0c396849f57c9  EXT/000-kernel.xzm\r
+9b699227f44178dfd323d7503510c868  EXT/001-core.xzm\r
+aafb2191accb37bd6725c84522c92e51  EXT/003-settings.xzm\r
+0cd503757d9829847a01b9403f60fee2  EXT/004-wifi.xzm\r
+501b6096122dcf0da75cdbba1868cd31  EXT/06-fonts.xzm\r
+ce677b50b223ce76df070d23af016338  EXT/initrd.xz\r
+9e96e4550de38f8e22733a0afe56dab3  EXT/vmlinuz\r
diff --git a/LiveCDGUI/GRUB/boot_hybrid.img b/LiveCDGUI/GRUB/boot_hybrid.img
new file mode 100644 (file)
index 0000000..721cbf0
Binary files /dev/null and b/LiveCDGUI/GRUB/boot_hybrid.img differ
diff --git a/LiveCDGUI/GRUB/bootx64.efi b/LiveCDGUI/GRUB/bootx64.efi
new file mode 100644 (file)
index 0000000..8377d6d
Binary files /dev/null and b/LiveCDGUI/GRUB/bootx64.efi differ
diff --git a/LiveCDGUI/GRUB/cdrom.img b/LiveCDGUI/GRUB/cdrom.img
new file mode 100644 (file)
index 0000000..2df6491
Binary files /dev/null and b/LiveCDGUI/GRUB/cdrom.img differ
diff --git a/LiveCDGUI/GRUB/embed.cfg b/LiveCDGUI/GRUB/embed.cfg
new file mode 100644 (file)
index 0000000..e88752a
--- /dev/null
@@ -0,0 +1,5 @@
+
+search -f /EFI/VentoyLiveCD -s root
+configfile ($root)/EFI/boot/grub.cfg
+
+
diff --git a/LiveCDGUI/ISO/EFI/VentoyLiveCD b/LiveCDGUI/ISO/EFI/VentoyLiveCD
new file mode 100644 (file)
index 0000000..3f7afb8
--- /dev/null
@@ -0,0 +1,3 @@
+VentoyLiveCD\r
+\r
+https://www.ventoy.net\r
diff --git a/LiveCDGUI/ISO/EFI/boot/grub.cfg b/LiveCDGUI/ISO/EFI/boot/grub.cfg
new file mode 100644 (file)
index 0000000..0dc4828
--- /dev/null
@@ -0,0 +1,27 @@
+
+set timeout=3
+set default=LiveCD
+
+clear
+
+menuentry 'Ventoy xxx LiveCD GUI' --id=LiveCD {
+    echo downloading kernel ...
+    linux  /EFI/boot/vmlinuz quiet first_run rdinit=/VTOY/init
+    
+    echo downloading initrd ...
+    initrd /EFI/boot/initrd
+    
+    echo booting LiveCD ...
+    boot
+}
+
+menuentry 'Ventoy xxx LiveCD GUI (Debug Mode)' { 
+    echo downloading kernel ...
+    linux  /EFI/boot/vmlinuz debug loglevel=7 first_run rdinit=/VTOY/init
+    
+    echo downloading initrd ...
+    initrd /EFI/boot/initrd
+    
+    echo booting LiveCD ...
+    boot
+}
diff --git a/LiveCDGUI/VTOY/autostart b/LiveCDGUI/VTOY/autostart
new file mode 100644 (file)
index 0000000..7a4fbd2
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+hsetroot -fill /usr/share/wallpapers/wallpaper.png
+
+INIFILE=/ventoy/Ventoy2Disk.ini
+
+echo "[Ventoy]"                                 >> $INIFILE
+echo "Language=Chinese Simplified (简体中文)"   >> $INIFILE
+echo "PartStyle=0"                              >> $INIFILE
+echo "ShowAllDevice=0"                          >> $INIFILE
+
+/ventoy/tool/x86_64/Ventoy2Disk.gtk3 --kiosk
+
diff --git a/LiveCDGUI/VTOY/background.png b/LiveCDGUI/VTOY/background.png
new file mode 100644 (file)
index 0000000..d9cc57c
Binary files /dev/null and b/LiveCDGUI/VTOY/background.png differ
diff --git a/LiveCDGUI/VTOY/init b/LiveCDGUI/VTOY/init
new file mode 100644 (file)
index 0000000..957d417
--- /dev/null
@@ -0,0 +1,98 @@
+#!/bin/sh
+#
+# Porteus Kiosk initialization script.
+# Author: T.Jokiel <http://porteus-kiosk.org>
+#
+# 2021 longpanda  admin@ventoy.net
+#
+
+
+/bin/busybox --install -s
+mount -nt proc proc /proc
+grep -q -w debug /proc/cmdline || { echo 0 >/proc/sys/kernel/printk 2>/dev/null; clear; }
+mount -nt sysfs sysfs /sys
+mount -nt devtmpfs none /dev
+mkdir -p /dev/shm; chmod 1777 /dev/shm
+
+grep -q -w debug /proc/cmdline && touch /tmp/lspci || quiet=yes
+
+# Use memory as aufs
+mount -nt tmpfs -o size=75% tmpfs /memory
+mkdir -p /memory/xino /memory/changes /memory/images /memory/copy2ram
+
+# Setup aufs
+mount -nt aufs -o nowarn_perm,xino=/memory/xino/.aufs.xino,br:/memory/changes=rw aufs /union
+
+
+#Draw background 
+if [ -z "$quiet" ]; then
+    echo "##################################################"
+    echo "Starting Ventoy Live GUI <https://www.ventoy.net>"
+    echo "##################################################"
+else
+    mkdir -p /lib /opt/000 /opt/001; lspci >/tmp/lspci
+    mount -o loop /000-kernel.xzm /opt/000
+    mount -o loop /001-core.xzm /opt/001
+    [ `uname -m` = x86_64 ] && prefix="-x86-64"
+    ln -sf /opt/000/lib/firmware /lib/firmware
+    ln -sf /opt/000/lib/modules /lib/modules
+    ln -sf /opt/001/lib64/libc.so.6 /lib/libc.so.6
+    ln -sf /opt/001/lib64/ld-linux"$prefix".so.2 /lib/ld-linux"$prefix".so.2
+    ln -s /opt/001/bin/kmod /bin/modprobe
+
+    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)"
+    
+    # Nvidia quirk:
+    [ "$driver" ] || { lspci | grep 0300: | head -n1 | cut -d: -f3 | grep -q "10de" && driver=nouveau; }
+    
+    # VirtualBox quirk:
+    [ "$driver" = vboxvideo ] || modprobe $driver 2>/dev/null
+    test -e /dev/fb0 || { cp /opt/001/sbin/v86d /sbin; modprobe uvesafb mode_option=1024x768-32; }
+    if test -e /dev/fb0; then
+        rm -r /lib; ln -sf /opt/001/lib64 /lib; ln -sf /opt/001/usr/lib64 /usr/lib
+        /opt/001/usr/bin/fbv -a -c -u -i -k -e -r /VTOY/background.png 2>/dev/null &
+    fi
+fi
+
+
+cp -a /*.xzm /memory/copy2ram/
+
+# Populate aufs with modules:
+for x in `ls -1 /memory/copy2ram/ | grep \\.xzm$`; do
+    mkdir -p /memory/images/$x
+    mount -nt squashfs -o loop /memory/copy2ram/$x /memory/images/$x 2>/dev/null
+    if [ $? -eq 0 ]; then
+        mount -no remount,add:1:/memory/images/$x=rr aufs /union
+    fi
+done
+
+
+
+
+#clean 
+if [ -n "$quiet" ]; then
+    while [ "`pidof fbv`" ]; do 
+        usleep 500000
+    done
+    umount /opt/000 /opt/001 2>/dev/null
+    rm -r /lib
+fi
+
+
+
+mkdir -p /union/opt/scripts/
+echo 123 > /union/opt/scripts/extras
+rm -f /union/lib64/udev/rules.d/10-kiosk-auto_mount.rules
+cp -a /VTOY/autostart /union/etc/xdg/openbox/autostart
+cp -a /VTOY/*.png /union/ventoy/
+
+cp -a /bin/busybox /union/bin; ln -sf /union/lib /lib
+cp -a /VTOY/wallpaper.png /union/usr/share/wallpapers/ 2>/dev/null
+
+#to suppress error message
+mkdir -p /mnt/fake/docs
+echo 11 > /mnt/fake/docs/kiosk.sgn
+
+# swith_root
+exec /sbin/switch_root /union /sbin/init
+
diff --git a/LiveCDGUI/VTOY/refresh.png b/LiveCDGUI/VTOY/refresh.png
new file mode 100644 (file)
index 0000000..ce8f917
Binary files /dev/null and b/LiveCDGUI/VTOY/refresh.png differ
diff --git a/LiveCDGUI/VTOY/secure.png b/LiveCDGUI/VTOY/secure.png
new file mode 100644 (file)
index 0000000..0416f38
Binary files /dev/null and b/LiveCDGUI/VTOY/secure.png differ
diff --git a/LiveCDGUI/VTOY/wallpaper.png b/LiveCDGUI/VTOY/wallpaper.png
new file mode 100644 (file)
index 0000000..d1131a4
Binary files /dev/null and b/LiveCDGUI/VTOY/wallpaper.png differ
diff --git a/LiveCDGUI/download_ext.sh b/LiveCDGUI/download_ext.sh
new file mode 100644 (file)
index 0000000..ba4a2df
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+date +"%Y/%m/%d %H:%M:%S"
+echo downloading EXT files ...
+
+wget -q -P ./EXT/ https://github.com/ventoy/KioskFiles/releases/download/v1.0/Porteus-Kiosk-5.2.0-x86_64.iso
+wget -q -P ./EXT/ https://github.com/ventoy/KioskFiles/releases/download/v1.0/06-fonts.xzm
+
+[ -d ./__tmp__ ] && rm -rf ./__tmp__
+mkdir __tmp__
+
+mount ./EXT/Porteus-Kiosk-5.2.0-x86_64.iso ./__tmp__
+cp -a ./__tmp__/boot/vmlinuz   ./EXT/
+cp -a ./__tmp__/boot/initrd.xz ./EXT/
+cp -a ./__tmp__/xzm/* ./EXT/
+
+umount ./__tmp__
+rm -rf ./__tmp__
+rm -f ./EXT/Porteus-Kiosk-5.2.0-x86_64.iso
+
+date +"%Y/%m/%d %H:%M:%S"
+echo downloading EXT files finish ...
+
diff --git a/LiveCDGUI/initrd.sh b/LiveCDGUI/initrd.sh
new file mode 100644 (file)
index 0000000..08293a7
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+VENTOY_PATH=$PWD/../
+
+if ! [ -f $VENTOY_PATH/INSTALL/grub/grub.cfg ]; then
+    echo "no grub.cfg detected"
+    exit 1
+fi
+
+version=$(grep 'set.*VENTOY_VERSION=' $VENTOY_PATH/INSTALL/grub/grub.cfg | awk -F'"' '{print $2}')
+
+if ! [ -e $VENTOY_PATH/INSTALL/ventoy-${version}-linux.tar.gz ]; then
+    echo "no ventoy-${version}-linux.tar.gz detected"
+    exit 1
+fi
+
+echo "Ventoy LiveCD GUI $version"
+
+[ -d _INITRD_ ] && rm -rf _INITRD_
+mkdir _INITRD_
+cd _INITRD_
+
+xzcat ../EXT/initrd.xz | cpio -idmu --quiet >/dev/null 2>&1
+cp -a ../EXT/*.xzm ./
+cp -a ../VTOY ./
+
+
+
+mkdir ventoy
+tar -xf $VENTOY_PATH/INSTALL/ventoy-${version}-linux.tar.gz -C .
+mv ./ventoy-${version}  ./ventoy/ventoy
+chmod -R 777 ./ventoy
+mksquashfs ventoy ventoy.xzm  -comp xz 
+rm -rf ./ventoy
+
+
+rm -f ../initrd.img
+find . | cpio --quiet -o -H newc  > ../initrd.img
+
+cd ..
+rm -rf _INITRD_
+
diff --git a/LiveCDGUI/livecd.sh b/LiveCDGUI/livecd.sh
new file mode 100644 (file)
index 0000000..1aae4a8
--- /dev/null
@@ -0,0 +1,87 @@
+#!/bin/bash
+
+if [ "$1" = "CI" ]; then
+    OPT='-dR'
+else
+    OPT='-a'
+fi
+
+VENTOY_PATH=$PWD/../
+
+if ! [ -f $VENTOY_PATH/INSTALL/grub/grub.cfg ]; then
+    echo "no grub.cfg detected"
+    exit 1
+fi
+
+version=$(grep 'set.*VENTOY_VERSION=' $VENTOY_PATH/INSTALL/grub/grub.cfg | awk -F'"' '{print $2}')
+
+if ! [ -e $VENTOY_PATH/INSTALL/ventoy-${version}-linux.tar.gz ]; then
+    echo "no ventoy-${version}-linux.tar.gz detected"
+    exit 1
+fi
+
+if [ "$1" = "CI" ]; then
+    sh ./download_ext.sh
+fi
+
+if [ ! -f ./EXT/vmlinuz ]; then
+    echo "Please download EXT files first!"
+    exit 1
+fi
+
+sh ./initrd.sh
+
+
+rm -rf ISO_TMP
+cp -a ISO ISO_TMP
+
+if ! [ -d ISO_TMP ]; then
+    echo "Copy ISO_TMP failed"
+    exit 1
+fi
+
+cp -a ./EXT/vmlinuz ISO_TMP/EFI/boot/
+mv ./initrd.img ISO_TMP/EFI/boot/initrd
+
+cp -a GRUB/cdrom.img ISO_TMP/EFI/boot/
+cp -a GRUB/bootx64.efi ISO_TMP/EFI/boot/
+
+
+rm -rf efimnt
+rm -f efi.img
+mkdir -p efimnt
+
+dd if=/dev/zero of=efi.img bs=1M count=2
+mkfs.vfat efi.img
+mount efi.img efimnt
+mkdir -p efimnt/EFI/boot
+cp $OPT GRUB/bootx64.efi efimnt/EFI/boot/
+umount efimnt
+
+sync
+cp -a efi.img ISO_TMP/EFI/boot/
+
+rm -rf efimnt
+rm -f efi.img
+
+
+cd ISO_TMP
+
+sed "s/xxx/$version/g" -i EFI/boot/grub.cfg
+
+rm -f ../ventoy-${version}-livecd.iso
+
+xorriso -as mkisofs  -allow-lowercase  --sort-weight 0 / --sort-weight 1 /EFI  -v -R -J  -V  'VentoyLiveCD' -P 'VENTOY COMPATIBLE' -p 'https://www.ventoy.net' -sysid 'Ventoy' -A 'VentoyLiveCD' -b EFI/boot/cdrom.img --grub2-boot-info --grub2-mbr ../GRUB/boot_hybrid.img  -c EFI/boot/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e EFI/boot/efi.img -no-emul-boot  -append_partition 2 0xEF  EFI/boot/efi.img   -o ../ventoy-${version}-livecd.iso  .
+
+cd ../
+rm -rf ISO_TMP
+
+echo ""
+if [ -f ventoy-${version}-livecd.iso ]; then
+    echo "========== SUCCESS ============="
+else
+    echo "========== FAILED ============="
+fi
+echo ""
+
+