QA/Test Days/Live Image

From FedoraProject

< QA | Test Days(Difference between revisions)
Jump to: navigation, search
m (improve pre syntax)
(update to match current kickstart)
(2 intermediate revisions by one user not shown)
Line 1: Line 1:
 
{{header|qa}}
 
{{header|qa}}
  
= Creating a Test Day Live Image =
+
[[File:qa-test-day-live-image.png|right|400px]]
  
The following steps outline how to create a Fedora live image based on current [[Releases/Branched|Fedora Branched]] packages for use during [[QA/Test_Days|Test Days]]. This is mainly intended for Fedora QA team and teams that host a Test Day. Of course these teams can also use a [http://alt.fedoraproject.org/pub/alt/nightly-composes/ nightly compose] image, but special Test Day images bring additional benefits - easy access to test day channels (web, chat), smaller size and customizability.
+
= Creating a Test Day Live Image =
  
The following procedure should always be performed on the same Fedora release that you want to build the Live image for. For example if you want to build a Live image for {{FedoraVersion|long|next}}, you should build it on {{FedoraVersion|long|next}}. You can try to build it on {{FedoraVersion|long|current}}, but it might not work.
+
The following steps outline how to create a Fedora live image based on current [[Releases/Branched|Fedora Branched]] packages for use during [[QA/Test_Days|Test Days]]. This is mainly intended for Fedora QA team and teams that host a Test Day. Of course these teams can also use a [http://alt.fedoraproject.org/pub/alt/nightly-composes/ nightly compose] image, but special Test Day images bring additional benefits - a welcome screen with an easy access to test day channels (web, chat), smaller size and customizability.
  
 
How to build a Test Day Live image:
 
How to build a Test Day Live image:
 
<ol>
 
<ol>
<li>Install required packages:
+
<li>Install {{package|livecd-tools}} from the same or higher release that you intend to build the image for. If you want to build a {{FedoraVersion|long|next}} live image, you need to install the <code>.fc{{FedoraVersion|number|next}}</code> package or later. Usually you can install it and run it on an older release ({{FedoraVersion|long|current}}) just fine. If that doesn't work, you will need to install {{FedoraVersion|long|next}} first:
<pre>
+
{{#tag:pre|
yum install livecd-tools git
+
yum install livecd-tools --releasever={{FedoraVersion|number|next}}
</pre>
+
}}
 
</li>
 
</li>
  
 
<li>Download the kickstart script used by {{FedoraVersion|long|next}} by using the <code>f{{FedoraVersion|number|next}}</code> git branch:
 
<li>Download the kickstart script used by {{FedoraVersion|long|next}} by using the <code>f{{FedoraVersion|number|next}}</code> git branch:
{{#tag:pre|git clone 'git://git.fedorahosted.org/spin-kickstarts.git' -b f{{FedoraVersion|number|next}}}}
+
{{#tag:pre|
 +
yum install git
 +
git clone 'git://git.fedorahosted.org/spin-kickstarts.git' -b f{{FedoraVersion|number|next}}
 +
}}
 
or if you have done it in the past, just update it:
 
or if you have done it in the past, just update it:
 
{{#tag:pre|cd spin-kickstarts; git checkout f{{FedoraVersion|number|next}}; git pull; cd ..}}
 
{{#tag:pre|cd spin-kickstarts; git checkout f{{FedoraVersion|number|next}}; git pull; cd ..}}
 +
The Test Day kickstart is located at {{filename|spin-kickstarts/custom/qa-test-day.ks}}.
 
</li>
 
</li>
  
<li>OPTIONAL: Create your custom kickstart file ''my-test-day.ks'', if you need some changes from the default configuration:
+
<li>OPTIONAL: If you need some changes related to your Test Day (some packages pre-installed or some default configuration adjusted), either modify {{filename|qa-test-day.ks}} (it is well documented) or create a new kickstart file, include {{filename|qa-test-day.ks}} and put in your changes. This is an example of ''my-test-day.ks'':
<!-- don't ask why this works, just read http://www.gossamer-threads.com/lists/wiki/mediawiki/118688#118688 -->
+
<pre>
<pre&lt;noinclude&gt;&lt;/noinclude&gt;>
+
 
%include spin-kickstarts/custom/qa-test-day.ks
 
%include spin-kickstarts/custom/qa-test-day.ks
  
#redefine repos as you need (e.g. point it to local mirror with --baseurl, etc)
+
# Point repositories to a local mirror
#repo --name=fedora --baseurl=file:/mnt/globalsync/fedora/linux/development/{{FedoraVersion|number|next}}/$basearch/os/
+
repo --name=fedora --baseurl=file:/mnt/globalsync/fedora/linux/development/$releasever/$basearch/os/
#repo --name=updates --baseurl=file:/mnt/globalsync/fedora/linux/updates/{{FedoraVersion|number|next}}/$basearch/
+
repo --name=updates --baseurl=file:/mnt/globalsync/fedora/linux/updates/$releasever/$basearch/
 +
# Enable updates-testing (from the Internet)
 +
repo --name=updates-testing --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-testing-f$releasever&arch=$basearch
 +
 
  
 
%packages
 
%packages
#provide list of packages to be added or removed - dependencies are handled
+
# List of packages to be added or removed - dependencies are handled
#packageYouWant
+
packageYouWant
#wildcardedPackagesYouWant*
+
wildcardedPackagesYouWant*
#@GroupYouWant
+
@GroupYouWant
#-packageYouDontWant
+
-packageYouDontWant (unless something else requires it)
 
%end
 
%end
  
 
%post
 
%post
#put any shell commands here
+
# Put any shell commands here, they will be executed in a chrooted environment
 
%end
 
%end
</pre&lt;noinclude&gt;&lt;/noinclude&gt;>
+
</pre>
 +
More kickstart documentation is available at [[Anaconda/Kickstart]].
 
</li>
 
</li>
  
Line 48: Line 55:
 
(of course replace ''spin-kickstarts/custom/qa-test-day.ks'' with ''my-test-day.ks'' if you have created your custom kickstart file)
 
(of course replace ''spin-kickstarts/custom/qa-test-day.ks'' with ''my-test-day.ks'' if you have created your custom kickstart file)
  
{{Admon/tip|Different architecture|You can use <code>setarch</code> command to create a x86 Live CD/DVD on a x86_64 system. Example: <code>setarch i686 livecd-creator <...></code>. (Or you can hardcode the architecture inside the kickstart by replacing <code>$basearch</code> variable.)}}
+
{{Admon/tip|Different architecture|You can use <code>setarch</code> command to create a x86 Live image on a x86_64 system. Example: <code>setarch i686 livecd-creator <...></code>}}
 
</li>
 
</li>
 
</ol>
 
</ol>
  
= Solving problems =
+
= Further tips =
  
== Anaconda dependencies broken ==
+
== Using unreleased or custom packages ==
Sometimes the image can't be built because of broken package dependencies. You may solve the problem by removing <code>anaconda</code> package. Anaconda requires a lot of dependencies and it may very often be the culprit. To remove anaconda you just put <code>-anaconda</code> line in the <code>%packages</code> section.
+
It happens quite often that you need to include some bleeding-edge packages that have already been built in [[Koji]], but they haven't been pushed to any of the repositories (''fedora'', ''updates'' or ''updates-testing'') yet, or they haven't hit your mirror yet.
  
== SELinux complaints ==
+
If the packages are already available on the [http://dl.fedoraproject.org/pub/fedora/linux/ master mirror], but not yet on your local mirror, you can overwrite the <code>repo</code> definitions to force using the master mirror:
For building Test Days LiveCD you '''must''' have SELinux installed and enabled. Ideally it should be in the enforcing mode and everything should run fine. In case you have problems with that, you may switch the mode temporarily into permissive mode with this command run as root:
+
{{#tag:pre|
<pre>
+
repo --name=fedora --baseurl=http://dl.fedoraproject.org/pub/fedora/linux/development/$releasever/$basearch/os/
setenforce 0
+
repo --name=updates --baseurl=http://dl.fedoraproject.org/pub/fedora/linux/updates/$releasever/$basearch/
</pre>
+
repo --name=updates-testing --baseurl=http://dl.fedoraproject.org/pub/fedora/linux/updates/testing/$releasever/$basearch/
 +
}}
 +
Please use this only when necessary. Don't stress our master mirror needlessly.
  
If that doesn't help, you may also modify your ''my-test-day.ks'' kickstart file and after <code>%include</code> line add a directive
+
If your package builds are not available even on the master mirror, just in Koji, you need to download them, create a custom repository and use it in your kickstart file. Example:
<pre>
+
<ol>
selinux --permissive
+
<li>Download the packages:
</pre>
+
<pre>koji download-build NVR</pre></li>
 +
<li>Create a repository from the contents of the current directory:
 +
<pre>createrepo -v .</pre></li>
 +
<li>Share the repository over HTTP, FTP or NFS. One of the easiest way is:
 +
<pre>python -m SimpleHTTPServer</pre>
 +
Now your repository is available at http://localhost:8000.</li>
 +
<li>Include the repository in your kickstart:
 +
<pre>repo --name=test-day --baseurl=http://server/path</pre>
 +
<li>If the packages are included by default, their new versions will be picked up automatically. Otherwise you need to list them:
 +
<pre>%packages
 +
package1
 +
package2
 +
%end</pre></li>
 +
</ol>
  
(Note: Due to {{bz|547152}} you may also need to add <code>/usr/sbin/lokkit</code> inside <code>%packages</code>.)
+
== Using a non-debug kernel ==
 +
In [[Rawhide]] and in {{FedoraVersion|long|next}} before Beta the debug kernels are used by default. That lowers the system performance considerably. If you need performance rather than kernel debug information, you can manually add a production (non-debug) kernel to the Live image.
 +
 
 +
The information how to distinguish a production and a debug kernel is outlined in [[KernelDebugStrategy]]. The easiest way is to search [[Koji]] for a list of kernels built for your Fedora release and pick the latest one that contains ''kernel-debug'' RPM (the presence of this RPM indicates this is a production kernel, i.e. the debug information are separated). If this kernel is available in one of the repositories, you can simple put kernel NVR into the <code>%packages</code> section, like this:
 +
{{#tag:pre|
 +
%packages
 +
kernel-3.9.0-0.rc7.git3.1.fc{{FedoraVersion|number|next}}
 +
%end
 +
}}
  
Now the build should run fine.
+
Very often, however, a production kernel will not be a part of any repository and you'll need to download it manually from Koji and put it into a [[#Using unreleased or custom packages|custom repository]] first.
  
 
= Further references =
 
= Further references =

Revision as of 13:38, 22 April 2013

QA.png


Qa-test-day-live-image.png

Contents

Creating a Test Day Live Image

The following steps outline how to create a Fedora live image based on current Fedora Branched packages for use during Test Days. This is mainly intended for Fedora QA team and teams that host a Test Day. Of course these teams can also use a nightly compose image, but special Test Day images bring additional benefits - a welcome screen with an easy access to test day channels (web, chat), smaller size and customizability.

How to build a Test Day Live image:

  1. Install Package-x-generic-16.pnglivecd-tools from the same or higher release that you intend to build the image for. If you want to build a Fedora 21 live image, you need to install the .fc21 package or later. Usually you can install it and run it on an older release (Fedora 20) just fine. If that doesn't work, you will need to install Fedora 21 first:
    yum install livecd-tools --releasever=21
    
  2. Download the kickstart script used by Fedora 21 by using the f21 git branch:
    yum install git
    git clone 'git://git.fedorahosted.org/spin-kickstarts.git' -b f21
    

    or if you have done it in the past, just update it:

    cd spin-kickstarts; git checkout f21; git pull; cd ..

    The Test Day kickstart is located at spin-kickstarts/custom/qa-test-day.ks.

  3. OPTIONAL: If you need some changes related to your Test Day (some packages pre-installed or some default configuration adjusted), either modify qa-test-day.ks (it is well documented) or create a new kickstart file, include qa-test-day.ks and put in your changes. This is an example of my-test-day.ks:
    %include spin-kickstarts/custom/qa-test-day.ks
    
    # Point repositories to a local mirror
    repo --name=fedora --baseurl=file:/mnt/globalsync/fedora/linux/development/$releasever/$basearch/os/
    repo --name=updates --baseurl=file:/mnt/globalsync/fedora/linux/updates/$releasever/$basearch/
    # Enable updates-testing (from the Internet)
    repo --name=updates-testing --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-testing-f$releasever&arch=$basearch
    
    
    %packages
    # List of packages to be added or removed - dependencies are handled
    packageYouWant
    wildcardedPackagesYouWant*
    @GroupYouWant
    -packageYouDontWant (unless something else requires it)
    %end
    
    %post
    # Put any shell commands here, they will be executed in a chrooted environment
    %end
    

    More kickstart documentation is available at Anaconda/Kickstart.

  4. Create the live image:
    livecd-creator -c spin-kickstarts/custom/qa-test-day.ks --releasever 21 --cache /var/cache/live -f testday-YYYY-MM-DD

    (of course replace spin-kickstarts/custom/qa-test-day.ks with my-test-day.ks if you have created your custom kickstart file)

    Idea.png
    Different architecture
    You can use setarch command to create a x86 Live image on a x86_64 system. Example: setarch i686 livecd-creator <...>

Further tips

Using unreleased or custom packages

It happens quite often that you need to include some bleeding-edge packages that have already been built in Koji, but they haven't been pushed to any of the repositories (fedora, updates or updates-testing) yet, or they haven't hit your mirror yet.

If the packages are already available on the master mirror, but not yet on your local mirror, you can overwrite the repo definitions to force using the master mirror:

repo --name=fedora --baseurl=http://dl.fedoraproject.org/pub/fedora/linux/development/$releasever/$basearch/os/
repo --name=updates --baseurl=http://dl.fedoraproject.org/pub/fedora/linux/updates/$releasever/$basearch/
repo --name=updates-testing --baseurl=http://dl.fedoraproject.org/pub/fedora/linux/updates/testing/$releasever/$basearch/

Please use this only when necessary. Don't stress our master mirror needlessly.

If your package builds are not available even on the master mirror, just in Koji, you need to download them, create a custom repository and use it in your kickstart file. Example:

  1. Download the packages:
    koji download-build NVR
  2. Create a repository from the contents of the current directory:
    createrepo -v .
  3. Share the repository over HTTP, FTP or NFS. One of the easiest way is:
    python -m SimpleHTTPServer
    Now your repository is available at http://localhost:8000.
  4. Include the repository in your kickstart:
    repo --name=test-day --baseurl=http://server/path
  5. If the packages are included by default, their new versions will be picked up automatically. Otherwise you need to list them:
    %packages
    package1
    package2
    %end

Using a non-debug kernel

In Rawhide and in Fedora 21 before Beta the debug kernels are used by default. That lowers the system performance considerably. If you need performance rather than kernel debug information, you can manually add a production (non-debug) kernel to the Live image.

The information how to distinguish a production and a debug kernel is outlined in KernelDebugStrategy. The easiest way is to search Koji for a list of kernels built for your Fedora release and pick the latest one that contains kernel-debug RPM (the presence of this RPM indicates this is a production kernel, i.e. the debug information are separated). If this kernel is available in one of the repositories, you can simple put kernel NVR into the %packages section, like this:

%packages
kernel-3.9.0-0.rc7.git3.1.fc21
%end

Very often, however, a production kernel will not be a part of any repository and you'll need to download it manually from Koji and put it into a custom repository first.

Further references