ventoy / Ventoy

A new bootable USB solution.
https://www.ventoy.net
GNU General Public License v3.0
62.34k stars 4.07k forks source link

Make install scripts more portable #200

Open mmuman opened 4 years ago

mmuman commented 4 years ago

Most linuxisms used in the install scripts can likely be replaced by more portable code, or be done in a way that allows porting to other platforms (BSD, Haiku…).

We probably want to clean them up first though (#199).

grahamperrin commented 3 years ago
# date ; uname -v
Mon May  3 20:11:27 BST 2021
FreeBSD 14.0-CURRENT #93 main-n246330-5eb9c93a20d: Tue Apr 27 05:14:26 BST 2021     root@mowa219-gjp4-8570p:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG 
# pwd
/usr/home/grahamperrin/Desktop/ventoy-1.0.42
# ./Ventoy2Disk.sh -i /dev/da0

**********************************************
      Ventoy: 1.0.42  x86_64
      longpanda admin@ventoy.net
      https://www.ventoy.net
**********************************************

Failed to access /dev/da0, maybe root privilege is needed!

# whoami
root
# 
probonopd commented 2 years ago

Tried to build the Qt GUI on FreeBSD. No luck because #include <linux/fs.h> doesn't exist on FreeBSD:

FreeBSD% wget https://github.com/ventoy/Ventoy/archive/refs/heads/master.zip

FreeBSD% unzip master.zip

FreeBSD% cd Ventoy-master/LinuxGUI/Ventoy2Disk/QT

FreeBSD% qmake-qt5

FreeBSD% ln -s ../* .  

FreeBSD% make        
clang -c -pipe -O2 -Wall -Wextra -pthread -fPIC -DQT_DEPRECATED_WARNINGS -DSTATIC=static -DINIT= -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I/home/panda/Ventoy2Disk/Core -I/home/panda/Ventoy2Disk/Web -I/home/panda/Ventoy2Disk/QT -I/home/panda/Ventoy2Disk/Include -I/home/panda/Ventoy2Disk/Lib/libhttp/include -I/home/panda/Ventoy2Disk/Lib/fat_io_lib/include -I/home/panda/Ventoy2Disk/Lib/xz-embedded/linux/include -I/home/panda/Ventoy2Disk/Lib/xz-embedded/linux/include/linux -I/home/panda/Ventoy2Disk/Lib/xz-embedded/userspace -I/home/panda/Ventoy2Disk/Lib/exfat/src/libexfat -I/home/panda/Ventoy2Disk/Lib/fat_io_lib -I/usr/local/include/qt5 -I/usr/local/include/qt5/QtWidgets -I/usr/local/include/qt5/QtGui -I/usr/local/include/qt5/QtCore -I. -I/usr/local/include -I. -I/usr/local/include -I/usr/local/lib/qt5/mkspecs/freebsd-clang -o ventoy_crc32.o Core/ventoy_crc32.c
clang -c -pipe -O2 -Wall -Wextra -pthread -fPIC -DQT_DEPRECATED_WARNINGS -DSTATIC=static -DINIT= -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I/home/panda/Ventoy2Disk/Core -I/home/panda/Ventoy2Disk/Web -I/home/panda/Ventoy2Disk/QT -I/home/panda/Ventoy2Disk/Include -I/home/panda/Ventoy2Disk/Lib/libhttp/include -I/home/panda/Ventoy2Disk/Lib/fat_io_lib/include -I/home/panda/Ventoy2Disk/Lib/xz-embedded/linux/include -I/home/panda/Ventoy2Disk/Lib/xz-embedded/linux/include/linux -I/home/panda/Ventoy2Disk/Lib/xz-embedded/userspace -I/home/panda/Ventoy2Disk/Lib/exfat/src/libexfat -I/home/panda/Ventoy2Disk/Lib/fat_io_lib -I/usr/local/include/qt5 -I/usr/local/include/qt5/QtWidgets -I/usr/local/include/qt5/QtGui -I/usr/local/include/qt5/QtCore -I. -I/usr/local/include -I. -I/usr/local/include -I/usr/local/lib/qt5/mkspecs/freebsd-clang -o ventoy_disk.o Core/ventoy_disk.c
Core/ventoy_disk.c:31:10: fatal error: 'linux/fs.h' file not found
#include <linux/fs.h>
         ^~~~~~~~~~~~
1 error generated.                                                                               
*** Error code 1

Stop.
make: stopped in /tmp/Ventoy-master/LinuxGUI/Ventoy2Disk/QT
probonopd commented 2 years ago

Until the Ventoy installation scripts and Qt GUI supports FreeBSD, FreeBSD users can use the Ventoy Live ISO.

For the FreeBSD friends out there, I added Ventoy support to the Create Live Media utility in helloSystem:

image

image

hurzl commented 1 year ago

Can the iso update itself when booted by ventoy?

probonopd commented 1 year ago

The Live medium can be used to install Ventoy to another drive. When you want a new version, you can download a new version of the Live ISO, overwrite the Live medium with it, and use it to update the Ventoy installation on the other drive while keeping your ISO collection.

hurzl commented 1 year ago

Can the iso update itself when booted by ventoy?

yes it worked.