Hans Harder's picture

                            

I am trying to find out how I can make a openvz version

If I do the make core, i get an iso

Are there ways to get the openvz or any other format.. ?

EDITED by Liraz: I've attached the 2 TKLPatches used to patch the ISO filesystem to create the OpenVZ build.

Forum: 
Jeremy Davis's picture

And one that I'd like the answer too too!

Liraz Siri's picture

TKLDev only produces ISOs. Other image formats are created in a mega EC2 batch job that converts them in the cloud, signs the images, uploads them to sourceforgfe, etc. The problem is that the software that does this is designed for use in this kind of cloud batch job, not for "personal use". It takes care of many other things besides converting ISOs to other formats and most problematically it embeds security sensitive information such as keys to TurnKey AWS accounts.

In other words, we need to do more work to separate the sensitive private bits from the public non-sensitive bits.

In the meantime, maybe we can do provide a temporary solution. The core of the conversion process is tklpatch. Here's a snippet:

$BT/bin/iso-download $BT_ISOS $BT_VERSION $appname
$BT/bin/iso-verify $BT_ISOS $BT_VERSION $appname

cd $O

tklpatch-extract-iso $BT_ISOS/$isofile

tklpatch-apply $rootfs $BT/patches/headless
tklpatch-apply $rootfs $BT/patches/openvz
An OpenVZ build is created by extracting the ISO and applying 2 patches: headless and openvz. Maybe we can just publish the tklpatches separately.
Liraz Siri's picture

Since you can't attach files to Drupal comments (at least not out of the box) I've attached the required TKLPatches to the original post.
Jeremy Davis's picture

Nice work mate! :)

Hans Harder's picture

Great, thanks for the patches... I will look into it and see what I can do with it...

QUOTE:  ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`ol

Jonathan Struebel's picture

I must be missing something, but how do I create the OpenVZ template from the patched product.rootfs?

Jonathan Struebel's picture

Ok, I figured it out. I just need to run the following commands after applying the patches.

 

cd product.rootfs
tar --numeric-owner -czf ../"template name".tar.gz .

 

I did discover while testing this out that the headless patch attached above needs to be fixed to work with the latest version of inithooks. Namely the last line of overlay/usr/lib/inithooks/firstboot.d/29preseed needs to be changed to:

 

chmod +x /usr/lib/inithooks/firstboot.d/30turnkey-init-fence
Jeremy Davis's picture

I have posted a feature request on the TKL Issue tracker to have these patches hosted on GitHub so issues such as this can be lodged against it.

FWIW I have also lodged another feature request to have these integrated into TKLDev as options.

L. Arnold's picture

Working through basic install.  Got i386 ARCH installed and logged in via xterm.  Could not get in via WebSHELL (12321) or WebMin (12320) though the App page indicates it works by default.

Haven't been able to proceed since then (full detail in Forum Link in "since then").  I expect there is no i386 build or something is up with SOURCEFORGE for me.

Trying to progress.  Want to test a Joomla 3.2 install (they say this is the future)...  Also really want to try a OpenERP build.  Need a Mentor I expect.  OpenERP (in my world) is working well, but would like to formalize the build for myself and others.

Jeremy Davis's picture

But unfortunately I'm not in a position to give anything this invloved much work ATM - just snowed under sorry...

L. Arnold's picture

After Running the following:

cd /turnkey/fab/products
git-clone https://github.com/l-arnold/joomla32
cd joomla32
make

I ended up with the following.  Somehow Joomla Version was given a * instead of 32 in the Name. I will update to * to 32 to see if that does the job.

+ WEBROOT=/var/www/joomla
+ mkdir -p /var/www/joomla
+ tar -zxf /usr/local/src/Joomla*.tar.gz -C /var/www/joomla
tar <child>: /usr/local/src/Joomla*.tar.gz: Cannot open: No such file or directo
ry
tar <child>: Error is not recoverable: exiting now
tar: Child returned status 2
tear: Error is not recoverable: exiting now
make:    [build/stamps/root .patched] Error 2
rootPtkldev    tt

(This came from my conf.d / main file) which read (for somereason I lost the * declaration):

# unpack tarball to webroot and set permissions
tar -zxf /usr/local/src/Joomla*.tar.gz -C $WEBROOT
rm -f /usr/local/src/Joomla*
chown -R www-data:www-data $WEBROOT

 

Full Screen Shot Reads:

fab-apply-removelist /turnkey/fab/common/removelists/turnkey build/root.patched;
warning: entry    does    not    exist:    etc/apt/trusted.gpg~
warning: entry    does    not    exist:    etc/apt/trusted.gpg.d/debian-gpg~
warning: entry    does    not    exist:    etc/apt/trusted.gpg.d/turnkey-gpg~
j# apply the product-local root    overlay
if [ -d overlay 1; then fab-apply-overlay overlay build/root.patched; fi
tt run the product-local configuration scripts
6<call run-conf-scripts, conf.d>
tfab-chroot build/root.patched —script conf.d/downloads
\* UERSION=19007/134333/Joomla_3.2.l-Stable-Full_Package.zip
|+ URL=http://joomlacode.org/gf/download/frsre lease/19007/134333/Joomla_3.2.1-Sta
Ible-FullJPackage .zip
♦ dl http://joomlacode.org/gf/download/frsrelease/19007/134333/Joomla_3.2.1-Stab
le-Full_Package.zip /usr/local/src
+    http://127.0.0.1:8124 ' ]'
+ PR0XV = '~proxy http://127.0.0.1:8124'
+ cd /usr/local/src
+ curl -L -f -0 —proxy http://127.0.0.1:8124 http://joomlacode.org/gf/download/
±rsrelease/19007/134333/Joomla_3.2.l-Stable-Full_Package.zip
X Total X Received X Xferd Average Speed    Time    Time    Time    Current
Dload Upload    Total    Spent    Left    Speed
100 9285k 100 9285k    0    0    2561k    0    0:00:03    0:00:03 —: —2562k
+ cd -
Y
tfab-chroot build/root.patched —script conf.d/main
[+ fiDMIN_NfiME=admin
+ fiDMIN_PfiSS=turnkey
+ fiDMIN_MfiIL=adminBexample.com
+ DB_PREFIX =jos_
+ DB_NfiME=joomla
+ DB_USER=joomla
+ mcookie
+ DB_PfiSS=4-----------------------------------------------
+ WEBROOT=/var/www/joomla
+ mkdir -p /var/www/joomla
+ tar -zxf /usr/local/src/Joomla*.tar.gz -C /var/www/joomla
tar <child>: /usr/local/src/Joomla*.tar.gz: Cannot open: No such file or directo
ry
tar <child>: Error is not recoverable: exiting now
tar: Child returned status 2
tear: Error is not recoverable: exiting now
make:    [build/stamps/root .patched] Error 2
rootPtkldev    tt
3

Jeremy Davis's picture

I'm sure that I have used * as a wildcard successfully in scenarios like that without error...

However there's no arguning with your result! And obviously it didn't work for you. Rather than hardcoding the name in, I'd be inclined to set it as a variable in the start of the script. That makes updating down the track easier. So I'd be inclined to add (somewhere around line 12):

VERSION="32"

or even

VERSION="Joomla32"

Then lines 16 and 17 would be something like this:

tar -zxf /usr/local/src/Joomla$VERSION.tar.gz -C $WEBROOT
rm -f /usr/local/src/Joomla$VERSION

or if you used the second suggestion:

tar -zxf /usr/local/src/$VERSION.tar.gz -C $WEBROOT
rm -f /usr/local/src/$VERSION

What you've done isn't wrong, it's just better practice to not hard code those sort of things in as then you need to change it everywhere if you adapt to a different version. In this instance it's probably not a big deal (as it's only 2 lines of code) but still good practice is good practice! :)

L. Arnold's picture

I did get a download that time but I should have left the * (x2)

Crazy thing is I can't delete the Folder (rm -R * /or rm -r -f *) and start over.  I can rename it (joomla-junk)

then a new Joomla32 folder  (lets give it one more go)

L. Arnold's picture

I'm not seeing that Joomla32 actually dropped in.  Sure seemed like it did somewhere along the way but I am not finding it now. It looks like I have a Zip Called, then a Tar.gz Called.  Also, they have moved the Versions forward since I first built this (updating to http://joomlacode.org/gf/download/frsrelease/19239/158103/Joomla_3.2.3-S...)

This is the end of my Shell Session.


V. Total V. Receiued '/. Xferd Average Speed Time Time    T ime    Current        R
Dload Upload Total Spent    Left    Speed            J
100 9285k 100 9285k 0 0 1618k 0 0:00:05 0:00:05 —    : —: -    -- 1729k        
+ cd - /                
fab-chroot build/root.patched —script conf.d/main                
+ ADMIN_NAME=admin                
+ ADMIN_PASS=turnkey                
+ ADMIN_MAIL=adminBexample.com                
+ DB_PREFIX =jos_                
+ DB_NAME=joomla                
+ DB_USER=joomla                
+ mcookie                
+ DB_PASS=xxx
+ WEBROOT=/var/www/joomla                
+ mkdir -p /var/www/joomla                
+ tar -zxf /usr/local/src/Joomla32.tar.gz -C /var/www/joomla                
tar <child>: /usr/local/src/Joomla32.tar.gz: Cannot open: No such    f ile    or direct        
ory                
tar <child>: Error is not recoverable: exiting now                
tar: Child returned status 2                
tar: Error is not recoverable: exiting now                
make: [build/stamps/root .patched] Error 2                
rootPtkldev #                
rootPtkldev tt                ▼

L. Arnold's picture

 Getting Closer.  I'll bet there was a change in the Database Structure.  Actually suprised if a Database would be created for the ISO, but will look further.  This was templated off of Joomla 2.5 App.  I suppose a "dummy install" is taking place and packed into the ISO that will be changed at firstboot.  Will look at the Databases and maybe do a Joomla install in Lamp to see what the files are called.

Class InstallationControllerSetup.saoeconfig not found* curl -c /tmp/cookie -b /
itmp/cookie http://127.0.0.1/installation/index.php?view=complete
+ rn -rf /var/www/joomla/installation
+ mo /var/www/joomla/htaccess.txt /uar/www/joomla/.htaccess
+ sed -i s r# RewriteBase /!RewriteBase /! /var/www/joomla/.htaccess
+ sed -i s!sef_rewrite = '0' !sef_rewrite = '1'! /var/www/joomla/configuration.ph
IP
+ mysql —user=root —password= —batch —database=joomla —execute INSERT INTO
ljos_content UALUES <'1', '35', ' Welcome to TurnKey Joomla', 'welcome', ", '<h2>
Cetting started</h2Xp></pXulXli>Log into the <a href = ,padministrator,p>administ
[ration console</a> as <strong>admin</strongX/li> <li>Refer to the <a href=°http
://www.turnkeylinux.org/joomla32,p>TurnKey Joomla release notes</aX/liXli>Refer
to the <a href =,phttp://docs. joomla.org,p>Joomla documentation</a></liX/ulXp></
k>>', ", Jl', '0', '0', ' 2' , ' 2010-01-01 00:00:00' , '42', ", '2010-01-01 00:00:
00', '0', '0', '2010-01-01 00:00:00', '2010-01-01 00:00:00', '2020-01-01 00:00:0
0' , ", ", ' <"show_title,p:    "link_t it les”:    "show.intro”:    "show_category":,p
r, ,plink_category,p:,MP, ,pshow_parent_category”:,p,p, ,plink_parent_category,p:,MP, ,pshow_a
uthor":,p,p, "link_author":,p,p, ,pshow_create_date,p:,p,p, ,pshow_modif y_date,p:,p,p, ,pshow_pub
lish_date”:,p,p, "show_item_navigation”:,pshow_icons,p:,p,p, "show_print_icon”:”sh
ow_email_icon”:,p,p, ,pshow_vote,p:,p,p, ”show_hits”:,p,p, ,pshow_noauth,p:,p,p, ,palternat ive_re
admore”:,part ic le_layout,p: ,p,p>', '1', '0', '1', ", ", '1', '0', ", '1', '*',
L">;
lERROR 1146 <42S02) at line 1: Table 'joomla.jos_content' doesn't exist
make:    Ibuild/stamps/root .patched] Error 1
rootPtkldev    #

Learning as I go.  I should have posted this in the Forums.

Jeremy Davis's picture

Even for an ISO the DB needs to pre-exist. Because Joomla needs to have a MySQL user account. I guess hte user could be checked and created on firstboot, but often for an app to be 'pre-installed' it needs to have it's basic database tables in place or otherwise it doesn't think it's installed...

Like you say it might be worth running through the commands on LAMP. Or you could do it in your build environment.

Jeremy Davis's picture

Just thought I'd note in this thread that all the scripts to build the various formats is now available on GitHub here.

Add new comment