mirror of
https://github.com/ventoy/Ventoy.git
synced 2025-12-15 16:26:20 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
052a0152e4 | ||
|
|
5fae0ca35f | ||
|
|
6482f2e7b3 | ||
|
|
bd8aebf166 | ||
|
|
3c05d55b8a | ||
|
|
92ed0c995e | ||
|
|
dc7e310828 |
@@ -48,3 +48,6 @@ else
|
||||
fi
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
||||
set_ventoy_hook_finish
|
||||
|
||||
|
||||
@@ -49,3 +49,6 @@ else
|
||||
fi
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
||||
set_ventoy_hook_finish
|
||||
|
||||
|
||||
@@ -52,3 +52,6 @@ ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2"
|
||||
# fi
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
||||
|
||||
set_ventoy_hook_finish
|
||||
|
||||
@@ -36,3 +36,6 @@ ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2"
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
||||
|
||||
set_ventoy_hook_finish
|
||||
|
||||
|
||||
@@ -30,3 +30,6 @@ for i in 0 1 2 3 4 5 6 7 8 9; do
|
||||
done
|
||||
|
||||
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2"
|
||||
|
||||
set_ventoy_hook_finish
|
||||
|
||||
|
||||
@@ -47,3 +47,6 @@ else
|
||||
fi
|
||||
|
||||
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2"
|
||||
|
||||
set_ventoy_hook_finish
|
||||
|
||||
|
||||
@@ -39,3 +39,6 @@ ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
|
||||
|
||||
$BUSYBOX_PATH/rm -f /dev/dm-*
|
||||
|
||||
|
||||
set_ventoy_hook_finish
|
||||
|
||||
|
||||
@@ -119,3 +119,6 @@ fi
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
||||
|
||||
set_ventoy_hook_finish
|
||||
|
||||
|
||||
@@ -41,3 +41,6 @@ fi
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
||||
|
||||
set_ventoy_hook_finish
|
||||
|
||||
|
||||
@@ -80,3 +80,6 @@ ventoy_os_install_dmsetup $vtdiskname
|
||||
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
||||
set_ventoy_hook_finish
|
||||
|
||||
|
||||
@@ -75,3 +75,6 @@ ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
||||
|
||||
set_ventoy_hook_finish
|
||||
|
||||
|
||||
@@ -81,3 +81,6 @@ ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
||||
|
||||
set_ventoy_hook_finish
|
||||
|
||||
|
||||
@@ -39,3 +39,6 @@ $BUSYBOX_PATH/insmod $vtLoopExDir/dm-mod/$(uname -r)/64/dm-mod.ko
|
||||
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
||||
set_ventoy_hook_finish
|
||||
|
||||
|
||||
@@ -84,3 +84,6 @@ cp -a /dev/$vtDM /dev/ventoy
|
||||
ln -s /dev/$vtDM /dev/root
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
||||
set_ventoy_hook_finish
|
||||
|
||||
|
||||
@@ -34,3 +34,6 @@ for i in 0 1 2 3 4 5 6 7 8 9; do
|
||||
done
|
||||
|
||||
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
|
||||
|
||||
set_ventoy_hook_finish
|
||||
|
||||
|
||||
@@ -48,3 +48,6 @@ else
|
||||
fi
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
||||
set_ventoy_hook_finish
|
||||
|
||||
|
||||
@@ -68,3 +68,6 @@ ventoy_os_install_dmsetup_by_unsquashfs $vtdiskname
|
||||
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
||||
set_ventoy_hook_finish
|
||||
|
||||
|
||||
@@ -72,3 +72,6 @@ ventoy_os_install_device_mapper $vtdiskname
|
||||
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2"
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
||||
set_ventoy_hook_finish
|
||||
|
||||
|
||||
@@ -36,3 +36,6 @@ blkdev_num=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\
|
||||
mknod -m 0660 /dev/ventoy b $blkdev_num
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
||||
set_ventoy_hook_finish
|
||||
|
||||
|
||||
@@ -36,3 +36,6 @@ vtDM=$(ventoy_find_dm_id ${blkdev_num})
|
||||
echo -n "/dev/$vtDM" > /ventoy/rootdev
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
||||
set_ventoy_hook_finish
|
||||
|
||||
|
||||
@@ -36,3 +36,6 @@ blkdev_num=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\
|
||||
mknod -m 0660 /dev/ventoy b $blkdev_num
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
||||
set_ventoy_hook_finish
|
||||
|
||||
|
||||
@@ -33,3 +33,6 @@ fi
|
||||
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
||||
set_ventoy_hook_finish
|
||||
|
||||
|
||||
@@ -40,3 +40,6 @@ mknod -m 660 /dev/ventoy b $blkdev_num
|
||||
echo "/dev/ventoy" > cdrom.hint
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
||||
set_ventoy_hook_finish
|
||||
|
||||
|
||||
@@ -50,3 +50,6 @@ if [ "$1" = "fakecdrom" ]; then
|
||||
fi
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
||||
set_ventoy_hook_finish
|
||||
|
||||
|
||||
@@ -63,3 +63,6 @@ blkdev_num=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\
|
||||
mknod -m 0660 /dev/ventoy b $blkdev_num
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
||||
set_ventoy_hook_finish
|
||||
|
||||
|
||||
@@ -46,3 +46,6 @@ done
|
||||
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
||||
set_ventoy_hook_finish
|
||||
|
||||
|
||||
@@ -40,3 +40,6 @@ if ! [ -e $VTOY_DM_PATH ]; then
|
||||
fi
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
||||
set_ventoy_hook_finish
|
||||
|
||||
|
||||
@@ -487,19 +487,19 @@ function ventoy_freebsd_proc {
|
||||
ventoy_get_truenas_ver "$1" "${chosen_path}"
|
||||
elif vt_strstr "$vt_volume_id" "FURYBSD"; then
|
||||
ventoy_get_furybsd_ver "$1" "${chosen_path}"
|
||||
elif regexp --set 1:vtBsdVerNum "^(14|13|12|11|10|9)_[0-9]" "$vt_volume_id"; then
|
||||
elif regexp --set 1:vtBsdVerNum "^(15|14|13|12|11|10|9)_[0-9]" "$vt_volume_id"; then
|
||||
set vt_freebsd_ver=${vtBsdVerNum}.x
|
||||
elif [ -d (loop)/usr/midnightbsd-dist ]; then
|
||||
ventoy_get_midnightbsd_ver "$1" "${chosen_path}"
|
||||
set vtFreeBsdDistro=MidnightBSD
|
||||
elif [ -e (loop)/bin/freebsd-version ]; then
|
||||
vt_unix_parse_freebsd_ver (loop)/bin/freebsd-version vt_userland_ver
|
||||
if regexp --set 1:vtBsdVerNum "\"(14|13|12|11|10|9)\.[0-9]-" "$vt_userland_ver"; then
|
||||
if regexp --set 1:vtBsdVerNum "\"(15|14|13|12|11|10|9)\.[0-9]-" "$vt_userland_ver"; then
|
||||
set vt_freebsd_ver=${vtBsdVerNum}.x
|
||||
fi
|
||||
elif [ -e (loop)/README.TXT ]; then
|
||||
vt_1st_line (loop)/README.TXT vt_freebsd_line1
|
||||
if regexp --set 1:vtBsdVerNum "FreeBSD (14|13|12|11|10|9)\.[0-9]-" "$vt_freebsd_line1"; then
|
||||
if regexp --set 1:vtBsdVerNum "FreeBSD (15|14|13|12|11|10|9)\.[0-9]-" "$vt_freebsd_line1"; then
|
||||
set vt_freebsd_ver=${vtBsdVerNum}.x
|
||||
fi
|
||||
elif vt_strstr "${chosen_path}" "MidnightBSD"; then
|
||||
@@ -2431,7 +2431,7 @@ function mimg_common_menuentry {
|
||||
#############################################################
|
||||
#############################################################
|
||||
|
||||
set VENTOY_VERSION="1.1.06"
|
||||
set VENTOY_VERSION="1.1.08"
|
||||
|
||||
#ACPI not compatible with Window7/8, so disable by default
|
||||
set VTOY_PARAM_NO_ACPI=1
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
<h4 align="left">
|
||||
Ventoy is an open source tool to create bootable USB drive for ISO/WIM/IMG/VHD(x)/EFI files. <br/>
|
||||
With ventoy, you don't need to format the disk over and over, you just need to copy the image files to the USB drive and boot it.
|
||||
With ventoy, you don't need to format the disk over and over, just copy the image files to the USB drive and boot them.
|
||||
You can copy many image files at a time and ventoy will give you a boot menu to select them. <br/>
|
||||
You can also browse ISO/WIM/IMG/VHD(x)/EFI files in local disk and boot them.<br/>
|
||||
x86 Legacy BIOS, IA32 UEFI, x86_64 UEFI, ARM64 UEFI and MIPS64EL UEFI are supported in the same way.<br/>
|
||||
@@ -24,13 +24,13 @@ Most type of OS supported(Windows/WinPE/Linux/Unix/ChromeOS/Vmware/Xen...) <br/>
|
||||
|
||||
# Tested OS
|
||||
**Windows**
|
||||
Windows 7, Windows 8, Windows 8.1, Windows 10, Windows 11, Windows Server 2012, Windows Server 2012 R2, Windows Server 2016, Windows Server 2019, Windows Server 2022, WinPE
|
||||
Windows 7, Windows 8, Windows 8.1, Windows 10, Windows 11, Windows Server 2012, Windows Server 2012 R2, Windows Server 2016, Windows Server 2019, Windows Server 2022, Windows Server 2025, WinPE
|
||||
|
||||
**Linux**
|
||||
Debian, Ubuntu, CentOS(6/7/8/9), RHEL(6/7/8/9), Deepin, Fedora, Rocky Linux, AlmaLinux, EuroLinux(6/7/8/9), openEuler, OpenAnolis, SLES, openSUSE, MX Linux, Manjaro, Linux Mint, Endless OS, Elementary OS, Solus, Linx, Zorin, antiX, PClinuxOS, Arch, ArcoLinux, ArchLabs, BlackArch, Obarun, Artix Linux, Puppy Linux, Tails, Slax, Kali, Mageia, Slackware, Q4OS, Archman, Gentoo, Pentoo, NixOS, Kylin, openKylin, Ubuntu Kylin, KylinSec, Lubuntu, Xubuntu, Kubuntu, Ubuntu MATE, Ubuntu Budgie, Ubuntu Studio, Bluestar, OpenMandriva, ExTiX, Netrunner, ALT Linux, Nitrux, Peppermint, KDE neon, Linux Lite, Parrot OS, Qubes, Pop OS, ROSA, Void Linux, Star Linux, EndeavourOS, MakuluLinux, Voyager, Feren, ArchBang, LXLE, Knoppix, Calculate Linux, Clear Linux, Pure OS, Oracle Linux, Trident, Septor, Porteus, Devuan, GoboLinux, 4MLinux, Simplicity Linux, Zeroshell, Android-x86, netboot.xyz, Slitaz, SuperGrub2Disk, Proxmox VE, Kaspersky Rescue, SystemRescueCD, MemTest86, MemTest86+, MiniTool Partition Wizard, Parted Magic, veket, Sabayon, Scientific, alpine, ClearOS, CloneZilla, Berry Linux, Trisquel, Ataraxia Linux, Minimal Linux Live, BackBox Linux, Emmabuntüs, ESET SysRescue Live,Nova Linux, AV Linux, RoboLinux, NuTyX, IPFire, SELKS, ZStack, Enso Linux, Security Onion, Network Security Toolkit, Absolute Linux, TinyCore, Springdale Linux, Frost Linux, Shark Linux, LinuxFX, Snail Linux, Astra Linux, Namib Linux, Resilient Linux, Virage Linux, Blackweb Security OS, R-DriveImage, O-O.DiskImage, Macrium, ToOpPy LINUX, GNU Guix, YunoHost, foxclone, siduction, Adelie Linux, Elive, Pardus, CDlinux, AcademiX, Austrumi, Zenwalk, Anarchy, DuZeru, BigLinux, OpenMediaVault, Ubuntu DP, Exe GNU/Linux, 3CX Phone System, KANOTIX, Grml, Karoshi, PrimTux, ArchStrike, CAELinux, Cucumber, Fatdog, ForLEx, Hanthana, Kwort, MiniNo, Redcore, Runtu, Asianux, Clu Linux Live, Uruk, OB2D, BlueOnyx, Finnix, HamoniKR, Parabola, LinHES, LinuxConsole, BEE free, Untangle, Pearl, Thinstation, TurnKey, tuxtrans, Neptune, HefftorLinux, GeckoLinux, Mabox Linux, Zentyal, Maui, Reborn OS, SereneLinux , SkyWave Linux, Kaisen Linux, Regata OS, TROM-Jaro, DRBL Linux, Chalet OS, Chapeau, Desa OS, BlankOn, OpenMamba, Frugalware, Kibojoe Linux, Revenge OS, Tsurugi Linux, Drauger OS, Hash Linux, gNewSense, Ikki Boot, SteamOS, Hyperbola, VyOS, EasyNAS, SuperGamer, Live Raizo, Swift Linux, RebeccaBlackOS, Daphile, CRUX, Univention, Ufficio Zero, Rescuezilla, Phoenix OS, Garuda Linux, Mll, NethServer, OSGeoLive, Easy OS, Volumio, FreedomBox, paldo, UBOS, Recalbox, batocera, Lakka, LibreELEC, Pardus Topluluk, Pinguy, KolibriOS, Elastix, Arya, Omoikane, Omarine, Endian Firewall, Hamara, Rocks Cluster, MorpheusArch, Redo, Slackel, SME Server, APODIO, Smoothwall, Dragora, Linspire, Secure-K OS, Peach OSI, Photon, Plamo, SuperX, Bicom, Ploplinux, HP SPP, LliureX, Freespire, DietPi, BOSS, Webconverger, Lunar, TENS, Source Mage, RancherOS, T2, Vine, Pisi, blackPanther, mAid, Acronis, Active.Boot, AOMEI, Boot.Repair, CAINE, DaRT, EasyUEFI, R-Drive, PrimeOS, Avira Rescue System, bitdefender, Checkra1n Linux, Lenovo Diagnostics, Clover, Bliss-OS, Lenovo BIOS Update, Arcabit Rescue Disk, MiyoLinux, TeLOS, Kerio Control, RED OS, OpenWrt, MocaccinoOS, EasyStartup, Pyabr, Refracta, Eset SysRescue, Linpack Xtreme, Archcraft, NHVBOOT, pearOS, SeaTools, Easy Recovery Essentional, iKuai, StorageCraft SCRE, ZFSBootMenu, TROMjaro, BunsenLabs, Todo en Uno, ChallengerOS, Nobara, Holo, CachyOS, Peux OS, Vanilla OS, ShredOS, paladin, Palen1x, dban, ReviOS, HelenOS, XeroLinux, Tiny 11, chimera linux, CuteFish, DragonOs, Rhino Linux, vanilladpup, crystal, IGELOS, MiniOS, gnoppix, PikaOS, ......
|
||||
Debian, Ubuntu, CentOS(6/7/8/9), RHEL(6/7/8/9), Deepin, Fedora, Rocky Linux, AlmaLinux, EuroLinux(6/7/8/9), openEuler, OpenAnolis, SLES, openSUSE, MX Linux, Manjaro, Linux Mint, Endless OS, Elementary OS, Solus, Linx, Zorin, antiX, PClinuxOS, Arch, ArcoLinux, ArchLabs, BlackArch, Obarun, Artix Linux, Puppy Linux, Tails, Slax, Kali, Mageia, Slackware, Q4OS, Archman, Gentoo, Pentoo, NixOS, Kylin, openKylin, Ubuntu Kylin, KylinSec, Lubuntu, Xubuntu, Kubuntu, Ubuntu MATE, Ubuntu Budgie, Ubuntu Studio, Bluestar, OpenMandriva, ExTiX, Netrunner, ALT Linux, Nitrux, Peppermint, KDE neon, Linux Lite, Parrot OS, Qubes, Pop OS, ROSA, Void Linux, Star Linux, EndeavourOS, MakuluLinux, Voyager, Feren, ArchBang, LXLE, Knoppix, Calculate Linux, Clear Linux, Pure OS, Oracle Linux, Trident, Septor, Porteus, Devuan, GoboLinux, 4MLinux, Simplicity Linux, Zeroshell, Android-x86, netboot.xyz, Slitaz, SuperGrub2Disk, Proxmox VE, Kaspersky Rescue, SystemRescueCD, MemTest86, MemTest86+, MiniTool Partition Wizard, Parted Magic, veket, Sabayon, Scientific, alpine, ClearOS, CloneZilla, Berry Linux, Trisquel, Ataraxia Linux, Minimal Linux Live, BackBox Linux, Emmabuntüs, ESET SysRescue Live,Nova Linux, AV Linux, RoboLinux, NuTyX, IPFire, SELKS, ZStack, Enso Linux, Security Onion, Network Security Toolkit, Absolute Linux, TinyCore, Springdale Linux, Frost Linux, Shark Linux, LinuxFX, Snail Linux, Astra Linux, Namib Linux, Resilient Linux, Virage Linux, Blackweb Security OS, R-DriveImage, O-O.DiskImage, Macrium, ToOpPy LINUX, GNU Guix, YunoHost, foxclone, siduction, Adelie Linux, Elive, Pardus, CDlinux, AcademiX, Austrumi, Zenwalk, Anarchy, DuZeru, BigLinux, OpenMediaVault, Ubuntu DP, Exe GNU/Linux, 3CX Phone System, KANOTIX, Grml, Karoshi, PrimTux, ArchStrike, CAELinux, Cucumber, Fatdog, ForLEx, Hanthana, Kwort, MiniNo, Redcore, Runtu, Asianux, Clu Linux Live, Uruk, OB2D, BlueOnyx, Finnix, HamoniKR, Parabola, LinHES, LinuxConsole, BEE free, Untangle, Pearl, Thinstation, TurnKey, tuxtrans, Neptune, HefftorLinux, GeckoLinux, Mabox Linux, Zentyal, Maui, Reborn OS, SereneLinux , SkyWave Linux, Kaisen Linux, Regata OS, TROM-Jaro, DRBL Linux, Chalet OS, Chapeau, Desa OS, BlankOn, OpenMamba, Frugalware, Kibojoe Linux, Revenge OS, Tsurugi Linux, Drauger OS, Hash Linux, gNewSense, Ikki Boot, SteamOS, Hyperbola, VyOS, EasyNAS, SuperGamer, Live Raizo, Swift Linux, RebeccaBlackOS, Daphile, CRUX, Univention, Ufficio Zero, Rescuezilla, Phoenix OS, Garuda Linux, Mll, NethServer, OSGeoLive, Easy OS, Volumio, FreedomBox, paldo, UBOS, Recalbox, batocera, Lakka, LibreELEC, Pardus Topluluk, Pinguy, KolibriOS, Elastix, Arya, Omoikane, Omarine, Endian Firewall, Hamara, Rocks Cluster, MorpheusArch, Redo, Slackel, SME Server, APODIO, Smoothwall, Dragora, Linspire, Secure-K OS, Peach OSI, Photon, Plamo, SuperX, Bicom, Ploplinux, HP SPP, LliureX, Freespire, DietPi, BOSS, Webconverger, Lunar, TENS, Source Mage, RancherOS, T2, Vine, Pisi, blackPanther, mAid, Acronis, Active.Boot, AOMEI, Boot.Repair, CAINE, DaRT, EasyUEFI, R-Drive, PrimeOS, Avira Rescue System, bitdefender, Checkra1n Linux, Lenovo Diagnostics, Clover, Bliss-OS, Lenovo BIOS Update, Arcabit Rescue Disk, MiyoLinux, TeLOS, Kerio Control, RED OS, OpenWrt, MocaccinoOS, EasyStartup, Pyabr, Refracta, Eset SysRescue, Linpack Xtreme, Archcraft, NHVBOOT, pearOS, SeaTools, Easy Recovery Essentional, iKuai, StorageCraft SCRE, ZFSBootMenu, TROMjaro, BunsenLabs, Todo en Uno, ChallengerOS, Nobara, Holo, CachyOS, Peux OS, Vanilla OS, ShredOS, paladin, Palen1x, dban, ReviOS, HelenOS, XeroLinux, Tiny 11, chimera linux, CuteFish, DragonOs, Rhino Linux, vanilladpup, crystal, IGELOS, MiniOS, gnoppix, PikaOS, UwUntu, Noble, PocketHandyBox, DiskGenius, ......
|
||||
|
||||
**Unix**
|
||||
DragonFly, FreeBSD, pfSense, GhostBSD, FreeNAS, TrueNAS, XigmaNAS, FuryBSD, OPNsense, HardenedBSD, MidnightBSD, ClonOS, EmergencyBootKit
|
||||
DragonFly, FreeBSD, pfSense, OPNsense, GhostBSD, FreeNAS, TrueNAS, XigmaNAS, FuryBSD, HardenedBSD, MidnightBSD, ClonOS, EmergencyBootKit, helloSystem
|
||||
|
||||
**ChromeOS**
|
||||
FydeOS, CloudReady, ChromeOS Flex
|
||||
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,147 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
|
||||
*
|
||||
* Copyright (c) 2020 longpanda <admin@ventoy.net>
|
||||
* Copyright (c) 2004-2005 Pawel Jakub Dawidek <pjd@FreeBSD.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#ifndef _G_VENTOY_H_
|
||||
#define _G_VENTOY_H_
|
||||
|
||||
#include <sys/endian.h>
|
||||
|
||||
#define G_VENTOY_CLASS_NAME "VENTOY"
|
||||
|
||||
#define G_VENTOY_MAGIC "GEOM::VENTOY"
|
||||
/*
|
||||
* Version history:
|
||||
* 1 - Initial version number.
|
||||
* 2 - Added 'stop' command to gconcat(8).
|
||||
* 3 - Added md_provider field to metadata and '-h' option to gconcat(8).
|
||||
* 4 - Added md_provsize field to metadata.
|
||||
*/
|
||||
#define G_VENTOY_VERSION 4
|
||||
|
||||
#ifdef _KERNEL
|
||||
#define G_VENTOY_TYPE_MANUAL 0
|
||||
#define G_VENTOY_TYPE_AUTOMATIC 1
|
||||
|
||||
#define G_DEBUG(...) if (bootverbose) printf(__VA_ARGS__)
|
||||
#define G_VENTOY_DEBUG(lvl, ...) if (g_ventoy_debug) printf(__VA_ARGS__)
|
||||
#define G_VENTOY_LOGREQ(bp, ...) if (g_ventoy_debug) printf(__VA_ARGS__)
|
||||
|
||||
struct g_ventoy_disk {
|
||||
TAILQ_ENTRY(g_ventoy_disk) d_next;
|
||||
struct g_consumer *d_consumer;
|
||||
struct g_ventoy_softc *d_softc;
|
||||
off_t d_start;
|
||||
off_t d_end;
|
||||
off_t d_map_start;
|
||||
off_t d_map_end;
|
||||
int d_candelete;
|
||||
int d_removed;
|
||||
bool d_hardcoded;
|
||||
};
|
||||
|
||||
struct g_ventoy_softc {
|
||||
u_int sc_type; /* provider type */
|
||||
struct g_geom *sc_geom;
|
||||
struct g_provider *sc_provider;
|
||||
uint32_t sc_id; /* concat unique ID */
|
||||
|
||||
uint16_t sc_ndisks;
|
||||
TAILQ_HEAD(g_ventoy_disks, g_ventoy_disk) sc_disks;
|
||||
struct mtx sc_completion_lock; /* synchronizes cross-boundary IOs */
|
||||
struct sx sc_disks_lock; /* synchronizes modification of sc_disks */
|
||||
};
|
||||
#define sc_name sc_geom->name
|
||||
|
||||
|
||||
#pragma pack(1)
|
||||
#define VENTOY_UNIX_SEG_MAGIC0 0x11223344
|
||||
#define VENTOY_UNIX_SEG_MAGIC1 0x55667788
|
||||
#define VENTOY_UNIX_SEG_MAGIC2 0x99aabbcc
|
||||
#define VENTOY_UNIX_SEG_MAGIC3 0xddeeff00
|
||||
#define VENTOY_UNIX_MAX_SEGNUM 40960
|
||||
struct g_ventoy_seg {
|
||||
uint64_t seg_start_bytes;
|
||||
uint64_t seg_end_bytes;
|
||||
};
|
||||
|
||||
struct g_ventoy_map{
|
||||
uint32_t magic1[4];
|
||||
uint32_t magic2[4];
|
||||
uint64_t segnum;
|
||||
uint64_t disksize;
|
||||
uint8_t diskuuid[16];
|
||||
struct g_ventoy_seg seglist[VENTOY_UNIX_MAX_SEGNUM];
|
||||
uint32_t magic3[4];
|
||||
};
|
||||
#pragma pack()
|
||||
|
||||
#define VENTOY_MAP_VALID(magic2) \
|
||||
(magic2[0] == VENTOY_UNIX_SEG_MAGIC0 && magic2[1] == VENTOY_UNIX_SEG_MAGIC1 && magic2[2] == VENTOY_UNIX_SEG_MAGIC2 && magic2[3] == VENTOY_UNIX_SEG_MAGIC3)
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
||||
struct g_ventoy_metadata {
|
||||
char md_magic[16]; /* Magic value. */
|
||||
uint32_t md_version; /* Version number. */
|
||||
char md_name[16]; /* Concat name. */
|
||||
uint32_t md_id; /* Unique ID. */
|
||||
uint16_t md_no; /* Disk number. */
|
||||
uint16_t md_all; /* Number of all disks. */
|
||||
char md_provider[16]; /* Hardcoded provider. */
|
||||
uint64_t md_provsize; /* Provider's size. */
|
||||
};
|
||||
static __inline void
|
||||
ventoy_metadata_encode(const struct g_ventoy_metadata *md, u_char *data)
|
||||
{
|
||||
|
||||
bcopy(md->md_magic, data, sizeof(md->md_magic));
|
||||
le32enc(data + 16, md->md_version);
|
||||
bcopy(md->md_name, data + 20, sizeof(md->md_name));
|
||||
le32enc(data + 36, md->md_id);
|
||||
le16enc(data + 40, md->md_no);
|
||||
le16enc(data + 42, md->md_all);
|
||||
bcopy(md->md_provider, data + 44, sizeof(md->md_provider));
|
||||
le64enc(data + 60, md->md_provsize);
|
||||
}
|
||||
static __inline void
|
||||
ventoy_metadata_decode(const u_char *data, struct g_ventoy_metadata *md)
|
||||
{
|
||||
|
||||
bcopy(data, md->md_magic, sizeof(md->md_magic));
|
||||
md->md_version = le32dec(data + 16);
|
||||
bcopy(data + 20, md->md_name, sizeof(md->md_name));
|
||||
md->md_id = le32dec(data + 36);
|
||||
md->md_no = le16dec(data + 40);
|
||||
md->md_all = le16dec(data + 42);
|
||||
bcopy(data + 44, md->md_provider, sizeof(md->md_provider));
|
||||
md->md_provsize = le64dec(data + 60);
|
||||
}
|
||||
#endif /* _G_VENTOY_H_ */
|
||||
@@ -0,0 +1,8 @@
|
||||
# $FreeBSD$
|
||||
|
||||
.PATH: ${SRCTOP}/sys/geom/ventoy
|
||||
|
||||
KMOD= geom_ventoy
|
||||
SRCS= g_ventoy.c
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
Reference in New Issue
Block a user