|
|
@ -6,14 +6,15 @@
|
|
|
|
# Licence: This file is a part of multibootusb package. You can redistribute it or modify
|
|
|
|
# Licence: This file is a part of multibootusb package. You can redistribute it or modify
|
|
|
|
# under the terms of GNU General Public License, v.2 or above
|
|
|
|
# under the terms of GNU General Public License, v.2 or above
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from functools import partial
|
|
|
|
import os
|
|
|
|
import os
|
|
|
|
import platform
|
|
|
|
import platform
|
|
|
|
import re
|
|
|
|
import re
|
|
|
|
from .iso import *
|
|
|
|
|
|
|
|
from .isodump3 import ISO9660
|
|
|
|
|
|
|
|
from .gen import *
|
|
|
|
|
|
|
|
from . import _7zip
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from . import _7zip
|
|
|
|
|
|
|
|
from .gen import *
|
|
|
|
|
|
|
|
from . import iso
|
|
|
|
|
|
|
|
from .isodump3 import ISO9660
|
|
|
|
|
|
|
|
|
|
|
|
def distro(iso_cfg_ext_dir, iso_link, expose_exception=False):
|
|
|
|
def distro(iso_cfg_ext_dir, iso_link, expose_exception=False):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
@ -23,140 +24,150 @@ def distro(iso_cfg_ext_dir, iso_link, expose_exception=False):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
# iso9660fs = ISO9660(iso_link)
|
|
|
|
# iso9660fs = ISO9660(iso_link)
|
|
|
|
# iso_file_list = iso9660fs.readDir("/")
|
|
|
|
# iso_file_list = iso9660fs.readDir("/")
|
|
|
|
iso_file_list = _7zip.list_iso(iso_link, expose_exception=expose_exception)
|
|
|
|
|
|
|
|
|
|
|
|
distro = None # tenatively set to None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
iso_file_list = _7zip.list_iso(
|
|
|
|
|
|
|
|
iso_link, expose_exception=expose_exception)
|
|
|
|
|
|
|
|
iso_file_list_lower = [f.lower() for f in iso_file_list]
|
|
|
|
|
|
|
|
v_isolinux_bin_exists = iso.isolinux_bin_exist(iso_link)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Let's have less costly checks first.
|
|
|
|
|
|
|
|
# We'll have to make these checks as strictive as possible
|
|
|
|
|
|
|
|
# so that keyword based tests will not be skipped because
|
|
|
|
|
|
|
|
# of a false positive.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if iso_file_list:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
distro = detect_iso_from_file_list(iso_file_list)
|
|
|
|
|
|
|
|
if distro:
|
|
|
|
|
|
|
|
return distro
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
iso_file_list = []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def run_contains(keywords, filename, file_content, iso_flielist,
|
|
|
|
|
|
|
|
isolinux_bin_exists):
|
|
|
|
|
|
|
|
return any(k in file_content for k in keywords.split('|'))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def contains(keywords):
|
|
|
|
|
|
|
|
return partial(run_contains, keywords.lower())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def run_file_exists(filename_sought, filename, file_content, iso_filelist,
|
|
|
|
|
|
|
|
isolinux_bin_exists):
|
|
|
|
|
|
|
|
return filename_sought in iso_filelist
|
|
|
|
|
|
|
|
def file_exists(filename_sought):
|
|
|
|
|
|
|
|
return partial(run_file_exists, filename_sought)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def run_isolinux_bin_exists(exist_or_not, filename, file_content,
|
|
|
|
|
|
|
|
iso_filelist, isolinux_bin_exists):
|
|
|
|
|
|
|
|
return exist_or_not is isolinux_bin_exists
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def isolinux_bin_exists(exist_or_not):
|
|
|
|
|
|
|
|
return partial(run_isolinux_bin_exists, exist_or_not)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def run_not(predicate, filename, file_content,
|
|
|
|
|
|
|
|
iso_filelist, isolinux_bin_exists):
|
|
|
|
|
|
|
|
return not predicate(filename, file_content, iso_filelist,
|
|
|
|
|
|
|
|
isolinux_bin_exists)
|
|
|
|
|
|
|
|
def not_(predicate):
|
|
|
|
|
|
|
|
return partial(run_not, predicate)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test_vector = [
|
|
|
|
|
|
|
|
('ubcd', contains('ubcd')),
|
|
|
|
|
|
|
|
('sgrubd2', contains('Super Grub Disk')),
|
|
|
|
|
|
|
|
('hbcd', contains('hbcd')),
|
|
|
|
|
|
|
|
('systemrescuecd', contains('systemrescuecd')),
|
|
|
|
|
|
|
|
('parted-magic', [contains('pmagic|partedmagic'),
|
|
|
|
|
|
|
|
isolinux_bin_exists(True)]),
|
|
|
|
|
|
|
|
# mounting fat filesystem hard coded in to initrd.
|
|
|
|
|
|
|
|
# Can be modified only under linux.
|
|
|
|
|
|
|
|
('mageialive', contains('mgalive')),
|
|
|
|
|
|
|
|
('arch', contains('archisolabel|misolabel|parabolaisolabel')),
|
|
|
|
|
|
|
|
('chakra', contains('chakraisolabel')),
|
|
|
|
|
|
|
|
('kaos', contains('kdeosisolabel')),
|
|
|
|
|
|
|
|
('debian', [contains('boot=live'), isolinux_bin_exists(True)]),
|
|
|
|
|
|
|
|
('grml', [contains('grml'), contains('live-media-path')]),
|
|
|
|
|
|
|
|
('debian-install', [contains('debian-installer'),
|
|
|
|
|
|
|
|
not_(file_exists('casper'))]),
|
|
|
|
|
|
|
|
('solydx', contains('solydx')),
|
|
|
|
|
|
|
|
('knoppix', contains('knoppix')),
|
|
|
|
|
|
|
|
('centos', contains('root=live:CDLABEL=CentOS')),
|
|
|
|
|
|
|
|
('fedora', contains('root=live:CDLABEL=|root=live:LABEL=')),
|
|
|
|
|
|
|
|
('fedora', contains('redcore')),
|
|
|
|
|
|
|
|
('redhat', contains('redhat')),
|
|
|
|
|
|
|
|
('slitaz', contains('slitaz|dban |ophcrack|tinycore|rescue.cpi'
|
|
|
|
|
|
|
|
'|xpud|untangle|4mlinux|partition wizard'
|
|
|
|
|
|
|
|
'|android-x86.png|riplinux|lebel dummy'
|
|
|
|
|
|
|
|
'|http://pogostick.net/~pnh/ntpasswd/'
|
|
|
|
|
|
|
|
'|AVG Rescue CD|AntivirusLiveCD'
|
|
|
|
|
|
|
|
'|lkrn|Nanolinux|OSForensics|PING')),
|
|
|
|
|
|
|
|
('slitaz', contains('minimal Slackware|Slackware-HOWTO')),
|
|
|
|
|
|
|
|
#('suse', contains('suse')),
|
|
|
|
|
|
|
|
('opensuse-install', contains('class opensuse')),
|
|
|
|
|
|
|
|
('ubuntu', contains('boot=casper')),
|
|
|
|
|
|
|
|
('wifislax', contains('wifislax')),
|
|
|
|
|
|
|
|
('slax', contains('slax')),
|
|
|
|
|
|
|
|
('sms', [contains('sms.jpg|vector |autoexec'),
|
|
|
|
|
|
|
|
isolinux_bin_exists(True)]),
|
|
|
|
|
|
|
|
('antix', contains('antix')),
|
|
|
|
|
|
|
|
('porteus', contains('porteus')),
|
|
|
|
|
|
|
|
('pclinuxos', contains('livecd=livecd|PCLinuxOS')),
|
|
|
|
|
|
|
|
('gentoo', contains('looptype=squashfs|http://dee.su/liberte')),
|
|
|
|
|
|
|
|
('finnix', contains('finnix')),
|
|
|
|
|
|
|
|
('wifiway', contains('wifiway')),
|
|
|
|
|
|
|
|
('puppy', contains('puppy|quirky|fatdog|slacko|xenialpup')),
|
|
|
|
|
|
|
|
('ipcop', contains('ipcop')),
|
|
|
|
|
|
|
|
('ipfire', contains('ipfire')),
|
|
|
|
|
|
|
|
('salix-live', [contains('zenwalk|slack|salix'),
|
|
|
|
|
|
|
|
contains('live')]),
|
|
|
|
|
|
|
|
('zenwalk', contains('zenwalk|slack|salix')),
|
|
|
|
|
|
|
|
('ubuntu-server', contains('ubuntu server')),
|
|
|
|
|
|
|
|
('centos-install', contains('Install CentOS')),
|
|
|
|
|
|
|
|
('centos', contains('centos')),
|
|
|
|
|
|
|
|
('trinity-rescue', contains('Trinity Rescue Kit')),
|
|
|
|
|
|
|
|
('alpine', contains('alpine')),
|
|
|
|
|
|
|
|
('kaspersky', contains('http://support.kaspersky.com')),
|
|
|
|
|
|
|
|
('alt-linux', contains('ALT Linux')),
|
|
|
|
|
|
|
|
('Windows', contains('Sergei Strelec')),
|
|
|
|
|
|
|
|
('ReactOS', contains('ReactOS')),
|
|
|
|
|
|
|
|
('fsecure', contains('fsecure')),
|
|
|
|
|
|
|
|
('pc-unlocker', contains('default rwp')),
|
|
|
|
|
|
|
|
('pc-tool', contains('/system/stage1')),
|
|
|
|
|
|
|
|
('grub2only', contains('vba32rescue')),
|
|
|
|
|
|
|
|
('rising-av', contains('BOOT_IMAGE=rising')),
|
|
|
|
|
|
|
|
('Avira-RS', contains('Avira Rescue System')),
|
|
|
|
|
|
|
|
('insert', contains('BOOT_IMAGE=insert')),
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# I'm not sure if this check is necessary prvious but code had skipped
|
|
|
|
|
|
|
|
# keyword based checks if the platform is unknown.
|
|
|
|
if platform.system() == "Linux" or platform.system() == "Windows":
|
|
|
|
if platform.system() == "Linux" or platform.system() == "Windows":
|
|
|
|
for path, subdirs, files in os.walk(iso_cfg_ext_dir):
|
|
|
|
for path, subdirs, files in os.walk(iso_cfg_ext_dir):
|
|
|
|
for name in files:
|
|
|
|
for name in files:
|
|
|
|
if name.endswith(('.cfg', '.CFG', '.txt', '.TXT', '.lst')):
|
|
|
|
name_lower = name.lower()
|
|
|
|
if name.lower()=='i18n.cfg':
|
|
|
|
if not name_lower.endswith(('.cfg', '.txt', '.lst')):
|
|
|
|
|
|
|
|
continue
|
|
|
|
|
|
|
|
if name_lower=='i18n.cfg':
|
|
|
|
# i18n.cfg in salitaz-rolling cause misdetection
|
|
|
|
# i18n.cfg in salitaz-rolling cause misdetection
|
|
|
|
# of centos by the following line.
|
|
|
|
# of centos by the following line.
|
|
|
|
# MENU LABEL English US (acentos)
|
|
|
|
# MENU LABEL English US (acentos)
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
# errors='ignore' is required as some files also contain non utf character
|
|
|
|
# errors='ignore' is required as some files also
|
|
|
|
string = open(os.path.join(path, name), errors='ignore').read()
|
|
|
|
# contain non utf character
|
|
|
|
|
|
|
|
string = open(os.path.join(path, name),
|
|
|
|
|
|
|
|
errors='ignore').read()
|
|
|
|
except IOError:
|
|
|
|
except IOError:
|
|
|
|
return "Read Error."
|
|
|
|
log("Read Error on %s." % name)
|
|
|
|
else:
|
|
|
|
continue
|
|
|
|
if any("f4ubcd" in s.lower() for s in iso_file_list):
|
|
|
|
|
|
|
|
return "f4ubcd"
|
|
|
|
for distro_, predicate in test_vector:
|
|
|
|
if re.search(r'ubcd', string, re.I):
|
|
|
|
predicates = [predicate] if callable(predicate) \
|
|
|
|
return "ubcd"
|
|
|
|
else predicate
|
|
|
|
elif re.search(r'Super Grub Disk', string, re.I):
|
|
|
|
if all( p(name_lower, string.lower(), iso_file_list_lower,
|
|
|
|
return "sgrubd2"
|
|
|
|
v_isolinux_bin_exists) for p in predicates ):
|
|
|
|
elif re.search(r'hbcd', string, re.I):
|
|
|
|
return distro_
|
|
|
|
return "hbcd"
|
|
|
|
|
|
|
|
elif re.search(r'systemrescuecd', string, re.I):
|
|
|
|
|
|
|
|
return "systemrescuecd"
|
|
|
|
|
|
|
|
elif re.search(r'pmagic|partedmagic', string, re.I) and isolinux_bin_exist(iso_link):
|
|
|
|
|
|
|
|
return "parted-magic"
|
|
|
|
|
|
|
|
elif re.search(r'mgalive', string, re.I): # mounting fat filesystem hard coded in to initrd.
|
|
|
|
|
|
|
|
# Can be modified only under linux.
|
|
|
|
|
|
|
|
return "mageialive"
|
|
|
|
|
|
|
|
elif re.search(r'archisolabel|misolabel|parabolaisolabel', string, re.I):
|
|
|
|
|
|
|
|
return "arch"
|
|
|
|
|
|
|
|
elif re.search(r'chakraisolabel', string, re.I):
|
|
|
|
|
|
|
|
return "chakra"
|
|
|
|
|
|
|
|
elif re.search(r'kdeosisolabel', string, re.I):
|
|
|
|
|
|
|
|
return "kaos"
|
|
|
|
|
|
|
|
elif re.search(r'boot=live', string, re.I) and isolinux_bin_exist(iso_link):
|
|
|
|
|
|
|
|
return "debian"
|
|
|
|
|
|
|
|
elif re.search(r'grml', string, re.I) and re.search(r'live-media-path=', string, re.I):
|
|
|
|
|
|
|
|
return "grml"
|
|
|
|
|
|
|
|
elif re.search(r'debian-installer', string, re.I) and not any("casper" in s.lower() for s in iso_file_list):
|
|
|
|
|
|
|
|
return "debian-install"
|
|
|
|
|
|
|
|
elif re.search(r'solydx', string, re.I):
|
|
|
|
|
|
|
|
return "solydx"
|
|
|
|
|
|
|
|
elif re.search(r'knoppix', string, re.I):
|
|
|
|
|
|
|
|
return "knoppix"
|
|
|
|
|
|
|
|
elif re.search(r'root=live:CDLABEL=CentOS',
|
|
|
|
|
|
|
|
string, re.I):
|
|
|
|
|
|
|
|
return 'centos' # centos-live
|
|
|
|
|
|
|
|
elif re.search(r'root=live:CDLABEL=', string, re.I) or re.search(r'root=live:LABEL=', string, re.I):
|
|
|
|
|
|
|
|
return "fedora"
|
|
|
|
|
|
|
|
elif re.search(r'redcore', string, re.I):
|
|
|
|
|
|
|
|
return "fedora"
|
|
|
|
|
|
|
|
elif re.search(r'redhat', string, re.I):
|
|
|
|
|
|
|
|
return "redhat"
|
|
|
|
|
|
|
|
elif re.search(
|
|
|
|
|
|
|
|
r'slitaz|dban |ophcrack|tinycore|rescue.cpi|xpud|untangle|4mlinux|partition wizard|android-x86.png|'
|
|
|
|
|
|
|
|
r'riplinux|lebel dummy|http://pogostick.net/~pnh/ntpasswd/|AVG Rescue CD|AntivirusLiveCD|'
|
|
|
|
|
|
|
|
r'lkrn|Nanolinux|OSForensics|PING', string, re.I): # acentos is a text found in slitaz distro
|
|
|
|
|
|
|
|
return "slitaz"
|
|
|
|
|
|
|
|
elif re.search(r'minimal Slackware|Slackware-HOWTO', string, re.I):
|
|
|
|
|
|
|
|
# for minimal slackware detection
|
|
|
|
|
|
|
|
return "slitaz"
|
|
|
|
|
|
|
|
# elif re.search(r'suse', string, re.I):
|
|
|
|
|
|
|
|
# return "suse"
|
|
|
|
|
|
|
|
elif re.search(r'class opensuse', string, re.I):
|
|
|
|
|
|
|
|
return "opensuse-install"
|
|
|
|
|
|
|
|
elif re.search(r'boot=casper', string, re.I):
|
|
|
|
|
|
|
|
return "ubuntu"
|
|
|
|
|
|
|
|
elif re.search(r'wifislax', string, re.I):
|
|
|
|
|
|
|
|
return "wifislax"
|
|
|
|
|
|
|
|
elif re.search(r'slax', string, re.I):
|
|
|
|
|
|
|
|
return "slax"
|
|
|
|
|
|
|
|
elif re.search(r'sms.jpg|vector |autoexec', string, re.I) and isolinux_bin_exist(iso_link):
|
|
|
|
|
|
|
|
return "sms"
|
|
|
|
|
|
|
|
elif re.search(r'antix', string, re.I):
|
|
|
|
|
|
|
|
return "antix"
|
|
|
|
|
|
|
|
elif re.search(r'porteus', string, re.I):
|
|
|
|
|
|
|
|
return "porteus"
|
|
|
|
|
|
|
|
elif re.search(r'livecd=livecd|PCLinuxOS', string, re.I):
|
|
|
|
|
|
|
|
return "pclinuxos"
|
|
|
|
|
|
|
|
elif re.search(r'looptype=squashfs|http://dee.su/liberte', string, re.I):
|
|
|
|
|
|
|
|
return "gentoo"
|
|
|
|
|
|
|
|
elif re.search(r'finnix', string, re.I):
|
|
|
|
|
|
|
|
return "finnix"
|
|
|
|
|
|
|
|
elif re.search(r'wifiway', string, re.I):
|
|
|
|
|
|
|
|
return "wifiway"
|
|
|
|
|
|
|
|
elif re.search(r'puppy|quirky|fatdog|slacko|xenialpup', string, re.I):
|
|
|
|
|
|
|
|
return "puppy"
|
|
|
|
|
|
|
|
elif re.search(r'ipcop', string, re.I):
|
|
|
|
|
|
|
|
return "ipcop"
|
|
|
|
|
|
|
|
elif re.search(r'ipfire', string, re.I):
|
|
|
|
|
|
|
|
return "ipfire"
|
|
|
|
|
|
|
|
elif re.search(r'zenwalk|slack|salix', string, re.I) and re.search(r'live', string, re.I):
|
|
|
|
|
|
|
|
return "salix-live"
|
|
|
|
|
|
|
|
elif re.search(r'zenwalk|slack|salix', string, re.I):
|
|
|
|
|
|
|
|
return "zenwalk"
|
|
|
|
|
|
|
|
elif re.search(r'ubuntu server', string, re.I):
|
|
|
|
|
|
|
|
return "ubuntu-server"
|
|
|
|
|
|
|
|
elif re.search(r'Install CentOS', string, re.I):
|
|
|
|
|
|
|
|
return "centos-install"
|
|
|
|
|
|
|
|
elif re.search(r'CentOS', string, re.I):
|
|
|
|
|
|
|
|
return "centos"
|
|
|
|
|
|
|
|
elif re.search(r'Trinity Rescue Kit', string, re.I):
|
|
|
|
|
|
|
|
return "trinity-rescue"
|
|
|
|
|
|
|
|
elif re.search(r'alpine', string, re.I):
|
|
|
|
|
|
|
|
return "alpine"
|
|
|
|
|
|
|
|
elif re.search(r'http://support.kaspersky.com', string, re.I):
|
|
|
|
|
|
|
|
return "kaspersky"
|
|
|
|
|
|
|
|
elif re.search(r'ALT Linux', string, re.I):
|
|
|
|
|
|
|
|
return "alt-linux"
|
|
|
|
|
|
|
|
elif re.search(r'Sergei Strelec', string, re.I):
|
|
|
|
|
|
|
|
return "Windows"
|
|
|
|
|
|
|
|
elif re.search(r'ReactOS', string, re.I):
|
|
|
|
|
|
|
|
return "ReactOS"
|
|
|
|
|
|
|
|
elif re.search(r'fsecure', string, re.I):
|
|
|
|
|
|
|
|
return "fsecure"
|
|
|
|
|
|
|
|
elif re.search(r'default rwp', string, re.I):
|
|
|
|
|
|
|
|
return "pc-unlocker"
|
|
|
|
|
|
|
|
elif re.search(r'/system/stage1', string, re.I):
|
|
|
|
|
|
|
|
return 'pc-tool'
|
|
|
|
|
|
|
|
elif re.search(r'vba32rescue', string, re.I):
|
|
|
|
|
|
|
|
return 'grub2only'
|
|
|
|
|
|
|
|
elif re.search(r'BOOT_IMAGE=rising', string, re.I):
|
|
|
|
|
|
|
|
return 'rising-av'
|
|
|
|
|
|
|
|
elif re.search(r'Avira Rescue System', string, re.I):
|
|
|
|
|
|
|
|
return 'Avira-RS'
|
|
|
|
|
|
|
|
elif any("alpine-release" in s.lower() for s in iso_file_list):
|
|
|
|
|
|
|
|
return 'alpine'
|
|
|
|
|
|
|
|
elif re.search(r'BOOT_IMAGE=insert', string, re.I):
|
|
|
|
|
|
|
|
return 'insert'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
distro = detect_iso_from_file_list(iso_link, iso_file_list)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if distro:
|
|
|
|
if distro:
|
|
|
|
return distro
|
|
|
|
return distro
|
|
|
@ -176,12 +187,14 @@ def distro(iso_cfg_ext_dir, iso_link, expose_exception=False):
|
|
|
|
return None
|
|
|
|
return None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def detect_iso_from_file_list(iso_link, iso_file_list):
|
|
|
|
def detect_iso_from_file_list(iso_file_list):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
Fallback detection script from the content of an ISO.
|
|
|
|
Fallback detection script from the content of an ISO.
|
|
|
|
:return: supported distro as string
|
|
|
|
:return: supported distro as string
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
keys_to_distro = [
|
|
|
|
keys_to_distro = [
|
|
|
|
|
|
|
|
(['f4ubcd'], 'f4ubcd'),
|
|
|
|
|
|
|
|
(['alpine-release'], 'alpine'),
|
|
|
|
(['sources', 'boot.wim'], 'Windows'),
|
|
|
|
(['sources', 'boot.wim'], 'Windows'),
|
|
|
|
(['config.isoclient'], 'opensuse'),
|
|
|
|
(['config.isoclient'], 'opensuse'),
|
|
|
|
(['dban'], 'slitaz'),
|
|
|
|
(['dban'], 'slitaz'),
|
|
|
@ -190,16 +203,14 @@ def detect_iso_from_file_list(iso_link, iso_file_list):
|
|
|
|
(['menu.lst'], 'grub4dos'),
|
|
|
|
(['menu.lst'], 'grub4dos'),
|
|
|
|
(['bootwiz.cfg', 'bootmenu_logo.png'], 'grub4dos_iso') ]
|
|
|
|
(['bootwiz.cfg', 'bootmenu_logo.png'], 'grub4dos_iso') ]
|
|
|
|
|
|
|
|
|
|
|
|
if os.path.exists(iso_link):
|
|
|
|
|
|
|
|
filenames = [f.lower() for f in iso_file_list]
|
|
|
|
filenames = [f.lower() for f in iso_file_list]
|
|
|
|
for keys, distro in keys_to_distro:
|
|
|
|
for keys, distro in keys_to_distro:
|
|
|
|
if all(k in filenames for k in keys):
|
|
|
|
if all(k in filenames for k in keys):
|
|
|
|
return distro
|
|
|
|
return distro
|
|
|
|
log("Examined %d %s in the iso but could not determine the distro."
|
|
|
|
#log("Examined %d %s in the iso but could not determine the distro."
|
|
|
|
% (len(filenames), len(filenames)==1 and 'filename' or 'filenames'))
|
|
|
|
# % (len(filenames), len(filenames)==1 and 'filename' or 'filenames'))
|
|
|
|
return None
|
|
|
|
return None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
if __name__ == '__main__':
|
|
|
|
iso_cfg_ext_dir = os.path.join(multibootusb_host_dir(), "iso_cfg_ext_dir")
|
|
|
|
iso_cfg_ext_dir = os.path.join(multibootusb_host_dir(), "iso_cfg_ext_dir")
|
|
|
|
iso_link = 'Downloads/clonezilla-live-2.4.2-32-amd64.iso'
|
|
|
|
iso_link = 'Downloads/clonezilla-live-2.4.2-32-amd64.iso'
|
|
|
|