Add support for some EulerOS release.

This commit is contained in:
longpanda
2026-07-24 11:52:45 +08:00
parent 0963c1d396
commit ac300d7464
4 changed files with 78 additions and 1 deletions

View File

@@ -0,0 +1,24 @@
#!/ventoy/busybox/sh
. /ventoy/hook/ventoy-hook-lib.sh
vtlog "######### $0 $* ############"
if is_ventoy_hook_finished; then
exit 0
fi
wait_for_usb_disk_ready
vtdiskname=$(get_ventoy_disk_name)
if [ "$vtdiskname" = "unknown" ]; then
vtlog "ventoy disk not found"
exit 0
fi
vtlog "vtdiskname=$vtdiskname"
ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" "noreplace"
# OK finish
set_ventoy_hook_finish

View File

@@ -0,0 +1,7 @@
function ft_mountCdromDir()
{
/ventoy/busybox/sh /ventoy/hook/euleros/disk_mount_hook.sh
ft_mountCdromDirXX "$@"
}

View 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/>.
#
#************************************************************************************
. $VTOY_PATH/hook/ventoy-os-lib.sh
TRANSFILE=/usr/Euler/project/load/filetransfer.sh
LINE=$($GREP -n 'function ft_mountCdromDir' $TRANSFILE | $AWK -F':' '{print $1}')
echo "LINE=$LINE" >> $VTLOG
$SED 's#FT_SR_DEV=.*#FT_SR_DEV=/dev/mapper/ventoy#g' -i $TRANSFILE
$SED 's/function ft_mountCdromDir/function ft_mountCdromDirXX/' -i $TRANSFILE
let LINE--
$SED -n "1,${LINE}p" $TRANSFILE >> /ventoy/filetransfer.sh
$CAT $VTOY_PATH/hook/euleros/hook_func.sh >> /ventoy/filetransfer.sh
let LINE++
$SED -n "${LINE},\$p" $TRANSFILE >> /ventoy/filetransfer.sh
$BUSYBOX_PATH/mv /ventoy/filetransfer.sh $TRANSFILE
#fix the euler os shell script
$SED 's/-z ${harddisk_disk_list}/-z "${harddisk_disk_list}"/' -i /usr/Euler/project/disk/disk_tool.sh

View File

@@ -100,7 +100,11 @@ ventoy_get_os_type() {
echo 'rhel7'; return echo 'rhel7'; return
elif $GREP -q 'euleros' /proc/version; then elif $GREP -q 'euleros' /proc/version; then
if [ -d /usr/Euler/project/init ]; then
echo 'euleros'; return
else
echo 'rhel7'; return echo 'rhel7'; return
fi
# SUSE # SUSE
elif $GREP -q 'SUSE' /proc/version; then elif $GREP -q 'SUSE' /proc/version; then