Added Avira Rescue System

pull/166/head
mbusb 8 years ago
parent 72f7c6e0e1
commit 6beacbf175

@ -137,6 +137,8 @@ def distro(iso_cfg_ext_dir, iso_link):
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'
distro = detect_iso_from_file_list(iso_link)

@ -106,13 +106,19 @@ def mbusb_update_grub_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')
menu = False
if config.distro == 'pc-tool':
menu = menus.pc_tool_config(syslinux=False, grub=True)
elif config.distro == 'rising-av':
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)

@ -97,6 +97,18 @@ def install_distro():
iso_extract_full(config.image_path, usb_mount)
elif config.distro == 'grub4dos_iso' or config.distro == 'raw_iso':
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:
iso.iso_extract_full(config.image_path, install_dir)

@ -73,11 +73,14 @@ def delete_frm_file_list():
gen.log('Could not remove ldlinux.sys')
if os.path.exists(os.path.join(usb_mount, f)):
if os.path.isfile(os.path.join(usb_mount, f)):
gen.log("Removing " + (os.path.join(usb_mount, f)))
if os.path.isdir(os.path.join(usb_mount, f)):
gen.log("Removing directory " + (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))
elif os.path.isdir(os.path.join(usb_mount, f)):
shutil.rmtree(os.path.join(usb_mount, f))
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:
@ -127,6 +130,7 @@ def uninstall_distro():
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":
delete_frm_file_list()
if config.distro == "ipfire":
files = os.listdir(usb_mount)
for f in files:

Loading…
Cancel
Save