ONL KVM build problems

645 views
Skip to first unread message

Kishore Atreya

unread,
Apr 22, 2015, 10:38:28 PM4/22/15
to opennetw...@googlegroups.com
I was able to get past some of my earlier problems by building everything as Root. That got rid of the edit line dependency issue I faced.

It looks like the make onl-kvm target builds quite a lot of things, including 3 different toolchains for the 3 different support archs. When looking to build the SWI for KVM I'm running into this error:

root@onie:/home/kishore/repo/rt-onl-work# cd ONL/
root@onie:/home/kishore/repo/rt-onl-work/ONL# ls
builds components  debian  docs  LICENSE  make  Makefile  README.md  submodules  tools
root@onie:/home/kishore/repo/rt-onl-work/ONL# make onl-kvm
export ONL=`pwd` && make -C $ONL/builds/components
make[1]: Entering directory `/home/kishore/repo/rt-onl-work/ONL/builds/components'
All components built.
make[1]: Leaving directory `/home/kishore/repo/rt-onl-work/ONL/builds/components'
export ONL=`pwd` && make -C $ONL/builds/swi/i386/all
make[1]: Entering directory `/home/kishore/repo/rt-onl-work/ONL/builds/swi/i386/kvm'
make -C rootfs rootfs.all
update-binfmts: warning: unable to open /proc/filesystems: No such file or directory
update-binfmts: warning: binfmt_misc module seemed to be loaded, but no /proc/sys/fs/binfmt_misc directory!  Giving up.
GEN /home/kishore/repo/rt-onl-work/ONL/builds/swi/i386/kvm/rootfs/.rootfs-i386.done
/tmp/tmp.AoUx3dm6ph
ONL=/home/kishore/repo/rt-onl-work/ONL
/home/kishore/repo/rt-onl-work/ONL
Creating i386 workspace in /home/kishore/repo/rt-onl-work/ONL/builds/swi/i386/kvm/rootfs/rootfs-i386
APT Cache: 127.0.0.1:3142/
multistrap 2.1.20 using /tmp/tmp.NTUVDH7iHL
multistrap 2.1.20 using /tmp/tmp.NTUVDH7iHL
Using foreign architecture: i386
multistrap building i386 multistrap on 'amd64'
I: Setting /home/kishore/repo/rt-onl-work/ONL/builds/swi/i386/kvm/rootfs/rootfs-i386/lib64 -> /home/kishore/repo/rt-onl-work/ONL/builds/swi/i386/kvm/rootfs/rootfs-i386/lib symbolic link.
Getting package lists: apt-get  -o Apt::Architecture=i386 -o Dir::Etc::TrustedParts=/home/kishore/repo/rt-onl-work/ONL/builds/swi/i386/kvm/rootfs/rootfs-i386/etc/apt/trusted.gpg.d -o Dir::Etc::Trusted=/home/kishore/repo/rt-onl-work/ONL/builds/swi/i386/kvm/rootfs/rootfs-i386/etc/apt/trusted.gpg.d/trusted.gpg -o Apt::Get::AllowUnauthenticated=true -o Apt::Get::Download-Only=true -o Apt::Install-Recommends=false -o Dir=/home/kishore/repo/rt-onl-work/ONL/builds/swi/i386/kvm/rootfs/rootfs-i386/ -o Dir::Etc=/home/kishore/repo/rt-onl-work/ONL/builds/swi/i386/kvm/rootfs/rootfs-i386/etc/apt/ -o APT::Default-Release=* -o Dir::State=/home/kishore/repo/rt-onl-work/ONL/builds/swi/i386/kvm/rootfs/rootfs-i386/var/lib/apt/ -o Dir::State::Status=/home/kishore/repo/rt-onl-work/ONL/builds/swi/i386/kvm/rootfs/rootfs-i386/var/lib/dpkg/status -o Dir::Cache=/home/kishore/repo/rt-onl-work/ONL/builds/swi/i386/kvm/rootfs/rootfs-i386/var/cache/apt/ update
Ign copy: ./ Release.gpg
Err http://127.0.0.1 wheezy Release.gpg
  Could not connect to 127.0.0.1:3142 (127.0.0.1). - connect (111: Connection refused)
Ign copy: ./ Release.gpg                
Ign copy: ./ Release                    
Ign copy: ./ Release                    
Get:1 copy: ./ Packages [13.8 kB]       
Ign copy: ./ Translation-en_US                                     
Ign copy: ./ Translation-en              
Get:2 copy: ./ Packages [861 B]          
Ign copy: ./ Translation-en_US                                    
Ign copy: ./ Translation-en              
Ign http://apt.opennetlinux.org unstable Release.gpg                                                                    
Ign http://apt.opennetlinux.org unstable Release
Get:3 http://apt.opennetlinux.org unstable/main i386 Packages
Ign http://apt.opennetlinux.org unstable/main Translation-en_US
Ign http://apt.opennetlinux.org unstable/main Translation-en
Fetched 14.7 kB in 0s (27.2 kB/s)
Reading package lists... Done
W: Failed to fetch http://127.0.0.1:3142/mirrors.kernel.org/debian/dists/wheezy/Release.gpg  Could not connect to 127.0.0.1:3142 (127.0.0.1). - connect (111: Connection refused)

W: Some index files failed to download. They have been ignored, or old ones used instead.
I: Calculating required packages.
apt-get -y  -o Apt::Architecture=i386 -o Dir::Etc::TrustedParts=/home/kishore/repo/rt-onl-work/ONL/builds/swi/i386/kvm/rootfs/rootfs-i386/etc/apt/trusted.gpg.d -o Dir::Etc::Trusted=/home/kishore/repo/rt-onl-work/ONL/builds/swi/i386/kvm/rootfs/rootfs-i386/etc/apt/trusted.gpg.d/trusted.gpg -o Apt::Get::AllowUnauthenticated=true -o Apt::Get::Download-Only=true -o Apt::Install-Recommends=false -o Dir=/home/kishore/repo/rt-onl-work/ONL/builds/swi/i386/kvm/rootfs/rootfs-i386/ -o Dir::Etc=/home/kishore/repo/rt-onl-work/ONL/builds/swi/i386/kvm/rootfs/rootfs-i386/etc/apt/ -o APT::Default-Release=* -o Dir::State=/home/kishore/repo/rt-onl-work/ONL/builds/swi/i386/kvm/rootfs/rootfs-i386/var/lib/apt/ -o Dir::State::Status=/home/kishore/repo/rt-onl-work/ONL/builds/swi/i386/kvm/rootfs/rootfs-i386/var/lib/dpkg/status -o Dir::Cache=/home/kishore/repo/rt-onl-work/ONL/builds/swi/i386/kvm/rootfs/rootfs-i386/var/cache/apt/ install  apt apt-utils bsdmainutils cpio debian-archive-keyring dosfstools ethtool fancontrol gnu-fdisk i2c-tools ifupdown iproute iputils-ping isc-dhcp-client kexec-tools less lldpd lm-sensors localepurge locales lsof make mingetty module-init-tools mtd-utils nano net-tools netbase nfs-common ntp openssh-server pciutils platform-config-qemu procps psmisc python python-flask python-pyinotify realpath resolvconf rssh rsyslog snmpd sudo tcpdump telnetd traceroute usbutils util-linux vendor-config-onl vendor-config-qemu vim-tiny wget zile
Reading package lists... Done
Building dependency tree... Done
E: Unable to locate package apt
E: Unable to locate package apt-utils
E: Unable to locate package bsdmainutils
E: Unable to locate package cpio
E: Unable to locate package debian-archive-keyring
E: Unable to locate package dosfstools
E: Unable to locate package ethtool
E: Unable to locate package fancontrol
E: Unable to locate package gnu-fdisk
E: Unable to locate package i2c-tools
E: Unable to locate package ifupdown
E: Unable to locate package iproute
E: Unable to locate package iputils-ping
E: Unable to locate package isc-dhcp-client
E: Unable to locate package kexec-tools
E: Unable to locate package less
E: Unable to locate package lldpd
E: Unable to locate package lm-sensors
E: Unable to locate package localepurge
E: Unable to locate package locales
E: Unable to locate package lsof
E: Unable to locate package make
E: Unable to locate package mingetty
E: Unable to locate package module-init-tools
E: Unable to locate package mtd-utils
E: Unable to locate package nano
E: Unable to locate package net-tools
E: Unable to locate package netbase
E: Unable to locate package nfs-common
E: Unable to locate package ntp
E: Unable to locate package openssh-server
E: Unable to locate package pciutils
E: Unable to locate package procps
E: Unable to locate package psmisc
E: Unable to locate package python
E: Unable to locate package python-flask
E: Unable to locate package python-pyinotify
E: Unable to locate package realpath
E: Unable to locate package resolvconf
E: Unable to locate package rssh
E: Unable to locate package rsyslog
E: Unable to locate package snmpd
E: Unable to locate package sudo
E: Unable to locate package tcpdump
E: Unable to locate package telnetd
E: Unable to locate package traceroute
E: Unable to locate package usbutils
E: Unable to locate package util-linux
E: Unable to locate package vim-tiny
E: Unable to locate package wget
E: Unable to locate package zile
apt download failed. Exit value: 100
cp: cannot create regular file `/home/kishore/repo/rt-onl-work/ONL/builds/swi/i386/kvm/rootfs/rootfs-i386/usr/bin/': Not a directory
/home/kishore/repo/rt-onl-work/ONL/tools/scripts/onl-mkws: line 190: /home/kishore/repo/rt-onl-work/ONL/builds/swi/i386/kvm/rootfs/rootfs-i386/tmp/config.sh: No such file or directory
chmod: cannot access `/home/kishore/repo/rt-onl-work/ONL/builds/swi/i386/kvm/rootfs/rootfs-i386/tmp/config.sh': No such file or directory
mount: mount point /home/kishore/repo/rt-onl-work/ONL/builds/swi/i386/kvm/rootfs/rootfs-i386/proc does not exist
chroot: failed to run command `/tmp/config.sh': No such file or directory
warning: failed to read mtab
umount: /home/kishore/repo/rt-onl-work/ONL/builds/swi/i386/kvm/rootfs/rootfs-i386/proc: not found
make[3]: *** [/home/kishore/repo/rt-onl-work/ONL/builds/swi/i386/kvm/rootfs/.rootfs-i386.done] Error 1
make[2]: *** [rootfs-i386.sqsh] Error 2
make[1]: *** [component] Error 2
make[1]: Leaving directory `/home/kishore/repo/rt-onl-work/ONL/builds/swi/i386/kvm'
make: *** [swi] Error 2
root@onie:/home/kishore/repo/rt-onl-work/ONL# 

Anyone else hit this?

Thanks!

-Kishore

Kishore Atreya

unread,
Apr 22, 2015, 10:42:39 PM4/22/15
to opennetw...@googlegroups.com
Also another stupid question.

Do I need to create a workspace for i386 specifically to build onl-kvm, considering it uses that arch? Right now I've been using the host architecture as the workspace (amd64).

Anyways, I'll give it a try.

-Kishore

Kishore Atreya

unread,
Apr 23, 2015, 2:42:53 PM4/23/15
to opennetw...@googlegroups.com
So I finally was able to build this morning successfully. It looks like when the make system tries to package the SWI, it looks for an APT repo that is build on localhost for debs to place inside the rootfs. I had some network issues last night, I wonder if this played a part. 

-Kishore

Kishore Atreya

unread,
Apr 23, 2015, 2:54:26 PM4/23/15
to opennetw...@googlegroups.com
Also, I think you are right

To build the SWI and installer images you do not need to be inside the workspace, in fact you shouldn’t be.

It seems like the only real need for the workspace is to build the toolchains and the packages that will be placed into the rootfs. But to actually build the SWI/rootfs you shouldn’t be inside the chroot/iso workspace. This really needs to be documented. Let’s together compose an email and send it to Rob about our findings.

-Kishore

--
You received this message because you are subscribed to a topic in the Google Groups "opennetworklinux" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/opennetworklinux/76CcYdLNAEQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to opennetworklin...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rob Sherwood

unread,
Apr 23, 2015, 4:56:19 PM4/23/15
to Kishore Atreya, opennetw...@googlegroups.com
Hi Kishore,

Sorry you had so many problems -- but if you could get a list together of what you ran into it would definitely help.  From your mails it's not entirely clear what problems you were running into.

That said, as I mentioned on a different thread, I'm trying to get a docker-based build system going which should make a lot of this much simpler.  I've been slow to reply to build system related problems because I believe the time is better spent working the new system than fixing the old one -- particularly because there are pre-compiled binaries available for people already.

- Rob
.

--
You received this message because you are subscribed to the Google Groups "opennetworklinux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opennetworklin...@googlegroups.com.

Kishore Atreya

unread,
Apr 23, 2015, 5:08:54 PM4/23/15
to Rob Sherwood, opennetw...@googlegroups.com
Hi Rob

Sorry, that email was meant to be internal to my team :)

I am interested in your docker based build environment. That’s something I’ve been trying to learn and play with internally for our own builds. Let me spend a little time perusing repo that you are working on. 

As for the errors I ran into, for the most part I’ve noticed that simply enabling sudo access with NOPASSWD is not enough. I had to switch into root. (Granted this it not that big of a deal) I think I wasted quite a bit of time with that. Once I built as root the only issues I faced were these two:

1) libi2c-dev header file was missing in the powerpc sysroot
* Jeff Townsend had a good workaround, which is to install it on the host machine and copy the header file into the powerpc sysroot

2) While in the chrooted workspace, trying to get the complete make onl-kvm target to build successfully was not possible. Basically the SWI build when trying to make the rootfs image couldn’t access the localhost via the 127.0.0.1 IP address. 
* Umesh’s workaround here is to exit the network isolated workspace and build the SWI outside of it. This worked


I spent a little time documenting the procedure we’ve been able to follow to get it to successfully build with the chroot env.

Here is the procedure that I followed (Umesh Lakshminarayan's procedure was similar I believe):

  1. Become root
    su -
  2. Create a new work directory
    mkdir rt-onl-work
  3. Git clone ONL
    cd rt-onl-work
    git clone https://github.com/opennetworklinux/ONL.git
    
  4. Install host dependencies
    cd ONL
    make install-host-deps
    
  5. Create the chrooted/network isolated workspace for toolchain and kernel building
    cd .. # Cd back into rt-onl-work
    onl-mkws -a amd64 ws.amd64 # Create and amd64 host workspace
    
  6. Enter the chrooted/network isolated workspace for toolchain and kernel building
    cd ws.amd64
    onl-chws
    
  7. Build the toolchains and kernels first
    cd ../ONL
    make onl-kvm
    
    • NOTE: There will be errors, the following bullets describe how to work around them
      • First Error: libi2c-dev is not installed in the correct rootfs path for powerpc. WORKAROUND:
      • In another window issue:
        sudo apt-get install libi2c-dev
        cp /usr/include/linux/i2c-dev.h /usr/powerpc-linux-gnu/linux/i2c-dev
        
      • Second Error: SWI is not build able due to no path to local host apt repo. WORKAROUND:
      • This is due to the network isolation present. There is no route to 127.0.0.1, issue the following:
        exit
        cd rt-onl-work/ONL
        make onl-kvm
        
    • This will build the SWI for kvm
  8. To run ONL in KVM
    cd rt-onl-work/ONL/builds/kvm/i386/onl
    make
    make run-nat # Nat mode
    OR
    make run-bridged # Bridged mode

Kishore Atreya

unread,
Apr 23, 2015, 5:11:33 PM4/23/15
to Rob Sherwood, opennetw...@googlegroups.com
Sorry forgot to add the ws-dependency installation step. Resending…

Here is the procedure that I followed (Umesh Lakshminarayan's procedure was similar I believe):

  1. Become root
    su -
  2. Create a new work directory
    mkdir rt-onl-work
  3. Git clone ONL
    cd rt-onl-work
    git clone https://github.com/opennetworklinux/ONL.git
    
  4. Install host dependencies
    cd ONL
    make install-host-deps
    
  5. Create the chrooted/network isolated workspace for toolchain and kernel building
    cd .. # Cd back into rt-onl-work
    onl-mkws -a amd64 ws.amd64 # Create and amd64 host workspace
    
  6. Enter the chrooted/network isolated workspace for toolchain and kernel building
    cd ws.amd64
    onl-chws
    
  1. Install the workspace dependencies
    cd rt-onl-work/ONL
    make install-ws-deps
    
  1. Build the toolchains and kernels first
  1. cd rt-onl-work/ONL
    make onl-kvm
    
    • NOTE: There will be errors, the following bullets describe how to work around them
      • First Error: libi2c-dev is not installed in the correct rootfs path for powerpc. WORKAROUND:
      • In another window issue:
        sudo apt-get install libi2c-dev
        cp /usr/include/linux/i2c-dev.h /usr/powerpc-linux-gnu/linux/i2c-dev
        
      • Second Error: SWI is not build able due to no path to local host apt repo. WORKAROUND:
      • This is due to the network isolation present. There is no route to 127.0.0.1, issue the following:
        exit
        cd rt-onl-work/ONL
        make onl-kvm
        
    • This will build the SWI for kvm
  1. To run ONL in KVM
    cd rt-onl-work/ONL/builds/kvm/i386/onl
    make
    make run-nat # Nat mode
    OR
    make run-bridged # Bridged mode
Reply all
Reply to author
Forward
0 new messages