Are there any drawbacks to the "kernel argument" solution ?
I don't think so.
Did I miss any other simple solutions ?
I would go on the kernel solution and use a specific runlevel.
If i understood well your needs, the integration mode will implement the same things than production/operation mode but with stuff added (ssh, etc...).
So i would use ...
I solved this issue by loading the image to a higher address. When I was getting the error I was doing
fatload mmc 0 0x2000000 image.ub
I fixed it by doing
fatload mmc 0 0x40000000 image.ub
Since image.ub was of size 129476304 > 0x2000000 it was probably overwriting something when uncompressing if it uncompresses to ...
Add all the mtd partitions in the bootargs, I was getting the same error...
After adding mtd parition in bootargs I could get past it..
bootargs=console=ttyS0,115200 root=/dev/mmcblk0p2 rw rootwait ubi.mtd=5
Basically by doing so we tell the kernel to attach mtd5 to ubi.
If you are using mtd0 to mtd5 then add all of them in bootargs
A principal failing in your code is the use of time(). This returns a value in seconds, so your loop might last from 4 to 5 seconds. Instead you should use gettimeofday() which provides a microseconds field (though the resolution might be worse than that).
You might also reduce variability by making your process a real-time process. Use chrt -f to run your ...
While the statements might operate at a constant number of clock cycles for each loop, there is no guarantee that they will have a constant clock time for execution.
There are any number of other things which the kernel must address, using clock cycles which your loop will not have available. Updating the system clock, checking for other processes to run, ...
Here is my opinion: Sorry for verbosity in advance.
When we are specifically talking about ubifs we should always either sync / similar options.
ubifs supports write-back caching
That means changes written on the files do not go to flash directly. They are stored on the page cache first and later written to flash.
(Read more on write buffers for NAND ...
ifupdown set of scripts isn't designed to work that way.
Instead, you may:
Stop using ifupdown and manage to configure the networking by yourself inside a dedicated script. (i would probably choose this option)
Use the post-up feature of ifupdown, that way:
iface eth0 inet static
pre-up ifconfig eth0 hw ether `cat /root/macaddress`