LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-14-2010, 04:14 AM   #1
albert-mcfly
LQ Newbie
 
Registered: Oct 2010
Posts: 3

Rep: Reputation: 0
Compiling the kernel


Hi everyone. I recentlly succeded to compile the kernel version 2.6 for a soft-core embedded CPU (MicroBlaze) in a development board designed by Xilinx (SP605). However, after reinstalling my OS and doing some other things I can no longer compile using the same procedure. ( I am using ubuntu 10.04 now)


Next I describe the steps that i have followed, some of them are pretty specific to my platform but don't worry if you don't totally understand them as I suspect that my problem is a more general and has to do with ubuntu itself.
I have uncompressed the initramfs.cpio file into a directory and pointed the CONFIG_INITRAMFS_SOURCE parameter in the .config file to it. I have applied the commands (both using sudo and without it) "sudo make ARCH=microblaze mmu_defconfig", "sudo make ARCH=microblaze menuconfig" (configured the platform). I have also generated the Device Tree Source file and placed it in "../ARCH/microblaze/boot/dts". I also set the environment variable PATH with " export PATH="/home/arquerc/mb-gnu-tools/microblaze-unknown-linux-gnu/bin":$PATH; " which is where I have the microblaze tools placed (the mb-linux-gcc executable is there).



If I am not forgetting anything I went ahead and ran "sudo make ARCH=microblaze CROSS_COMPILE=mb-linux- simpleImage.xilinx" and I got the following output:


arquerc@arquerc-UBUNTU:~/linux-2.6-xlnx$ sudo make ARCH=microblaze CROSS_COMPILE=mb-linux- simpleImage.system
make: mb-linux-gcc: Command not found
make: mb-linux-gcc: Command not found
CHK include/linux/version.h
CHK include/generated/utsrelease.h
CC kernel/bounds.s
/bin/sh: mb-linux-gcc: command not found
make[1]: *** [kernel/bounds.s] Error 127
make: *** [prepare0] Error 2




If I am correct this means that the command mb-linux-gcc can not be found and that would mean that i have incorrectlly set the PATH variable . However if I type "echo $PATH" the value of the variable is correct.... I set the PATH variable by adding the following line to /home/arquerc/.bashrc : export PATH="/home/arquerc/mb-gnu-tools/microblaze-unknown-linux-gnu/bin":$PATH;

arquerc@arquerc-UBUNTU:~$ echo $PATH
/home/arquerc/mb-gnu-tools/microblaze-unknown-linux-gnu/bin:/opt/Xilinx/12.2/ISE_DS/ISE/bin/lin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games


The most alarming thing is that if i write "mb-linux-gcc" into the shell I don't get the "command not found" message... meaning that the file can actually be located....

arquerc@arquerc-UBUNTU:~$ mb-linux-gcc
mb-linux-gcc: no input files


I really don't know what to do... I was able to compile using this same procedure without any problems just like a week ago.
 
Old 10-14-2010, 09:26 AM   #2
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,780

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
Do you need to sudo for make? I think sudo might be resetting the environment variables for security purposes. This is probably configurable in /etc/sudoers
 
Old 10-14-2010, 09:51 AM   #3
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
How about adding the full filespec prefix to your CROSS_COMPILE parameter?
Code:
sudo make ARCH=microblaze CROSS_COMPILE=/home/arquerc/mb-gnu-tools/microblaze-unknown-linux-gnu/bin/mb-linux- simpleImage.xilinx
You should not need root privileges to do any of these things.

--- rod.
 
Old 10-15-2010, 05:11 AM   #4
albert-mcfly
LQ Newbie
 
Registered: Oct 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks!

Thanks people it was the sudo thing! I was only using sudo because "make ARCH=microblaze mrproper" had given me error without it. I did it without sudo and it compiled OK!!!

Thanks again!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Good but sorta easy guide to Kernel compiling/Re-Compiling? linus72 Linux - General 1 07-13-2009 01:37 PM
Compiling a module separately without compiling entire kernel kushalkoolwal Linux - Kernel 8 08-06-2008 01:45 AM
Where Is Kernel Directory In Rh9(kernel 2.4.20-8), For Compiling HSP56 MR(pctel) Mode rudy3107 Linux - Software 1 07-25-2004 04:17 AM
Kernel compiling and module compiling tarballed Linux - General 1 12-22-2002 05:31 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration