How to add custom apt repositories and install packages from them as part of the build process?

265 views
Skip to first unread message

ba...@rtbrick.com

unread,
Sep 21, 2017, 5:25:19 AM9/21/17
to opennetworklinux

Hi,
I am not sure if this is the right forum. I want to build a custom ONL where I want to add extra apt repositories and install packages from them. Is this possible? If so, how can i do the same? If there are any examples, it would help as well.

Regards
Basil

Steven Noble

unread,
Sep 21, 2017, 1:08:12 PM9/21/17
to ba...@rtbrick.com, opennetworklinux
Hello!

If you look here : http://opennetlinux.org/docs/build

You will see a section about Adding/Removing packages from a SWI which references the following files:

https://github.com/opencomputeproject/OpenNetworkLinux/tree/master/builds/any/rootfs/jessie/common/*.yml

If the files are not available on any of the current repositories, you can add a new repository by going into:

https://github.com/opencomputeproject/OpenNetworkLinux/blob/master/builds/any/rootfs/jessie/standard/standard.yml

and copying how we add the ONL repository for your new one:

  ONL:
    packages: *Packages
    source: http://apt.opennetlinux.org/debian
    suite: unstable
    omitdebsrc: true

Let me know if you have more questions.

September 21, 2017 at 2:25 AM
--
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.
For more options, visit https://groups.google.com/d/optout.

ba...@rtbrick.com

unread,
Sep 21, 2017, 3:56:51 PM9/21/17
to opennetworklinux
Hi Steven,

Thank you for the prompt response. Where do I mention the component name and distribution name of the repository?

For eg. deb http://ftp.debian.org/debian jessie-backports main

here distribution is jessie-backports and component is main(which can be anything else)

Regards
Basil

Steven Noble

unread,
Sep 22, 2017, 10:54:16 AM9/22/17
to ba...@rtbrick.com, opennetworklinux
Hi Basil,

Thank you for your patience, can you point me to a package from backports that you want to use? I will add the repo and test. 

In case you are interested, we are also starting to add support for debian 9 if that is where the package is from. 


To unsubscribe from this group and stop receiving emails from it, send an email to opennetworklinux+unsubscribe@googlegroups.com.

ba...@rtbrick.com

unread,
Sep 22, 2017, 7:05:16 PM9/22/17
to opennetworklinux
Hi Steven,

The package is lxc. Please try the same and let me know what I need to add it. I am definitely interested in debian 9 but currently i want to get it working with jessie. Kindly let me know how i can do the same once you are done testing. Thank you once again. Much appreciated.

Regards
Basil

Steven Noble

unread,
Sep 22, 2017, 8:01:04 PM9/22/17
to ba...@rtbrick.com, opennetworklinux
Hi Basil,

I am able to install lxc without issue using the current repositories:

root@as5712-1:~# apt-cache policy lxc
lxc:
  Installed: (none)
  Candidate: 1:1.0.6-6+deb8u6
  Version table:
     1:1.0.6-6+deb8u6 0
        500 http://mirrors.kernel.org/debian/ jessie/main amd64 Packages


root@as5712-1:~# lxc-attach -n my-container
root@my-container:~#

Is there something different that you need?
September 22, 2017 at 4:05 PM
Hi Steven,

The package is lxc. Please try the same and let me know what I need to add it. I am definitely interested in debian 9 but currently i want to get it working with jessie. Kindly let me know how i can do the same once you are done testing. Thank you once again. Much appreciated.

Regards
Basil

On Friday, September 22, 2017 at 8:24:16 PM UTC+5:30, Steven Noble wrote:
--
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.
For more options, visit https://groups.google.com/d/optout.
September 22, 2017 at 7:54 AM
Hi Basil,

Thank you for your patience, can you point me to a package from backports that you want to use? I will add the repo and test. 

In case you are interested, we are also starting to add support for debian 9 if that is where the package is from. 



September 21, 2017 at 12:56 PM
Hi Steven,

Thank you for the prompt response. Where do I mention the component name and distribution name of the repository?

For eg. deb http://ftp.debian.org/debian jessie-backports main

here distribution is jessie-backports and component is main(which can be anything else)

Regards
Basil

On Thursday, September 21, 2017 at 10:38:12 PM UTC+5:30, Steven Noble wrote:
--
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.
For more options, visit https://groups.google.com/d/optout.
September 21, 2017 at 10:08 AM

ba...@rtbrick.com

unread,
Sep 25, 2017, 12:07:40 PM9/25/17
to opennetworklinux
Hi Steven,

Once ONL is brought up, installation works normally. I want to install this as part of the ONL image build process using standard.yml and packages yaml. I want to know how to provide the repository with the component and distribution name in the standard.yml file to achieve this.

Thanks & Regards
Basil

Steven Noble

unread,
Sep 26, 2017, 1:54:26 PM9/26/17
to ba...@rtbrick.com, opennetworklinux
Hi Basil,

I am trying to work through getting a specific version of lxc from the correct repository.

Right now you can add lxc and cgroupfs-mount to the amd64-base-packages.yml and you will have a functional LXC on any amd64 platform.  I have tested it and it appears to work.

diff --git a/builds/any/rootfs/jessie/common/amd64-base-packages.yml b/builds/any/rootfs/jessie/common/amd64-base-packages.yml
index efaf425..aa72a07 100644
--- a/builds/any/rootfs/jessie/common/amd64-base-packages.yml
+++ b/builds/any/rootfs/jessie/common/amd64-base-packages.yml
@@ -13,3 +13,5 @@
 - onl-kernel-3.16-lts-x86-64-all-modules
 - efibootmgr
 - gdisk
+- lxc
+- cgroupfs-mount

If you want a specific version, from a specific repository (backports), I would need to know what the version is to determine if we can pin it or version it within the auto-builder.

September 25, 2017 at 9:07 AM
Hi Steven,

Once ONL is brought up, installation works normally. I want to install this as part of the ONL image build process using standard.yml and packages yaml. I want to know how to provide the repository with the component and distribution name in the standard.yml file to achieve this.

Thanks & Regards
Basil

On Saturday, September 23, 2017 at 5:31:04 AM UTC+5:30, Steven Noble wrote:
--
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.
For more options, visit https://groups.google.com/d/optout.
September 22, 2017 at 5:00 PM

Steven Noble

unread,
Sep 27, 2017, 3:59:37 PM9/27/17
to ba...@rtbrick.com, opennetworklinux
Hi Again Basil,

Here is a setup that uses Backports and installs a package (auto-apt-proxy) that is only available on Backports.  I have added Backports to deboostrap so that the file is installed but the repository is not added to the ONL sources.list in the installer.  If you want it in the ONL sources.list, you can add it to the aptsources line.  Let me know if you have any other questions.

FYI auto-apt-proxy is just a sample single package, I would not recommend using it as it interferes with apt on the switch.

diff --git a/builds/any/rootfs/jessie/common/amd64-base-packages.yml b/builds/any/rootfs/jessie/common/amd64-base-packages.yml
index efaf425..7cdb396 100644
--- a/builds/any/rootfs/jessie/common/amd64-base-packages.yml
+++ b/builds/any/rootfs/jessie/common/amd64-base-packages.yml
@@ -13,3 +13,4 @@

 - onl-kernel-3.16-lts-x86-64-all-modules
 - efibootmgr
 - gdisk
+- auto-apt-proxy
diff --git a/builds/any/rootfs/jessie/standard/standard.yml b/builds/any/rootfs/jessie/standard/standard.yml
index fad73bd..1869d12 100644
--- a/builds/any/rootfs/jessie/standard/standard.yml
+++ b/builds/any/rootfs/jessie/standard/standard.yml
@@ -23,7 +23,7 @@ Multistrap:
     noauth: true
     explicitsuite: false
     unpack: true
-    debootstrap: Debian-Local Local-All Local-Arch ONL
+    debootstrap: Debian-Local Local-All Local-Arch ONL Backports
     aptsources: Debian ONL

   Debian:
@@ -46,6 +46,12 @@ Multistrap:
     suite: unstable
     omitdebsrc: true

+  Backports:
+    packages: *Packages
+    source:  http://ftp.debian.org/debian/
+    suite: jessie-backports
+    omitdebsrc: true
+
   Local-All:
     source: ${ONLPM_OPTION_REPO}/${ONL_DEBIAN_SUITE}/packages/binary-all
     omitdebsrc: true


Without Backports in aptsources :

root@localhost:~# ls /etc/apt/sources.list.d/
multistrap-debian.list    multistrap-onl.list
root@localhost:~# apt-cache policy auto-apt-proxy
auto-apt-proxy:
  Installed: 1~bpo8+1
  Candidate: 1~bpo8+1
  Version table:
 *** 1~bpo8+1 0
        100 /var/lib/dpkg/status

With Backports in aptsource :

root@localhost:~# ls /etc/apt/sources.list.d/
multistrap-backports.list  multistrap-debian.list  multistrap-onl.list
root@localhost:~# apt-cache policy auto-apt-proxy
auto-apt-proxy:
  Installed: 1~bpo8+1
  Candidate: 1~bpo8+1
  Version table:
 *** 1~bpo8+1 0
        100 http://ftp.debian.org/debian/ jessie-backports/main amd64 Packages
        100 /var/lib/dpkg/status


September 26, 2017 at 10:53 AM

ba...@rtbrick.com

unread,
Oct 19, 2017, 2:13:50 AM10/19/17
to opennetworklinux
Hi Steven,

Thanks for this update. With your example, I tried a couple of different variations but could not get our local repository to work.

We have a local apt repo that we have setup using aptly. The apt repository is current added in the sources.list looks like the following

deb [arch=amd64] http://192.168.1.3/ubuntu/debug aries multiverse

I tried the following changes to incorporate but it did not work

+  Rtbrick:
+    packages: *Packages
+    source:  http://192.168.1.3/ubuntu/debug
+    suite: aries/multiverse
+    omitdebsrc: true

Any idea how we can incorporate this source into the packaging system?

Regards
Basil

ba...@rtbrick.com

unread,
Oct 26, 2017, 9:25:34 AM10/26/17
to opennetworklinux
Any help on this is much appreciated.

ba...@rtbrick.com

unread,
Oct 26, 2017, 9:26:33 AM10/26/17
to opennetworklinux

Hi Steven,

Thanks for this update. With your example, I tried a couple of different variations but could not get our local repository to work.

We have a local apt repo that we have setup using aptly. The apt repository is current added in the sources.list looks like the following

deb [arch=amd64] http://192.168.1.3/ubuntu/debug aries multiverse

I tried the following changes to incorporate but it did not work

+  Rtbrick:
+    packages: *Packages

+    source:  http://192.168.1.3/ubuntu/debug
+    suite: aries/multiverse
+    omitdebsrc: true

Any idea how we can incorporate this source into the packaging system?

Regards
Basil
Reply all
Reply to author
Forward
0 new messages