2. Optimization for Lenovo Recovery Image.
fi
if $GREP -qw 'SA[.]1' /proc/cmdline; then
fi
if $GREP -qw 'SA[.]1' /proc/cmdline; then
-if $GREP -qw 'SA[.]2' /proc/cmdline; then
+if $GREP -qw 'writable.fsimg' /proc/cmdline; then
if $GREP -qw 'rw' /proc/cmdline; then
echo 1 > $VTOY_PATH/distmagic/DELL_PER
fi
if $GREP -qw 'rw' /proc/cmdline; then
echo 1 > $VTOY_PATH/distmagic/DELL_PER
fi
if [ -f (loop)/boot/isolinux/syslnx64.cfg ]; then
syslinux_configfile (loop)/boot/isolinux/syslnx64.cfg
set vtback_cfg_find=1
if [ -f (loop)/boot/isolinux/syslnx64.cfg ]; then
syslinux_configfile (loop)/boot/isolinux/syslnx64.cfg
set vtback_cfg_find=1
+ elif [ -f (loop)/boot/syslinux/porteus.cfg ]; then
+ syslinux_configfile (loop)/boot/syslinux/porteus.cfg
+ set vtback_cfg_find=1
if [ -f (loop)/boot/isolinux/syslnx64.cfg ]; then
syslinux_configfile (loop)/boot/isolinux/syslnx64.cfg
set vtback_cfg_find=1
if [ -f (loop)/boot/isolinux/syslnx64.cfg ]; then
syslinux_configfile (loop)/boot/isolinux/syslnx64.cfg
set vtback_cfg_find=1
+ elif [ -f (loop)/boot/syslinux/porteus.cfg ]; then
+ syslinux_configfile (loop)/boot/syslinux/porteus.cfg
+ set vtback_cfg_find=1
if vt_need_secondary_menu "$vt_chosen_name"; then
vt_show_secondary_menu "$vt_chosen_path" "$vtoy_os" $vt_chosen_size
if [ "$VTOY_SECOND_EXIT" = "1" ]; then
if vt_need_secondary_menu "$vt_chosen_name"; then
vt_show_secondary_menu "$vt_chosen_path" "$vtoy_os" $vt_chosen_size
if [ "$VTOY_SECOND_EXIT" = "1" ]; then
-static CHAR GetIMDiskMountLogicalDrive(void)\r
+static CHAR GetIMDiskMountLogicalDrive(const char *suffix)\r
{\r
CHAR Letter = 'Y';\r
DWORD Drives;\r
{\r
CHAR Letter = 'Y';\r
DWORD Drives;\r
+ //fixed use Z as mountpoint for Lenovo Product Recovery\r
+ if (strcmp(suffix, "VTLRI") == 0)\r
+ {\r
+ return 'Z';\r
+ }\r
+\r
Drives = GetLogicalDrives();\r
Log("Drives=0x%x", Drives);\r
\r
Drives = GetLogicalDrives();\r
Log("Drives=0x%x", Drives);\r
\r
-static int VentoyRunImdisk(const char *IsoPath, const char *imdiskexe, const char *opt)\r
+static int VentoyRunImdisk(const char *suffix, const char *IsoPath, const char *imdiskexe, const char *opt)\r
{\r
CHAR Letter;\r
CHAR Cmdline[512];\r
WCHAR CmdlineW[512];\r
PROCESS_INFORMATION Pi;\r
\r
{\r
CHAR Letter;\r
CHAR Cmdline[512];\r
WCHAR CmdlineW[512];\r
PROCESS_INFORMATION Pi;\r
\r
- Log("VentoyRunImdisk <%s> <%s> <%s>", IsoPath, imdiskexe, opt);\r
+ Log("VentoyRunImdisk <%s> <%s> <%s> <%s>", suffix, IsoPath, imdiskexe, opt);\r
- Letter = GetIMDiskMountLogicalDrive();\r
+ Letter = GetIMDiskMountLogicalDrive(suffix);\r
- if (opt)\r
- {\r
- sprintf_s(Cmdline, sizeof(Cmdline), "%s -a -o %s -f \"%s\" -m %C:", imdiskexe, opt, IsoPath, Letter);\r
- }\r
- else\r
- {\r
- sprintf_s(Cmdline, sizeof(Cmdline), "%s -a -f \"%s\" -m %C:", imdiskexe, IsoPath, Letter);\r
- }\r
- \r
+ sprintf_s(Cmdline, sizeof(Cmdline), "%s -a -o %s -f \"%s\" -m %C:", imdiskexe, opt, IsoPath, Letter); \r
Log("mount iso to %C: use imdisk cmd <%s>", Letter, Cmdline);\r
\r
if (IsUTF8Encode(IsoPath))\r
Log("mount iso to %C: use imdisk cmd <%s>", Letter, Cmdline);\r
\r
if (IsUTF8Encode(IsoPath))\r
\r
if (0 == VentoyCopyImdisk(PhyDrive, ImPath))\r
{\r
\r
if (0 == VentoyCopyImdisk(PhyDrive, ImPath))\r
{\r
- VentoyRunImdisk(IsoPath, ImPath, "ro");\r
+ VentoyRunImdisk("iso", IsoPath, ImPath, "ro");\r
\r
VentoyCopyImdisk(PhyDrive, ImDiskPath);\r
\r
\r
VentoyCopyImdisk(PhyDrive, ImDiskPath);\r
\r
- VentoyRunImdisk(ImgPath, ImDiskPath, "rem");\r
+ VentoyRunImdisk("VTLRI", ImgPath, ImDiskPath, "ro,rem");\r