My company have been building a turnkey appliance for the last few weeks. I have a vm setup with a turnkey-core install on it with tklpatch that I use to build the iso images as we iterate through out initial build.
I can happily do the following on this system:
working
and it correctly builds our iso image. Recently I tried to replicate this at home and build another vm (just a fresh install of turnkey-core with tklpatch installed). However when I went to "apt-get install tklpatch" it says no installation candidate is available, once I have done an "apt-get update;apt-get install tklpatch" it installs however I'm now unable to build iso images:
broken
root@core ~# ls
Replies (18)
I haven't used it lately...
Reply 1That's strange...
Reply 2I don't think the latest changes should have broken anything, especially not like this...
What do you have in linked-data/conf/pre-debs ? Thats where it seems to be failing, and no error message is really strange. Could you add -x to pre-debs so it outputs what its doing?
tree and ls -lash outputs
Reply 3
patch location
Reply 4further testing
Reply 5our pre-debs is empty:
#!/bin/bash -ex
# executed before apply-debs
Are they the same version of TKL?
Reply 6I just installed TKLPatch on TKL v12.0 core and my apt-cache output looks the same as you second one. I also tried installing your patch but I got a different output (although obviously I'm using v13.0RC Core ISO so perhaps that's the problem...)
tklpatch turnkey-core-13.0rc-wheezy-amd64.iso Linked-Data/linked-data/ # extracting root filesystem and isolinux from ISO Parallel unsquashfs: Using 2 processors 26243 inodes (27393 blocks) to write [=================...=================|] 27393/27393 100% created 23482 files created 3003 directories created 2709 symlinks created 38 devices created 1 fifos TKLPATCH_ISOLABEL: linked-data # applying patch Linked-Data/linked-data # executing config script Linked-Data/linked-data/conf/pre-debs chroot: failed to run command `dpkg-divert': Exec format error
apt-cache show is not identical between hosts
Reply 7deffinately something odd, this is the full apt-cache show output from both systems, why do they look different???
working:
annoying
Reply 8It's annoying, because my 2 week old build machine that hasn't had any updates works fine, but every new install I do (or whenever our customer tries to generate an iso off the patch) the build breaks.
even though I'm doing a fresh git clone of the same repo before building :-/
I also did an apt-cache show apt to see if the debian apt tool chain has changed and it's the same version on both.
:(
for hijinks (test 13rc - it didn't break the build)
Reply 9first thing first, rm -r linked-data and started over on both hosts. then did a git clone to rebuild both the patch directories (because of how we set our git repo up then did a mv Linked-Data/linked-data ../, rm -r Linked-Data.
so old working machine, this time with 13rc:
</snip - output so long it went out of my console history>
and new not-working machine, this time with 13rc:
32bit vs 64bit explains Jeremy's build problem
Reply 10chroot: failed to run command `dpkg-divert': Exec format error
Jeremy did you try and build this patch with an amd64 iso on a 32bit system - I only get this error when I try and build against 64bit ISO on our 32bit build machine, if I use the i386 iso then it gets much further <see post above>
Andy
okay that was a crock of rubbish
Reply 11okay im talking guff now, both fail in the same way, 32bit or 64bit on the "non working" build machine:
brand new vm same problem.
Reply 12if someone could check my workflow am I missing a step
You are right, 64 bit the issue...
Reply 13I have just applied this to a 32 bit v12 ISO (inside 32 bit TKL v12 Core) and it seems to work.
At least initially...
tklpatch turnkey-core-12.0-squeeze-x86.iso Linked-Data/linked-data/ # extracting root filesystem and isolinux from ISO Parallel unsquashfs: Using 2 processors 25597 inodes (25986 blocks) to write [========================================================\] 25986/25986 100% created 23964 files created 2837 directories created 1074 symlinks created 38 devices created 1 fifos TKLPATCH_ISOLABEL: linked-data # applying patch Linked-Data/linked-data # executing config script Linked-Data/linked-data/conf/pre-debs Adding 'local diversion of /sbin/initctl to /sbin/initctl.distrib' # chroot execute: /tmp/tklpatch/pre-debs Removing 'local diversion of /sbin/initctl to /sbin/initctl.distrib' # executing config script Linked-Data/linked-data/conf/post-debs Adding 'local diversion of /sbin/initctl to /sbin/initctl.distrib' # chroot execute: /tmp/tklpatch/post-debs Removing 'local diversion of /sbin/initctl to /sbin/initctl.distrib' # executing config script Linked-Data/linked-data/conf/pre-overlay Adding 'local diversion of /sbin/initctl to /sbin/initctl.distrib' # chroot execute: /tmp/tklpatch/pre-overlay ++ dirname /tmp/tklpatch/pre-overlay + cwd=/tmp/tklpatch + source /tmp/tklpatch/functions + install apache2 openjdk-6-jre openssh-server php5 python2.6 virtuoso-opensource virtuoso-vad-conductor virtuoso-vad-isparql wget python-pip + apt-get update Get:1 http://security.debian.org squeeze/updates Release.gpg [836 B] Ign http://security.debian.org/ squeeze/updates/contrib Translation-en Ign http://security.debian.org/ squeeze/updates/main Translation-en Get:2 http://security.debian.org squeeze/updates Release [87.0 kB] Get:3 http://archive.turnkeylinux.org squeeze-security Release.gpg [490 B] Ign http://archive.turnkeylinux.org/debian/ squeeze-security/main Translation-en Get:4 http://archive.turnkeylinux.org squeeze Release.gpg [490 B] Ign http://archive.turnkeylinux.org/debian/ squeeze/main Translation-en Get:5 http://security.debian.org squeeze/updates/main i386 Packages [389 kB] Get:6 http://archive.turnkeylinux.org squeeze-security Release [1070 B] Get:7 http://archive.turnkeylinux.org squeeze Release [1322 B] Get:8 http://ftp.debian.org squeeze Release.gpg [1672 B] Ign http://ftp.debian.org/debian/ squeeze/contrib Translation-en Get:9 http://security.debian.org squeeze/updates/contrib i386 Packages [621 B] Ign http://ftp.debian.org/debian/ squeeze/main Translation-en Get:10 http://ftp.debian.org squeeze Release [99.8 kB] Get:11 http://archive.turnkeylinux.org squeeze-security/main i386 Packages [665 B] Get:12 http://archive.turnkeylinux.org squeeze/main i386 Packages [26.5 kB] Get:13 http://ftp.debian.org squeeze/main i386 Packages [8633 kB] Get:14 http://ftp.debian.org squeeze/contrib i386 Packages [65.6 kB] Fetched 9309 kB in 37s (247 kB/s) Reading package lists... Done + DEBIAN_FRONTEND=noninteractive + apt-get -y -o DPkg::Options::=--force-confdef -o DPkg::Options::=--force-confold install apache2 openjdk-6-jre openssh-server php5 python2.6 virtuoso-opensource virtuoso-vad-conductor virtuoso-vad-isparql wget python-pip Reading package lists... Done Building dependency tree Reading state information... Done python2.6 is already the newest version. wget is already the newest version. The following extra packages will be installed: apache2-mpm-prefork apache2-utils apache2.2-bin apache2.2-common ca-certificates-java defoma fontconfig fontconfig-config java-common libaccess-bridge-java libaccess-bridge-java-jni libapache2-mod-php5 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libasound2 libasyncns0 libatk1.0-0 libavahi-client3 libavahi-common-data libavahi-common3 libcairo2 libcups2 libdatrie1 libdbus-1-3 libflac8 libfontconfig1 libgif4 libglib2.0-0 libgomp1 libgtk2.0-0 libgtk2.0-common libice6 libjasper1 libjpeg62 liblcms1 liblqr-1-0 libltdl7 libmagickcore3 libmagickwand3 libnspr4-0d libnss3-1d libogg0 libonig2 libpango1.0-0 libpango1.0-common libpcre3 libpixman-1-0 libpng12-0 libpulse0 libqdbm14 libsm6 libsndfile1 libthai-data libthai0 libtiff4 libvirtodbc0 libvorbis0a libvorbisenc2 libwbxml2-0 libx11-6 libx11-data libxau6 libxcb-render-util0 libxcb-render0 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxdmcp6 libxext6 libxfixes3 libxft2 libxi6 libxinerama1 libxrandr2 libxrender1 libxt6 libxtst6 odbcinst odbcinst1debian2 openjdk-6-jre-headless openjdk-6-jre-lib openssh-client php5-common python-pkg-resources python-setuptools shared-mime-info ttf-dejavu-core tzdata tzdata-java virtuoso-opensource-6.1 virtuoso-opensource-6.1-bin virtuoso-opensource-6.1-common x11-common Suggested packages: www-browser apache2-doc apache2-suexec apache2-suexec-custom defoma-doc psfontmgr x-ttcidfont-conf dfontmgr default-jre equivs php-pear libasound2-plugins cups-common librsvg2-common gvfs libjasper-runtime liblcms-utils libmagickcore3-extra ttf-japanese-gothic ttf-japanese-mincho ttf-thryomanes ttf-baekmuk ttf-arphic-gbsn00lp ttf-arphic-bsmi00lp ttf-arphic-gkai00mp ttf-arphic-bkai00mp pulseaudio icedtea6-plugin libnss-mdns sun-java6-fonts ttf-sazanami-gothic ttf-kochi-gothic ttf-sazanami-mincho ttf-kochi-mincho ttf-wqy-microhei ttf-wqy-zenhei ttf-indic-fonts ssh-askpass libpam-ssh keychain rssh molly-guard ufw python-distribute python-distribute-doc virtuoso-vad-doc virtuoso-vad-demo virtuoso-vad-tutorial virtuoso-vad-rdfmappers virtuoso-vad-sparqldemo virtuoso-vad-syncml virtuoso-vad-bpel virtuoso-vad-ods Recommended packages: ssl-cert libfont-freetype-perl php5-cli libatk1.0-data dbus libglib2.0-data hicolor-icon-theme libgtk2.0-bin ghostscript gsfonts ttf-dejavu-extra xauth openssh-blacklist-extra php5-suhosin virtuoso-server virtuoso-vsp-startpage The following NEW packages will be installed: apache2 apache2-mpm-prefork apache2-utils apache2.2-bin apache2.2-common ca-certificates-java defoma fontconfig fontconfig-config java-common libaccess-bridge-java libaccess-bridge-java-jni libapache2-mod-php5 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libasound2 libasyncns0 libatk1.0-0 libavahi-client3 libavahi-common-data libavahi-common3 libcairo2 libcups2 libdatrie1 libdbus-1-3 libflac8 libfontconfig1 libgif4 libglib2.0-0 libgomp1 libgtk2.0-0 libgtk2.0-common libice6 libjasper1 libjpeg62 liblcms1 liblqr-1-0 libltdl7 libmagickcore3 libmagickwand3 libnspr4-0d libnss3-1d libogg0 libonig2 libpango1.0-0 libpango1.0-common libpcre3 libpixman-1-0 libpng12-0 libpulse0 libqdbm14 libsm6 libsndfile1 libthai-data libthai0 libtiff4 libvirtodbc0 libvorbis0a libvorbisenc2 libwbxml2-0 libx11-6 libx11-data libxau6 libxcb-render-util0 libxcb-render0 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxdmcp6 libxext6 libxfixes3 libxft2 libxi6 libxinerama1 libxrandr2 libxrender1 libxt6 libxtst6 odbcinst odbcinst1debian2 openjdk-6-jre openjdk-6-jre-headless openjdk-6-jre-lib php5 php5-common python-pip python-pkg-resources python-setuptools shared-mime-info ttf-dejavu-core tzdata-java virtuoso-opensource virtuoso-opensource-6.1 virtuoso-opensource-6.1-bin virtuoso-opensource-6.1-common virtuoso-vad-conductor virtuoso-vad-isparql x11-common The following packages will be upgraded: openssh-client openssh-server tzdata 3 upgraded, 101 newly installed, 0 to remove and 65 not upgraded. Need to get 73.1 MB of archives. After this operation, 201 MB of additional disk space will be used. Get:1 http://security.debian.org/ squeeze/updates/main apache2.2-bin i386 2.2.16-6+squeeze11 [1355 kB] <snip> # applying overlay Linked-Data/linked-data/overlay # executing config script Linked-Data/linked-data/conf/post-overlay Adding 'local diversion of /sbin/initctl to /sbin/initctl.distrib' # chroot execute: /tmp/tklpatch/post-overlay + a2enmod auth_digest proxy_http Enabling module auth_digest. Considering dependency proxy for proxy_http: Enabling module proxy. Enabling module proxy_http. Run '/etc/init.d/apache2 restart' to activate new configuration! + a2ensite sparql Enabling site sparql. Run '/etc/init.d/apache2 reload' to activate new configuration! + rm /var/www/index.html< + echo 'Hello world - I just patched TurnKey!' Removing 'local diversion of /sbin/initctl to /sbin/initctl.distrib' # cleaning up stray files Adding 'local diversion of /sbin/initctl to /sbin/initctl.distrib' # chroot execute: rm -rf /var/log/dpkg.log /var/log/apt/* /var/lib/apt/lists/* /var/cache/apt/archives/*.deb /var/cache/apt/*.bin Removing 'local diversion of /sbin/initctl to /sbin/initctl.distrib' # preparing cdroot Parallel mksquashfs: Using 2 processors Creating 4.0 filesystem on turnkey-core-12.0-squeeze-x86.cdroot/casper/10root.squashfs, block size 131072. [==================================================================\] 30424/30424 100% Exportable Squashfs 4.0 filesystem, data block size 131072 compressed data, compressed metadata, compressed fragments duplicates are removed Filesystem size 195896.63 Kbytes (191.31 Mbytes) 38.02% of uncompressed filesystem size (515217.09 Kbytes) Inode table size 334121 bytes (326.29 Kbytes) 30.14% of uncompressed inode table size (1108440 bytes) Directory table size 323332 bytes (315.75 Kbytes) 45.54% of uncompressed directory table size (709950 bytes) Number of duplicate files found 1943 Number of inodes 32984 Number of files 28126 Number of fragments 1589 Number of symbolic links 1510 Number of device nodes 38 Number of fifo nodes 1 Number of socket nodes 0 Number of directories 3309 Number of ids (unique uids + gids) 19 Number of uids 7 root (0) man (6) libuuid (100) ntp (101) www-data (33) proxy (13) shellinabox (103) Number of gids 18 root (0) tty (5) kmem (15) disk (6) shadow (42) certssl (1000) bin (2) crontab (102) utmp (43) ssh (104) staff (50) libuuid (101 www-data (33) proxy (13) ntp (103) shellinabox (105) adm (4) mail (8) # generating turnkey-core-12.0-squeeze-x86-patched.iso Size of boot image is 4 sectors -> No emulation 4.81% done, estimate finish Thu Apr 18 21:43:43 2013 9.62% done, estimate finish Thu Apr 18 21:43:43 2013 <snip> 96.09% done, estimate finish Thu Apr 18 21:43:46 2013 Total translation table size: 2048 Total rockridge attributes bytes: 1816 Total directory bytes: 4574 Path table size(bytes): 40 Max brk space used 0 104087 extents written (203 MB)
Obviously inserted page breaks for readability... And FYI it was using a v12 Core ISO I had already on my server (a known good one) and the clone of your git repo that I did last night.
Although my base install (what I installed TKLPatch into) has been installed for some time, but theoretically it should be at least similar to yours (as you haven't run apt-get upgrade...)
When I run
apt-get upgrade Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be upgraded: auto-apt-archive confconsole di-live hubdns inithooks pycurl-wrapper python-dialog shellinabox tklbam tklbam-python-boto tklbam-squid tklbam-squid-common tklpatch turnkey-pylib turnkey-sysinfo turnkey-version webmin webmin-custom webmin-fdisk webmin-file webmin-firewall webmin-lvm webmin-mount webmin-net webmin-passwd webmin-raid webmin-shell webmin-software webmin-sshd webmin-syslog webmin-text-editor webmin-theme-stressfree webmin-updown webmin-useradmin 34 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 10.1 MB of archives. After this operation, 752 kB of additional disk space will be used.
And then try to run your patch again (I removed the previously patched ISO) I get this:
tklpatch turnkey-core-12.0-squeeze-x86.iso Linked-Data/linked-data/ # extracting root filesystem and isolinux from ISO Parallel unsquashfs: Using 2 processors 25597 inodes (25986 blocks) to write [=================================================|] 25986/25986 100% created 23964 files created 2837 directories created 1074 symlinks created 38 devices created 1 fifos TKLPATCH_ISOLABEL: linked-data # applying patch Linked-Data/linked-data # executing config script Linked-Data/linked-data/conf/pre-debs Adding 'local diversion of /sbin/initctl to /sbin/initctl.distrib' # chroot execute: /tmp/tklpatch/pre-debs Removing 'local diversion of /sbin/initctl to /sbin/initctl.distrib'
Some strange stuff going on there!
seems the same
Reply 14that's pretty much exactly what I get!
the reason it looks like i havn't done an apt-get upgrade is because during the install i told it to install security updates (which requires and apt-get update) so by the time i install tklpatch i get the current repo version.
if i don't do this, or don't manuallly apt-get update, i get a "no installation candidate available" message when trying to apt-get install it.
what version of tklpatch
Reply 15
Which version of tklpatch do you have now? I notice it WAS upgraded by apt. You should be able to do an apt-cache show tklpatch to get the version info.
The following packages will be upgraded: auto-apt-archive confconsole di-live hubdns inithooks pycurl-wrapper python-dialog shellinabox tklbam tklbam-python-boto tklbam-squid tklbam-squid-common tklpatch
because mine shows the same version but chops the bottom half of the package details of the apt-cache show output but otherwise looks the same, it's deff changing something though!
Nice work Alon
Reply 16Glad it's all good now! :)
There was a regression, deployed a fix.
Reply 17I found the issue, and you are correct - there was a regression (sorry about that!). The part that was failing was during enumeration of debs overlay - if debs/ existed but didn't contain any *all.deb or *$arch.deb, it would return a non-zero exit code which would traverse back up to the main tklpatch script, and abort.
I fixed the code, and verified it now works with all the use cases i could think of. I also updated the package archive with the new version:
apt-get update apt-get install tklpatch
Again, sorry about that.
cheers
Reply 18THANK YOU!
But I don't think it's broken. Looking at your post it seems that it's the same TKLPatch deb (same file name, same size and same hashes...!)
A quick glance at you console output makes me think that your conf is probably not executable, but I'm only guessing...