1. Fix a bug about source media missing when boot CentOS8

2. Support RED OS
This commit is contained in:
longpanda 2021-04-12 18:56:26 +08:00
parent e71221cdba
commit 37212a8ea4
3 changed files with 45 additions and 8 deletions

View File

@ -85,6 +85,20 @@ fi
$BUSYBOX_PATH/cp -a $VTOY_PATH/hook/rhel7/ventoy-inotifyd-start.sh /lib/dracut/hooks/pre-udev/${vtPriority}-ventoy-inotifyd-start.sh
$BUSYBOX_PATH/cp -a $VTOY_PATH/hook/rhel7/ventoy-timeout.sh /lib/dracut/hooks/initqueue/timeout/${vtPriority}-ventoy-timeout.sh
vtNeedRepo=
if [ -f /etc/system-release ]; then
if $GREP -q 'RED OS' /etc/system-release ]; then
vtNeedRepo="yes"
fi
fi
if $GREP -q el8 /proc/version; then
vtNeedRepo="yes"
fi
if [ "$vtNeedRepo" = "yes" ]; then
$BUSYBOX_PATH/cp -a $VTOY_PATH/hook/rhel7/ventoy-repo.sh /lib/dracut/hooks/pre-pivot/99-ventoy-repo.sh
fi
if [ -e /sbin/dmsquash-live-root ]; then
echo "patch /sbin/dmsquash-live-root ..." >> $VTLOG
$SED "1 a $BUSYBOX_PATH/sh $VTOY_PATH/hook/rhel7/ventoy-make-link.sh" -i /sbin/dmsquash-live-root

View File

@ -41,14 +41,8 @@ if is_inotify_ventoy_part $3; then
vtlog "find ventoy partition ..."
vtReplaceOpt=noreplace
if $GREP -q el8 /proc/version && [ -f /etc/system-release ]; then
vtRhel8Ver=$($SED "s#.*8\.\([0-9]*\).*#\1#" /etc/system-release)
if [ $vtRhel8Ver -ge 3 ]; then
vtReplaceOpt=""
elif $GREP -q "Stream" /etc/system-release; then
vtReplaceOpt=""
fi
if [ -f /lib/dracut/hooks/pre-pivot/99-ventoy-repo.sh ]; then
vtReplaceOpt=""
fi
$BUSYBOX_PATH/sh $VTOY_PATH/hook/default/udev_disk_hook.sh $3 $vtReplaceOpt

View File

@ -0,0 +1,29 @@
#!/ventoy/busybox/sh
#************************************************************************************
# Copyright (c) 2020, longpanda <admin@ventoy.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
#************************************************************************************
. /ventoy/hook/ventoy-hook-lib.sh
vtlog "##### $0 $* ..."
VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
repodev=$(ls $VTOY_PATH/dev_backup*)
echo "inst.repo=hd:/dev/${repodev#*dev_backup_}" >> /sysroot/etc/cmdline
PATH=$VTPATH_OLD