]> glassweightruler.freedombox.rocks Git - Ventoy.git/commitdiff
1. Fix a bug about source media missing when boot CentOS8
authorlongpanda <admin@ventoy.net>
Mon, 12 Apr 2021 10:56:26 +0000 (18:56 +0800)
committerlongpanda <admin@ventoy.net>
Mon, 12 Apr 2021 10:56:26 +0000 (18:56 +0800)
2. Support RED OS

IMG/cpio/ventoy/hook/rhel7/ventoy-hook.sh
IMG/cpio/ventoy/hook/rhel7/ventoy-inotifyd-hook.sh
IMG/cpio/ventoy/hook/rhel7/ventoy-repo.sh [new file with mode: 0644]

index d3d7ab8175b6c3784b85dc38b1a502c17d48b8a1..5e57ec25039c464413fdbb6b8097e1ec443e7c93 100644 (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
index 4058840bdb3fd2eb21a5ea9351c5114420363396..4a2435e1d6bdfd43ce425f12d25ec86c1b22e339 100644 (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
diff --git a/IMG/cpio/ventoy/hook/rhel7/ventoy-repo.sh b/IMG/cpio/ventoy/hook/rhel7/ventoy-repo.sh
new file mode 100644 (file)
index 0000000..af85beb
--- /dev/null
@@ -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