Hi, Lucas Thanks very much for you help, shared my solutions below:
On 4/16/12, Lucas Meneghel Rodrigues <[email protected]> wrote: > On Mon, 2012-04-16 at 11:43 +0800, Wu Zhangjin wrote: >> ---------- Forwarded message ---------- >> From: Wu Zhangjin <[email protected]> >> Date: Mon, Apr 16, 2012 at 11:40 AM >> Subject: Question about cross compiling support >> To: Autotest Team <[email protected]> >> >> >> Hi, Autotest Team >> >> Thanks very much for your work on the autotest support of Linux, I'm >> currently playing with this powerful tool but I encountered a problem, >> that is: >> >> How to compile a kernel in a local machine and install it to a target >> board, then, reboot the target with the new kernel. >> >> For example, my local machine is an X86 PC, the target machine is an >> ARM board, I want to cross compile the kernel from X86 PC and then >> install >> it to the ARM board, how can I simply implement this? >> >> BTW, my target board doesn't support the popular Grub or Lilo >> bootloader, but instead, it uses a Uboot bootloader, so, it is not >> suitable to use >> the old install() and boot() methods of the kernel class, is that >> possible to add a new Bootloader support for Uboot? or simply hack the >> install() and boot() methods? > > Hi Wu, > > I don't have a good answer for your query just yet. I saw a while ago > patches from the guys working on ChromeOS that allow cross compilation, > but I am not sure how to use it. Maybe Scott Zawalski knows more about > cross compilation, I'm copying him in this reply. > For the kernel cross compilation, I did find two 'simple' solutions (Will paste the using demo's tomorrow): 1. Build the kernel on a 'localhost' SSHHost, but we need to explicitly set the autodir to another directory, it should differ from the default one: '/usr/local/autotest', for example, '/usr/local/kbuild', otherwise, there will be conflicts. Note: The existing LocalHost class doesn't work as the argument of kernel.build() for it lacks lots of required functions. 2. Use the utils tools to run 'cp /path/to/defconfig .config', 'make oldconfig', 'make -j8 zImage' commands one by one directly, but this will not benefit from the Kernel classes. Seems both of them require to add the path of the cross compiler to the PATH env variable explicitly, not sure if there is a better method to use the existing PATH (included the path to cross compiler) in /etc/profile or ~/.bashrc. > Otherwise, I'd have to do a bit of research, as I don't work with ARM > boards. > In order to install the cross-compiled kernel image to the board with Uboot, I simply give up the the install() and boot() functions of the kernel class and add my own function to copy the kernel image from my localhost to a directory(e.x /path/to/zimage) of the target board with the send_file() method of the host, and then, install it with the dd command: dd if=/path/to/zimage of=/dev/zimage_partition. after that, issue a host.reboot() will let the board run with the new kernel. > I'll tell you that I have recently talked with some folks interested in > cross compilation support. I'd love to enable you guys to use autotest > for your use cases, but we'd need some help with documentation of the > feature, and helping with patches. > Cross compilation may speedup the testing of the slow embedded targets for it saves the time of sending source files between the server and the client and also save the time of compilation, if the clients are the same, the time saving may be more explicit since the clients may share the same cross-compiled binaries. Hope I can join in, but I'm a newbie to autotest currently ;-) Best Regards, Wu Zhangjin > Cheers, > > Lucas > >> Thanks in advance. >> >> Best Regards, >> Wu Zhangjin >> _______________________________________________ >> Autotest mailing list >> [email protected] >> http://test.kernel.org/cgi-bin/mailman/listinfo/autotest > > > _______________________________________________ Autotest mailing list [email protected] http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
