diapolonDecember 19, 2017 at 7:05 pm #348361
Hi at all.
I need to boot every time into nor, i use boot_dev=on and it work.
But because i want prevent to boot into nand , this solution is not good (change switch and it boot on nand)
I tried with bootcount=3 but it is reset to zero every boot, even this solution is not good
If i change “bootcmd” param:
bootcmd=if nand bad; then nboot 0x81000000 0 || run blf; else run blf; fi
bluewavenetDecember 20, 2017 at 7:31 pm #349551
- This topic was modified 4 weeks by diapolon.
I have posted this before, but it keeps getting lost under all the other posts, so I’ll post again.
As this keeps popping up it might be worth adding it into the docs 🙂
Here it is:
Setting bootcount 3 in rc.local does not permanently work as LEDE, presumably kernel, sets it back to bootcount=0 as soon as the init.d process has finished ie as rc.local completes.
A workaround for this is to add the following to /etc/rc.local of the NOR image:
echo sleep 1 > /tmp/bootnor
echo fw_setenv bootcount 3 >> /tmp/bootnor
chmod +x /tmp/bootnor
This created a script file and sets it to run in the background.
Now if you want to boot NAND again all you have to do is manually set bootcount=0
Possibly if power is removed in the short interval between init.d completing and the one second sleep ending then you might still have bootcount=0, defeating this workaround, so just add the extra lines to rc.local in the NAND image as well.
This will effectively swap the default from NAND to NOR
diapolonDecember 20, 2017 at 9:57 pm #349761
- This reply was modified 3 weeks by bluewavenet.
thankyou, i know you solution but it’s a workaround and i wold like prevent this:
“Possibly if power is removed in the short interval between init.d completing and the one second sleep ending then you might still have bootcount=0, defeating this workaround”bluewavenetDecember 20, 2017 at 10:28 pm #349861
“so just add the extra lines to rc.local in the NAND image as well.”
You could even add a reboot command to the end of the bootnor script in the NAND image then the only way to get back into NAND image would be to reflash.diapolonDecember 21, 2017 at 12:35 am #350191
yes, but refllashing NAND image the tricks is bypassed.. i would like a definitive solutions 🙂bluewavenetDecember 25, 2017 at 7:30 pm #355871
Yes that is true and I did start down that path only to abandon it as:
1. NAND not supported on this device by LEDE
2. The NAND version is discontinued in favour of NOR only version.
3. The extra space given by the NAND is very rarely used. In my application I have lighttpd, php7, uhttpd with luci, and a whole suite of my own software and still have over 8MB free flash so it was not worth the effort.
4. The 16MB version is cheaper 🙂
You must be logged in to create new replies.