Build of LXC 3.0.x on Oracle Linux 8 is failing as shown below (this example is LXC 3.0.4). Any thoughts on how to get this build to succeed ? Thanks!
utils.c: In function ‘do_sha1_hash’:
utils.c:350:38: error: pointer targets in passing argument 3 of ‘EVP_DigestFinal_ex’ differ in signedness [-Werror=pointer-sign]
EVP_DigestFinal_ex(mdctx, md_value, md_len);
^~~~~~
In file included from utils.c:334:
/usr/include/openssl/evp.h:548:12: note: expected ‘unsigned int *’ but argument is of type ‘int *’
__owur int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md,
^~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[3]: *** [Makefile:2251: liblxc_la-utils.lo] Error 1
make[3]: Leaving directory ‘/opt/olxc/home/ubuntu/Downloads/orabuntu-lxc-master/uekulele/lxc/rpmbuild/BUILD/lxc-3.0.4/src/lxc’
make[2]: *** [Makefile:429: all-recursive] Error 1
make[2]: Leaving directory ‘/opt/olxc/home/ubuntu/Downloads/orabuntu-lxc-master/uekulele/lxc/rpmbuild/BUILD/lxc-3.0.4/src’
make[1]: *** [Makefile:368: all] Error 2
make[1]: Leaving directory ‘/opt/olxc/home/ubuntu/Downloads/orabuntu-lxc-master/uekulele/lxc/rpmbuild/BUILD/lxc-3.0.4/src’
make: *** [Makefile:523: all-recursive] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.bV6Bx6 (%build)
I have a working solution for this now. A couple of changes were needed to the lxc.spec file to get LXC 3.0.4 to build on Oracle Linux 8. Comments on any ramifications or drawbacks of these spec file changes are welcomed.
The changes were made using the following sed commands:
sudo sed -i ‘s/_smp_mflags}/_smp_mflags} CFLAGS="-fPIC"/’ lxc.spec
sudo sed -i ‘/^%prep/i %define debug_package %{nil}’ lxc.spec
This results in the following changes:
++++++ change 1 +++++++++++++
%description devel
The %{name}-devel package contains header files and library needed for
development of the Linux containers.
%define debug_package %{nil} <-- This line is added
%prep
+++++++++++++++++++++++++
++++++ Change 2 +++++++++++
make %{?_smp_mflags} CFLAGS="-fPIC" <-- CFLAGS="-fPIC" is added to the make line
As an added bonus, here is a lxc-templates.spec file that I created for building an lxc-templates RPM for lxc 3.0.4 on Oracle Linux 8. Comments welcome and invited in particular for ways to improve this spec file or make it more “elegant.” And that covers my current solution for Oracle Linux 8, Thanks, Gilbert
Note that all of this is “built-in” to Orabuntu-LXC which is a tool for deploying LXC Linux Containers across multiple linux hosts multiple linux distros over OpenvSwitch networks that span all the physical and VM hosts on which the containers on all these heterogenous hosts can communicate with each other over the same network no matter where they are located, no matter whether it is VM or physical host, and no matter what particular Linux distribution or flavor.
There is no Oracle Linux 8 yet as a container image at http://us.images.linuxcontainers.org/
You may request to have it added, since Oracle Linux 8 was released at the end of July 2019.
It helps to try out a system container with Oracle Linux 8 and have it compile LXC for testing.
Thanks simos. This thread applies only to the task of install LXC 3.0.4 on Oracle Linux 8 physical or VM hosts. However, it is useful to know that Oracle Linux 8 container images are not yet available. Thanks!
If there was an Oracle Linux 8 container image, it would be enough to replicate the issue you are facing.
It is common to use system containers for specific Linux distributions/versions to test whether something works or not. For the purposes of the compilation, it would be just fine to use such a container image.
It works for me, using LXD 3.18. By default the container only gets the BaseOS repository and you need to enable the rest, if you need them, per http://yum.oracle.com/oracle-linux-8.html
$ lxc launch images:oracle/8 oracle
Creating oracle
Starting oracle
$ lxc exec oracle -- /bin/bash
[root@oracle ~]# cat /etc/system-release
Oracle Linux Server release 8.0
[root@oracle ~]# yum repoinfo
Last metadata expiration check: 0:02:38 ago on Sat Oct 26 11:23:37 2019.
Repo-id : base
Repo-name : Oracle Linux
Repo-updated : Fri Oct 25 02:53:32 2019
Repo-pkgs : 2758
Repo-size : 4.3 G
Repo-baseurl : http://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/x86_64/
Repo-expire : 172800 second(s) (last: Sat Oct 26 11:23:37 2019)
Repo-filename: /etc/yum.repos.d/base.repo
[root@oracle ~]#
Thanks simos. I am not using LXD. I am using LXC. Therefore I do not have the “lxc” command I have the “lxc-create” command. Orabuntu-LXC does not use LXD for a number of good reasons (which is not to say that LXD is also a great software), among them for example VLAN support issues.
This worked: (I just edited this post to reflect that)
(Note: I had to use “–release 8” because “–release latest” did not work nor did “–release 8.latest”).
And confirming the release info:
ubuntu@ubuntu-ThinkPad-P72:~$ sudo lxc-attach -n oracle801
bash-4.4# cat /etc/oracle-release
Oracle Linux Server release 8.0
bash-4.4#
What you are doing afaik is pulling the Oracle 8 LXC container images from Oracle Corporation repos, which is not the same as what I believe Stephane was talking about - or maybe I am wrong.
If I am working on Ubuntu Linux 19.04 for example, there isn’t any way to activate these various Oracle repos (which I am familiar with so yes I do know about that) if I want to create an Oracle 8 LXC container on Ubuntu Linux host OS.
Well if I am mistaken in this then please LMK it will be appreciated. Thanks, Gilbert
You can add extra repositories to a Oracle Linux 8 container. I am not sure I understand why it would not be possible to add extra repositories if the host is Ubuntu.
By the way, it is also possible to create custom Oracle Linux 8 container images, by adding extra configuration such as enabling by default additional repositories, or adding extra packages.