From a365ff42458a623f6eecb8838f7c809d6cafa37d Mon Sep 17 00:00:00 2001 From: Riccardo Pittau Date: Mon, 28 Jan 2019 12:01:26 +0100 Subject: [PATCH] Build tinyipa with tinycore 8.x Upgrading to a more recent tinycore distribution to prepare support to deliver a tinyipa image with ironic-python-agent built with python 3 Most important changes in Tinycore 8.x include: * kernel updated to 4.8.17 * glibc updated to 2.24 * support for Python 3.6 This patch also removes the need of get-pip.py script in favor of native pip installation Change-Id: I9f2f5d9faca7cbf736547b0d0ec39c5c2bb554bc Story: #2002598 Task: #29131 --- imagebuild/tinyipa/build-tinyipa.sh | 12 +++---- imagebuild/tinyipa/build_files/bootlocal.sh | 2 +- imagebuild/tinyipa/build_files/buildreqs.lst | 34 +++++++++---------- imagebuild/tinyipa/build_files/fakeuname | 5 +-- imagebuild/tinyipa/build_files/finalreqs.lst | 4 +-- imagebuild/tinyipa/finalise-tinyipa.sh | 12 +++---- ...nyipa-with-tinycore8-b39d0415b1c25f6b.yaml | 3 ++ 7 files changed, 35 insertions(+), 37 deletions(-) create mode 100644 releasenotes/notes/build-tinyipa-with-tinycore8-b39d0415b1c25f6b.yaml diff --git a/imagebuild/tinyipa/build-tinyipa.sh b/imagebuild/tinyipa/build-tinyipa.sh index 7d1ebd401..119e73c5e 100755 --- a/imagebuild/tinyipa/build-tinyipa.sh +++ b/imagebuild/tinyipa/build-tinyipa.sh @@ -40,8 +40,8 @@ fi choose_tc_mirror cd $WORKDIR/build_files -wget -N $TINYCORE_MIRROR_URL/7.x/x86_64/release/distribution_files/corepure64.gz -wget -N $TINYCORE_MIRROR_URL/7.x/x86_64/release/distribution_files/vmlinuz64 +wget -N $TINYCORE_MIRROR_URL/8.x/x86_64/release/distribution_files/corepure64.gz +wget -N $TINYCORE_MIRROR_URL/8.x/x86_64/release/distribution_files/vmlinuz64 cd $WORKDIR ######################################################## @@ -57,9 +57,6 @@ mkdir "$BUILDDIR" # Configure mirror sudo sh -c "echo $TINYCORE_MIRROR_URL > $BUILDDIR/opt/tcemirror" -# Download get-pip into ramdisk -( cd "$BUILDDIR/tmp" && wget https://bootstrap.pypa.io/get-pip.py ) - # Download TGT, Qemu-utils, Biosdevname and IPMItool source clone_and_checkout "https://github.com/fujita/tgt.git" "${BUILDDIR}/tmp/tgt" "v1.0.62" clone_and_checkout "https://github.com/qemu/qemu.git" "${BUILDDIR}/tmp/qemu" "v2.5.0" @@ -135,10 +132,9 @@ while read line; do done < $WORKDIR/build_files/buildreqs.lst # Build python wheels -$CHROOT_CMD python /tmp/get-pip.py +$CHROOT_CMD python -m ensurepip +$CHROOT_CMD pip install --upgrade pip wheel $CHROOT_CMD pip install pbr -$CHROOT_CMD pip wheel -c /tmp/upper-constraints.txt --wheel-dir /tmp/wheels setuptools -$CHROOT_CMD pip wheel -c /tmp/upper-constraints.txt --wheel-dir /tmp/wheels pip $CHROOT_CMD pip wheel -c /tmp/upper-constraints.txt --wheel-dir /tmp/wheels -r /tmp/ipa-requirements.txt if [ -n "$IRONIC_LIB_SOURCE" ]; then $CHROOT_CMD pip wheel -c /tmp/upper-constraints.txt --wheel-dir /tmp/wheels -r /tmp/ironic-lib-requirements.txt diff --git a/imagebuild/tinyipa/build_files/bootlocal.sh b/imagebuild/tinyipa/build_files/bootlocal.sh index 6d0c8ea62..c5cd29ea8 100755 --- a/imagebuild/tinyipa/build_files/bootlocal.sh +++ b/imagebuild/tinyipa/build_files/bootlocal.sh @@ -20,7 +20,7 @@ fi # Install IPA and dependecies if ! type "ironic-python-agent" > /dev/null ; then - python /tmp/get-pip.py --no-wheel --no-index --find-links=file:///tmp/wheelhouse ironic_python_agent + pip install --no-index --find-links=file:///tmp/wheelhouse ironic_python_agent fi # Create ipa-rescue-config directory for rescue password diff --git a/imagebuild/tinyipa/build_files/buildreqs.lst b/imagebuild/tinyipa/build_files/buildreqs.lst index ab1ca2e7b..c255a1072 100644 --- a/imagebuild/tinyipa/build_files/buildreqs.lst +++ b/imagebuild/tinyipa/build_files/buildreqs.lst @@ -1,27 +1,27 @@ +autoconf.tcz +autogen-dev.tcz +autogen.tcz +automake.tcz bash.tcz +binutils.tcz compiletc.tcz coreutils.tcz dmidecode.tcz gdisk.tcz +git.tcz +glib2-dev.tcz hdparm.tcz -parted.tcz -python.tcz -python-dev.tcz -pciutils.tcz libpci-dev.tcz -raid-dm-4.2.9-tinycore64.tcz -scsi-4.2.9-tinycore64.tcz +libtool-dev.tcz +libtool.tcz +parted.tcz +pciutils.tcz +pixman-dev.tcz +pkg-config.tcz +python-dev.tcz +python.tcz +raid-dm-4.8.17-tinycore64.tcz +scsi-4.8.17-tinycore64.tcz udev-lib.tcz util-linux.tcz -pkg-config.tcz zlib_base-dev.tcz -glib2-dev.tcz -pixman-dev.tcz -binutils.tcz -git.tcz -autoconf.tcz -autogen.tcz -autogen-dev.tcz -automake.tcz -libtool.tcz -libtool-dev.tcz diff --git a/imagebuild/tinyipa/build_files/fakeuname b/imagebuild/tinyipa/build_files/fakeuname index be2d37fe3..96405e328 100755 --- a/imagebuild/tinyipa/build_files/fakeuname +++ b/imagebuild/tinyipa/build_files/fakeuname @@ -1,9 +1,10 @@ #!/bin/sh + S="Linux" N="box" -R="4.2.9-tinycore64" +R="4.8.17-tinycore64" P="unknown" -V="#777 SMP (2016-02-29)" +V="#2017 SMP" M="x86_64" I="unknown" O="GNU/Linux" diff --git a/imagebuild/tinyipa/build_files/finalreqs.lst b/imagebuild/tinyipa/build_files/finalreqs.lst index 4134b8c22..b1ad59aa3 100644 --- a/imagebuild/tinyipa/build_files/finalreqs.lst +++ b/imagebuild/tinyipa/build_files/finalreqs.lst @@ -8,8 +8,8 @@ parted.tcz popt.tcz python.tcz pciutils.tcz -raid-dm-4.2.9-tinycore64.tcz -scsi-4.2.9-tinycore64.tcz +raid-dm-4.8.17-tinycore64.tcz +scsi-4.8.17-tinycore64.tcz udev-lib.tcz util-linux.tcz glib2.tcz diff --git a/imagebuild/tinyipa/finalise-tinyipa.sh b/imagebuild/tinyipa/finalise-tinyipa.sh index df8e0c0e2..260b0d046 100755 --- a/imagebuild/tinyipa/finalise-tinyipa.sh +++ b/imagebuild/tinyipa/finalise-tinyipa.sh @@ -59,16 +59,12 @@ mkdir "$FINALDIR" # Extract rootfs from .gz file ( cd "$FINALDIR" && zcat $WORKDIR/build_files/corepure64.gz | sudo cpio -i -H newc -d ) -# Download get-pip into ramdisk -( cd "$FINALDIR/tmp" && wget https://bootstrap.pypa.io/get-pip.py ) - - # Setup Final Dir setup_tce "$DST_DIR" # Modify ldconfig for x86-64 $CHROOT_CMD cp /sbin/ldconfig /sbin/ldconfigold -printf '/sbin/ldconfigold $@ | sed "s/unknown/libc6,x86-64/"' | $CHROOT_CMD tee -a /sbin/ldconfignew +printf '#!/bin/sh\n/sbin/ldconfigold $@ | sed -r "s/libc6|ELF/libc6,x86-64/"' | $CHROOT_CMD tee -a /sbin/ldconfignew $CHROOT_CMD cp /sbin/ldconfignew /sbin/ldconfig $CHROOT_CMD chmod u+x /sbin/ldconfig @@ -132,11 +128,13 @@ fi # Ensure tinyipa picks up installed kernel modules $CHROOT_CMD depmod -a `$WORKDIR/build_files/fakeuname -r` +# Install pip +$CHROOT_CMD python -m ensurepip --upgrade + # If flag is set install the python now if $BUILD_AND_INSTALL_TINYIPA ; then - $CHROOT_CMD python /tmp/get-pip.py --no-wheel --no-index --find-links=file:///tmp/wheelhouse --pre ironic_python_agent + $CHROOT_CMD pip install --no-index --find-links=file:///tmp/wheelhouse --pre ironic_python_agent rm -rf $FINALDIR/tmp/wheelhouse - rm -rf $FINALDIR/tmp/get-pip.py fi # Unmount /proc and clean up everything diff --git a/releasenotes/notes/build-tinyipa-with-tinycore8-b39d0415b1c25f6b.yaml b/releasenotes/notes/build-tinyipa-with-tinycore8-b39d0415b1c25f6b.yaml new file mode 100644 index 000000000..d0a94503d --- /dev/null +++ b/releasenotes/notes/build-tinyipa-with-tinycore8-b39d0415b1c25f6b.yaml @@ -0,0 +1,3 @@ +--- +other: + - Updates the tinyipa build scripts to TinyCoreLinux 8.x