I want to build an image where the kernel is to be written to a specific partition in a nand flash.
first i created a new partition from U-boot commandline with the name mpart.
second i edited the dts file at target/linux/ipq40xx/files-4.14/arch/arm/boot/dts
and added the new partition i made with label = 'mpart'
last i edited the Makefile at /target/linux/ipq40xx/image and added KERNEL_PART = mpart
is this how can i customize the image beeing built and allow the kernel to be installed in the specified nand partition.
the device is wallysDR4029 based on the iqp40xx.
Kernel 4.14 is very old. Either you are using a vendor fork or some very old version of OpenWrt. I strongly suggest using the latest codebase of OpenWrt, your device is supported there.
That said: Your device has a NAND which is likely to have bad blocks. It's a bad idea to put the kernel directly into a partition. That's why your device uses UBI for the kernel and the rootfs. Why do you want to change that?
I want to make an image as a back up something as a dual boot.
there will be the ordinary kernel image and another customized image on another partition. in case of some conditions it boots from the customized image,
I'am using openwrt18.06.
is there something in the openwrt make files to make the UBI partitions, or is it done from the U-boot command line.
I want to edit the bootargs to load the kernel from another ubi partition,
where does openwrt sets the bootargs during building.
after a little search i found that there is /chosen { bootargs = "root=/dev/ubiblock0_1 rootfstype=squashfs rootwait ubi.mtd=0"; };
line in the dts file but when i edited it to add the new partition i want the kernel to be in i didn't found this line should i add it or does openwrt sets these parameters else where.
you have the option to try and see if it works ... grep under target/linux for bootargs and you will see examples (in particular for your device) however that much depends on your device and u-boot... be ready with a backup of your partitions and able to boot from tftp etc
Standard disclaimer applies. 18.06 is long out of support and should not be used. There are multiple unpatched security vulnerabilities that will not be fixed.
It is so old any advice you receive may not be valid for 18.06
Start by upgrading to a supported release, then begin your dev project
IMHO it's hard to get all this working correctly, i.e. when do you need to boot the second image? It might be easier to just boot an initramfs image over TFTP or use a recovery method supposedly present in U-Boot.
The bootargs are parsed once the kernel has been loaded. They are there to be independent from incorrectly configured bootloaders. You need to change the bootloader load parameters (from within OpenWrt using fw_setenv, if supported).