]> glassweightruler.freedombox.rocks Git - Ventoy.git/blobdiff - IMG/cpio/ventoy/hook/ventoy-os-lib.sh
Update languages.json (#1174)
[Ventoy.git] / IMG / cpio / ventoy / hook / ventoy-os-lib.sh
index 0be5a0a75ad0947495fca5e5dda0b849eca2b318..dbd015f877e91228d2f636e9c1587e77448fc054 100644 (file)
@@ -80,14 +80,19 @@ ventoy_add_udev_rule() {
 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=869719
 #
 ventoy_systemd_udevd_work_around() {
-    VTSYSTEMUDEV="$VT_RULE_DIR_PREFIX/lib/systemd/system/systemd-udevd.service"
-    if [ -e $VTSYSTEMUDEV ]; then
-        if $GREP -q 'SystemCallArchitectures.*native' $VTSYSTEMUDEV; then
-            $SED "s/.*\(SystemCallArchitectures.*native\)/#\1/g"  -i $VTSYSTEMUDEV
+    for vtdir in 'lib' 'usr/lib'; do
+    
+        VTSYSTEMUDEV="$VT_RULE_DIR_PREFIX/$vtdir/systemd/system/systemd-udevd.service"
+        if [ -e $VTSYSTEMUDEV ]; then
+            if $GREP -q 'SystemCallArchitectures.*native' $VTSYSTEMUDEV; then
+                $SED "s/.*\(SystemCallArchitectures.*native\)/#\1/g"  -i $VTSYSTEMUDEV
+                break
+            fi
         fi
-    fi
+    done
 }
 
+
 ventoy_print_yum_repo() {
     echo "[$1]"
     echo "name=$1"
@@ -96,3 +101,23 @@ ventoy_print_yum_repo() {
     echo "gpgcheck=0"
     echo "priority=0"
 }
+
+ventoy_set_inotify_script() {
+    echo $VTOY_PATH/hook/$1 > $VTOY_PATH/inotifyd-hook-script.txt
+}
+
+ventoy_set_loop_inotify_script() {
+    echo $VTOY_PATH/loop/$1 > $VTOY_PATH/inotifyd-loop-script.txt
+}
+
+ventoy_check_insmod() {
+    if [ -e $1 ]; then
+        $BUSYBOX_PATH/insmod $1
+    fi
+}
+
+ventoy_check_mount() {
+    if [ -e $1 ]; then
+        $BUSYBOX_PATH/mount $1 $2
+    fi
+}