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
This commit is contained in:
Riccardo Pittau 2019-01-28 12:01:26 +01:00
parent 1684ad707c
commit a365ff4245
7 changed files with 35 additions and 37 deletions

View File

@ -40,8 +40,8 @@ fi
choose_tc_mirror choose_tc_mirror
cd $WORKDIR/build_files cd $WORKDIR/build_files
wget -N $TINYCORE_MIRROR_URL/7.x/x86_64/release/distribution_files/corepure64.gz wget -N $TINYCORE_MIRROR_URL/8.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/vmlinuz64
cd $WORKDIR cd $WORKDIR
######################################################## ########################################################
@ -57,9 +57,6 @@ mkdir "$BUILDDIR"
# Configure mirror # Configure mirror
sudo sh -c "echo $TINYCORE_MIRROR_URL > $BUILDDIR/opt/tcemirror" 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 # 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/fujita/tgt.git" "${BUILDDIR}/tmp/tgt" "v1.0.62"
clone_and_checkout "https://github.com/qemu/qemu.git" "${BUILDDIR}/tmp/qemu" "v2.5.0" 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 done < $WORKDIR/build_files/buildreqs.lst
# Build python wheels # 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 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 $CHROOT_CMD pip wheel -c /tmp/upper-constraints.txt --wheel-dir /tmp/wheels -r /tmp/ipa-requirements.txt
if [ -n "$IRONIC_LIB_SOURCE" ]; then 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 $CHROOT_CMD pip wheel -c /tmp/upper-constraints.txt --wheel-dir /tmp/wheels -r /tmp/ironic-lib-requirements.txt

View File

@ -20,7 +20,7 @@ fi
# Install IPA and dependecies # Install IPA and dependecies
if ! type "ironic-python-agent" > /dev/null ; then 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 fi
# Create ipa-rescue-config directory for rescue password # Create ipa-rescue-config directory for rescue password

View File

@ -1,27 +1,27 @@
autoconf.tcz
autogen-dev.tcz
autogen.tcz
automake.tcz
bash.tcz bash.tcz
binutils.tcz
compiletc.tcz compiletc.tcz
coreutils.tcz coreutils.tcz
dmidecode.tcz dmidecode.tcz
gdisk.tcz gdisk.tcz
git.tcz
glib2-dev.tcz
hdparm.tcz hdparm.tcz
parted.tcz
python.tcz
python-dev.tcz
pciutils.tcz
libpci-dev.tcz libpci-dev.tcz
raid-dm-4.2.9-tinycore64.tcz libtool-dev.tcz
scsi-4.2.9-tinycore64.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 udev-lib.tcz
util-linux.tcz util-linux.tcz
pkg-config.tcz
zlib_base-dev.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

View File

@ -1,9 +1,10 @@
#!/bin/sh #!/bin/sh
S="Linux" S="Linux"
N="box" N="box"
R="4.2.9-tinycore64" R="4.8.17-tinycore64"
P="unknown" P="unknown"
V="#777 SMP (2016-02-29)" V="#2017 SMP"
M="x86_64" M="x86_64"
I="unknown" I="unknown"
O="GNU/Linux" O="GNU/Linux"

View File

@ -8,8 +8,8 @@ parted.tcz
popt.tcz popt.tcz
python.tcz python.tcz
pciutils.tcz pciutils.tcz
raid-dm-4.2.9-tinycore64.tcz raid-dm-4.8.17-tinycore64.tcz
scsi-4.2.9-tinycore64.tcz scsi-4.8.17-tinycore64.tcz
udev-lib.tcz udev-lib.tcz
util-linux.tcz util-linux.tcz
glib2.tcz glib2.tcz

View File

@ -59,16 +59,12 @@ mkdir "$FINALDIR"
# Extract rootfs from .gz file # Extract rootfs from .gz file
( cd "$FINALDIR" && zcat $WORKDIR/build_files/corepure64.gz | sudo cpio -i -H newc -d ) ( 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 Final Dir
setup_tce "$DST_DIR" setup_tce "$DST_DIR"
# Modify ldconfig for x86-64 # Modify ldconfig for x86-64
$CHROOT_CMD cp /sbin/ldconfig /sbin/ldconfigold $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 cp /sbin/ldconfignew /sbin/ldconfig
$CHROOT_CMD chmod u+x /sbin/ldconfig $CHROOT_CMD chmod u+x /sbin/ldconfig
@ -132,11 +128,13 @@ fi
# Ensure tinyipa picks up installed kernel modules # Ensure tinyipa picks up installed kernel modules
$CHROOT_CMD depmod -a `$WORKDIR/build_files/fakeuname -r` $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 flag is set install the python now
if $BUILD_AND_INSTALL_TINYIPA ; then 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/wheelhouse
rm -rf $FINALDIR/tmp/get-pip.py
fi fi
# Unmount /proc and clean up everything # Unmount /proc and clean up everything

View File

@ -0,0 +1,3 @@
---
other:
- Updates the tinyipa build scripts to TinyCoreLinux 8.x