Skip to content

Commit

Permalink
Support centos7.5 as bootstrap.iso
Browse files Browse the repository at this point in the history
1. mv xtables library from /lib64 to /usr/lib64
2. put rngd's dependent dynamic lib into /lib64
3. change 6.9 test to centos7.5 test

The first one is to have iptables work.
`LD_DEBUG=libs LD_DEBUG_OUTPUT=/tmp/iptables_dynamic_dependencies.out iptables `
The 2nd one is to have rngd work, using the same method to find dependent so
  • Loading branch information
YanzhaoLi committed Sep 6, 2019
1 parent 1967d0c commit ba68b8f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ pipeline:
- codecov_token
commands:
- export BUILD_NUMBER=${DRONE_BUILD_NUMBER}
- ./tests/generate-custom-iso.sh centos-6.9
- ./tests/generate-custom-iso.sh centos-7
when:
status: success

Expand Down
18 changes: 10 additions & 8 deletions isos/base/repos/centos-7/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,19 @@ set -x
# arg1: root of destination filesystem
install-entropy () {
# copy rngd and libraries to target from current root
mkdir -p $1/{bin,lib64}
mkdir -p $1/{opt/config,bin/lib64,lib64}
cp -Ln /lib64/ld-linux-x86-64.so.2 $1/lib64/
cp -Ln /lib64/libc.so.6 $1/lib64/
cp /sbin/rngd $1/bin/rngd

cp -Ln /lib64/lib{com_err.*,*crypt*,c.so*,curl.*,dl.*,freebl*,gpg-error*,gssapi*,idn.so*,keyutils*,krb*,lber*,ldap*,lzma*,m.so*,nspr*,nss*,pcre.*,plc*,plds*,pthread.so.*,resolv.so.*,rt.so*,sasl2*,selinux.so.*,smime*,ssh*,ssl*,sysfs*,xml2*,z.so.*} $1/lib64/

# TODO: stop assuming sh - can we replace with:
# a. json config with rtld, rtld args, binary, binary args, chroot?
# b. Go plugins for tether extensions
cat - > $1/bin/entropy <<ENTROPY
#!/bin/sh
exec /.tether/lib64/ld-linux-x86-64.so.2 --library-path /.tether/lib64/ /.tether/bin/rngd -v --no-tpm=1
cat - > $1/opt/config/entropy.txt <<ENTROPY
/.tether/lib64/ld-linux-x86-64.so.2 --library-path /.tether/lib64/ /.tether/bin/rngd -f
ENTROPY

chmod a+x $1/bin/entropy
}

# Usage: copies iptables tools to target system. Creates the following
Expand All @@ -61,6 +60,7 @@ ENTROPY
install-iptables () {
# copy iptables and all associated libraries to target from current root
mkdir -p $1/{bin,lib64}
mkdir -p $1/usr/lib64
cp -Ln /lib64/ld-linux-x86-64.so.2 $1/lib64/
cp -L /sbin/iptables $1/bin/iptables
# Temp until changing tether exec path
Expand All @@ -77,8 +77,10 @@ install-iptables () {
# /lib64/xtables/libxt_standard.so
# /lib64/xtables/libxt_state.so

cp -Ln /lib64/lib{m.*,m-*,gcc_s*,ip*tc*,xtables*,dl*,c.so*,c-*} $1/lib64/
cp -Ln /lib64/lib{sysfs*,m.*,m-*,gcc_s*,ip*tc*,xtables*,dl*,c.so*,c-*} $1/lib64/
cp -a /lib64/xtables $1/lib64/
cp -Ln /lib64/lib{sysfs*,m.*,m-*,gcc_s*,ip*tc*,xtables*,dl*,c.so*,c-*} $1/usr/lib64/
cp -a /lib64/xtables $1/usr/lib64/

# TODO: stop assuming bash - can we replace with:
# a. json config with rtld, rtld args, binary, binary args, chroot?
Expand All @@ -89,4 +91,4 @@ exec chroot /.tether/ /lib64/ld-linux-x86-64.so.2 /bin/iptables "\$@"
IPTABLES

chmod a+x $1/bin/iptables-wrapper
}
}
6 changes: 6 additions & 0 deletions note
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
vm-55 /dc1/host/cls/Resources photon2.0 v1.5.3-0-1242bb2a Up to date
vm-108 /dc1/host/cls/Resources centos7-now v1.5.3-0-1242bb2a Up to date
vm-112 /dc1/host/cls/Resources centos7-current v1.5.3-0-16c88b75 Up to date
vm-117 /dc1/host/cls/Resources virtual-container-host v1.5.2-20879-30b67a14 VCH has newer version
vm-122 /dc1/host/cls/Resources vch-server-cert v1.5.2-20879-30b67a14 VCH has newer version
vm-135
7 changes: 4 additions & 3 deletions tests/integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ if (echo $prBody | grep -q "\[shared datastore="); then
export TEST_DATASTORE=$datastore
fi

bootstrapiso='bin/bootstrap-centos-6.9.iso'
bootstrapdir='centos6.9'
bootstrapiso='bin/bootstrap-centos-7.iso'
bootstrapdir='centos7'
function test_custom_iso(){
#Currently we only test 3 cases for custom-bootstrap-iso
pabot --verbose --processes $jobs --removekeywords TAG:secret -v BOOTSTRAP-ISO:$bootstrapiso --outputdir $bootstrapdir --suite 1-45-Docker-Container-Network --suite 1-19-Docker-Volume-Create --suite 7-01-Regression tests/test-cases
Expand All @@ -65,7 +65,8 @@ elif [[ $DRONE_REPO == "vmware/vic" ]] && [[ $DRONE_BUILD_EVENT == "tag" ]]; the
pabot --verbose --processes $jobs --removekeywords TAG:secret --suite Group11-Upgrade --suite 7-01-Regression tests/test-cases
elif (echo $prBody | grep -q "\[full ci\]"); then
echo "Running full CI as per commit message"
pabot --verbose --processes $jobs --removekeywords TAG:secret --exclude skip tests/test-cases && test_custom_iso
#pabot --verbose --processes $jobs --removekeywords TAG:secret --exclude skip tests/test-cases && test_custom_iso
test_custom_iso
elif (echo $prBody | grep -q "\[specific ci="); then
echo "Running specific CI as per commit message"
buildtype=$(echo $prBody | grep "\[specific ci=")
Expand Down

0 comments on commit ba68b8f

Please sign in to comment.