Site Notice: Trading sexual favors for grunt work. This applies to:

Broken Links <Fix or fill in
Dead ends including some of our oldest pages
Unlinked Pages - Just fix what's up to date
and also p much anything u find under 'Maintenance reports' here

Chakra-Live

From /i/nsurgency W/i/ki

Jump to: navigation, search

Cherimoya uses Chakra-Live to create liveCDs. Chakra-Live was built for the Chakra project by Phil Miller, based on Gerardo Exequiel Pozzi's ArchISO. It includes usage of squashFS and Aufs2 multiple overlays, which was removed in the current ArchISO.

Contents

[edit] Introduction

Chakra-Live works similarly to ArchISO; it installs packages from a list to make a "pure" installation, and uses a simple "overlay" filesystem to configure every single aspect of the resulting system. This makes for an extremely easy-to-use liveCD creator, one that stays simple no matter what level you develop at. It also increases transparency, as instead of relying on complicated and abstract bash scripts to edit files, you just dump the files in where they should be, and that's that.

Unlike other liveCD creators, Chakra-Live makes sure all configuration and installation is as automated as possible, making it possible to redistribute all the settings and package lists in a single folder called a "profile". This makes for a system that needs almost no human input while building, like a Makefile. When you give this profile to someone else, it's only a matter of a single command to reproduce the results.

[edit] Getting started

Before beginning, you will need:

  • Choose one:
    • Any Linux distro, just add Pacman
    • A Chakra-based operating system, such as Cherimoya (recommended)
  • Template:Codeline
  • Basic development tools needed to compile C source code (GCC, Make, whatnot)
  • Template:Codeline

To use Chakra-Live, a Linux distro must be used, with Template:Codeline installed to it. See instructions below to install Template:Codeline.

Once you've got that, you'll need to get Chakra-Live. Use the following command:

git clone git://gitorious.org/chakra/chakra-live.git

Now you have all the files to begin.

[edit] Installing Pacman

Template:Note

Because we create a chroot to build a liveCD, any Linux distro from Gentoo to Debian can build Cherimoya liveCDs. All you need to do is to install the Template:Codeline package manager to your host system.

Gentoo has a Template:Codeline package ready to go. Follow these instructions to install it and configure it for the chroot.

For other distros, such as Debian or Fedora, they either do not have a Pacman package, or it is too old. Not to worry though, just download this script, run it, and pacman will be installed.

[edit] Creating a chroot

LiveCD creation is a very messy process, requiring lots of programs to be installed and configuration to be made. Also, these configurations could be incompatible with the host system! Therefore, creating a chroot jail is quite useful. A chroot simply changes the apparent root directory for the programs inside it, preventing them from messing with the real filesystem.

[edit] Chakra-based distros

If you have a Chakra-based system (Cherimoya is one of them), just use these commands to create your chroot:

pacman -S base base-devel nano vi vim rsync pacman file wget
mkchakraroot /tmp/chroot base

Then, use this command anywhere to enter the chroot:

mkchakraroot -r bash /tmp/chroot

[edit] Other Linux distros

If you don't have a Chakra based system you first have to install your basic development packages along with Template:Codeline and Template:Codeline before proceeding.

To create a chroot using the source code of Chakra-Live, use these commands:

 git clone git://gitorious.org/chakra/chakra-live.git
 cd chakra-live/mkchakraroot
 ./mkchakraroot /tmp/chroot base

Make sure you are in that same directory, and you can use this command to enter the chroot at anytime:

./mkchakraroot -r bash /tmp/chroot

[edit] Post-install Configuration

The chroot does not have any uncommented mirrors in /etc/pacman.d/mirrorlist, so you'll have to set them manually each time (allowing you to choose between making a i686 or x86_64 version).

First, open Template:Codeline, remove the "Template:Codeline" from the mirror server you want, and replace Template:Codeline with either "Template:Codeline" or "Template:Codeline". The file should then look something like this:

Template:File

Get all of Chakra-Live's dependencies with this command:

pacman -S git squashfs-tools syslinux chakra-live cdrkit make nbd mkinitcpio-nfs-utils ccr

Next, install Cherimoya's repository with Template:Codeline.

ccr -S cherimoya-mirrorlist cherimoya-profiles

After that, open Template:Filename and add these lines to the bottom of it:

Template:File

Finally, uncomment a mirror in Template:Filename:

Template:File

Your chroot is ready! All steps below this should always be done inside this chroot.

[edit] Editing the profile

Template:Note

The profile is a folder that contains every setting needed to create a liveCD. It can be zipped up and distributed over the internet, and when built with Chakra-Live, everyone will get the exact same results every time, with a single little command. By editing the profile, the resulting liveCD can be customized as needed.

The profile is composed of multiple parts, the overlay, the package lists, and the build script.

[edit] The Package Lists

Packages are the very basis of a Linux system. Once all the packages are installed, the Linux system is ready for use. Therefore, the package list forms the very core of a profile.

The package names are placed in a list, to be read by pacman and installed. It's not more complicated than that. However, you will see that, for most lists, there is a lot of extra text that is ignored by pacman. These are called comments, and explain what a package is, and the reason for it's inclusion.

The following example shows every single possible comment that can be made in a package list:

#--------------------------------------------#
# 	Fonts
#--------------------------------------------#
xorg-fonts-cyrillic

# ui & decorative fonts
ttf-liberation
ttf-google-webfonts	# font metapackage
#ttf-droid		# part of google webfonts
#ttf-anonymous-pro

Pacman ignores everything past the "#" character. This makes it possible to add an explanation right inside the source code or otherwise add some organization, but without screwing everything up. It also becomes possible to easily remove a package while keeping it in the code by "commenting it out", as you see above with the package ttf-anonymous-pro.

It is good practice to add a lot of comments so that others can understand what the packages are, and what they do.

Now that you know that, this is what pacman actually reads:

xorg-fonts-cyrillic
ttf-liberation
ttf-google-webfonts

All the comments have been removed, and the desired packages are then installed. It's that simple.

[edit] Installing Unofficial Packages

Well, in theory. The problem is that (currently), the package list can only fetch packages from binary repositories, not from source-code based User Repositories. And since the binary repositories only include the most important and trusted packages, you're really going to need the unofficial ones.

The solution is to create your own binary repository, precompiling packages from the User Repositories. Rather than getting an http/ftp server, you can just use the Dropbox service. Dropbox is a powerful file synchronizer that can also act as a basic http server, and it is up even when your computer is down.

Template:Note

First, install Dropbox. Then, go to your Dropbox folder, and enter the Public folder within. In this folder, the files can be shared with the world by using the HTTP protocol, meaning you can host downloads, and even a basic website.

We want to host a Template:Codeline repository with Dropbox, so create a folder with the name of your repository (make one up). Enter the folder, and then put your packages into it. Once that's done, replace the Template:Codeline placeholder with the name of the folder. Then run the following command:

$ repo-add <repo-name>.db.tar.gz *.pkg.tar.gz

This command will add every single package in the same directory to the repository. Since your repository may increase in size, it is best to use this sparingly. Instead, add a package one by one with the below command, replacing the <packagetoadd> placeholder with the package name:

$ repo-add <repo-name>.db.tar.gz <packagetoadd>-1.0-1-i686.pkg.tar.gz

Conversely, to remove a package, type the package name without any file extensions and use repo-remove:

$ repo-remove <repo-name>.db.tar.gz <packagetoremove>

Now, as soon as everything is in sync with Dropbox, your repository is ready to go. Get the public URL (from Dropbox's web interface) and add the repository to the bottom of the file: Template:Filename. Here is a working example:

[cherimoya]
Server = http://dl.dropbox.com/u/22186524/cherimoya/

Save that, and now you can add packages from that repository to the package list.

Template:Note

[edit] Overlays

However, there's more to liveCDs than installing packages. The resulting system needs to be configured to work in a desired manner. Most liveCD creators complicate this by using bash scripts, which are extremely abstract, making the changes nearly impossible to understand.

Thankfully, Chakra-Live configures every aspect of the entire system by simply overwriting the originals. By doing this, configuration becomes easier to understand, and works exactly the same way as on a working version.

While this isn't an exhaustive list of what can be configured using the overlay (every single thing can), here are some of the essentials:

System

  • etc/rc.conf -- This file is the BSD-style central configuration file, controlling everything from default locales and time zones, to Kernel Modules and Daemons. If your program is started by a daemon, or requires a kernel module, don't forget to add it to the list here!
  • etc/pacman.conf -- This file configures the repositories and options of the Pacman package manager.

Global Application Settings

The files in the Template:Filename directory are copied to the Template:Codeline directory of every new user when they are created. They are only used when Cherimoya is installed to disk, not for the live user running the liveCD (as it is created before )

Template:Note

  • /etc/skel/.bashrc -- A hidden file that sets variables and alias for Bash. Cherimoya makes many alias and variables to make Bash more convienent, and even friendly.

[edit] Making the liveCD

Once you're done with all that, go to the Template:Filename folder inside Template:Filename.

cd /usr/share/chakraiso/configs

Here, you can place profiles Template:Codeline to get pre-configured profiles from others, or make and build your own.

[edit] Preperations

Don't forget that each time you restart the chroot, it will reset /etc/pacman.d/mirrorlist. So just as before, remove the "#" from the mirror server you want, and replace <arch> with either i686 or x86_64.

Also, do the same to the new Template:Filename file if you are building a Cherimoya-based profile.

nano /etc/pacman.d/mirrorlist
nano /etc/pacman.d/cherimoya-mirrorlist

And always upgrade your chroot before building with the following command. Failure to do so could cause some severe bugs in the liveCD.

pacman -Syyu

[edit] Building

Finally, while inside your chosen profile directory, use this command:

./build.sh

Everything will be totally automated. Once the script completes, you will have your very own ISO!

[edit] Tips

[edit] Making an x86_64 version

Template:Note

Just follow the below steps before building to make an Template:Codeline version:

First, open Template:Codeline, remove the "Template:Codeline" from a nearby mirror server, and replace Template:Codeline with "Template:Codeline". The file should then look something like this:

Template:File

Next, if you want to use packages from Cherimoya, uncomment a nearby mirror Template:Codeline:

Template:File

[edit] Troubleshooting

Personal tools
Invasion Boards

FMP256 Flash Music Playhead

To listen you must install Flash Player. Visit Draftlight Networks for more info.


LOL