<div dir="ltr"><div><div><div><div><div><div><div><div>Thanks you for the reply. Yeah I spent a lot of time poking around the code I have for that particular kernel. After tests and reading around forums for similar problem some guy mention that boot parsing code could be in /arch as well. So I looked at specific for the board file and found the customized code.<br><br></div>So the guy that did the customizing performed check up what buttons are pressed at boot and did several if .. else .. to load from different partitions. Any way is still doesn&#39;t do what is supposed to so I did ugly hack.<br><br></div>custom arch file ... /home/user/linux_letux/arch/mips/jz4730/board-minipc.c<br><br></div>and the code <br><br>+++++++++++++++++++++++++++++++++++++++++++++==<br><br>void overwrite_root_name(/* full path to root device */ char *root_name, /* comma separated list of file systems */ char **root_fs_names)<br>{<br>    extern int jz_kbd_get_col(int col);<br>    /* check GPIOs if there is a boot key pressed and override boot arguments<br>     F1:                boot from first SD partition (/dev/mmcblk0p1, ext3)<br>     F2:                boot from second SD partition (/dev/mmcblk0p2, ext3)<br>     F3:                boot minifs from internal partition (/dev/mtdblock3, jffs2)<br>     F4:                boot from internal partition (/dev/mtdblock4, yaffs2)<br>     Fn:                boot from second SD partition (/dev/mmcblk0p2, ext3) (kernel was booted from SD on Fn+LeftShift)<br>     none:                boot from internal partition (/dev/mtdblock4, yaffs2)<br>     <br>     Notes:<br>        - the first condition in this list is taken, i.e. Fn+F4 results in F4 mode<br>        - there may be shadow keys (like F5) if Fn-Ctrl-LShift are pressed<br>        - pressed keys return a 0 bit<br>        - this check is done some seconds after starting the kernel right before the init process starts<br><br>     */<br>#if 0<br>    {<br>        int i;<br>        for(i=0; i &lt;= 16; i++) {<br>            if(jz_kbd_get_col(i) != 0xff)<br>                printk(KERN_INFO &quot;col %d: %02x\n&quot;, i, jz_kbd_get_col(i));<br>        }<br>    }<br>#endif<br>    if ((jz_kbd_get_col(16) &amp; 0x40) == 0)    // F1<br>        strcpy(root_name, &quot;/dev/mmcblk0p1&quot;);<br>    else if ((jz_kbd_get_col(13) &amp; 0x40) == 0)    // F2<br>        strcpy(root_name, &quot;/dev/mmcblk0p2&quot;);<br>    else if ((jz_kbd_get_col(3) &amp; 0x02) == 0)    // F3<br>        strcpy(root_name, &quot;/dev/mtdblock3&quot;), *root_fs_names=&quot;jffs2&quot;;<br>    else if ((jz_kbd_get_col(3) &amp; 0x08) == 0)    // F4<br>        strcpy(root_name, &quot;/dev/mtdblock4&quot;);<br>/*<br> else if ((jz_kbd_get_col(0) &amp; 0x80) == 0)    // F5<br> strcpy(root_name, &quot;/dev/mtdblock4&quot;);<br> else if ((jz_kbd_get_col(6) &amp; 0x08) == 0)    // F6<br> strcpy(root_name, &quot;/dev/mtdblock4&quot;);<br> else if ((jz_kbd_get_col(7) &amp; 0x02) == 0)    // F7<br> strcpy(root_name, &quot;/dev/mtdblock4&quot;);<br> else if ((jz_kbd_get_col(6) &amp; 0x40) == 0)    // F8<br> strcpy(root_name, &quot;/dev/mtdblock4&quot;);<br> else if ((jz_kbd_get_col(9) &amp; 0x40) == 0)    // F9<br> strcpy(root_name, &quot;/dev/mtdblock4&quot;);<br> else if ((jz_kbd_get_col(12) &amp; 0x80) == 0)    // F10<br> strcpy(root_name, &quot;/dev/mtdblock4&quot;);<br> */<br>    else if ((jz_kbd_get_col(16) &amp; 0x80) == 0)    // Fn<br>        strcpy(root_name, &quot;/dev/mmcblk0p2&quot;);<br>    else    // neither<br>        strcpy (root_name, &quot;/dev/mtdblock4&quot;);<br>    printk(KERN_INFO &quot;Root file system (%s) overwritten as: %s\n&quot;, *root_fs_names, root_name);<br>}<br><br><br>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<br><br></div>so I replaced &quot;mtdblock4&quot; with &quot;mmcblk0p2&quot; UGLY WAY to mount always to mmcblk0p2 in all conditions.<br><br></div>I haven&#39;t ​looked at so much kernel code for years :)<br></div><br></div>But now I have good kernel.<br><br></div>Thanks again.<br></div>