From 90c49b7fc2bdb156ef88c6d17f9d718e7f165e52 Mon Sep 17 00:00:00 2001 From: gutosie Date: Wed, 15 Apr 2020 20:24:41 +0200 Subject: [PATCH] fix8.24 --- NeoBoot/extract.py | 53 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 5 deletions(-) diff --git a/NeoBoot/extract.py b/NeoBoot/extract.py index caea68e..fa78d36 100644 --- a/NeoBoot/extract.py +++ b/NeoBoot/extract.py @@ -333,6 +333,53 @@ def NEOBootMainEx(source, target, stopenigma, CopyFiles, CopyKernel, TvList, Ste os.system('echo "MediaPortal not found."') # for all image: + + if os.path.exists('%s/ImageBoot/%s/etc/rc.local' % (media, target)): + filename = '%s/ImageBoot/%s/etc/rc.local' % (media, target) + if os.path.exists(filename): + filename2 = filename + '.tmp' + out = open(filename2, 'w') + f = open(filename, 'r') + for line in f.readlines(): + if line.find('exit 0') != -1: + line = '\n' + out.write(line) + + f.close() + out.close() + os.rename(filename2, filename) + cmd = 'echo -n "\n\n/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/userscript.sh \n\nexit 0" >> %s/ImageBoot/%s/etc/rc.local' % (media, target) + rc = os.system(cmd) + cmd = 'chmod 0755 %s/ImageBoot/%s/etc/rc.local' % (media, target) + rc = os.system(cmd) + + if os.path.exists('%s/ImageBoot/%s/etc/init.d/rc.local' % (media, target)): + filename = '%s/ImageBoot/%s/etc/init.d/rc.local' % (media, target) + if os.path.exists(filename): + filename2 = filename + '.tmp' + out = open(filename2, 'w') + f = open(filename, 'r') + for line in f.readlines(): + if line.find('exit 0') != -1: + line = '\n' + out.write(line) + + f.close() + out.close() + os.rename(filename2, filename) + + cmd = 'echo -n "\n\n/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/userscript.sh \n\nexit 0" >> %s/ImageBoot/%s/etc/init.d/rc.local' % (media, target) + rc = os.system(cmd) + cmd = 'chmod 0755 %s/ImageBoot/%s/etc/init.d/rc.local' % (media, target) + rc = os.system(cmd) + + if not os.path.exists('%s/ImageBoot/%s/etc/init.d/rc.local' % (media, target)) and not os.path.exists('%s/ImageBoot/%s/etc/rc.local' % (media, target)) : + cmd = 'ln -s %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/userscript.sh %s/ImageBoot/%s/etc/init.d/S99neo.local' % (media, + target, + media, + target) + rc = os.system(cmd) + if not os.path.exists('' + getNeoLocation() + 'ImageBoot/.without_copying'): if not os.path.exists('%s/ImageBoot/%s/etc/enigma2' % (media, target)): cmd = 'mkdir -p %s/ImageBoot/%s/etc/enigma2' % (media, target) @@ -355,12 +402,8 @@ def NEOBootMainEx(source, target, stopenigma, CopyFiles, CopyKernel, TvList, Ste rc = os.system(cmd) +##################################### if not os.path.exists('' + media_target + '/boot/zImage.' + getBoxHostName() + ''): - cmd = 'echo -n "#!/bin/sh -e \n# rc.local \n\n' + extensions_path + 'NeoBoot/files/userscript.sh \n\n exit 0" > %s/ImageBoot/%s/etc/rc.local' % (media, target) - rc = os.system(cmd) - cmd = 'chmod 0755 %s/ImageBoot/%s/etc/rc.local' % (media, target) - rc = os.system(cmd) - namefile = media + '/ImageBoot/' + target + '/etc/fstab' namefile2 = namefile + '.tmp' if os.path.exists(namefile2):