PDA

View Full Version : F25 onwards - Livemedia-creator usage



antikythera
4th August 2017, 09:41 AM
Objective - Create and burn a live-respin or a custom ISO

Requirements - Basic Terminal command knowledge, a text editor of your choice, uncapped internet access or a large chunk of monthly data allowance left.

Additional Requirements for custom ISO creation - Lots of time and patience, the stubbornness of a mule because it will take a few attempts before you nail the procedure.

The official wiki (https://fedoraproject.org/wiki/Livemedia-creator-_How_to_create_and_use_a_Live_CD) recommends using mock. If you value your sanity don't (http://forums.fedoraforum.org/showthread.php?t=314814) until the bug (https://bugzilla.redhat.com/show_bug.cgi?id=1473880) is dealt with properly.

Instead if possible run the same version and architecture of Fedora as the target ISO as a proper installation in VM. I happen to use VirtualBox but other VM are available and should work just as well. read the notes about the novirt switch here (https://rhinstaller.github.io/lorax/livemedia-creator.html#anaconda-image-install-no-virt) used during the build phase. This is why I run the process in a disposable VM rather than a main bare metal install.

Inside the VM proceed as follows to install the required packages and set up the media creation environment properly.

1. Open a Terminal window and type the following to install the packages:

sudo dnf install lorax-lmc-novirt git vim-minimal pykickstart2. Clone the contents of the fedora-kickstarts git repository. Don't use the older kickstarts from the fedora repositories.

git clone https://pagure.io/fedora-kickstarts.git3. Make sure SELinux is in permissive mode or the media build will fail

sudo setenforce 04. change to the fedora-kickstarts directory

cd fedora-kickstartsIf you want to customise the kickstarts to make your own media, now is the time to do so. For this guide I'll use MATE-Compiz as the example. In this case there are five key files you need to be concerned with. all open with any standard text editor, they are not encoded.

- fedora-repo.ks - where you tell lorax if you want rawhide or release, which 3rd-party repositories you want to use
- fedora-repo-rawhide OR fedora-repo-not-rawhide.ks
- fedora-live-base.ks
- fedora-live-mate_compiz.ks - substitute accordingly with the spin you want to build
- fedora-mate-common.ks - sets the package groups and packages to install or ignore

fedora-repo.ks

open the file and you will see comments. read them carefully, especially the lower section. the file comes configured to build a rawhide ISO. If you don't want this to happen, remove the 'comment' (# symbol and space) from the following line and insert the same in the opposing entry for rawhide so it reads:


%include fedora-repo-not-rawhide.ks

and

# %include fedora-repo-rawhide.ksto add third party repositories put them in the section above like so:


repo --name="Insert Name Here" --baseurl=http://rpms.remirepo.net/fedora/26/remi/x86_64/Don't use meta url link formatting as it will cause build failure. It is vital to only use a standard url. test them in your web browser to make sure you entered them properly. you should get a list of packages displayed. The name must be enclosed as double quotation marks as shown if it contains any spaces

fedora-repo-rawhide.ks OR fedora-repo-non-rawhide.ks

This as supplied will not work. You need to replace all the meta url links with proper addresses.

everywhere the links mention the following strings, just replace the entire string with actual values as per these examples. do not leave the dollar signs.

$release - 26
$basearch - X86_64

you can even use a local mirror.

for example:

repo --name=fedora --baseurl=http://mirrorservice.org/sites/dl.fedoraproject.org/pub/fedora/linux/releases/26/Everything/x86_64/os/
repo --name=updates --baseurl=http://mirrorservice.org/sites/dl.fedoraproject.org/pub/fedora/linux/updates/26/x86_64/
#repo --name=updates-testing --baseurl=http://mirrorservice.org/sites/dl.fedoraproject.org/pub/fedora/linux/updates/testing/26/x86_64/
url --mirrorlist=https://mirrors.fedoraproject.org/mirrorlist?repo=fedora-26&arch=x86_64fedora-live-base

All I changed here was the regional settings and time zone. If not sure of codes to use, look (https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Installation_Guide/s1-kickstart2-options.html) them up.

fedora-live-mate_compiz.ks

I removed the entry %include fedora-live-minimization.ks from the list at the beginning of the file because it contains a few packages I wanted to use. Check out this minimization file and see if you need to do the same.

fedora-mate-common.ks

This is the place to add or remove a package. read through what is already there. if you dont want anything add a - symbol before it to exclude it. if something already there you need is excluded then just remove the - symbol to include it in your image.

Adding any other inclusions or exclusions is the same. just add the package name with our without the -symbol.

packages in groups are not listed individually. if you want to exclude for example parole, then add an entry for it.

if you want a group add it in the same format as the existing ones. with an @ symbol before the group name. to remove a group, delete the group entry rather than comment it out.

antikythera
4th August 2017, 10:03 AM
The build stage

First flatten the kickstart files. In the terminal window make sure it is still in the fedora-kickstarts directory. If not cd fedora-kickstarts from your home directory.

then enter the following command

ksflatten -v, --config fedora-live-mate_compiz.ks -o flat-fedora-live-mate_compiz.ks --version F26switches:
-v = verbose
--config = which file to flatten from
-o = output file

The next command to enter builds the ISO file. If successful, the build process can take anything up to or over 3 hours depending on the speed of your internet, PC and the number of packages selected for installation.


sudo livemedia-creator --ks flat-fedora-live-mate_compiz.ks --no-virt --resultdir /var/lmc --project Fedora-MATE-Live --make-iso --volid Fedora-MATE-26 --iso-only --iso-name F26-MATE-x86_64.iso --releasever 26 --title Fedora-MATE-live --macbootswitches:
https://rhinstaller.github.io/lorax/livemedia-creator.html

IMPORTANT - read the notes about the novirt switch here (https://rhinstaller.github.io/lorax/livemedia-creator.html#anaconda-image-install-no-virt). This is why I run the process in a disposable VM rather than a main bare metal install.

What if it goes wrong? You need to delete the directory /var/lmc with sudo or root rights before trying again. If you don't lorax will tell you it already exists and exit.

What if it works? Retrieve your ISO in a few hours from the output directory /var/lmc. also, turn selinux back on.

sudo setenforce 1If you want to build any more ISO images remember to delete any existing /var/lmc directory first.