Kickstarting in Fedora

Forum rules
Share your brain ;)
machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Kickstarting in Fedora

Unread post by machinebacon » Sat Feb 22, 2014 3:39 am

Very similar to the Debian Live scripts, Fedora has a way of creating custom (live) images called 'kickstart'. I have been playing around with it in the last days and found it to be surprisingly 'easy' (well, not as rotten as dl)

Kickstart, briefly, is a set of scripts that basically 'answers all questions that the installer would ask' and also allows for commands to be run in a chroot (more about it later). So, a config.ks file has a list of applications that will be included or excluded from your future ISO, as well as what Debian calls 'hooks', though in a slightly different way.

Step 1: Get Fedora

First of all, you will need a very minimal (netinstall) installation of Fedora, probably http://download.fedoraproject.org/pub/f ... etinst.iso or http://download.fedoraproject.org/pub/f ... etinst.iso
I will not go into details about how to install Fedora, just as a little hint: keep one part of your drive unpartitioned before you boot into the anaconda (Fedora installer), this makes it easier to point and click.

Step 2: Set up kickstart

After we have booted into our base Fedora, we will have to get some files to make kickstart work.

Code: Select all

sudo yum install livecd-tools spin-kickstarts
sudo setenforce 0
The first is something like the live-boot things are in Debian to create bootable ISO files, the latter is a set of scripts similar to the debian-live package (also known as dh formerly, IIRC). setenforce 0 turns off selinux. Basically that's all we need, and an editor.

Step 3: Pick a kickstart file

If you visit the /usr/share/spin-kickstarts directory, you find a bunch of fedora-typical configuration files. Interesting is, for example, the fedora-install-fedora.ks file, or the fedora-aos.ks which is a very basic setup for applicances. Copy the one you like, let's say fedora-lxde-packages.ks, back to your home folder:

Code: Select all

cp /usr/share/spin-kickstarts/fedora-lxde-packages.ks our_file.ks
and edit it with, probably nano or vi. The file is quite self-explaining. Note, that there are sections that start with %, and entries that start with @ or -
Any % section must be closed, for example:

Code: Select all

%packages 
nano
emacs
vim
ed
%end
Inside of the, you place packages to be installed (simply type in the package name, one in each row), and those that shall be excluded, with a hyphen in front:

Code: Select all

%packages
nano
emacs
-vim
-ed
%end
Those that start with an '@' are groups. They include a big set of packages, and unwanted ones can later be excluded separately. So, optimally you first mention groups, and then the excludes. To see an overview of what is included in each group, visit: https://git.fedorahosted.org/cgit/comps ... f20.xml.in

Don't remove too much now. Save and exit, and let's do the ISO!

Step 4: Make me a sandwich!

We need quite a lot of space (a few GB) to grab the selection. This is now something like a bootstrap, so the stuff is downloaded into a chroot and then squashed into a ISO file.

Code: Select all

sudo livecd-creator --config=our_file.ks --fslabel=our_cd --cache=/var/cache/live
Takes a while, so prepare a coffee and something to smoke, or jerk off to Omegle. When finished, you find the our_cd.iso file in your home folder. Still too large, you say? Yes, but this is now the base we can work with and *remove* stuff from!

Step 5: Season to your liking

For future remasters it is good to have a comparably 'full feat' ISO to work with, because we do not download stuff, but purge it. So, let's exclude things - make a copy of the kickstart file, called our_small_file:

Code: Select all

cp our_file.ks our_small_file.ks
and edit it.
Now you can remove all the shit like xserver packages and gtk dependencies. Take a look at the fedora-live-minimization.ks file to get an idea about what can be removed. And now comes the special trick: at the end of the kickstart file, add this section:

Code: Select all

%post
echo We are in chroot now
/bin/bash
%end
This means, before the spin is created, you can move around in the (future) file system and copy and remove things, edit config files, etc.
Save and exit, and then finally:

Code: Select all

sudo livecd-creator -f modified -c our_small_file.ks -b our_cd.iso
This time it is quicker because only an update is performed and things are removed.


I have typed this from little notes, so maybe something is not 100% accurate, but you hopefully get the general idea. Google is your friend if you get stuck, search terms: "kickstart fedora"

http://fedoraproject.org/wiki/Anaconda/Kickstart
..gnutella..

User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

Re: Kickstarting in Fedora

Unread post by dkeg » Sun Feb 23, 2014 1:25 am

Thanks for taking the time to put this together. I read over while on my phone. Lot to digest. I have not been a Linux user long enough to have much of an opinion on the direction that Debian is going but there sure are areas that seem a bit in disarray

Work hard; Complain less

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: Kickstarting in Fedora

Unread post by machinebacon » Sun Feb 23, 2014 5:07 am

Thanks for taking the time to read this.
IMO Fedora is doing one thing right: they make a decision and follow the route to the gory end (pretty much like Ubuntu did with Unity/Mir, or Arch with their installation process or systemd). There are no half-assed decisions like in Debian, the only thing I would criticize about Fedora is their short release cycle, but this should not be a problem for a griller.
A BBQ remix of Fedora is 99% finished as I type this, so if somebody thinks these steps are too many (yes, it is time and space consuming), just be patient ;)
..gnutella..

pidsley
Hermit
Posts: 2539
Joined: Wed Oct 17, 2012 12:31 pm

Re: Kickstarting in Fedora

Unread post by pidsley » Sun Feb 23, 2014 7:48 am

I read it too -- thank you for putting it together. I downloaded the netinst iso (their server seemed to be having problems earlier today) and was planning to post when I had more experience trying a remix.

I think it will be a bumpy ride for Debian as they adopt systemd; it is a good idea to be looking for alternatives.

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: Kickstarting in Fedora

Unread post by machinebacon » Sun Feb 23, 2014 7:56 am

Pidsley, I'd like to especially point out the "drop into chroot" step in the howto. Please remember to execute a 'passwd root' in this step, else you have a perfectly booting system with root account but no password for it :)

The command I use to create an ISO from a modified kickstart file is:

livecd-creator --config=/path/to/config.ks --fslabel=linuxbbq-releasename --cache=/mnt/bigdrive --tmpdir=/mnt/bigdrive

Big drive, because it needs around 10-15GB :)
..gnutella..

pidsley
Hermit
Posts: 2539
Joined: Wed Oct 17, 2012 12:31 pm

Re: Kickstarting in Fedora

Unread post by pidsley » Sun Feb 23, 2014 8:01 am

^ thank you. I did notice the "special trick" at the end. ;)

I don't know how far I will get with this in the next few days, but I will also be happy to try any new remix you put together.

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: Kickstarting in Fedora

Unread post by machinebacon » Sun Feb 23, 2014 8:05 am

It's on the way up, though I haven't done a real iron install with it yet. So far, it works as it should in live mode (installable with "anaconda"), but the framebuffer session does _not_ work as expected. Haven't figured it out yet, I just store the ISO on SF and repartition the desktop machine for some new attempts. Probably it works OK if once installed -- no idea yet :)
..gnutella..

User avatar
ChefIronBelly
Approved BBQer
Posts: 1044
Joined: Mon Jan 13, 2014 6:01 am
Location: Michigan

Re: Kickstarting in Fedora

Unread post by ChefIronBelly » Sun Feb 23, 2014 2:16 pm

I installed the base, the framebuffer wasn't happy yet I need to read up, mpg123 not in the main repositories?

EDIT: @boot console idling after netinstall 100mb how about you?
Last edited by ChefIronBelly on Sun Feb 23, 2014 2:22 pm, edited 1 time in total.
(1/1) Installing: LinuxBBQ...................................[69%]==============[/]

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: Kickstarting in Fedora

Unread post by machinebacon » Sun Feb 23, 2014 2:21 pm

No, mpg123 comes from rpmforge, for example, as well as many other so-called non-free things. As an alternative for fbterm you can try jfbterm.
..gnutella..

User avatar
ChefIronBelly
Approved BBQer
Posts: 1044
Joined: Mon Jan 13, 2014 6:01 am
Location: Michigan

Re: Kickstarting in Fedora

Unread post by ChefIronBelly » Sun Feb 23, 2014 2:25 pm

machinebacon wrote:No, mpg123 comes from rpmforge, for example, as well as many other so-called non-free things. As an alternative for fbterm you can try jfbterm.
Ok thanks the jfbterm was found during a yum search. I had to google fedora + mpg123 after nothing came up in yum and seen it at what I thought was a 3rd party site.
(1/1) Installing: LinuxBBQ...................................[69%]==============[/]

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: Kickstarting in Fedora

Unread post by machinebacon » Sun Feb 23, 2014 2:38 pm

Add the rpmforge free/nonfree repos to yum.repo.d/

Install Howto
Download the latest rpmforge-release rpm from
http://apt.sw.be/redhat/el6/en/i386/rpmforge/RPMS/
Install rpmforge-release rpm:
# rpm -Uvh rpmforge-release*rpm
Install mpg123 rpm package:
# yum install mpg123
..gnutella..

User avatar
ChefIronBelly
Approved BBQer
Posts: 1044
Joined: Mon Jan 13, 2014 6:01 am
Location: Michigan

Re: Kickstarting in Fedora

Unread post by ChefIronBelly » Sun Feb 23, 2014 2:42 pm

thanks for that I would have looked it up. I just wanted to let you know that I had read and how far I got in the time I had which wasn't much, I plan on getting back in and finishing it up.

Did you see my edit ^^
EDIT: @boot console idling after netinstall 100mb how about you?
(1/1) Installing: LinuxBBQ...................................[69%]==============[/]

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: Kickstarting in Fedora

Unread post by machinebacon » Sun Feb 23, 2014 2:46 pm

Yes, between 80 and 90 here. Blame systemd and plymouth and all that noisy crap there :) After all it's a 686 spin, not optimized for 486 (which would push it down a bit, I guess) And IIRC dhcpcd/dhcpd/ntpd/cupsd and so on is running in the background.
..gnutella..

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: Kickstarting in Fedora

Unread post by machinebacon » Sun Feb 23, 2014 2:47 pm

Oh by the way:

if you come from Fedora netinstall, add alsa-utils from yum, and the user to the audio and video groups (for music and fbterm without being root)!
..gnutella..

User avatar
ChefIronBelly
Approved BBQer
Posts: 1044
Joined: Mon Jan 13, 2014 6:01 am
Location: Michigan

Re: Kickstarting in Fedora

Unread post by ChefIronBelly » Sun Feb 23, 2014 2:53 pm

Cool im in now with links it was @113mb but a ton of services running by default. This is what happens when you spoil us so much with your spins we start taking these things for granted :)
(1/1) Installing: LinuxBBQ...................................[69%]==============[/]

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: Kickstarting in Fedora

Unread post by machinebacon » Sun Feb 23, 2014 2:55 pm

Seems like a smooth sail so far? :)

Time to grab X and some *box window manager, for a try. fluxbox maybe? Ah, do what you want :D
..gnutella..

pidsley
Hermit
Posts: 2539
Joined: Wed Oct 17, 2012 12:31 pm

Re: Kickstarting in Fedora

Unread post by pidsley » Sun Feb 23, 2014 3:00 pm

I got the netinstall running (I chose "with minimal X and a pleasing assortment of window managers") and got a remastered LXDE iso to boot live, but I'm not sure how much more I will do with it.

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: Kickstarting in Fedora

Unread post by machinebacon » Sun Feb 23, 2014 3:03 pm

Hacking the kickstart file of course :)

Did you run in something unexpected?
..gnutella..

User avatar
ChefIronBelly
Approved BBQer
Posts: 1044
Joined: Mon Jan 13, 2014 6:01 am
Location: Michigan

Re: Kickstarting in Fedora

Unread post by ChefIronBelly » Sun Feb 23, 2014 5:51 pm

All set with my base install which is just jfbterm, tmux, mc, alsa and ended up using gst123. I will get to the remastering part later on thanks.

EDIT:specifics
(1/1) Installing: LinuxBBQ...................................[69%]==============[/]

User avatar
ivanovnegro
Minister of Truth
Posts: 5449
Joined: Wed Oct 17, 2012 11:12 pm

Re: Kickstarting in Fedora

Unread post by ivanovnegro » Mon Feb 24, 2014 3:39 am

This is crazy. I like it. Thanks for that Bacon. Though sometimes you really surprise me, in a fantastic way of course.

Post Reply