Tracking down makefile problems



  • I'm going through my first struggles with a linux kernel build, and I could use some help figuring out how to track down problems in the makefiles.

    I've spent 3 hours trying to even find where I might be going wrong. Once I find the makefile that's going wrong, I'll gladly post the problem part.

    Below is the build output:

    [root@5ae9ec063e3b elbox_WRGND15]# make
    svn: E155007: '/data/n900/elbox_WRGND15' is not a working copy
    cat: buildno: No such file or directory
    
    ===================================================
    You are going to build the f/w images.
    Both the release and tftp images will be generated.
    ===================================================
    
    Do you want to (re)build the linux kernel of the firmware now ?
    The linux kernel part of the firmware will be rebuild if you say yes.
    You can skip building kernel to save some time if it is not modified
    since last build. Please say yes, if this is the first time building
    the firmware.
    
    Do you want to build it now ? (yes/no) : yes
    svn: E155007: '/data/n900/elbox_WRGND15' is not a working copy
    cat: buildno: No such file or directory
    make[1]: Entering directory `/data/n900/elbox_WRGND15'
    Start building images (with kernel rebuild)...
    svn: E155007: '/data/n900/elbox_WRGND15' is not a working copy
    cat: buildno: No such file or directory
    make[2]: Entering directory `/data/n900/elbox_WRGND15'
    WRG-ND15 Building kernel ...
    #@make -C progs.board/ubicom -f sources.mk
    #@make -C progs.board/ubicom ultra V= DEBUG=
    svn: E155007: '/data/n900/elbox_WRGND15/boards/wrgnd15/ubicom' is not a working copy
    make[3]: Entering directory `/data/n900/elbox_WRGND15/boards/wrgnd15/ubicom'
    make[4]: ubicom32-elf-gcc: Command not found
    make[4]: Entering directory `/data/n900/elbox_WRGND15/kernels/ubicom32-kernel-2.6.36'
    make[4]: Entering directory `/data/n900/elbox_WRGND15/kernels/ubicom32-kernel-2.6.36'
    scripts/kconfig/conf --oldconfig arch/ubicom32/Kconfig
    #
    # configuration written to .config
    #
    make[4]: Leaving directory `/data/n900/elbox_WRGND15/kernels/ubicom32-kernel-2.6.36'
    make[4]: ubicom32-elf-gcc: Command not found
    make[4]: Entering directory `/data/n900/elbox_WRGND15/kernels/ubicom32-kernel-2.6.36'
    make[4]: ubicom32-elf-gcc: Command not found
    make[4]: Entering directory `/data/n900/elbox_WRGND15/kernels/ubicom32-kernel-2.6.36'
    make[4]: Entering directory `/data/n900/elbox_WRGND15/kernels/ubicom32-kernel-2.6.36'
    make[5]: ubicom32-elf-gcc: Command not found
    scripts/kconfig/conf --silentoldconfig arch/ubicom32/Kconfig
    make[4]: Leaving directory `/data/n900/elbox_WRGND15/kernels/ubicom32-kernel-2.6.36'
    make[4]: ubicom32-elf-gcc: Command not found
    make[4]: ubicom32-elf-gcc: Command not found
      CHK     include/linux/version.h
      CHK     include/generated/utsrelease.h
      CC      kernel/bounds.s
    /bin/sh: ubicom32-elf-gcc: command not found
    make[5]: *** [kernel/bounds.s] Error 127
    make[4]: *** [prepare0] Error 2
    make[3]: *** [kernel_image] Error 2
    make[3]: Leaving directory `/data/n900/elbox_WRGND15/boards/wrgnd15/ubicom'
    make[2]: *** [kernel] Error 2
    make[2]: Leaving directory `/data/n900/elbox_WRGND15'
    make[1]: *** [all_with_kernel] Error 2
    make[1]: Leaving directory `/data/n900/elbox_WRGND15'
    make: *** [all] Error 2
    

    ubicom32-elf-gcc is, as far as I can tell, a custom gcc, which lives in /opt/[stuff]/bin, which is in my path.

    [root@5ae9ec063e3b elbox_WRGND15]# env
    HOSTNAME=5ae9ec063e3b
    TERM=xterm
    LD_PRELOAD=libfakeroot-tcp.so
    LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:
    LD_LIBRARY_PATH=/usr/lib64/libfakeroot:/usr/lib64/libfakeroot:/usr/lib32/libfakeroot
    FAKEROOTKEY=37338
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    PWD=/data/n900/elbox_WRGND15
    SHLVL=3
    HOME=/root
    FAKED_MODE=unknown-is-root
    _=/usr/bin/env
    OLDPWD=/data/n900
    

    kernel info:

    [root@5ae9ec063e3b elbox_WRGND15]# uname -a
    Linux 5ae9ec063e3b 4.5.0-coreos-r1 #2 SMP Tue May 24 17:45:36 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
    

    OTHER: This is a Docker container on a Xen Center 7 hypervisor.

    Edit:

    source: http://download.wdc.com/gpl/My_Net_N900_1.07.16_d5ec.bin.tar.gz
    website: http://support.wdc.com/downloads.aspx?p=179&lang=en

    readme.txt:

    =========================
    0. Intriduction
    
       This file will show you how to build the GPL linux system.
       
    Step 1.	Install fedora linux 10 (choose Software Development) on 32bit CPU.
    
    Step 2.	Setup Build Enviornment($means command)
    
    	1) please login as a normal user such as john,and copy the gpl file to normal user folder,
    	
    	such as the folder /home/john
    	
    	2) $cd /home/john
    	
    	3) $tar zxvf My_Net_N900_1.07.16_d5ec.bin.tar.gz
    	
    	4) $cd elbox_WRGND15
    	
    	5) #cp -rf ubicom32_sdk32x_gcc-4.4.1_uclibc-0.9.30.1_v02 /opt	(ps : switch to root permission)
    
    	6) #rpm -ivh ./build_gpl/fakeroot-1.9.7-18.fc10.i386.rpm
    		  
    	7) $source ./setupenv	(ps : switch back to normal user permission)
    	
    Step 3. Building the image
    	1) $make
    	2) $make
    	3) $make
         	===================================================
    	 You are going to build the f/w images.
    	 Both the release and tftp images will be generated.
    	 ===================================================
    	 Do you want to rebuild the linux kernel ? (yes/no) : yes
    	 
          4) there are some options need to be selected , please input "enter" key to execute the default action. 
    	 
          5) After make successfully, you will find the image file in ./images/. 
    

  • Grade A Premium Asshole

    @rad131304 said in Tracking down makefile problems:

    Tracking down makefile problems

    You poor bastard.

    @rad131304 said in Tracking down makefile problems:

    OTHER: This is a Docker container on a Xen Center 7 hypervisor.

    I have nothing constructive to add except that you are double-fucked. I say that as a person who works with XenServer a lot.



  • @Polygeekery said in Tracking down makefile problems:

    I have nothing constructive to add except that you are double-fucked. I say that as a person who works with XenServer a lot.

    I work with Xen every day at work. It's our virtualization infrastructure. It's why I use it at home ... fewer skills to learn.

    I assume Docker is the offending item here. Xen 7 offers container visibility - you can't yet just run a container on their kernel build. It's a CoreOS VM.


  • Grade A Premium Asshole

    @rad131304 said in Tracking down makefile problems:

    I assume Docker is the offending item here. Xen 7 offers container visibility - you can't yet just run a container on their kernel build. It's a CoreOS VM.

    In all fairness, I did not even realize that XenServer was at 7.0 until this post. Adjust appropriately.



  • @Polygeekery said in Tracking down makefile problems:

    @rad131304 said in Tracking down makefile problems:

    I assume Docker is the offending item here. Xen 7 offers container visibility - you can't yet just run a container on their kernel build. It's a CoreOS VM.

    In all fairness, I did not even realize that XenServer was at 7.0 until this post. Adjust appropriately.

    It came out like ... 2 weeks ago?


  • Grade A Premium Asshole

    @rad131304 I am not what one would call an "early adopter".



  • @Polygeekery I'm usually not either, but 6.5 only had "container visibility" by extension. My home farm was acting like a schizophrenic gerbil regarding stats, and I finally decided to rebuild it a week ago, and saw 7 was out, so I just said "fuck it" and rebuilt on it.

    Edit: Everything spun down and up like a dream, which was awesome.



  • O shit, wait, /opt/[stuff]/bin isn't in my path ... WTF?!?!

    or, so why wouldn't:

    [root@machine dir]#source ./setupenv
    

    commit to env for root?



  • @rad131304 said in Tracking down makefile problems:

    O shit, wait, /opt/[stuff]/bin isn't in my path ... WTF?!?!

    or, so why wouldn't:

    [root@machine dir]#source ./setupenv
    

    commit to env for root?

    Did you run that in the same shell you ran make in? source only goes to the current subshell, it can't affect the parent process.


  • BINNED

    You are cross-compiling, that is why special gcc is needed. Cross-compiling means your gcc is compiled for e.g. x86 but it compiles for ubicom32 (seems to be used in OpenWrt).

    If there is support for your Arch (most likely it is because of QEMU), Aboriginal Linux can help in that it will remove the complexity of cross-compiling. It will become normal make menuconfig , make dep then make bzImage and make modules using gcc that is inside the chroot.

    Sorry it did not fix your problem with Makefile, but if you intend to do this many times it helps investing little effort for a clean environment you can reuse. Makefiles are ugly.



  • @rad131304 said in Tracking down makefile problems:

    O shit, wait, /opt/[stuff]/bin isn't in my path ... WTF?!?!

    or, so why wouldn't:

    [root@machine dir]#source ./setupenv
    

    commit to env for root?

    What @ben_lubar said - this will only affect your current shell, so if you go to a different shell (different terminal, different session, or use "su [user] -" or something similar), the env will not be changed there. The changes are not persistent, either.

    New shells spawned from that shell should inherit the environment, though.


  • :belt_onion:

    @rad131304 said in Tracking down makefile problems:

    schizophrenic gerbil

    I am not sure what this term means, but I approve of it wholeheartedly



  • @ben_lubar Possibly not; but I re-ran it, and it didn't help.



  • UPDATE:

    Much of the problem seems to stem from 2 issues:

    1. I'm missing some required build tools (I just have no idea which ones ATM)
    2. I'm root

    I fixed #2 by deploying a Fedora VM instead of trying to use a container ... now trying to figure out what tools I'm missing to get the build to work. Might go with @dse's suggestion of Aboriginal and see if that helps since the error messages are pretty useless.




  • Discourse touched me in a no-no place

    @fbmac said in Tracking down makefile problems:

    @rad131304 said in Tracking down makefile problems:

    I'm root

    0_1465514900750_images (2).jpg

    0_1465549533901_RootS4.jpg


    More on-topic, have you tried the various levels of --debug?


Log in to reply