1.0.14 release

This commit is contained in:
longpanda
2020-06-25 23:01:48 +08:00
parent 42990058ed
commit 1cbe4c81b4
58 changed files with 1079 additions and 331 deletions

View File

@@ -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

View 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 &

View File

@@ -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

View 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

View File

@@ -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)

View File

@@ -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"

View File

@@ -21,6 +21,8 @@
ventoy_os_install_dmsetup() {
vtlog "ventoy_os_install_dmsetup $1 ..."
vt_usb_disk=$1
# dump iso file location

View 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 &

View File

@@ -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

View File

@@ -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 &

View File

@@ -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

View File

@@ -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"