mirror of
https://github.com/ventoy/Ventoy.git
synced 2025-08-28 00:11:15 +00:00
update for new release
This commit is contained in:
@@ -40,11 +40,21 @@ if [ -e $BUSYBOX_PATH/64h ]; then
|
||||
$BUSYBOX_PATH/xzminidec32 < $BUSYBOX_PATH/busybox32.xz > $BUSYBOX_PATH/busybox
|
||||
$BUSYBOX_PATH/vtchmod32 $BUSYBOX_PATH/busybox
|
||||
else
|
||||
$BUSYBOX_PATH/xzminidec64 < $BUSYBOX_PATH/busybox64.xz > $BUSYBOX_PATH/busybox
|
||||
$BUSYBOX_PATH/vtchmod64 $BUSYBOX_PATH/busybox
|
||||
$BUSYBOX_PATH/xzminidec64 < $BUSYBOX_PATH/busybox64.xz > $BUSYBOX_PATH/busybox
|
||||
if [ -s $BUSYBOX_PATH/busybox ]; then
|
||||
$BUSYBOX_PATH/vtchmod64 $BUSYBOX_PATH/busybox
|
||||
else
|
||||
$BUSYBOX_PATH/xzminidec64_uclibc < $BUSYBOX_PATH/busybox64.xz > $BUSYBOX_PATH/busybox
|
||||
$BUSYBOX_PATH/vtchmod64_uclibc $BUSYBOX_PATH/busybox
|
||||
fi
|
||||
fi
|
||||
|
||||
$BUSYBOX_PATH/busybox --install $BUSYBOX_PATH
|
||||
if [ -e $BUSYBOX_PATH/busybox ]; then
|
||||
$BUSYBOX_PATH/busybox --install $BUSYBOX_PATH
|
||||
else
|
||||
$BUSYBOX_PATH/tmpxz -d $BUSYBOX_PATH/busybox32.xz
|
||||
$BUSYBOX_PATH/busybox32 --install $BUSYBOX_PATH
|
||||
fi
|
||||
|
||||
export PATH=$BUSYBOX_PATH/:$VTOY_PATH/tool
|
||||
|
||||
@@ -78,10 +88,12 @@ if [ -e $BUSYBOX_PATH/64h ]; then
|
||||
echo "Use busybox32 toolkit ..." >>$VTLOG
|
||||
ln -s $BUSYBOX_PATH/xzminidec32 $BUSYBOX_PATH/xzminidec
|
||||
ln -s $VTOY_PATH/tool/dmsetup32 $VTOY_PATH/tool/dmsetup
|
||||
ln -s $VTOY_PATH/tool/lunzip32 $VTOY_PATH/tool/lunzip
|
||||
else
|
||||
echo "Use busybox64 toolkit ..." >>$VTLOG
|
||||
ln -s $BUSYBOX_PATH/xzminidec64 $BUSYBOX_PATH/xzminidec
|
||||
ln -s $VTOY_PATH/tool/dmsetup64 $VTOY_PATH/tool/dmsetup
|
||||
ln -s $VTOY_PATH/tool/lunzip64 $VTOY_PATH/tool/lunzip
|
||||
fi
|
||||
|
||||
rm -f *.xz
|
||||
|
BIN
IMG/cpio/ventoy/busybox/vtchmod64_uclibc
Normal file
BIN
IMG/cpio/ventoy/busybox/vtchmod64_uclibc
Normal file
Binary file not shown.
BIN
IMG/cpio/ventoy/busybox/xzminidec64_uclibc
Normal file
BIN
IMG/cpio/ventoy/busybox/xzminidec64_uclibc
Normal file
Binary file not shown.
@@ -59,7 +59,15 @@ mkdir -p $VTOY_PATH/mnt
|
||||
mount /vt_modloop $VTOY_PATH/mnt
|
||||
|
||||
KoModPath=$(find $VTOY_PATH/mnt/ -name 'dm-mod.ko*')
|
||||
vtlog "insmod $KoModPath"
|
||||
vtlog "KoModPath=$KoModPath"
|
||||
|
||||
if modinfo $KoModPath | grep -q 'depend.*dax'; then
|
||||
vtlog "First install dax mod ..."
|
||||
DaxModPath=$(echo $KoModPath | sed 's#md/dm-mod#dax/dax#')
|
||||
vtlog "insmod $DaxModPath"
|
||||
insmod $DaxModPath
|
||||
fi
|
||||
|
||||
insmod $KoModPath
|
||||
|
||||
umount $VTOY_PATH/mnt
|
||||
|
@@ -21,11 +21,20 @@
|
||||
|
||||
if $GREP -q '^"$mount_handler"' /init; then
|
||||
echo 'use mount_handler ...' >> $VTLOG
|
||||
$SED "/^\"\$mount_handler\"/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/arch/ventoy-disk.sh \"\$archisodevice\"" -i /init
|
||||
|
||||
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
|
||||
vthookfile=/hooks/archiso
|
||||
|
||||
if [ -e /hook/miso ]; then
|
||||
vthookfile=/hooks/miso
|
||||
$SED "/^\"\$mount_handler\"/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/arch/ventoy-disk.sh \"\$misodevice\"" -i /init
|
||||
else
|
||||
$SED "/^\"\$mount_handler\"/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/arch/ventoy-disk.sh \"\$archisodevice\"" -i /init
|
||||
fi
|
||||
|
||||
if [ -f $vthookfile ]; then
|
||||
$SED '/while ! poll_device "${dev}"/a\ if /ventoy/busybox/sh /ventoy/hook/arch/ventoy-timeout.sh ${dev}; then break; fi' -i $vthookfile
|
||||
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
|
||||
|
51
IMG/cpio/ventoy/hook/aryalinux/disk_hook.sh
Normal file
51
IMG/cpio/ventoy/hook/aryalinux/disk_hook.sh
Normal file
@@ -0,0 +1,51 @@
|
||||
#!/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
|
||||
|
||||
VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
|
||||
|
||||
mkdir /sys
|
||||
mount -t sysfs sys /sys
|
||||
|
||||
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
IMG/cpio/ventoy/hook/aryalinux/ventoy-hook.sh
Normal file
26
IMG/cpio/ventoy/hook/aryalinux/ventoy-hook.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 660 /dev/console b 5 1
|
||||
|
||||
$SED "/for device in/i $BUSYBOX_PATH/sh $VTOY_PATH/hook/aryalinux/disk_hook.sh" -i /init
|
||||
#$SED "/for device in/i exec $BUSYBOX_PATH/sh" -i /init
|
@@ -29,7 +29,7 @@ for i in 0 1 2 3 4 5 6 7 8 9; do
|
||||
fi
|
||||
done
|
||||
|
||||
ventoy_extract_vtloopex /dev/${vtdiskname#/dev/}2 crux
|
||||
ventoy_extract_vtloopex ${vtdiskname}2 crux
|
||||
|
||||
vtLoopExDir=$VTOY_PATH/vtloopex/crux/vtloopex
|
||||
$BUSYBOX_PATH/xz -d $vtLoopExDir/dm-mod/$(uname -r)/64/dax.ko.xz
|
||||
|
@@ -60,3 +60,18 @@ if [ -f $VTOY_PATH/autoinstall ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
#for ARMA aka Omoikane
|
||||
if [ -f /mod.img ] && [ -f /mod/fs/cramfs.ko ]; then
|
||||
echo "mount mod.img and install dm-mod.ko" >> $VTLOG
|
||||
$BUSYBOX_PATH/insmod /mod/fs/cramfs.ko
|
||||
|
||||
$BUSYBOX_PATH/mkdir $VTOY_PATH/modmnt
|
||||
$BUSYBOX_PATH/mount /mod.img $VTOY_PATH/modmnt
|
||||
$BUSYBOX_PATH/insmod $VTOY_PATH/modmnt/md/dm-mod.ko
|
||||
$BUSYBOX_PATH/umount $VTOY_PATH/modmnt
|
||||
|
||||
$BUSYBOX_PATH/rmmod cramfs
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
43
IMG/cpio/ventoy/hook/debian/mll-disk.sh
Normal file
43
IMG/cpio/ventoy/hook/debian/mll-disk.sh
Normal file
@@ -0,0 +1,43 @@
|
||||
#!/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
|
||||
|
||||
if is_ventoy_hook_finished; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
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"
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
||||
set_ventoy_hook_finish
|
21
IMG/cpio/ventoy/hook/debian/mll-hook.sh
Normal file
21
IMG/cpio/ventoy/hook/debian/mll-hook.sh
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/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/>.
|
||||
#
|
||||
#************************************************************************************
|
||||
|
||||
$SED "/^for DEVICE in/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/mll-disk.sh" -i /etc/02_overlay.sh
|
||||
|
@@ -47,7 +47,13 @@ ventoy_os_install_dmsetup() {
|
||||
if [ $LINTCNT -gt 1 ]; then
|
||||
vtlog "more than one pkgs, need to filter..."
|
||||
VER=$($BUSYBOX_PATH/uname -r)
|
||||
|
||||
LINE=$($GREP ' md-modules.*\.udeb' $VTOY_PATH/iso_file_list | $GREP $VER)
|
||||
LINTCNT=$($GREP ' md-modules.*\.udeb' $VTOY_PATH/iso_file_list | $GREP -c $VER)
|
||||
if [ $LINTCNT -gt 1 ]; then
|
||||
vtlog "Still more than one pkgs, use the first one..."
|
||||
LINE=$($GREP ' md-modules.*\.udeb' $VTOY_PATH/iso_file_list | $GREP -m1 $VER)
|
||||
fi
|
||||
fi
|
||||
install_udeb_from_line "$LINE" ${vt_usb_disk}
|
||||
fi
|
||||
|
@@ -35,6 +35,8 @@ ventoy_get_debian_distro() {
|
||||
else
|
||||
echo 'puppy'; return
|
||||
fi
|
||||
elif $GREP -m1 -q 'Minimal.*Linux.*Live' /init; then
|
||||
echo 'mll'; return
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@@ -22,3 +22,12 @@
|
||||
ventoy_systemd_udevd_work_around
|
||||
|
||||
ventoy_add_udev_rule "$VTOY_PATH/hook/default/udev_disk_hook.sh %k"
|
||||
|
||||
if [ -f /init ]; then
|
||||
vtSize=$($BUSYBOX_PATH/stat -c '%s' /init)
|
||||
if ! [ -L /init ]; then
|
||||
if [ $vtSize -eq 0 ]; then
|
||||
rm -f /init
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
41
IMG/cpio/ventoy/hook/dragora/disk_hook.sh
Normal file
41
IMG/cpio/ventoy/hook/dragora/disk_hook.sh
Normal file
@@ -0,0 +1,41 @@
|
||||
#!/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
|
||||
|
||||
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_extract_vtloopex ${vtdiskname}2 dragora
|
||||
vtLoopExDir=$VTOY_PATH/vtloopex/dragora/vtloopex
|
||||
$BUSYBOX_PATH/xz -d $vtLoopExDir/dm-mod/$(uname -r)/64/dm-mod.ko.xz
|
||||
$BUSYBOX_PATH/insmod $vtLoopExDir/dm-mod/$(uname -r)/64/dm-mod.ko
|
||||
|
||||
|
||||
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
|
||||
|
||||
PATH=$VTPATH_OLD
|
22
IMG/cpio/ventoy/hook/dragora/ventoy-hook.sh
Normal file
22
IMG/cpio/ventoy/hook/dragora/ventoy-hook.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/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
|
||||
|
||||
$SED "/iso9660/i $BUSYBOX_PATH/sh $VTOY_PATH/hook/dragora/disk_hook.sh" -i /init
|
27
IMG/cpio/ventoy/hook/lunar/ventoy-hook.sh
Normal file
27
IMG/cpio/ventoy/hook/lunar/ventoy-hook.sh
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/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
|
||||
|
||||
$SED "s#printf\(.*\)\$CMDLINE#printf\1\$CMDLINE root=/dev/dm-0#" -i /lib/dracut-lib.sh
|
||||
|
||||
$BUSYBOX_PATH/rm -f /usr/lib/systemd/system-generators/systemd-fstab-generator /lib/systemd/system-generators/systemd-fstab-generator
|
||||
|
||||
ventoy_set_inotify_script lunar/ventoy-inotifyd-hook.sh
|
||||
$BUSYBOX_PATH/cp -a $VTOY_PATH/hook/lunar/ventoy-inotifyd-start.sh /lib/dracut/hooks/pre-udev/01-ventoy-inotifyd-start.sh
|
45
IMG/cpio/ventoy/hook/lunar/ventoy-inotifyd-hook.sh
Normal file
45
IMG/cpio/ventoy/hook/lunar/ventoy-inotifyd-hook.sh
Normal file
@@ -0,0 +1,45 @@
|
||||
#!/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
|
||||
|
||||
if is_ventoy_hook_finished; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
|
||||
|
||||
if is_inotify_ventoy_part $3; then
|
||||
|
||||
vtlog "##### INOTIFYD: $2/$3 is created (YES) ..."
|
||||
|
||||
vtlog "find ventoy partition ..."
|
||||
$BUSYBOX_PATH/sh $VTOY_PATH/hook/default/udev_disk_hook.sh $3 noreplace
|
||||
|
||||
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})
|
||||
|
||||
mount -t iso9660 /dev/$vtDM /sysroot
|
||||
|
||||
set_ventoy_hook_finish
|
||||
else
|
||||
vtlog "##### INOTIFYD: $2/$3 is created (NO) ..."
|
||||
fi
|
||||
|
||||
PATH=$VTPATH_OLD
|
31
IMG/cpio/ventoy/hook/lunar/ventoy-inotifyd-start.sh
Normal file
31
IMG/cpio/ventoy/hook/lunar/ventoy-inotifyd-start.sh
Normal file
@@ -0,0 +1,31 @@
|
||||
#!/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
|
||||
|
||||
vtHook=$($CAT $VTOY_PATH/inotifyd-hook-script.txt)
|
||||
|
||||
vtdisk=$(get_ventoy_disk_name)
|
||||
if [ "$vtdisk" = "unknown" ]; then
|
||||
vtlog "... start inotifyd listen $vtHook ..."
|
||||
$BUSYBOX_PATH/nohup $VTOY_PATH/tool/inotifyd $vtHook /dev:n 2>&- &
|
||||
else
|
||||
vtlog "... $vtdisk already exist ..."
|
||||
$BUSYBOX_PATH/sh $vtHook n /dev "${vtdisk#/dev/}2"
|
||||
fi
|
34
IMG/cpio/ventoy/hook/photon/ventoy-hook.sh
Normal file
34
IMG/cpio/ventoy/hook/photon/ventoy-hook.sh
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/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
|
||||
|
||||
$SED 's#/dev/cdrom#/dev/ventoy#' -i /installer/isoInstaller.py
|
||||
|
||||
ventoy_set_inotify_script photon/ventoy-inotifyd-hook.sh
|
||||
|
||||
[ -d /dev ] || $BUSYBOX_PATH/mkdir /dev
|
||||
[ -d /sys ] || $BUSYBOX_PATH/mkdir /sys
|
||||
|
||||
$BUSYBOX_PATH/mount -t devtmpfs -o mode=0755,noexec,nosuid,strictatime devtmpfs /dev
|
||||
$BUSYBOX_PATH/mount -t sysfs sys /sys
|
||||
|
||||
$BUSYBOX_PATH/rm -f /init
|
||||
$BUSYBOX_PATH/sh $VTOY_PATH/hook/photon/ventoy-inotifyd-start.sh
|
||||
|
43
IMG/cpio/ventoy/hook/photon/ventoy-inotifyd-hook.sh
Normal file
43
IMG/cpio/ventoy/hook/photon/ventoy-inotifyd-hook.sh
Normal file
@@ -0,0 +1,43 @@
|
||||
#!/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
|
||||
|
||||
if is_ventoy_hook_finished; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
|
||||
|
||||
if is_inotify_ventoy_part $3; then
|
||||
|
||||
vtlog "##### INOTIFYD: $2/$3 is created (YES) ..."
|
||||
|
||||
vtlog "find ventoy partition ..."
|
||||
$BUSYBOX_PATH/sh $VTOY_PATH/hook/default/udev_disk_hook.sh $3 noreplace
|
||||
|
||||
blkdev_num=$($VTOY_PATH/tool/dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1 \2/')
|
||||
mknod -m 0660 /dev/ventoy b $blkdev_num
|
||||
|
||||
set_ventoy_hook_finish
|
||||
else
|
||||
vtlog "##### INOTIFYD: $2/$3 is created (NO) ..."
|
||||
fi
|
||||
|
||||
PATH=$VTPATH_OLD
|
31
IMG/cpio/ventoy/hook/photon/ventoy-inotifyd-start.sh
Normal file
31
IMG/cpio/ventoy/hook/photon/ventoy-inotifyd-start.sh
Normal file
@@ -0,0 +1,31 @@
|
||||
#!/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
|
||||
|
||||
vtHook=$($CAT $VTOY_PATH/inotifyd-hook-script.txt)
|
||||
|
||||
vtdisk=$(get_ventoy_disk_name)
|
||||
if [ "$vtdisk" = "unknown" ]; then
|
||||
vtlog "... start inotifyd listen $vtHook ..."
|
||||
$BUSYBOX_PATH/nohup $VTOY_PATH/tool/inotifyd $vtHook /dev:n 2>&- &
|
||||
else
|
||||
vtlog "... $vtdisk already exist ..."
|
||||
$BUSYBOX_PATH/sh $vtHook n /dev "${vtdisk#/dev/}2"
|
||||
fi
|
47
IMG/cpio/ventoy/hook/pisilinux/ventoy-disk.sh
Normal file
47
IMG/cpio/ventoy/hook/pisilinux/ventoy-disk.sh
Normal file
@@ -0,0 +1,47 @@
|
||||
#!/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
|
||||
|
||||
if is_ventoy_hook_finished; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
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=$(dmsetup ls | grep ventoy | sed 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1 \2/')
|
||||
mknod -m 660 /dev/ventoy b $blkdev_num
|
||||
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
||||
set_ventoy_hook_finish
|
24
IMG/cpio/ventoy/hook/pisilinux/ventoy-hook.sh
Normal file
24
IMG/cpio/ventoy/hook/pisilinux/ventoy-hook.sh
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/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
|
||||
|
||||
$SED "/^\"\$mount_handler\"/i\ $BUSYBOX_PATH/sh $VTOY_PATH/hook/pisilinux/ventoy-disk.sh" -i /init
|
||||
$SED "/^\"\$mount_handler\"/i\ export root=/dev/ventoy" -i /init
|
||||
|
38
IMG/cpio/ventoy/hook/ploplinux/disk_hook.sh
Normal file
38
IMG/cpio/ventoy/hook/ploplinux/disk_hook.sh
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/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
|
||||
|
||||
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/')
|
||||
mknod -m 0660 /dev/ventoy b $blkdev_num
|
||||
|
||||
PATH=$VTPATH_OLD
|
24
IMG/cpio/ventoy/hook/ploplinux/ventoy-hook.sh
Normal file
24
IMG/cpio/ventoy/hook/ploplinux/ventoy-hook.sh
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/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
|
||||
|
||||
$SED "/export *CMDLINE/i CMDLINE=\"root=/dev/ventoy \${CMDLINE}\"" -i /etc/rc.d/init.d/rc.S
|
||||
$SED "1a $BUSYBOX_PATH/sh $VTOY_PATH/hook/ploplinux/disk_hook.sh" -i /etc/rc.d/init.d/rootmount
|
||||
|
38
IMG/cpio/ventoy/hook/rancher/disk_hook.sh
Normal file
38
IMG/cpio/ventoy/hook/rancher/disk_hook.sh
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/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
|
||||
|
||||
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/')
|
||||
mknod -m 0660 /dev/ventoy b $blkdev_num
|
||||
|
||||
PATH=$VTPATH_OLD
|
21
IMG/cpio/ventoy/hook/rancher/ventoy-hook.sh
Normal file
21
IMG/cpio/ventoy/hook/rancher/ventoy-hook.sh
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/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
|
||||
|
35
IMG/cpio/ventoy/hook/slackware/disk_hook.sh
Normal file
35
IMG/cpio/ventoy/hook/slackware/disk_hook.sh
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/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
|
||||
|
||||
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"
|
||||
|
||||
PATH=$VTPATH_OLD
|
@@ -2,7 +2,11 @@
|
||||
|
||||
. $VTOY_PATH/hook/ventoy-os-lib.sh
|
||||
|
||||
ventoy_systemd_udevd_work_around
|
||||
if $GREP '^mediadetected=' /init; then
|
||||
$SED "/^mediadetected=/i $BUSYBOX_PATH/sh $VTOY_PATH/hook/slackware/disk_hook.sh" -i /init
|
||||
else
|
||||
ventoy_systemd_udevd_work_around
|
||||
ventoy_add_udev_rule "$VTOY_PATH/hook/slackware/udev_disk_hook.sh %k noreplace"
|
||||
fi
|
||||
|
||||
ventoy_add_udev_rule "$VTOY_PATH/hook/slackware/udev_disk_hook.sh %k noreplace"
|
||||
|
||||
|
42
IMG/cpio/ventoy/hook/smgl/disk_hook.sh
Normal file
42
IMG/cpio/ventoy/hook/smgl/disk_hook.sh
Normal file
@@ -0,0 +1,42 @@
|
||||
#!/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
|
||||
|
||||
VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
|
||||
|
||||
#exec /ventoy/busybox/sh
|
||||
|
||||
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/')
|
||||
mknod -m 660 /dev/ventoy b $blkdev_num
|
||||
|
||||
echo "/dev/ventoy" > cdrom.hint
|
||||
|
||||
PATH=$VTPATH_OLD
|
45
IMG/cpio/ventoy/hook/smgl/ventoy-hook.sh
Normal file
45
IMG/cpio/ventoy/hook/smgl/ventoy-hook.sh
Normal file
@@ -0,0 +1,45 @@
|
||||
#!/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
|
||||
|
||||
PATH=$PATH:$VTOY_PATH/busybox
|
||||
|
||||
mkdir /ventoy_rdroot
|
||||
|
||||
mknod -m 660 /ram0 b 1 0
|
||||
|
||||
dd if=/initrd001 of=/ram0
|
||||
rm -f /initrd001
|
||||
|
||||
mount /ram0 /ventoy_rdroot
|
||||
|
||||
vtSize=$(du -m -s $VTOY_PATH | awk '{print $1}')
|
||||
let vtSize=vtSize+4
|
||||
|
||||
mkdir -p /ventoy_rdroot/ventoy
|
||||
mount -t tmpfs -o size=${vtSize}m tmpfs /ventoy_rdroot/ventoy
|
||||
cp -a /ventoy/* /ventoy_rdroot/ventoy/
|
||||
|
||||
|
||||
cd /ventoy_rdroot
|
||||
|
||||
sed "/scan_cdroms *$/i $BUSYBOX_PATH/sh $VTOY_PATH/hook/smgl/disk_hook.sh" -i sbin/smgl.init
|
||||
|
||||
|
33
IMG/cpio/ventoy/hook/smoothwall/cd_list.sh
Normal file
33
IMG/cpio/ventoy/hook/smoothwall/cd_list.sh
Normal file
@@ -0,0 +1,33 @@
|
||||
#!/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
|
||||
|
||||
VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
|
||||
|
||||
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})
|
||||
vtSize=$(cat /sys/block/$vtDM/size)
|
||||
|
||||
cp -a /tmp/cd.list /tmp/cd_new.list
|
||||
echo "$vtDM $vtSize UNK_MODEL " > /tmp/cd.list
|
||||
cat /tmp/cd_new.list >> /tmp/cd.list
|
||||
rm -f /tmp/cd_new.list
|
||||
|
||||
PATH=$VTPATH_OLD
|
52
IMG/cpio/ventoy/hook/smoothwall/disk_hook.sh
Normal file
52
IMG/cpio/ventoy/hook/smoothwall/disk_hook.sh
Normal file
@@ -0,0 +1,52 @@
|
||||
#!/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
|
||||
|
||||
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/')
|
||||
vtDM=$(ventoy_find_dm_id ${blkdev_num})
|
||||
|
||||
if [ "$1" = "fakecdrom" ]; then
|
||||
if [ -e /dev/sr0 ]; then
|
||||
for i in 0 1 2 3 4 5 6 7 8; do
|
||||
if ! [ -e /dev/sr$i ]; then
|
||||
mv /dev/sr0 /dev/sr$i
|
||||
cp -a /dev/$vtDM /dev/sr0
|
||||
break
|
||||
fi
|
||||
done
|
||||
else
|
||||
cp -a /dev/$vtDM /dev/sr0
|
||||
fi
|
||||
fi
|
||||
|
||||
PATH=$VTPATH_OLD
|
25
IMG/cpio/ventoy/hook/smoothwall/ventoy-hook.sh
Normal file
25
IMG/cpio/ventoy/hook/smoothwall/ventoy-hook.sh
Normal file
@@ -0,0 +1,25 @@
|
||||
#!/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
|
||||
|
||||
$SED "/Running installer/i $BUSYBOX_PATH/sh $VTOY_PATH/hook/smoothwall/disk_hook.sh fakecdrom" -i /etc/install.rc
|
||||
|
||||
$SED "/cd \/sys\/block/a $BUSYBOX_PATH/sh $VTOY_PATH/hook/smoothwall/disk_hook.sh" -i /etc/config-install.rc
|
||||
$SED "/wc *-l *\/tmp\/cd.list/i $BUSYBOX_PATH/sh $VTOY_PATH/hook/smoothwall/cd_list.sh" -i /etc/config-install.rc
|
64
IMG/cpio/ventoy/hook/suse/disk_hook.sh
Normal file
64
IMG/cpio/ventoy/hook/suse/disk_hook.sh
Normal file
@@ -0,0 +1,64 @@
|
||||
#!/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
|
||||
|
||||
VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
|
||||
|
||||
|
||||
ventoy_os_install_dmsetup_by_fuse() {
|
||||
vtlog "ventoy_os_install_dmsetup_by_fuse $*"
|
||||
|
||||
mkdir -p $VTOY_PATH/mnt/fuse $VTOY_PATH/mnt/iso $VTOY_PATH/mnt/squashfs
|
||||
|
||||
vtoydm -p -f $VTOY_PATH/ventoy_image_map -d $1 > $VTOY_PATH/ventoy_dm_table
|
||||
vtoy_fuse_iso -f $VTOY_PATH/ventoy_dm_table -m $VTOY_PATH/mnt/fuse
|
||||
|
||||
mount -t iso9660 $VTOY_PATH/mnt/fuse/ventoy.iso $VTOY_PATH/mnt/iso
|
||||
|
||||
mount -t squashfs $VTOY_PATH/mnt/iso/system/squashfs_sys.img $VTOY_PATH/mnt/squashfs
|
||||
|
||||
KoName=$(ls $VTOY_PATH/mnt/squashfs/lib/modules/$2/kernel/drivers/md/dm-mod.ko*)
|
||||
vtlog "insmod $KoName"
|
||||
insmod $KoName
|
||||
|
||||
umount $VTOY_PATH/mnt/squashfs 2>>$VTLOG
|
||||
umount $VTOY_PATH/mnt/iso 2>>$VTLOG
|
||||
umount $VTOY_PATH/mnt/fuse 2>>$VTLOG
|
||||
}
|
||||
|
||||
|
||||
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
|
||||
|
||||
modprobe fuse
|
||||
ventoy_os_install_dmsetup_by_fuse $vtdiskname $(uname -r)
|
||||
|
||||
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/')
|
||||
mknod -m 0660 /dev/ventoy b $blkdev_num
|
||||
|
||||
PATH=$VTPATH_OLD
|
@@ -31,5 +31,14 @@ fi
|
||||
#echo "install: hd:/?device=/dev/mapper/ventoy" >> /info-ventoy
|
||||
#$SED "1 iinfo: file:/info-ventoy" -i /linuxrc.config
|
||||
|
||||
ventoy_systemd_udevd_work_around
|
||||
ventoy_add_udev_rule "$VTOY_PATH/hook/suse/udev_disk_hook.sh %k"
|
||||
if [ -e /etc/initrd.functions ] && $GREP -q 'HPIP' /etc/initrd.functions; then
|
||||
echo "HPIP" >> $VTLOG
|
||||
$BUSYBOX_PATH/mkdir /dev
|
||||
$BUSYBOX_PATH/mknod -m 660 /dev/console b 5 1
|
||||
$SED "/CD_DEVICES=/a $BUSYBOX_PATH/sh $VTOY_PATH/hook/suse/disk_hook.sh" -i /etc/initrd.functions
|
||||
$SED "/CD_DEVICES=/a CD_DEVICES=\"/dev/ventoy \$CD_DEVICES\"" -i /etc/initrd.functions
|
||||
else
|
||||
echo "SUSE" >> $VTLOG
|
||||
ventoy_systemd_udevd_work_around
|
||||
ventoy_add_udev_rule "$VTOY_PATH/hook/suse/udev_disk_hook.sh %k"
|
||||
fi
|
||||
|
47
IMG/cpio/ventoy/hook/t2/disk_hook.sh
Normal file
47
IMG/cpio/ventoy/hook/t2/disk_hook.sh
Normal file
@@ -0,0 +1,47 @@
|
||||
#!/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
|
||||
|
||||
if is_ventoy_hook_finished; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
|
||||
|
||||
modprobe dm-mod
|
||||
|
||||
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/')
|
||||
mknod -m 0660 /dev/ventoy b $blkdev_num
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
||||
set_ventoy_hook_finish
|
||||
|
24
IMG/cpio/ventoy/hook/t2/ventoy-hook.sh
Normal file
24
IMG/cpio/ventoy/hook/t2/ventoy-hook.sh
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/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
|
||||
|
||||
$SED "/getdevice *devicefile/i $BUSYBOX_PATH/sh $VTOY_PATH/hook/t2/disk_hook.sh" -i /init
|
||||
$SED "/getdevice *devicefile/a devicefile=/dev/ventoy" -i /init
|
||||
|
@@ -343,6 +343,37 @@ extract_file_from_line() {
|
||||
fi
|
||||
}
|
||||
|
||||
extract_rpm_from_line() {
|
||||
vtlog "extract_rpm_from_line $1 disk=#$2#"
|
||||
|
||||
if ! [ -b "$2" ]; then
|
||||
vterr "disk #$2# not exist"
|
||||
return
|
||||
fi
|
||||
|
||||
sector=$(echo $1 | $AWK '{print $(NF-1)}')
|
||||
length=$(echo $1 | $AWK '{print $NF}')
|
||||
vtlog "sector=$sector length=$length"
|
||||
|
||||
$VTOY_PATH/tool/vtoydm -e -f $VTOY_PATH/ventoy_image_map -d ${2} -s $sector -l $length -o /tmp/xxx.rpm
|
||||
if [ -e /tmp/xxx.rpm ]; then
|
||||
vtlog "extract rpm file from iso success"
|
||||
else
|
||||
vterr "extract rpm file from iso fail"
|
||||
return
|
||||
fi
|
||||
|
||||
CURPWD=$($BUSYBOX_PATH/pwd)
|
||||
|
||||
$BUSYBOX_PATH/mkdir -p $VTOY_PATH/rpm
|
||||
cd $VTOY_PATH/rpm
|
||||
vtlog "extract rpm..."
|
||||
$BUSYBOX_PATH/rpm2cpio /tmp/xxx.rpm | $BUSYBOX_PATH/cpio -idm 2>>$VTLOG
|
||||
cd $CURPWD
|
||||
|
||||
$BUSYBOX_PATH/rm -f /tmp/xxx.rpm
|
||||
}
|
||||
|
||||
install_rpm_from_line() {
|
||||
vtlog "install_rpm_from_line $1 disk=#$2#"
|
||||
|
||||
@@ -535,9 +566,9 @@ ventoy_swap_device() {
|
||||
ventoy_extract_vtloopex() {
|
||||
vtCurPwd=$PWD
|
||||
$BUSYBOX_PATH/mkdir -p $VTOY_PATH/partmnt $VTOY_PATH/vtloopex
|
||||
$BUSYBOX_PATH/mount -o ro -t vfat /dev/${vtdiskname#/dev/}2 $VTOY_PATH/partmnt
|
||||
$BUSYBOX_PATH/mount -o ro -t vfat $1 $VTOY_PATH/partmnt
|
||||
cd $VTOY_PATH/vtloopex
|
||||
$CAT $VTOY_PATH/partmnt/ventoy/vtloopex.cpio | $BUSYBOX_PATH/cpio -idm
|
||||
$CAT $VTOY_PATH/partmnt/ventoy/vtloopex.cpio | $BUSYBOX_PATH/cpio -idm >> $VTLOG 2>&1
|
||||
$BUSYBOX_PATH/umount $VTOY_PATH/partmnt
|
||||
$BUSYBOX_PATH/rm -rf $VTOY_PATH/partmnt
|
||||
|
||||
|
@@ -19,21 +19,20 @@
|
||||
|
||||
. /ventoy/hook/ventoy-hook-lib.sh
|
||||
|
||||
while [ -n "1" ]; do
|
||||
if [ -e /dev/null ]; then
|
||||
break
|
||||
else
|
||||
$SLEEP 0.5
|
||||
fi
|
||||
done
|
||||
vine_wait_for_exist() {
|
||||
while [ -n "1" ]; do
|
||||
if [ -e $1 ]; then
|
||||
break
|
||||
else
|
||||
$SLEEP 0.5
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
vine_wait_for_exist /dev/null
|
||||
vine_wait_for_exist /sys/block
|
||||
vine_wait_for_exist /proc/ide
|
||||
|
||||
while [ -n "1" ]; do
|
||||
if [ -e /sys/block ]; then
|
||||
break
|
||||
else
|
||||
$SLEEP 0.5
|
||||
fi
|
||||
done
|
||||
|
||||
while [ -n "Y" ]; do
|
||||
vtdiskname=$(get_ventoy_disk_name)
|
||||
@@ -51,13 +50,14 @@ if ! [ -b $vtdiskname ]; then
|
||||
$BUSYBOX_PATH/mknod -m 0660 $vtdiskname b $blkdev
|
||||
fi
|
||||
|
||||
if ! [ -b "${vtdiskname}1" ]; then
|
||||
blkdev=$($CAT /sys/class/block/${vtshortdev}1/dev | $SED 's/:/ /g')
|
||||
$BUSYBOX_PATH/mknod -m 0660 "${vtdiskname}1" b $blkdev
|
||||
fi
|
||||
|
||||
if ! [ -b "${vtdiskname}2" ]; then
|
||||
blkdev=$($CAT /sys/class/block/${vtshortdev}2/dev | $SED 's/:/ /g')
|
||||
$BUSYBOX_PATH/mknod -m 0660 "${vtdiskname}2" b $blkdev
|
||||
fi
|
||||
|
||||
$BUSYBOX_PATH/ls /dev/ > /dev/console
|
||||
|
||||
$BUSYBOX_PATH/sh $VTOY_PATH/hook/vine/udev_disk_hook.sh "${vtdiskname#/dev/}2"
|
||||
|
||||
|
||||
|
@@ -19,10 +19,27 @@
|
||||
|
||||
. /ventoy/hook/ventoy-hook-lib.sh
|
||||
|
||||
vtCheatLoop=loop6
|
||||
ventoy_os_install_dmsetup_by_ko() {
|
||||
vtlog "ventoy_os_install_dmsetup_by_ko $1"
|
||||
|
||||
vtVer=$($BUSYBOX_PATH/uname -r)
|
||||
if $BUSYBOX_PATH/uname -m | $GREP -q 64; then
|
||||
vtBit=64
|
||||
else
|
||||
vtBit=32
|
||||
fi
|
||||
|
||||
ventoy_extract_vtloopex $1 vine
|
||||
vtLoopExDir=$VTOY_PATH/vtloopex/vine/vtloopex
|
||||
|
||||
if [ -e $vtLoopExDir/dm-mod/$vtVer/$vtBit/dm-mod.ko.xz ]; then
|
||||
$BUSYBOX_PATH/xz -d $vtLoopExDir/dm-mod/$vtVer/$vtBit/dm-mod.ko.xz
|
||||
insmod $vtLoopExDir/dm-mod/$vtVer/$vtBit/dm-mod.ko
|
||||
fi
|
||||
}
|
||||
|
||||
ventoy_os_install_dmsetup() {
|
||||
vtlog "ventoy_os_install_dmsetup $1"
|
||||
ventoy_os_install_dmsetup_by_rpm() {
|
||||
vtlog "ventoy_os_install_dmsetup_by_rpm $1"
|
||||
|
||||
vt_usb_disk=$1
|
||||
|
||||
@@ -32,48 +49,47 @@ ventoy_os_install_dmsetup() {
|
||||
# install dmsetup
|
||||
LINE=$($GREP 'kernel-[0-9].*\.rpm' $VTOY_PATH/iso_file_list)
|
||||
if [ $? -eq 0 ]; then
|
||||
install_rpm_from_line "$LINE" ${vt_usb_disk}
|
||||
extract_rpm_from_line "$LINE" ${vt_usb_disk}
|
||||
fi
|
||||
|
||||
$BUSYBOX_PATH/modprobe dm-mod
|
||||
vtKoName=$($BUSYBOX_PATH/find $VTOY_PATH/rpm/ -name dm-mod.ko*)
|
||||
vtlog "vtKoName=$vtKoName"
|
||||
|
||||
vtlog "dmsetup install finish, now check it..."
|
||||
insmod $vtKoName
|
||||
|
||||
dmsetup_path=/ventoy/tool/dmsetup
|
||||
if [ -z "$dmsetup_path" ]; then
|
||||
vterr "dmsetup still not found after install"
|
||||
elif $dmsetup_path info >> $VTLOG 2>&1; then
|
||||
vtlog "$dmsetup_path work ok"
|
||||
else
|
||||
vterr "$dmsetup_path not work"
|
||||
fi
|
||||
$BUSYBOX_PATH/rm -rf $VTOY_PATH/rpm/
|
||||
}
|
||||
|
||||
|
||||
if is_ventoy_hook_finished || not_ventoy_disk "${1:0:-1}"; then
|
||||
# /dev/vtCheatLoop come first
|
||||
if [ "$1" = "$vtCheatLoop" ] && [ -b $VTOY_DM_PATH ]; then
|
||||
ventoy_copy_device_mapper /dev/$vtCheatLoop
|
||||
fi
|
||||
if is_ventoy_hook_finished || not_ventoy_disk "${1:0:-1}"; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
ventoy_os_install_dmsetup "/dev/${1:0:-1}"
|
||||
ventoy_os_install_dmsetup_by_ko "/dev/$1"
|
||||
if $GREP -q 'device.mapper' /proc/devices; then
|
||||
vtlog "device-mapper module install OK"
|
||||
else
|
||||
ventoy_os_install_dmsetup_by_rpm "/dev/${1:0:-1}"
|
||||
fi
|
||||
|
||||
ventoy_udev_disk_common_hook $* "noreplace"
|
||||
ventoy_udev_disk_common_hook $*
|
||||
|
||||
$BUSYBOX_PATH/mount $VTOY_DM_PATH /mnt/ventoy
|
||||
blkdev_num=$($VTOY_PATH/tool/dmsetup ls | $GREP ventoy | $SED 's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/')
|
||||
blkdev_num_dev=$($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})
|
||||
|
||||
#
|
||||
# We do a trick for rhel6 series here.
|
||||
# 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/$vtCheatLoop
|
||||
[ -b /dev/$vtDM ] || $BUSYBOX_PATH/mknod -m 0660 /dev/$vtDM b $blkdev_num_dev
|
||||
$BUSYBOX_PATH/rm -rf /dev/mapper
|
||||
|
||||
#Create a fake IDE-CDROM driver can't be ide-scsi /proc has been patched to /vtoy
|
||||
$BUSYBOX_PATH/mkdir -p /vtoy
|
||||
$BUSYBOX_PATH/cp -a /proc/ide /vtoy/
|
||||
$BUSYBOX_PATH/mkdir -p /vtoy/ide/aztcd
|
||||
|
||||
echo 'ide' > /vtoy/ide/aztcd/driver
|
||||
echo 'cdrom' > /vtoy/ide/aztcd/media
|
||||
|
||||
$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
|
||||
|
||||
exit 0
|
||||
|
@@ -19,10 +19,8 @@
|
||||
|
||||
. $VTOY_PATH/hook/ventoy-os-lib.sh
|
||||
|
||||
$BUSYBOX_PATH/mkdir -p /etc/anaconda.repos.d /mnt/ventoy
|
||||
ventoy_print_yum_repo "ventoy" "file:///mnt/ventoy" > /etc/anaconda.repos.d/ventoy.repo
|
||||
|
||||
$BUSYBOX_PATH/cp -a /sbin/loader /sbin/loader_bk
|
||||
$VTOY_PATH/tool/vine_patch_loader /sbin/loader 253 -v >> $VTLOG
|
||||
|
||||
$BUSYBOX_PATH/mknod -m 0660 /dev/null c 1 3
|
||||
$VTOY_PATH/hook/vine/dev-listen.sh &
|
||||
|
||||
|
48
IMG/cpio/ventoy/hook/wifislax/disk_hook.sh
Normal file
48
IMG/cpio/ventoy/hook/wifislax/disk_hook.sh
Normal file
@@ -0,0 +1,48 @@
|
||||
#!/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
|
||||
|
||||
VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
|
||||
|
||||
vtlog "##### $0 $* #####"
|
||||
|
||||
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"
|
||||
|
||||
while true; do
|
||||
if blkid | grep -q '/dev/dm'; then
|
||||
vtlog 'Find /dev/dm ...'
|
||||
break
|
||||
else
|
||||
vtlog 'Wait /dev/dm ...'
|
||||
sleep 0.3
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
PATH=$VTPATH_OLD
|
26
IMG/cpio/ventoy/hook/wifislax/ventoy-hook.sh
Normal file
26
IMG/cpio/ventoy/hook/wifislax/ventoy-hook.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
|
||||
|
||||
$SED "/mount.*devtmpfs/a $BUSYBOX_PATH/sh $VTOY_PATH/hook/wifislax/disk_hook.sh" -i /linuxrc
|
||||
|
||||
#replace original blkid
|
||||
$BUSYBOX_PATH/rm -f /usr/bin/blkid
|
||||
$BUSYBOX_PATH/cp -a $BUSYBOX_PATH/blkid /usr/bin/blkid
|
@@ -37,9 +37,11 @@ else
|
||||
fi
|
||||
|
||||
ventoy_is_initrd_ramdisk() {
|
||||
#As I known, PCLinuxOS use ramdisk
|
||||
#As I known, PCLinuxOS/smgl use ramdisk
|
||||
if echo $vtkerver | grep -i -q 'PCLinuxOS'; then
|
||||
true
|
||||
elif echo $vtkerver | grep -i -q 'SMGL-'; then
|
||||
true
|
||||
else
|
||||
false
|
||||
fi
|
||||
@@ -68,7 +70,7 @@ ventoy_unpack_initramfs() {
|
||||
return
|
||||
fi
|
||||
|
||||
for vtx in '1F8B zcat' '1F9E zcat' '425A bzcat' '5D00 lzcat' 'FD37 xzcat' '894C lzopcat' '0221 lz4cat' '28B5 zstdcat' '3037 cat'; do
|
||||
for vtx in '1F8B zcat' '1F9E zcat' '425A bzcat' '5D00 lzcat' 'FD37 xzcat' '894C lzopcat' '0221 lz4cat' '28B5 zstdcat' '3037 cat' '4C5A lunzip -c'; do
|
||||
if [ "${vtx:0:4}" = "${vtmagic:0:4}" ]; then
|
||||
echo "vtx=$vtx" >> $VTLOG
|
||||
if [ $vtskip -eq 0 ]; then
|
||||
|
62
IMG/cpio/ventoy/loop/LibreELEC/ventoy-disk.sh
Normal file
62
IMG/cpio/ventoy/loop/LibreELEC/ventoy-disk.sh
Normal file
@@ -0,0 +1,62 @@
|
||||
#!/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
|
||||
|
||||
if is_ventoy_hook_finished; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
vtlog "####### $0 $* ########"
|
||||
|
||||
VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
|
||||
|
||||
vtKerVer=$(uname -r)
|
||||
if uname -m | grep -q 64; then
|
||||
vtBit=64
|
||||
else
|
||||
vtBit=32
|
||||
fi
|
||||
|
||||
xz -d $VTOY_PATH/vtloopex/dm-mod/$vtKerVer/$vtBit/dm-mod.ko.xz
|
||||
insmod $VTOY_PATH/vtloopex/dm-mod/$vtKerVer/$vtBit/dm-mod.ko
|
||||
|
||||
|
||||
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"
|
||||
|
||||
ventoy_create_dev_ventoy_part
|
||||
|
||||
mkdir /ventoy/mnt
|
||||
mount /dev/ventoy2 /ventoy/mnt
|
||||
rm -f /ventoy/mnt/.please_resize_me
|
||||
sync
|
||||
umount /ventoy/mnt
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
||||
set_ventoy_hook_finish
|
23
IMG/cpio/ventoy/loop/LibreELEC/ventoy-hook.sh
Normal file
23
IMG/cpio/ventoy/loop/LibreELEC/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
|
||||
|
||||
$SED "/mount_flash.*{/a\ $BUSYBOX_PATH/sh $VTOY_PATH/loop/LibreELEC/ventoy-disk.sh" -i /init
|
||||
|
45
IMG/cpio/ventoy/loop/batocera/ventoy-disk.sh
Normal file
45
IMG/cpio/ventoy/loop/batocera/ventoy-disk.sh
Normal file
@@ -0,0 +1,45 @@
|
||||
#!/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
|
||||
|
||||
if is_ventoy_hook_finished; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
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"
|
||||
|
||||
ventoy_create_dev_ventoy_part
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
||||
set_ventoy_hook_finish
|
23
IMG/cpio/ventoy/loop/batocera/ventoy-hook.sh
Normal file
23
IMG/cpio/ventoy/loop/batocera/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
|
||||
|
||||
$SED "/mount.*devtmpfs/a\ $BUSYBOX_PATH/sh $VTOY_PATH/loop/batocera/ventoy-disk.sh" -i /init
|
||||
|
47
IMG/cpio/ventoy/loop/freedombox/ventoy-disk.sh
Normal file
47
IMG/cpio/ventoy/loop/freedombox/ventoy-disk.sh
Normal file
@@ -0,0 +1,47 @@
|
||||
#!/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
|
||||
|
||||
if is_ventoy_hook_finished; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
vtlog "####### $0 $* ########"
|
||||
|
||||
VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
|
||||
|
||||
insmod $VTOY_PATH/modules/dm-mod.ko
|
||||
|
||||
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"
|
||||
|
||||
ventoy_create_dev_ventoy_part
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
||||
set_ventoy_hook_finish
|
22
IMG/cpio/ventoy/loop/freedombox/ventoy-hook.sh
Normal file
22
IMG/cpio/ventoy/loop/freedombox/ventoy-hook.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/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
|
||||
|
||||
$SED "/local_mount_root *$/i $BUSYBOX_PATH/sh $VTOY_PATH/loop/freedombox/ventoy-disk.sh" -i /scripts/local
|
62
IMG/cpio/ventoy/loop/lakka/ventoy-disk.sh
Normal file
62
IMG/cpio/ventoy/loop/lakka/ventoy-disk.sh
Normal file
@@ -0,0 +1,62 @@
|
||||
#!/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
|
||||
|
||||
if is_ventoy_hook_finished; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
vtlog "####### $0 $* ########"
|
||||
|
||||
VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
|
||||
|
||||
vtKerVer=$(uname -r)
|
||||
if uname -m | grep -q 64; then
|
||||
vtBit=64
|
||||
else
|
||||
vtBit=32
|
||||
fi
|
||||
|
||||
xz -d $VTOY_PATH/vtloopex/dm-mod/$vtKerVer/$vtBit/dm-mod.ko.xz
|
||||
insmod $VTOY_PATH/vtloopex/dm-mod/$vtKerVer/$vtBit/dm-mod.ko
|
||||
|
||||
|
||||
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"
|
||||
|
||||
ventoy_create_dev_ventoy_part
|
||||
|
||||
mkdir /ventoy/mnt
|
||||
mount /dev/ventoy2 /ventoy/mnt
|
||||
rm -f /ventoy/mnt/.please_resize_me
|
||||
sync
|
||||
umount /ventoy/mnt
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
||||
set_ventoy_hook_finish
|
23
IMG/cpio/ventoy/loop/lakka/ventoy-hook.sh
Normal file
23
IMG/cpio/ventoy/loop/lakka/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
|
||||
|
||||
$SED "/mount_flash.*{/a\ $BUSYBOX_PATH/sh $VTOY_PATH/loop/lakka/ventoy-disk.sh" -i /init
|
||||
|
47
IMG/cpio/ventoy/loop/paldo/ventoy-disk.sh
Normal file
47
IMG/cpio/ventoy/loop/paldo/ventoy-disk.sh
Normal file
@@ -0,0 +1,47 @@
|
||||
#!/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
|
||||
|
||||
if is_ventoy_hook_finished; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
vtlog "####### $0 $* ########"
|
||||
|
||||
VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
|
||||
|
||||
modprobe dm-mod
|
||||
|
||||
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"
|
||||
|
||||
ventoy_create_dev_ventoy_part
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
||||
set_ventoy_hook_finish
|
22
IMG/cpio/ventoy/loop/paldo/ventoy-hook.sh
Normal file
22
IMG/cpio/ventoy/loop/paldo/ventoy-hook.sh
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/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
|
||||
|
||||
$SED "/for *dev *in .*root/i $BUSYBOX_PATH/sh $VTOY_PATH/loop/paldo/ventoy-disk.sh" -i /init
|
45
IMG/cpio/ventoy/loop/recalbox/ventoy-disk.sh
Normal file
45
IMG/cpio/ventoy/loop/recalbox/ventoy-disk.sh
Normal file
@@ -0,0 +1,45 @@
|
||||
#!/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
|
||||
|
||||
if is_ventoy_hook_finished; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
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"
|
||||
|
||||
ventoy_create_dev_ventoy_part
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
||||
set_ventoy_hook_finish
|
23
IMG/cpio/ventoy/loop/recalbox/ventoy-hook.sh
Normal file
23
IMG/cpio/ventoy/loop/recalbox/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
|
||||
|
||||
$SED "/mount.*devtmpfs/a\ $BUSYBOX_PATH/sh $VTOY_PATH/loop/recalbox/ventoy-disk.sh" -i /init
|
||||
|
26
IMG/cpio/ventoy/loop/ubos/newroot-hook.sh
Normal file
26
IMG/cpio/ventoy/loop/ubos/newroot-hook.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/>.
|
||||
#
|
||||
#************************************************************************************
|
||||
|
||||
. /ventoy/hook/ventoy-hook-lib.sh
|
||||
|
||||
VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
|
||||
|
||||
sed "/.* \/boot /d" -i /new_root/etc/fstab
|
||||
|
||||
PATH=$VTPATH_OLD
|
48
IMG/cpio/ventoy/loop/ubos/ventoy-disk.sh
Normal file
48
IMG/cpio/ventoy/loop/ubos/ventoy-disk.sh
Normal file
@@ -0,0 +1,48 @@
|
||||
#!/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
|
||||
|
||||
if is_ventoy_hook_finished; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
vtlog "####### $0 $* ########"
|
||||
|
||||
VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
|
||||
|
||||
xz -d $VTOY_PATH/modules/dm-mod.ko.xz
|
||||
insmod $VTOY_PATH/modules/dm-mod.ko
|
||||
|
||||
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"
|
||||
|
||||
ventoy_create_dev_ventoy_part
|
||||
|
||||
PATH=$VTPATH_OLD
|
||||
|
||||
set_ventoy_hook_finish
|
30
IMG/cpio/ventoy/loop/ubos/ventoy-hook.sh
Normal file
30
IMG/cpio/ventoy/loop/ubos/ventoy-hook.sh
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/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/cp -a $VTOY_PATH/hook/default/10-dm.rules /lib/udev/rules.d/
|
||||
$BUSYBOX_PATH/cp -a $VTOY_PATH/hook/default/13-dm-disk.rules /lib/udev/rules.d/
|
||||
|
||||
$SED "/^\"\$mount_handler\"/i\ $BUSYBOX_PATH/sh $VTOY_PATH/loop/ubos/ventoy-disk.sh" -i /init
|
||||
|
||||
$SED "/^\"\$mount_handler\"/a\ $BUSYBOX_PATH/sh $VTOY_PATH/loop/ubos/newroot-hook.sh" -i /init
|
||||
|
||||
$SED "/^\"\$mount_handler\"/a\ init=/usr/lib/systemd/systemd" -i /init
|
||||
|
@@ -53,6 +53,7 @@ else
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if $VTOY_PATH/tool/unsquashfs_64 -t 2>>$VTLOG; then
|
||||
echo "use unsquashfs_64" >>$VTLOG
|
||||
$BUSYBOX_PATH/cp -a $VTOY_PATH/tool/unsquashfs_64 $VTOY_PATH/tool/vtoy_unsquashfs
|
||||
|
@@ -249,6 +249,58 @@ ventoy_get_os_type() {
|
||||
echo 'crux'; return
|
||||
fi
|
||||
|
||||
if [ -f /init ]; then
|
||||
if $GREP -q 'AryaLinux' /init; then
|
||||
echo 'aryalinux'; return
|
||||
elif $GREP -q 'Dragora' /init; then
|
||||
echo 'dragora'; return
|
||||
|
||||
fi
|
||||
fi
|
||||
|
||||
if $GREP -q 'slackware' /proc/version; then
|
||||
echo 'slackware'; return
|
||||
fi
|
||||
|
||||
if $BUSYBOX_PATH/hostname | $GREP -q 'smoothwall'; then
|
||||
echo 'smoothwall'; return
|
||||
fi
|
||||
|
||||
if $GREP -q 'photon' /proc/version; then
|
||||
echo 'photon'; return
|
||||
fi
|
||||
|
||||
if $GREP -q 'ploplinux' /proc/version; then
|
||||
echo 'ploplinux'; return
|
||||
fi
|
||||
|
||||
if $GREP -q 'lunar' /proc/version; then
|
||||
echo 'lunar'; return
|
||||
fi
|
||||
|
||||
if $GREP -q 'SMGL-' /proc/version; then
|
||||
echo 'smgl'; return
|
||||
fi
|
||||
|
||||
if $GREP -q 'rancher' /proc/version; then
|
||||
echo 'rancher'; return
|
||||
fi
|
||||
|
||||
|
||||
if [ -e /init ]; then
|
||||
if $GREP -q -m1 'T2 SDE' /init; then
|
||||
echo 't2'; return
|
||||
fi
|
||||
fi
|
||||
|
||||
if $GREP -q 'wifislax' /proc/version; then
|
||||
echo 'wifislax'; return
|
||||
fi
|
||||
|
||||
if $GREP -q 'pisilinux' /proc/version; then
|
||||
echo 'pisilinux'; return
|
||||
fi
|
||||
|
||||
echo "default"
|
||||
}
|
||||
|
||||
|
@@ -92,6 +92,10 @@ ventoy_get_os_type() {
|
||||
fi
|
||||
fi
|
||||
|
||||
if $GREP -q 'ventoyos=' /proc/cmdline; then
|
||||
$SED "s/.*ventoyos=\([a-zA-Z0-9_-]*\).*/\1/" /proc/cmdline; return
|
||||
fi
|
||||
|
||||
echo "default"
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user