diff --git a/NeoBoot/files/tools.py b/NeoBoot/files/tools.py index 8dcc771..3e5eeb9 100644 --- a/NeoBoot/files/tools.py +++ b/NeoBoot/files/tools.py @@ -1819,8 +1819,11 @@ class CreateSwap(Screen): cmd1 = 'dd if=/dev/zero of=' + myfile + ' bs=1024 count=' + swapsize + ' 2>/dev/null' cmd2 = 'mkswap ' + myfile cmd3 = 'echo "' + myfile+ ' swap swap defaults 0 0 " >> /etc/fstab' - cmd4 = 'echo "/sbin/swapon ' + myfile+ '; swapon -a " >> /etc/init.d/rcS.local' - cmd5 = 'chmod 755 /etc/init.d/rcS.local; chmod 755 ' + myfile+ '; /sbin/swapon ' + myfile+ '' + if os.path.exists('/etc/init.d/rc.local'): + cmd4 = 'echo "/sbin/swapon ' + myfile+ '; swapon -a " >> /etc/init.d/rc.local; chmod 755 /etc/init.d/rc.local' + else: + cmd4 = 'echo "/sbin/swapon ' + myfile+ '; swapon -a " >> /etc/init.d/rcS.local; chmod 755 /etc/init.d/rcS.local' + cmd5 = 'chmod 755 ' + myfile+ '; /sbin/swapon ' + myfile+ '' cmd6 = "echo -e '\n\n%s '" % _('Creation complete swap ' + swapsize + '') self.session.open(Console, _('NeoBoot....'), [cmd0, cmd1,