From Fedora Project Wiki

< QA‎ | Test Days

(not yum but dnf)
(30 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{header|qa}}
{{header|qa}}
[[File:qa-test-day-live-image.png|right|400px]]


= Creating a Test Day Live Image =
= Creating a Test Day Live Image =


The following steps outline how to create a Fedora live image based on current Rawhide packages for use during Test Days.
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.


{{admon/note|This guide is intended mainly for Fedora QA team|Ordinary users who want to participate on a test day doesn't have to follow this guide, the pre-built images will be published and available for them to download on a [[QA/Test_Days|Test Day pages]].}}
How to build a Test Day Live image:
<ol>
<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:
{{#tag:pre|
dnf install livecd-tools --releasever={{FedoraVersion|number|next}}
}}
</li>


1. Install required packages:
<li>Download the kickstart script used by {{FedoraVersion|long|next}} by using the <code>f{{FedoraVersion|number|next}}</code> git branch:
<pre>
{{#tag:pre|
yum install spin-kickstarts livecd-tools
dnf install git
</pre>
git clone ssh://git@pagure.io/fedora-kickstarts.git fedora-kickstarts -b f{{FedoraVersion|number|next}}
}}
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 ..}}
The Test Day kickstart is located at {{filename|spin-kickstarts/custom/qa-test-day.ks}}.
</li>


2. Save most recent [http://git.fedorahosted.org/git/spin-kickstarts.git?p=spin-kickstarts.git;a=blob_plain;f=fedora-live-base.ks;hb=HEAD fedora-live-base.ks] and [http://git.fedorahosted.org/git/spin-kickstarts.git?p=spin-kickstarts.git;a=blob_plain;f=fedora-livecd-desktop.ks;hb=HEAD fedora-livecd-desktop.ks] kickstart templates to a custom directory:
<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'':
<pre>
<pre>
wget 'http://git.fedorahosted.org/git/spin-kickstarts.git?p=spin-kickstarts.git;a=blob_plain;f=fedora-live-base.ks;hb=HEAD' -O fedora-live-base.ks
%include spin-kickstarts/custom/qa-test-day.ks
wget 'http://git.fedorahosted.org/git/spin-kickstarts.git?p=spin-kickstarts.git;a=blob_plain;f=fedora-livecd-desktop.ks;hb=HEAD' -O fedora-livecd-desktop.ks
</pre>


3. Create a new testday kickstart template ''fedora-livecd-testday.ks'' in the same directory, with this content:  
# Point repositories to a local mirror
<pre>
repo --name=fedora --baseurl=file:/mnt/globalsync/fedora/linux/development/$releasever/$basearch/os/
%include fedora-livecd-desktop.ks
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


repo --name jlaska --baseurl http://jlaska.fedorapeople.org/repos/testday
repo --name awilliam --baseurl http://adamwill.fedorapeople.org/nouveau


%packages
%packages
gdb
# List of packages to be added or removed - dependencies are handled
strace
packageYouWant
ltrace
wildcardedPackagesYouWant*
rendercheck
@GroupYouWant
libdrm
-packageYouDontWant (unless something else requires it)
-olpc-logos
%end
 
# rebrand test spins
fedora-logos
-generic-logos
%end  


%post
%post
# Set Test_Day:Current as default browser homepage
# Put any shell commands here, they will be executed in a chrooted environment
cat << EOF > /usr/lib*/firefox*/browserconfig.properties
browser.startup.homepage=https://fedoraproject.org/wiki/Test_Day:Current
EOF
 
# Create a .desktop link for Test Day
mkdir -p /etc/skel/Desktop
cat << EOF > /etc/skel/Desktop/testday.desktop
[Desktop Entry]
Encoding=UTF-8
Name=Participate in a Test Day
Type=Link
URL=https://fedoraproject.org/wiki/Test_Day:Current
Icon=gnome-fs-bookmark
EOF
%end
%end
</pre>
</pre>
More kickstart documentation is available at [[Anaconda/Kickstart]].
</li>
<li>Create the live image:
{{#tag:pre|livecd-creator -c spin-kickstarts/custom/qa-test-day.ks --releasever {{FedoraVersion|number|next}} --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)


3. Create the live image:
{{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>}}
<pre>
</li>
livecd-creator -c fedora-livecd-testday.ks --cache /var/cache/live -f "testday-`date +%Y%m%d`"
</ol>
</pre>
 
= 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 [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:
{{#tag:pre|
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:
<ol>
<li>Download the packages:
<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>
 
== 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.


{{admon/tip|In case rawhide repository is broken|If current rawhide repository is broken and the livecd can't be built, and you have access to some mirror with older rawhide snapshot, you may edit ''fedora-livecd-testday.ks'' and redefine the rawhide repository after the <code>%include</code> line, for example looking like this:<br/>
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:
<pre>repo --name=rawhide --baseurl=protocol:/path-to-older-rawhide-repository/$basearch/os/</pre>
{{#tag:pre|
In the worst case you can base the whole livecd on Fedora 11 packages with this definition:
%packages
<pre>
kernel-3.9.0-0.rc7.git3.1.fc{{FedoraVersion|number|next}}
# not really rawhide, overriden with F11 'released' repo
%end
repo --name=rawhide --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-11&arch=$basearch
repo --name=updates --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f11&arch=$basearch
</pre>
Don't forget to comment out these lines when rawhide repository gets fixed.
}}
}}


= Using the Live Image =
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.
* [[FedoraLiveCD/USBHowTo|To write the live image to a USB stick]].   
 
* [[FedoraLiveCD|To write the live image to a CD or DVD media]].
== Changing the URL opened from the welcome screen ==
* [[How_to_create_and_use_a_Live_CD#Testing_your_Live_CD_using_KVM_or_qemu|To load the live image in KVM or qemu]].
We use a wiki redirect to display the currently active test day: [[Test_Day:Current]]. If you build your Live image in advance, some other (older) test day will display when you click on the welcome screen button. Don't worry, this will be adjusted later. Shortly before your test day should begin, just edit the redirect: [https://fedoraproject.org/wiki/Test_Day:Current?redirect=no Test_Day:Current?redirect=no]. No need to rebuild your images.
 
= Further references =
* [[QA Test Day Spin]]
* [[How to create and use a Live CD]]
* [[FedoraLiveCD/USBHowTo|How to write the live image to a USB stick]].   
* [[FedoraLiveCD|How to write the live image to a CD or DVD media]].
* [[How_to_create_and_use_a_Live_CD#Testing_your_Live_CD_using_KVM_or_qemu|How to load the live image in KVM or qemu]].


= Ideas For Improvement =
# <s>Create a .desktop file with a Test Day URL on the Desktop</s>
# <s>Make browser default homepage http://fedoraproject.org/wiki/Test_Day:Current (suggested by [[User:sgallagh]])</s>
# Setup a test day .repo for the running live image (suggested by [[User:sgallagh]])


[[Category:Test Days]]
[[Category:Test Days]]
[[Category:QA_SOPs]]

Revision as of 08:28, 2 December 2019

QA.png


Qa-test-day-live-image.png

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 40 live image, you need to install the .fc40 package or later. Usually you can install it and run it on an older release (Fedora 39) just fine. If that doesn't work, you will need to install Fedora 40 first:
    dnf install livecd-tools --releasever=40
    
  2. Download the kickstart script used by Fedora 40 by using the f40 git branch:
    dnf install git
    git clone ssh://git@pagure.io/fedora-kickstarts.git fedora-kickstarts -b f40
    

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

    cd spin-kickstarts; git checkout f40; 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 40 --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 40 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.fc40
%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.

Changing the URL opened from the welcome screen

We use a wiki redirect to display the currently active test day: Test_Day:Current. If you build your Live image in advance, some other (older) test day will display when you click on the welcome screen button. Don't worry, this will be adjusted later. Shortly before your test day should begin, just edit the redirect: Test_Day:Current?redirect=no. No need to rebuild your images.

Further references