Is there a syntax error in the shell script cl-dev.sh?

  • 1
  • Question
  • Updated 2 years ago
  • (Edited)
Hi, 

When I try to make a development environment for cumulus linux in accordance with "Building a Development Environment for Cumulus Linux" doc, there is an error:

cumulus@cumulus$ sudo ./cl-dev.sh CumulusLinux-2.5./cl-dev.sh: line 10: [[: 1$: syntax error: invalid arithmetic operator (error token is "$")

Why does it disply?

Last but most important, How can i make the development environment for Cumulus Linux?

Thanks in advance!

LiHongguang
Photo of Li Hongguang

Li Hongguang

  • 360 Points 250 badge 2x thumb

Posted 2 years ago

  • 1
Photo of Trapier Marshall

Trapier Marshall, Alum

  • 230 Points 100 badge 2x thumb
Doc for those following along:

https://support.cumulusnetworks.com/hc/en-us/articles/202937323-Building-a-Development-Environment-f...

What's the target cpu architecture?  For x86, just use VX!

If developing for PowerPC or ARM, it probably makes more sense to cross-compile rather than run Debian on a software emulated cpu.

Given the availability of VX, that KB may need to be retired.  Thoughts?
Photo of Li Hongguang

Li Hongguang

  • 360 Points 250 badge 2x thumb
My vm is x86 based VMwawre Workstation for Cumulus VX 2.5.6!
Photo of Donald Sharp

Donald Sharp, Employee

  • 182 Points 100 badge 2x thumb
Li -

Run this:

 apt-get install build-essential gawk automake autoconf libtool texinfo stgit binutils libreadline6-dev libjson0-dev libjson0-dbg debhelper dh-autoreconf dejagnu

To get a pretty good build env for Cumulus inside of the Cumulus VX. 

If something doesn't build without a package, a apt-get install xxxx should be sufficient.  Just make sure you are pointed at a wheezy repository.

donald
Photo of Li Hongguang

Li Hongguang

  • 360 Points 250 badge 2x thumb
Hi Donald,

Thanks for your reply!

After I ran the command based on your tip above, and then I typed "sudo ./cl-dev.sh CumulusLinux-2.5", some prompts disply as follows:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
grub-pc-bin is already the newest version.
grub2-common is already the newest version.

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 jdoo : Conflicts: monit but 1:5.4-2+cl2.5 is to be installed
 libdb5.1-dev : Depends: libdb5.1 (= 5.1.29-5) but 9999-cl2.5+1 is to be installed
 linux-libc-dev : Conflicts: linux-kernel-headers
 openvswitch-brcompat : Depends: openvswitch-switch (= 1.4.2+git20120612-9+cl2.5+4) but it is not going to be installed
 openvswitch-ipsec : Depends: openvswitch-switch (= 1.4.2+git20120612-9+cl2.5+4) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

How can the issue be resolved?

Thank you for your time and I look forward to your reply.

LiHongguang

PS.

My box is Cumulus-VM-2.5.6, the source.list file with the following content:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  The Cumulus Package Repository.#
#  Only packages from this repository are supported
#
#

deb http://repo.cumulusnetworks.com CumulusLinux-2.5 main addons updates
deb http://repo.cumulusnetworks.com CumulusLinux-2.5 security-updates

# Uncomment the next line to get access to the testing component
# deb http://repo.cumulusnetworks.com CumulusLinux-2.5 testing

# Uncomment the next line to get access to the Cumulus community repository
# deb http://repo.cumulusnetworks.com/community/ CumulusLinux-Community-2.5  main addons updates

# Uncomment the next line to get access to the debian wheezy repository
deb http://ftp.us.debian.org/debian/ wheezy main non-free
deb-src http://ftp.us.debian.org/debian/ wheezy main non-free
deb http://security.debian.org/ wheezy/updates main
deb-src http://security.debian.org/ wheezy/updates main
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(Edited)
Photo of Trapier Marshall

Trapier Marshall, Alum

  • 230 Points 100 badge 2x thumb
The packages suggested by Donald cover basic development requirements in Cumulus VX and Cumulus Linux.

The approach suggested by Donald should be used *instead* of cl-dev.sh.
Photo of Li Hongguang

Li Hongguang

  • 360 Points 250 badge 2x thumb
Thanks for your reply!

I will try it  again on my debian box tommorow.