[ale] Help with kernel complilation
Boris Borisov
bugyatl at gmail.com
Tue Apr 25 18:52:23 EDT 2017
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.
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't do what is supposed to so I did ugly
hack.
custom arch file ... /home/user/linux_letux/arch/mips/jz4730/board-minipc.c
and the code
+++++++++++++++++++++++++++++++++++++++++++++==
void overwrite_root_name(/* full path to root device */ char *root_name, /*
comma separated list of file systems */ char **root_fs_names)
{
extern int jz_kbd_get_col(int col);
/* check GPIOs if there is a boot key pressed and override boot
arguments
F1: boot from first SD partition (/dev/mmcblk0p1, ext3)
F2: boot from second SD partition (/dev/mmcblk0p2, ext3)
F3: boot minifs from internal partition
(/dev/mtdblock3, jffs2)
F4: boot from internal partition (/dev/mtdblock4,
yaffs2)
Fn: boot from second SD partition (/dev/mmcblk0p2,
ext3) (kernel was booted from SD on Fn+LeftShift)
none: boot from internal partition (/dev/mtdblock4,
yaffs2)
Notes:
- the first condition in this list is taken, i.e. Fn+F4 results in
F4 mode
- there may be shadow keys (like F5) if Fn-Ctrl-LShift are pressed
- pressed keys return a 0 bit
- this check is done some seconds after starting the kernel right
before the init process starts
*/
#if 0
{
int i;
for(i=0; i <= 16; i++) {
if(jz_kbd_get_col(i) != 0xff)
printk(KERN_INFO "col %d: %02x\n", i, jz_kbd_get_col(i));
}
}
#endif
if ((jz_kbd_get_col(16) & 0x40) == 0) // F1
strcpy(root_name, "/dev/mmcblk0p1");
else if ((jz_kbd_get_col(13) & 0x40) == 0) // F2
strcpy(root_name, "/dev/mmcblk0p2");
else if ((jz_kbd_get_col(3) & 0x02) == 0) // F3
strcpy(root_name, "/dev/mtdblock3"), *root_fs_names="jffs2";
else if ((jz_kbd_get_col(3) & 0x08) == 0) // F4
strcpy(root_name, "/dev/mtdblock4");
/*
else if ((jz_kbd_get_col(0) & 0x80) == 0) // F5
strcpy(root_name, "/dev/mtdblock4");
else if ((jz_kbd_get_col(6) & 0x08) == 0) // F6
strcpy(root_name, "/dev/mtdblock4");
else if ((jz_kbd_get_col(7) & 0x02) == 0) // F7
strcpy(root_name, "/dev/mtdblock4");
else if ((jz_kbd_get_col(6) & 0x40) == 0) // F8
strcpy(root_name, "/dev/mtdblock4");
else if ((jz_kbd_get_col(9) & 0x40) == 0) // F9
strcpy(root_name, "/dev/mtdblock4");
else if ((jz_kbd_get_col(12) & 0x80) == 0) // F10
strcpy(root_name, "/dev/mtdblock4");
*/
else if ((jz_kbd_get_col(16) & 0x80) == 0) // Fn
strcpy(root_name, "/dev/mmcblk0p2");
else // neither
strcpy (root_name, "/dev/mtdblock4");
printk(KERN_INFO "Root file system (%s) overwritten as: %s\n",
*root_fs_names, root_name);
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
so I replaced "mtdblock4" with "mmcblk0p2" UGLY WAY to mount always to
mmcblk0p2 in all conditions.
I haven't looked at so much kernel code for years :)
But now I have good kernel.
Thanks again.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20170425/dfbe4893/attachment.html>
More information about the Ale
mailing list