From 93d918a0b60a5b4d6ad4f604356dba55e96d9ac0 Mon Sep 17 00:00:00 2001 From: gutosie Date: Fri, 17 Dec 2021 20:29:26 +0200 Subject: [PATCH] Update arm_run.py --- NeoBoot/tmpfiles/runpy/arm_run.py | 48 ++++++++++++------------------- 1 file changed, 19 insertions(+), 29 deletions(-) diff --git a/NeoBoot/tmpfiles/runpy/arm_run.py b/NeoBoot/tmpfiles/runpy/arm_run.py index 0bc127f..9dbb12f 100644 --- a/NeoBoot/tmpfiles/runpy/arm_run.py +++ b/NeoBoot/tmpfiles/runpy/arm_run.py @@ -129,25 +129,19 @@ class StartImage(Screen): if getImageNeoBoot() == 'Flash': if fileExists('/.multinfo'): if fileExists('/media/InternalFlash/linuxrootfs1/sbin/neoinitarm'): - cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') - cmd1 = 'cd /media/InternalFlash/linuxrootfs1; ln -sfn /sbin/init.sysvinit /media/InternalFlash/linuxrootfs1/sbin/init; sleep 5; reboot -d -f ' - self.session.open(Console, _('NeoBoot-Reboot ....'), [cmd, cmd1]) + os.system('ln -sf "init.sysvinit" "/media/InternalFlash/linuxrootfs1/sbin/init"') if fileExists('/media/InternalFlash/linuxrootfs2/sbin/neoinitarm'): - cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') - cmd1 = 'cd /media/InternalFlash/linuxrootfs2; ln -sfn /sbin/init.sysvinit /media/InternalFlash/linuxrootfs2/sbin/init; sleep 5; reboot -d -f ' - self.session.open(Console, _('NeoBoot-Reboot ....'), [cmd, cmd1]) + os.system('ln -sf "init.sysvinit" "/media/InternalFlash/linuxrootfs2/sbin/init"') if fileExists('/media/InternalFlash/linuxrootfs3/sbin/neoinitarm'): - cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') - cmd1 = 'cd /media/InternalFlash/linuxrootfs3; ln -sfn /sbin/init.sysvinit /media/InternalFlash/linuxrootfs3/sbin/init; sleep 5; reboot -d -f ' - self.session.open(Console, _('NeoBoot-Reboot ....'), [cmd, cmd1]) + os.system('ln -sf "init.sysvinit" "/media/InternalFlash/linuxrootfs3/sbin/init"') if fileExists('/media/InternalFlash/linuxrootfs4/sbin/neoinitarm'): - cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') - cmd1 = 'cd /media/InternalFlash/linuxrootfs4; ln -sfn /sbin/init.sysvinit /media/InternalFlash/linuxrootfs4/sbin/init; sleep 5; reboot -d -f ' - self.session.open(Console, _('NeoBoot-Reboot ....'), [cmd, cmd1]) + os.system('ln -sf "init.sysvinit" "/media/InternalFlash/linuxrootfs4/sbin/init"') if fileExists('/media/InternalFlash/sbin/init'): - cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') - cmd1 = 'cd /media/InternalFlash; ln -sfn /sbin/init.sysvinit /media/InternalFlash/sbin/init; sleep 5; reboot -d -f ' - self.session.open(Console, _('NeoBoot-Reboot ....'), [cmd, cmd1]) + os.system('ln -sfn "init.sysvinit" "/media/InternalFlash/sbin/init"') + if fileExists('/media/InternalFlash'): + cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') + cmd1 ='sleep 5; reboot -d -f' + self.session.open(Console, _('NeoBoot-Reboot ....'), [cmd, cmd1]) else: cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') cmd1 = 'sleep 5; reboot -d -f ' @@ -163,25 +157,21 @@ class StartImage(Screen): elif getImageNeoBoot() != 'Flash': if fileExists('/.multinfo'): if fileExists('/media/InternalFlash/linuxrootfs1/sbin/neoinitarm'): - cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') - cmd1 = 'cd /media/InternalFlash/linuxrootfs1; ln -sfn /sbin/neoinitarm /media/InternalFlash/linuxrootfs1/sbin/init; sleep 5; reboot -d -f ' - self.session.open(Console, _('NeoBoot-Reboot ....'), [cmd, cmd1]) + os.system('ln -sf "init.sysvinit" "/media/InternalFlash/linuxrootfs1/sbin/init"') if fileExists('/media/InternalFlash/linuxrootfs2/sbin/neoinitarm'): - cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') - cmd1 = 'cd /media/InternalFlash/linuxrootfs2; ln -sfn /sbin/neoinitarm /media/InternalFlash/linuxrootfs2/sbin/init; sleep 5; reboot -d -f ' - self.session.open(Console, _('NeoBoot-Reboot ....'), [cmd, cmd1]) + os.system('ln -sf "init.sysvinit" "/media/InternalFlash/linuxrootfs2/sbin/init"') if fileExists('/media/InternalFlash/linuxrootfs3/sbin/neoinitarm'): - cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') - cmd1 = 'cd /media/InternalFlash/linuxrootfs3; ln -sfn /sbin/neoinitarm /media/InternalFlash/linuxrootfs3/sbin/init; sleep 5; reboot -d -f ' - self.session.open(Console, _('NeoBoot-Reboot ....'), [cmd, cmd1]) + os.system('ln -sf "init.sysvinit" "/media/InternalFlash/linuxrootfs3/sbin/init"') if fileExists('/media/InternalFlash/linuxrootfs4/sbin/neoinitarm'): + os.system('ln -sf "init.sysvinit" "/media/InternalFlash/linuxrootfs4/sbin/init"') + if fileExists('/media/InternalFlash'): + cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') + cmd1 ='sleep 20; reboot -d -f' + self.session.open(Console, _('NeoBoot-Reboot ....'), [cmd, cmd1]) + else: cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') - cmd1 = 'cd /media/InternalFlash/linuxrootfs4; ln -sfn /sbin/neoinitarm /media/InternalFlash/linuxrootfs4/sbin/init; sleep 5; reboot -d -f ' - self.session.open(Console, _('NeoBoot-Reboot ....'), [cmd, cmd1]) - else: - cmd = "echo -e '\n\n%s '" % _('NEOBOOT - Restart image flash....\nPlease wait, in a moment the decoder will be restarted...\n') cmd1 = 'sleep 5; reboot -d -f ' - self.session.open(Console, _('NeoBoot ....'), [cmd, cmd1]) + self.session.open(Console, _('NeoBoot-Reboot ....'), [cmd, cmd1]) elif not fileExists('/.multinfo'): cmd = "echo -e '\n\n%s '" % _('NEOBOOT - Restart image flash....\nPlease wait, in a moment the decoder will be restarted...\n') cmd1 = 'sleep 5; ln -sfn /sbin/neoinitarm /sbin/init; reboot -d -f '