File: patch-vagrant-install.html

package info (click to toggle)
vagrant-libvirt 0.12.2-4
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,756 kB
  • sloc: ruby: 12,865; xml: 2,465; sh: 373; javascript: 235; makefile: 13
file content (124 lines) | stat: -rw-r--r-- 4,511 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
  libssh issue:
  ```
  /opt/vagrant/embedded/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require': /opt/vagrant/embedded/lib64/libcrypto.so.1.1: version `OPENSSL_1_1_1b' not found (required by /lib64/libssh.so.4) - /home/xxx/.vagrant.d/gems/2.4.6/gems/ruby-libvirt-0.7.1/lib/_libvirt.so (LoadError)
  ```
  Solution identified thanks to James Reynolds (see [https://github.com/hashicorp/vagrant/issues/11020#issuecomment-540043472](https://github.com/hashicorp/vagrant/issues/11020#issuecomment-540043472)).

  libk5crypto issue:
  ```
  /opt/vagrant/embedded/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require': /usr/lib64/libk5crypto.so.3: undefined symbol: EVP_KDF_ctrl, version OPENSSL_1_1_1b - /home/rbelgrave/.vagrant.d/gems/2.4.9/gems/ruby-libvirt-0.7.1/lib/_libvirt.so (LoadError)
  ```
  Solution identified thanks to Marco Bevc (see [https://github.com/hashicorp/vagrant/issues/11020#issuecomment-625801983](https://github.com/hashicorp/vagrant/issues/11020#issuecomment-625801983)).

  Compile libraries to replaced those bundled with Vagrant to allow linking ruby-libvirt against
  vagrant's embedded ruby and the system libvirt (updated originals to be generic):

  ```bash
  mkdir patches
  pushd patches
{%- case include.distro %}
{%-   when "centos" %}

  [[ ! -d centos-git-common ]] && git clone https://git.centos.org/centos-git-common
  export PATH=$(readlink -f ./centos-git-common):$PATH
  chmod a+x ./centos-git-common/*.sh

  git clone https://git.centos.org/rpms/libssh
{%-   else %}

  mkdir libssh
{%- endcase %}
  pushd libssh
{%- case include.distro %}
{%-   when "fedora" %}
  nvr=$(rpm -q --queryformat "libssh-%{version}-%{release}" libssh)
  nv=$(rpm -q --queryformat "libssh-%{version}" libssh)
  dnf download --source libssh
  rpm2cpio ${nvr}.src.rpm | cpio -imdV
  rm -rf ${nv}
  tar xf ${nv}.tar.*z
{%-   when "centos" %}
  nvr=$(rpm -q --queryformat "libssh-%{version}-%{release}" libssh)
  nv=$(rpm -q --queryformat "libssh-%{version}" libssh)
  git checkout $(git tag -l | grep "${nvr}\$" | tail -n1)
  into_srpm.sh -d c8s
  pushd BUILD
  tar xf ../SOURCES/${nv}.tar.*z
{%-   when "opensuse" %}
  nvr=$(rpm -q --queryformat "libssh-%{version}-%{release}" libssh4)
  nv=$(rpm -q --queryformat "libssh-%{version}" libssh4)

  repository=$(zypper --quiet --no-refresh --xmlout search --type srcpackage --match-exact --details libssh | xpath -q -e 'string(//solvable/@repository)')
  url=$(zypper --quiet --xmlout repos | xpath -q -e "//repo[@name='${repository}']/url/text()")

  wget ${url}/src/${nvr}.src.rpm
  rpm2cpio ${nvr}.src.rpm | cpio -imdV
  rm -rf ${nv}
  tar xf ${nv}.tar.*z
{%-   else %}

  *******Missing the correct distro for patch commands********
{%- endcase %}

  mkdir libssh-build
  pushd libssh-build
  cmake ../${nv} -DOPENSSL_ROOT_DIR=/opt/vagrant/embedded/
  make
  sudo cp lib/libssh* /opt/vagrant/embedded/lib64
  popd
  popd
{%- if include.distro == "centos" %}

  popd
{%- endif %}

{%- case include.distro %}
{%-   when "centos" %}

  git clone https://git.centos.org/rpms/krb5
{%-   else %}

  mkdir krb5
{%- endcase %}
  pushd krb5
{%- case include.distro %}
{%-   when "fedora" %}
  nvr=$(rpm -q --queryformat "krb5-%{version}-%{release}" krb5-libs)
  nv=$(rpm -q --queryformat "krb5-%{version}" krb5-libs)
  dnf download --source krb5-libs
  rpm2cpio ${nvr}.src.rpm | cpio -imdV
  tar xf ${nv}.tar.*z
{%-   when "centos" %}
  nvr=$(rpm -q --queryformat "krb5-%{version}-%{release}" krb5-libs)
  nv=$(rpm -q --queryformat "krb5-%{version}" krb5-libs)
  git checkout $(git tag -l | grep "${nvr}\$" | tail -n1)
  into_srpm.sh -d c8s
  pushd BUILD
  tar xf ../SOURCES/${nv}.tar.*z
{%-   when "opensuse" %}
  nvr=$(rpm -q --queryformat "krb5-%{version}-%{release}\n" krb5 | uniq)
  nv=$(rpm -q --queryformat "krb5-%{version}\n" krb5 | uniq)
  repository=$(zypper --quiet --no-refresh --xmlout search --type srcpackage --match-exact --details krb5 | xpath -q -e 'string(//solvable/@repository)')
  url=$(zypper --quiet --xmlout repos | xpath -q -e "//repo[@name='${repository}']/url/text()")

  [[ ! -e ${nvr}.src.rpm ]] && wget ${url}/src/${nvr}.src.rpm
  rpm2cpio ${nvr}.src.rpm | cpio -imdV
  rm -rf ${nv}
  tar xf ${nv}.tar.*z
{%-   else %}
  *******Missing the correct distro for patch commands********
{%- endcase %}

  pushd ${nv}/src
  ./configure
  make
  sudo cp -P lib/crypto/libk5crypto.* /opt/vagrant/embedded/lib64/
  popd
  popd
{%- if include.distro == "centos" %}

  popd
{%- endif %}

  popd
  ```