]> glassweightruler.freedombox.rocks Git - Ventoy.git/blobdiff - IMG/cpio/ventoy/ventoy_loop.sh
Add LiveCD binaries
[Ventoy.git] / IMG / cpio / ventoy / ventoy_loop.sh
index bbb7c25977807a07afec7f20ef5134322119e743..c6f12dfca59d9d71b179603445e08c9137bfa52d 100644 (file)
@@ -37,10 +37,30 @@ for i in $vtcmdline; do
     fi
 done
 
+####################################################################
+#                                                                  #
+# Step 2 : Process ko                                              #
+#                                                                  #
+####################################################################
+$BUSYBOX_PATH/mkdir -p /ventoy/modules
+$BUSYBOX_PATH/ls -1a / | $EGREP '\.ko$|\.ko.[gx]z$' | while read vtline; do
+    if [ "${vtline:0:1}" = "." ]; then
+        $BUSYBOX_PATH/mv /${vtline} /ventoy/modules/${vtline:1}
+    else
+        $BUSYBOX_PATH/mv /${vtline} /ventoy/modules/
+    fi
+done
+
+if [ -e /vtloopex.tar.xz ]; then
+    echo "extract vtloopex ..." >> $VTLOG
+    $BUSYBOX_PATH/tar -xJf /vtloopex.tar.xz -C $VTOY_PATH/
+    $BUSYBOX_PATH/rm -f /vtloopex.tar.xz
+fi
+
 
 ####################################################################
 #                                                                  #
-# Step 2 : Do OS specific hook                                     #
+# Step 3 : Do OS specific hook                                     #
 #                                                                  #
 ####################################################################
 ventoy_get_os_type() {
@@ -56,6 +76,26 @@ ventoy_get_os_type() {
         echo 'endless'; return
     fi
     
+    if $GREP -q 'OpenWrt' /proc/version; then
+        echo 'openwrt'; return
+    fi
+    
+    if [ -e /BOOT_SPECS ]; then
+        if $GREP -q 'easyos' /BOOT_SPECS; then
+            echo 'easyos'; return
+        fi
+    fi
+    
+    if [ -e /etc/os-release ]; then
+        if $GREP -q 'volumio' /etc/os-release; then
+            echo 'volumio'; return
+        fi
+    fi
+    
+    if $GREP -q 'ventoyos=' /proc/cmdline; then
+        $SED "s/.*ventoyos=\([a-zA-Z0-9_-]*\).*/\1/" /proc/cmdline; return 
+    fi    
+    
     echo "default"
 }
 
@@ -68,7 +108,7 @@ fi
 
 ####################################################################
 #                                                                  #
-# Step 3 : Check for debug break                                   #
+# Step 4 : Check for debug break                                   #
 #                                                                  #
 ####################################################################
 if [ "$VTOY_BREAK_LEVEL" = "03" ] || [ "$VTOY_BREAK_LEVEL" = "13" ]; then
@@ -85,7 +125,7 @@ fi
 
 ####################################################################
 #                                                                  #
-# Step 3 : Hand over to real init                                  #
+# Step 5 : Hand over to real init                                  #
 #                                                                  #
 ####################################################################
 $BUSYBOX_PATH/umount /proc