Finally, I compiled a kernel and made a initramfs for it.
Now the "root"-parameter is being replaced in the init-script in the initramfs.
So I am now able to boot directly to the partition I want to, instead of stock OS without interrupting uboot.
This creates a initramfs on the NAS, which can be used for a kernel, either as parameter or inbuilt.
Since we can't give parameters for autoboot, we will compile it in the kernel.
sudo mkinitramfs -o myownramfs.gz
Move "myownramfs.gz" to the machine you compile your kernels for the NAS.
Now we extract it.
mkdir ramfs
cd ramfs
gzip -dc /home/you/myownramfs.gz | cpio -ivd
Now we need to edit the file "init".
An if start with a comment on line 74, the command is "# Parse command line options".
On line 182 the if ends. Now do a new line (line 183) and type this in (of course, put
your device and partition in it):
ROOT=/dev/sda2
Since our initramfs has the required modules from our working root, even USB should be bootable now, but I didn't test yet.
Only this modification is required, now we make a cpio archive of the files.
find . | cpio -H newc -o > ../initramfs.cpio
Now we have a file called initramfs.cpio on the above folder.
You can now copy this file to the root of the kernel-directory and run:
make ARCH=arm menuconfig
It should have load your existing configuration, else just navigate to load and load your .config.
Now go to "General Setup" (First entry) and navigate to "Initial RAM filesystem and RAM disk (initramfs/initrd) support".
Activate it with "y", move one down and press enter.
Enter the filename of your cpio archive. We named it "initramfs.cpio".
Press enter, go back and navigate to "Save an Alternate Configuration File" and just press enter, since the standard is ".config".
Now compile your kernel.
You should now have a new uImage. Move it to your NAS.
Mount the flash drive-partitions with the original uImage.
mkdir boot1
mkdir boot2
sudo mount /dev/mmcblk0p1 boot1
sudo mount /dev/mmcblk0p2 boot2
Backup the original, incase it is necessary.
mkdir stockuImage
sudo mv boot1/uImage stockuImage/uImage.p1
sudo mv boot2/uImage stockuImage/uImage.p2
Place your own kernel in the partitions.
sudo cp uImage boot1
sudo cp uImage boot2
Now you are done. Next time you dont need to interrupt uboot and pass new parameters and variables.
Uboot boots our kernel and our kernel doesn't uses the given "root"-parameter. Only the root-partition in the init-script is used.
Thats, btw, the reason why I currently don't provide prebuilt uImages, since the device and partition depends on your config and on the devices you have attached.
If you have only one HDD, it's of course
sda. If you have all three sATA-ports full and your system is on the above 2.5" slot, it will be
sdc.