I'm running LEDE 17.1.04 on the dualcore router O2 6431 and the default bootargs include nosmp
because one core is occupied by the FXS part of the router.
But I want to use a few of these routers as VPN-gateways and/or for freifunk and both scenarios benefit greatly of a second CPU core...
Now LEDEs buildsystem does not jet offer a selection between FXS+noSMP and noFXS+SMP builds.
I could just modify the .dtsi
file and/or the buildsystem could be updated to offer the mentioned options, but I'd rather like to be able to modify / edit / change the kernel command line / bootargs on a flashed router, without the need to reflash it.
So far I managed to define a slightly different bootargs var in uboot over a serial connection:
set bootargs 'console=ttyLTQ0,115200 mem=61M vpe1_load_addr=0x83e00000 vpe1_mem=2M maxvpes=1 maxtcs=1 nosmp'
... but LEDE just ignores mem=61M
and still reports:
[ 0.000000] Kernel command line: console=ttyLTQ0,115200 mem=62M vpe1_load_addr=0x83e00000 vpe1_mem=2M maxvpes=1 maxtcs=1
and
root@OpenWrt:~# cat /proc/cmdline console=ttyLTQ0,115200 mem=62M vpe1_load_addr=0x83e00000 vpe1_mem=2M maxvpes=1 maxtcs=1
How can I get LEDE to use the bootargs var provided by me, instead of the one integrated at build time?
And as a side question: How can I modify the uboot environment from a running LEDE?
So far I installed the packages uboot-envtools
and kmod-mtd-rw
but nothing works:
root@OpenWrt:~# cat /etc/fw_env.config
/dev/mtd2 0x0000 0x20000 0x20000
root@OpenWrt:~# fw_setenv bootcmd console=ttyLTQ0,115200 mem=61M
Can't open /dev/mtd2: Permission denied
Error: can't write fw_env to flash
root@OpenWrt:~# insmod mtd-rw.ko i_want_a_brick=1
root@OpenWrt:~# mtd unlock mtd2
Could not open mtd device: mtd2
Could not open mtd device: mtd2
root@OpenWrt:~# fw_setenv bootcmd console=ttyLTQ0,115200 mem=61M
MTD erase error on /dev/mtd2: I/O error
Error: can't write fw_env to flash
Of course I tried that only after getting fw_printenv
working:
root@OpenWrt:~# fw_printenv
addconsole=setenv bootargs $bootargs console=$consoledev,$baudrate
addeth=setenv bootargs $bootargs ethaddr=$ethaddr
addip=setenv bootargs $bootargs ip=$ipaddr:$serverip::::$netdev:off
addmachtype=setenv bootargs $bootargs machtype=VGV7510KW22
baudrate=115200
bootargs=console=ttyLTQ0,115200 mem=61M vpe1_load_addr=0x83e00000 vpe1_mem=2M maxvpes=1 maxtcs=1 nosmp
bootcmd=bootm ${kernel_addr}
bootdelay=2
consoledev=ttyLTQ1
ethact=ltq-eth
ethaddr=00:01:02:03:04:05
ipaddr=192.168.1.1
kernel_addr=0xB0080000
loadaddr=0x81000000
netdev=eth0
serverip=192.168.1.2
write-uboot-nor=protect off 0xB0000000 +$filesize && erase 0xB0000000 +$filesize && cp.b $fileaddr 0xB0000000 $filesize
(I removed a few unnecessary lines)
BTW: I accidentally mixed up fwtools
with uboot-envtools
and uninstalled fwtools
. This completely bricked my LEDE, partly because the package base-files
depends on fwtools and all that stuff was marked as deleted in the file system overly.
I couldn't even access a shell over the serial console. All I got after most of the usual boot/kernel log was repeated messages like this: Failed to execute Please press Enter to activate this console.
Luckily FAILSAFE MODE was working and I could've just cleared the overly ("firstboot - reset settings to factory defaults").
Instead I opted to manually compare /rom/
with /overlay/upper/
and fix all the wrongly removed/modified files etc. Now everything seems to be working again.
IMHO users should not be able to uninstall any essential packages with opkg...
Should I report this as a bug? Or make a feature request?