1. grub2 mode supports Porteus ISO file.

2. Optimization for Lenovo Recovery Image.
This commit is contained in:
longpanda 2023-01-04 21:46:40 +08:00
parent eac1c35f76
commit 7fe4762faa
5 changed files with 22 additions and 16 deletions

View File

@ -159,7 +159,7 @@ if $GREP -q SCRE /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

View File

@ -860,6 +860,9 @@ function uefi_linux_menu_func {
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
fi
fi
@ -1311,6 +1314,9 @@ function legacy_linux_menu_func {
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
fi
fi
@ -1486,6 +1492,8 @@ function iso_common_menuentry {
get_os_type (loop)
ventoy_debug_pause
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

Binary file not shown.

Binary file not shown.

View File

@ -916,7 +916,7 @@ static BOOL Is2K10PE(void)
return bRet;
}
static CHAR GetIMDiskMountLogicalDrive(void)
static CHAR GetIMDiskMountLogicalDrive(const char *suffix)
{
CHAR Letter = 'Y';
DWORD Drives;
@ -929,6 +929,12 @@ static CHAR GetIMDiskMountLogicalDrive(void)
return 'M';
}
//fixed use Z as mountpoint for Lenovo Product Recovery
if (strcmp(suffix, "VTLRI") == 0)
{
return 'Z';
}
Drives = GetLogicalDrives();
Log("Drives=0x%x", Drives);
@ -1073,26 +1079,18 @@ End:
return rc;
}
static int VentoyRunImdisk(const char *IsoPath, const char *imdiskexe, const char *opt)
static int VentoyRunImdisk(const char *suffix, const char *IsoPath, const char *imdiskexe, const char *opt)
{
CHAR Letter;
CHAR Cmdline[512];
WCHAR CmdlineW[512];
PROCESS_INFORMATION Pi;
Log("VentoyRunImdisk <%s> <%s> <%s>", IsoPath, imdiskexe, opt);
Log("VentoyRunImdisk <%s> <%s> <%s> <%s>", suffix, IsoPath, imdiskexe, opt);
Letter = GetIMDiskMountLogicalDrive();
Letter = GetIMDiskMountLogicalDrive(suffix);
if (opt)
{
sprintf_s(Cmdline, sizeof(Cmdline), "%s -a -o %s -f \"%s\" -m %C:", imdiskexe, opt, IsoPath, Letter);
}
else
{
sprintf_s(Cmdline, sizeof(Cmdline), "%s -a -f \"%s\" -m %C:", imdiskexe, IsoPath, Letter);
}
sprintf_s(Cmdline, sizeof(Cmdline), "%s -a -o %s -f \"%s\" -m %C:", imdiskexe, opt, IsoPath, Letter);
Log("mount iso to %C: use imdisk cmd <%s>", Letter, Cmdline);
if (IsUTF8Encode(IsoPath))
@ -1135,7 +1133,7 @@ int VentoyMountISOByImdisk(const char *IsoPath, DWORD PhyDrive)
if (0 == VentoyCopyImdisk(PhyDrive, ImPath))
{
VentoyRunImdisk(IsoPath, ImPath, "ro");
VentoyRunImdisk("iso", IsoPath, ImPath, "ro");
rc = 0;
}
@ -2370,7 +2368,7 @@ static int MountVTLRI(CHAR *ImgPath, DWORD PhyDrive)
VentoyCopyImdisk(PhyDrive, ImDiskPath);
VentoyRunImdisk(ImgPath, ImDiskPath, "rem");
VentoyRunImdisk("VTLRI", ImgPath, ImDiskPath, "ro,rem");
return 0;
}