Changeset 94296 in vbox for trunk/src/VBox
- Timestamp:
- Mar 17, 2022 3:15:46 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/UnattendedImpl.cpp
r94136 r94296 1390 1390 } 1391 1391 else if ( ( RTStrNICmp(pszOsAndVersion, RT_STR_TUPLE("Xubuntu")) == 0 1392 || RTStrNICmp(pszOsAndVersion, RT_STR_TUPLE("Kubuntu")) == 0) 1392 || RTStrNICmp(pszOsAndVersion, RT_STR_TUPLE("Kubuntu")) == 0 1393 || RTStrNICmp(pszOsAndVersion, RT_STR_TUPLE("Lubuntu")) == 0) 1393 1394 && !RT_C_IS_ALNUM(pszOsAndVersion[7])) 1394 1395 { … … 1422 1423 } 1423 1424 1425 static bool detectLinuxDistroNameII(const char *pszOsAndVersion, VBOXOSTYPE *penmOsType, const char **ppszNext) 1426 { 1427 bool fRet = true; 1428 if ( RTStrIStr(pszOsAndVersion, "RedHat") != NULL 1429 || RTStrIStr(pszOsAndVersion, "Red Hat") != NULL) 1430 *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_RedHat); 1431 else if (RTStrIStr(pszOsAndVersion, "Oracle") != NULL) 1432 *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Oracle); 1433 else if (RTStrIStr(pszOsAndVersion, "CentOS") != NULL) 1434 *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_RedHat); 1435 else if (RTStrIStr(pszOsAndVersion, "Fedora") != NULL) 1436 *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_FedoraCore); 1437 else if (RTStrIStr(pszOsAndVersion, "Ubuntu") != NULL) 1438 *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Ubuntu); 1439 else if (RTStrIStr(pszOsAndVersion, "Debian")) 1440 *penmOsType = (VBOXOSTYPE)((*penmOsType & VBOXOSTYPE_x64) | VBOXOSTYPE_Debian); 1441 else 1442 fRet = false; 1443 1444 /* 1445 * Skip forward till we get a number. 1446 */ 1447 if (ppszNext) 1448 { 1449 *ppszNext = pszOsAndVersion; 1450 char ch; 1451 for (const char *pszVersion = pszOsAndVersion; (ch = *pszVersion) != '\0'; pszVersion++) 1452 if (RT_C_IS_DIGIT(ch)) 1453 { 1454 *ppszNext = pszVersion; 1455 break; 1456 } 1457 } 1458 return fRet; 1459 } 1424 1460 1425 1461 /** … … 1752 1788 * Debian GNU/Linux 8.11.1 "Jessie" - Official amd64 CD Binary-1 20190211-02:10 1753 1789 * Kali GNU/Linux 2021.3a "Kali-last-snapshot" - Official amd64 BD Binary-1 with firmware 20211015-16:55 1790 * Official Debian GNU/Linux Live 10.10.0 cinnamon 2021-06-19T12:13 1754 1791 */ 1755 1792 vrc = RTVfsFileOpen(hVfsIso, ".disk/info", RTFILE_O_READ | RTFILE_O_DENY_NONE | RTFILE_O_OPEN, &hVfsFile); … … 1777 1814 } 1778 1815 1779 if (pszDiskName && pszArch) 1816 /* Some Debian Live ISO's have info file content as follows: 1817 * Official Debian GNU/Linux Live 10.10.0 cinnamon 2021-06-19T12:13 1818 * thus pszArch stays empty. Try Volume Id (label) if we get lucky and get architecture from that. */ 1819 if (!pszArch) 1820 { 1821 char szVolumeId[128]; 1822 size_t cchVolumeId; 1823 vrc = RTVfsQueryLabel(hVfsIso, szVolumeId, 128, &cchVolumeId); 1824 if (RT_SUCCESS(vrc)) 1825 { 1826 if (!detectLinuxArchII(szVolumeId, &mEnmOsType, VBOXOSTYPE_Ubuntu)) 1827 LogRel(("Unattended: .disk/info: Unknown: arch='%s'\n", pszArch)); 1828 } 1829 else 1830 LogRel(("Unattended: .disk/info No Volume Label found\n")); 1831 } 1832 else 1780 1833 { 1781 1834 if (!detectLinuxArchII(pszArch, &mEnmOsType, VBOXOSTYPE_Ubuntu)) 1782 LogRel(("Unattended: README.diskdefines: Unknown: arch='%s'\n", pszArch)); 1783 1835 LogRel(("Unattended: .disk/info: Unknown: arch='%s'\n", pszArch)); 1836 } 1837 1838 if (pszDiskName) 1839 { 1784 1840 const char *pszVersion = NULL; 1785 if (detectLinuxDistroName (pszDiskName, &mEnmOsType, &pszVersion))1841 if (detectLinuxDistroNameII(pszDiskName, &mEnmOsType, &pszVersion)) 1786 1842 { 1787 LogRelFlow(("Unattended: README.diskdefines: version=%s\n", pszVersion));1843 LogRelFlow(("Unattended: .disk/info: version=%s\n", pszVersion)); 1788 1844 try { mStrDetectedOSVersion = RTStrStripL(pszVersion); } 1789 1845 catch (std::bad_alloc &) { return E_OUTOFMEMORY; } 1790 1846 } 1791 1847 else 1792 LogRel(("Unattended: README.diskdefines: Unknown: diskname='%s'\n", pszDiskName)); 1793 } 1848 LogRel(("Unattended: .disk/info: Unknown: diskname='%s'\n", pszDiskName)); 1849 } 1850 1851 if (mEnmOsType == VBOXOSTYPE_Unknown) 1852 LogRel(("Unattended: .disk/info: Did not find DISKNAME or/and ARCH. :-/\n")); 1794 1853 else 1795 LogRel(("Unattended: README.diskdefines: Did not find both DISKNAME and ARCH. :-/\n"));1796 1797 if (mEnmOsType != VBOXOSTYPE_Unknown)1798 1854 return S_FALSE; 1799 1855 }
Note:
See TracChangeset
for help on using the changeset viewer.