mirror of
https://github.com/ventoy/Ventoy.git
synced 2025-08-28 00:11:15 +00:00
1.0.14 release
This commit is contained in:
@@ -19,19 +19,25 @@
|
||||
|
||||
. /ventoy/hook/ventoy-hook-lib.sh
|
||||
|
||||
if is_ventoy_hook_finished; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
vtlog "####### $0 $* ########"
|
||||
|
||||
VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
|
||||
|
||||
while ! [ -e /dev/null ]; do
|
||||
echo 'xxxxxxxxxx'
|
||||
echo 'xxxxxxxxxx' > /dev/console
|
||||
sleep 1
|
||||
done
|
||||
wait_for_usb_disk_ready
|
||||
|
||||
vtlog "... start inotifyd listen $vtHook ..."
|
||||
$BUSYBOX_PATH/nohup $VTOY_PATH/tool/inotifyd $VTOY_PATH/hook/guix/ventoy-disk.sh /dev:n 2>&- &
|
||||
vtdiskname=$(get_ventoy_disk_name)
|
||||
if [ "$vtdiskname" = "unknown" ]; then
|
||||
vtlog "ventoy disk not found"
|
||||
PATH=$VTPATH_OLD
|
||||
exit 0
|
||||
fi
|
||||
|
||||
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
||||
set_ventoy_hook_finish
|
23
IMG/cpio/ventoy/hook/adelie/ventoy-hook.sh
Normal file
23
IMG/cpio/ventoy/hook/adelie/ventoy-hook.sh
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/ventoy/busybox/sh
|
||||
#************************************************************************************
|
||||
# Copyright (c) 2020, longpanda <admin@ventoy.net>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
#************************************************************************************
|
||||
|
||||
. $VTOY_PATH/hook/ventoy-os-lib.sh
|
||||
|
||||
$VTOY_PATH/hook/adelie/disk-hook.sh &
|
||||
|
@@ -32,13 +32,14 @@ fi
|
||||
|
||||
#
|
||||
# We do a trick for ATL series here.
|
||||
# Use /dev/loop7 and wapper it as a cdrom with bind mount.
|
||||
# Then the installer will accept /dev/loop7 as the install medium.
|
||||
# Use /dev/vtCheatLoop and wapper it as a cdrom with bind mount.
|
||||
# Then the installer will accept /dev/vtCheatLoop as the install medium.
|
||||
#
|
||||
ventoy_copy_device_mapper /dev/loop7
|
||||
$BUSYBOX_PATH/mkdir -p /tmp/loop7/device/
|
||||
echo 5 > /tmp/loop7/device/type
|
||||
$BUSYBOX_PATH/mount --bind /tmp/loop7 /sys/block/loop7 >> $VTLOG 2>&1
|
||||
vtCheatLoop=loop6
|
||||
ventoy_copy_device_mapper /dev/$vtCheatLoop
|
||||
$BUSYBOX_PATH/mkdir -p /tmp/$vtCheatLoop/device/
|
||||
echo 5 > /tmp/$vtCheatLoop/device/type
|
||||
$BUSYBOX_PATH/mount --bind /tmp/$vtCheatLoop /sys/block/$vtCheatLoop >> $VTLOG 2>&1
|
||||
|
||||
|
||||
# OK finish
|
||||
|
50
IMG/cpio/ventoy/hook/arch/ovios-disk.sh
Normal file
50
IMG/cpio/ventoy/hook/arch/ovios-disk.sh
Normal file
@@ -0,0 +1,50 @@
|
||||
#!/ventoy/busybox/sh
|
||||
#************************************************************************************
|
||||
# Copyright (c) 2020, longpanda <admin@ventoy.net>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
#************************************************************************************
|
||||
|
||||
. /ventoy/hook/ventoy-hook-lib.sh
|
||||
|
||||
vtlog "######### $0 $* ############"
|
||||
|
||||
VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
|
||||
|
||||
wait_for_usb_disk_ready
|
||||
|
||||
vtdiskname=$(get_ventoy_disk_name)
|
||||
if [ "$vtdiskname" = "unknown" ]; then
|
||||
vtlog "ventoy disk not found"
|
||||
PATH=$VTPATH_OLD
|
||||
exit 0
|
||||
fi
|
||||
|
||||
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
|
||||
|
||||
blkdev_num=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/')
|
||||
blkdev_num_mknod=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1 \2/')
|
||||
vtDM=$(ventoy_find_dm_id ${blkdev_num})
|
||||
|
||||
vtlog "blkdev_num=$blkdev_num blkdev_num_mknod=$blkdev_num_mknod vtDM=$vtDM"
|
||||
|
||||
if [ -b /dev/$vtDM ]; then
|
||||
vtlog "dev already exist ..."
|
||||
else
|
||||
vtlog "mknode dev ..."
|
||||
mknod -m 660 /dev/$vtDM b $blkdev_num_mknod
|
||||
fi
|
||||
|
||||
PATH=$VTPATH_OLD
|
@@ -26,6 +26,14 @@ if $GREP -q '^"$mount_handler"' /init; then
|
||||
if [ -f /hooks/archiso ]; then
|
||||
$SED '/while ! poll_device "${dev}"/a\ if /ventoy/busybox/sh /ventoy/hook/arch/ventoy-timeout.sh ${dev}; then break; fi' -i /hooks/archiso
|
||||
fi
|
||||
elif $GREP -q '^KEEP_SEARCHING' /init; then
|
||||
echo 'KEEP_SEARCHING found ...' >> $VTLOG
|
||||
$SED "/^KEEP_SEARCHING/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/arch/ovios-disk.sh " -i /init
|
||||
|
||||
$BUSYBOX_PATH/mkdir -p /dev
|
||||
$BUSYBOX_PATH/mkdir -p /sys
|
||||
$BUSYBOX_PATH/mount -t sysfs sys /sys
|
||||
|
||||
else
|
||||
# some archlinux initramfs doesn't contain device-mapper udev rules file
|
||||
ARCH_UDEV_DIR=$(ventoy_get_udev_conf_dir)
|
||||
|
@@ -32,4 +32,5 @@ if [ "$vtdiskname" = "unknown" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
vtlog "${vtdiskname#/dev/}2 found..."
|
||||
$BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/udev_disk_hook.sh "${vtdiskname#/dev/}2"
|
||||
|
@@ -21,6 +21,8 @@
|
||||
|
||||
ventoy_os_install_dmsetup() {
|
||||
|
||||
vtlog "ventoy_os_install_dmsetup $1 ..."
|
||||
|
||||
vt_usb_disk=$1
|
||||
|
||||
# dump iso file location
|
||||
|
26
IMG/cpio/ventoy/hook/guix/ventoy-before-init.sh
Normal file
26
IMG/cpio/ventoy/hook/guix/ventoy-before-init.sh
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/ventoy/busybox/sh
|
||||
#************************************************************************************
|
||||
# Copyright (c) 2020, longpanda <admin@ventoy.net>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
#************************************************************************************
|
||||
|
||||
. $VTOY_PATH/hook/ventoy-os-lib.sh
|
||||
|
||||
$BUSYBOX_PATH/mkdir /dev
|
||||
$BUSYBOX_PATH/mknod -m 0660 /dev/null c 1 3
|
||||
|
||||
$BUSYBOX_PATH/sh $VTOY_PATH/hook/guix/ventoy-disk.sh &
|
||||
|
@@ -19,24 +19,32 @@
|
||||
|
||||
. /ventoy/hook/ventoy-hook-lib.sh
|
||||
|
||||
if is_ventoy_hook_finished; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
vtlog "##### INOTIFYD: $2/$3 is created ..."
|
||||
vtlog "######### $0 $* ############"
|
||||
|
||||
VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
|
||||
|
||||
if is_inotify_ventoy_part $3; then
|
||||
vtlog "find ventoy partition ..."
|
||||
$BUSYBOX_PATH/sh $VTOY_PATH/hook/default/udev_disk_hook.sh $3
|
||||
|
||||
blkdev_num=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/')
|
||||
vtDM=$(ventoy_find_dm_id ${blkdev_num})
|
||||
wait_for_usb_disk_ready
|
||||
|
||||
vtlog "This is $vtDM ..."
|
||||
vtdiskname=$(get_ventoy_disk_name)
|
||||
if [ "$vtdiskname" = "unknown" ]; then
|
||||
vtlog "ventoy disk not found"
|
||||
PATH=$VTPATH_OLD
|
||||
exit 0
|
||||
fi
|
||||
|
||||
set_ventoy_hook_finish
|
||||
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
|
||||
|
||||
blkdev_num=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/')
|
||||
blkdev_num_mknod=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1 \2/')
|
||||
vtDM=$(ventoy_find_dm_id ${blkdev_num})
|
||||
|
||||
vtlog "blkdev_num=$blkdev_num blkdev_num_mknod=$blkdev_num_mknod vtDM=$vtDM"
|
||||
|
||||
if [ -b /dev/$vtDM ]; then
|
||||
vtlog "dev already exist ..."
|
||||
else
|
||||
vtlog "mknode dev ..."
|
||||
mknod -m 660 /dev/$vtDM b $blkdev_num_mknod
|
||||
fi
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
@@ -18,8 +18,3 @@
|
||||
#************************************************************************************
|
||||
|
||||
. $VTOY_PATH/hook/ventoy-os-lib.sh
|
||||
|
||||
$BUSYBOX_PATH/mkdir /dev
|
||||
$BUSYBOX_PATH/mknode -m 0666 /dev/null c 1 3
|
||||
|
||||
$BUSYBOX_PATH/nohup $VTOY_PATH/hook/guix/ventoy-waitdev.sh &
|
||||
|
@@ -19,6 +19,8 @@
|
||||
|
||||
. /ventoy/hook/ventoy-hook-lib.sh
|
||||
|
||||
vtCheatLoop=loop6
|
||||
|
||||
ventoy_os_install_dmsetup() {
|
||||
vtlog "ventoy_os_install_dmsetup $1"
|
||||
|
||||
@@ -50,9 +52,9 @@ ventoy_os_install_dmsetup() {
|
||||
|
||||
|
||||
if is_ventoy_hook_finished || not_ventoy_disk "${1:0:-1}"; then
|
||||
# /dev/loop7 come first
|
||||
if [ "$1" = "loop7" ] && [ -b $VTOY_DM_PATH ]; then
|
||||
ventoy_copy_device_mapper /dev/loop7
|
||||
# /dev/vtCheatLoop come first
|
||||
if [ "$1" = "$vtCheatLoop" ] && [ -b $VTOY_DM_PATH ]; then
|
||||
ventoy_copy_device_mapper /dev/$vtCheatLoop
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
@@ -72,14 +74,14 @@ $BUSYBOX_PATH/mount $VTOY_DM_PATH /mnt/ventoy
|
||||
|
||||
#
|
||||
# We do a trick for rhel6 series here.
|
||||
# Use /dev/loop7 and wapper it as a removable cdrom with bind mount.
|
||||
# Then the anaconda installer will accept /dev/loop7 as the install medium.
|
||||
# Use /dev/$vtCheatLoop and wapper it as a removable cdrom with bind mount.
|
||||
# Then the anaconda installer will accept /dev/$vtCheatLoop as the install medium.
|
||||
#
|
||||
ventoy_copy_device_mapper /dev/loop7
|
||||
ventoy_copy_device_mapper /dev/$vtCheatLoop
|
||||
|
||||
$BUSYBOX_PATH/cp -a /sys/devices/virtual/block/loop7 /tmp/ >> $VTLOG 2>&1
|
||||
echo 19 > /tmp/loop7/capability
|
||||
$BUSYBOX_PATH/mount --bind /tmp/loop7 /sys/block/loop7 >> $VTLOG 2>&1
|
||||
$BUSYBOX_PATH/cp -a /sys/devices/virtual/block/$vtCheatLoop /tmp/ >> $VTLOG 2>&1
|
||||
echo 19 > /tmp/$vtCheatLoop/capability
|
||||
$BUSYBOX_PATH/mount --bind /tmp/$vtCheatLoop /sys/block/$vtCheatLoop >> $VTLOG 2>&1
|
||||
|
||||
# OK finish
|
||||
set_ventoy_hook_finish
|
||||
|
@@ -23,4 +23,6 @@ $BUSYBOX_PATH/mkdir -p /etc/anaconda.repos.d /mnt/ventoy
|
||||
ventoy_print_yum_repo "ventoy" "file:///mnt/ventoy" > /etc/anaconda.repos.d/ventoy.repo
|
||||
|
||||
ventoy_add_udev_rule "$VTOY_PATH/hook/rhel6/udev_disk_hook.sh %k"
|
||||
ventoy_add_kernel_udev_rule "loop7" "$VTOY_PATH/hook/rhel6/udev_disk_hook.sh %k"
|
||||
|
||||
#loop7 was used by loader
|
||||
ventoy_add_kernel_udev_rule "loop6" "$VTOY_PATH/hook/rhel6/udev_disk_hook.sh %k"
|
||||
|
@@ -192,6 +192,10 @@ ventoy_get_os_type() {
|
||||
echo 'android'; return
|
||||
fi
|
||||
|
||||
if $GREP -q 'adelielinux' /proc/version; then
|
||||
echo 'adelie'; return
|
||||
fi
|
||||
|
||||
echo "default"
|
||||
}
|
||||
|
||||
@@ -218,7 +222,6 @@ if [ "$VTOY_BREAK_LEVEL" = "03" ] || [ "$VTOY_BREAK_LEVEL" = "13" ]; then
|
||||
exec $BUSYBOX_PATH/sh
|
||||
fi
|
||||
|
||||
|
||||
####################################################################
|
||||
# #
|
||||
# Step 4 : Hand over to real init #
|
||||
@@ -235,7 +238,8 @@ if [ -f $VTOY_PATH/ventoy_persistent_map ]; then
|
||||
fi
|
||||
|
||||
cd /
|
||||
unset VTOY_PATH VTLOG FIND GREP EGREP CAT AWK SED SLEEP HEAD
|
||||
|
||||
unset VTLOG FIND GREP EGREP CAT AWK SED SLEEP HEAD
|
||||
|
||||
for vtinit in $user_rdinit /init /sbin/init /linuxrc; do
|
||||
if [ -d /ventoy_rdroot ]; then
|
||||
@@ -246,6 +250,9 @@ for vtinit in $user_rdinit /init /sbin/init /linuxrc; do
|
||||
fi
|
||||
else
|
||||
if [ -e "$vtinit" ];then
|
||||
if [ -f "$VTOY_PATH/hook/$VTOS/ventoy-before-init.sh" ]; then
|
||||
$BUSYBOX_PATH/sh "$VTOY_PATH/hook/$VTOS/ventoy-before-init.sh"
|
||||
fi
|
||||
exec "$vtinit"
|
||||
fi
|
||||
fi
|
||||
|
Reference in New Issue
Block a user