mirror of
https://github.com/mbusb/multibootusb
synced 2024-11-18 15:25:46 +00:00
Added Avira Rescue System
This commit is contained in:
parent
72f7c6e0e1
commit
6beacbf175
@ -137,6 +137,8 @@ def distro(iso_cfg_ext_dir, iso_link):
|
|||||||
return 'grub2only'
|
return 'grub2only'
|
||||||
elif re.search(r'BOOT_IMAGE=rising', string, re.I):
|
elif re.search(r'BOOT_IMAGE=rising', string, re.I):
|
||||||
return 'rising-av'
|
return 'rising-av'
|
||||||
|
elif re.search(r'Avira Rescue System', string, re.I):
|
||||||
|
return 'Avira-RS'
|
||||||
|
|
||||||
|
|
||||||
distro = detect_iso_from_file_list(iso_link)
|
distro = detect_iso_from_file_list(iso_link)
|
||||||
|
@ -106,13 +106,19 @@ def mbusb_update_grub_cfg():
|
|||||||
|
|
||||||
|
|
||||||
def write_custom_gurb_cfg():
|
def write_custom_gurb_cfg():
|
||||||
|
"""
|
||||||
|
Create custom grub loopback.cfg file for known distros. Custom menu entries are stored on munus.py module
|
||||||
|
:return:
|
||||||
|
"""
|
||||||
loopback_cfg_path = os.path.join(config.usb_mount, 'multibootusb', iso.iso_basename(config.image_path), 'loopback.cfg')
|
loopback_cfg_path = os.path.join(config.usb_mount, 'multibootusb', iso.iso_basename(config.image_path), 'loopback.cfg')
|
||||||
|
menu = False
|
||||||
if config.distro == 'pc-tool':
|
if config.distro == 'pc-tool':
|
||||||
menu = menus.pc_tool_config(syslinux=False, grub=True)
|
menu = menus.pc_tool_config(syslinux=False, grub=True)
|
||||||
elif config.distro == 'rising-av':
|
elif config.distro == 'rising-av':
|
||||||
menu = menus.rising(syslinux=False, grub=True)
|
menu = menus.rising(syslinux=False, grub=True)
|
||||||
|
|
||||||
if menus:
|
if menu is not False:
|
||||||
|
gen.log('Writing custom loopback.cfg file...')
|
||||||
write_to_file(loopback_cfg_path, menu)
|
write_to_file(loopback_cfg_path, menu)
|
||||||
|
|
||||||
|
|
||||||
|
@ -97,6 +97,18 @@ def install_distro():
|
|||||||
iso_extract_full(config.image_path, usb_mount)
|
iso_extract_full(config.image_path, usb_mount)
|
||||||
elif config.distro == 'grub4dos_iso' or config.distro == 'raw_iso':
|
elif config.distro == 'grub4dos_iso' or config.distro == 'raw_iso':
|
||||||
copy_iso(config.image_path, install_dir)
|
copy_iso(config.image_path, install_dir)
|
||||||
|
elif config.distro == 'Avira-RS':
|
||||||
|
iso_extract_full(config.image_path, install_dir)
|
||||||
|
# we want following directories on root of the USB drive. Ensure the previous directories are removed before moving.
|
||||||
|
if os.path.exists(os.path.join(usb_mount, 'antivir')):
|
||||||
|
shutil.rmtree(os.path.join(usb_mount, 'antivir'))
|
||||||
|
shutil.move(os.path.join(install_dir, 'antivir'), os.path.join(usb_mount))
|
||||||
|
if os.path.exists(os.path.join(usb_mount, 'avupdate')):
|
||||||
|
shutil.rmtree(os.path.join(usb_mount, 'avupdate'))
|
||||||
|
shutil.move(os.path.join(install_dir, 'avupdate'), os.path.join(usb_mount))
|
||||||
|
if os.path.exists(os.path.join(usb_mount, 'system')):
|
||||||
|
shutil.rmtree(os.path.join(usb_mount, 'system'))
|
||||||
|
shutil.move(os.path.join(install_dir, 'system'), os.path.join(usb_mount))
|
||||||
else:
|
else:
|
||||||
iso.iso_extract_full(config.image_path, install_dir)
|
iso.iso_extract_full(config.image_path, install_dir)
|
||||||
|
|
||||||
|
@ -73,12 +73,15 @@ def delete_frm_file_list():
|
|||||||
gen.log('Could not remove ldlinux.sys')
|
gen.log('Could not remove ldlinux.sys')
|
||||||
|
|
||||||
if os.path.exists(os.path.join(usb_mount, f)):
|
if os.path.exists(os.path.join(usb_mount, f)):
|
||||||
if os.path.isfile(os.path.join(usb_mount, f)):
|
if os.path.isdir(os.path.join(usb_mount, f)):
|
||||||
gen.log("Removing " + (os.path.join(usb_mount, f)))
|
gen.log("Removing directory " + (os.path.join(usb_mount, f)))
|
||||||
os.remove(os.path.join(usb_mount, f))
|
|
||||||
elif os.path.isdir(os.path.join(usb_mount, f)):
|
|
||||||
shutil.rmtree(os.path.join(usb_mount, f))
|
shutil.rmtree(os.path.join(usb_mount, f))
|
||||||
|
|
||||||
|
elif os.path.isfile(os.path.join(usb_mount, f)):
|
||||||
|
gen.log("Removing file " + (os.path.join(usb_mount, f)))
|
||||||
|
os.remove(os.path.join(usb_mount, f))
|
||||||
|
|
||||||
|
|
||||||
if os.path.exists(os.path.join(usb_mount, "multibootusb", config.uninstall_distro_dir_name, "generic.cfg")):
|
if os.path.exists(os.path.join(usb_mount, "multibootusb", config.uninstall_distro_dir_name, "generic.cfg")):
|
||||||
with open(os.path.join(usb_mount, "multibootusb", config.uninstall_distro_dir_name, "generic.cfg"), "r") as generic_cfg:
|
with open(os.path.join(usb_mount, "multibootusb", config.uninstall_distro_dir_name, "generic.cfg"), "r") as generic_cfg:
|
||||||
if platform.system() == "Windows":
|
if platform.system() == "Windows":
|
||||||
@ -127,6 +130,7 @@ def uninstall_distro():
|
|||||||
os.remove(os.path.join(usb_mount, config.uninstall_distro_dir_name + ".iso"))
|
os.remove(os.path.join(usb_mount, config.uninstall_distro_dir_name + ".iso"))
|
||||||
elif config.distro == "windows" or config.distro == "alpine" or config.distro == "generic":
|
elif config.distro == "windows" or config.distro == "alpine" or config.distro == "generic":
|
||||||
delete_frm_file_list()
|
delete_frm_file_list()
|
||||||
|
|
||||||
if config.distro == "ipfire":
|
if config.distro == "ipfire":
|
||||||
files = os.listdir(usb_mount)
|
files = os.listdir(usb_mount)
|
||||||
for f in files:
|
for f in files:
|
||||||
|
Loading…
Reference in New Issue
Block a user