Starting from the need to create my own LiveCD which I can periodically update and customize to my liking, and knowing the advances in computer technologies in the field of GNU / Linux, I realized the scarce need to install extra graphic programs.
Thanks to portables I will not need to install programs of daily use for me such as Gimp, Inskape, Blender, even Libreoffice for some occasions. Without these programs installed on my system I save several mega-bits in software and libraries.
The portables for Linux can be downloaded from the following site:
They can even make their own portables with the following programs from the same site:
- AppDirAssistant: Utility to port the programs, it is necessary to run AppDirAssistant before installing the software to be ported; such software cannot be installed before running AppDirAssistant.
- AppImageAssistant: Utility to compress the structure in a single self-executable file the folders created by
To create portables of some software already installed you can use the following program:
For 32 bit
For 64 bit
Creating portables with this method will not look for dependencies installed in your operating system, nor will it save the configuration in your user folder unless a symbolic link is created within cde-root or the cde.options file is indicated with a line similar to this:
ignore_prefix = / home
Seeing this we will realize that we can download or create the portables we want, eliminating the need to install extra applications outside our base system, and thus reduce your space when creating our own LiveCD.
As the title says, we will see how to create our own LiveCD from scratch which will allow us to install the applications we want starting by installing our base system, there are several ways to achieve this, one by means of a text mode installation without actually installing the graphic system and another using debootstrap, this last case is the one that we will address in this manual because it allows us to create our system from scratch without any extra program to the base system.
Having a GNU / Linux system, already installed we will create a partition with the desired size to install the base system on said partition, let's see step by step how to create our base system with debootstrap:
# apt-get install debootstrap
Mount the new partition in / mnt
# mount / dev / sdax / mnt
Install the base system on that partition:
For 32 bit
# debootstrap --arch i386 distribution / mnt
For 64 bit
# debootstrap --arch amd64 distribution / mnt
The distribution must be changed to the name of the version of GNU / Linux that we want to install, these files are found in / usr / share / debootstrap / scriptsIf the file with the name of the distribution that they are going to use does not exist, simply copy the one of the latest version with the name of the new version and open it with a text editor and where the web address is indicated, change it to the new one , example:
It occurs to me that I download the repository from another address and not from the official page, I will / usr / share / debootstrap / scripts I copy the latest version of this, in this case I use an Ubuntu repository (Oneiric) that is in this folder but the download address is different since it is on my pc's hard drive, we open the file and change
default_mirror file: /// path / to / repo / ubuntu
If they find more than one line with this shape, they have to change it too.
We change the working root from the terminal with chroot and proceed to install the essential software according to our needs.
- Changing the Cage
# mount -t proc none / mnt / proc # mount -o bind / dev / mnt / dev
- Mount the external disk that contains the repository
# mkdir / mnt / media / Disk-Name # mount / dev / sdax / mnt / media / Disk-Name # chroot / mnt
- Within the same cage indicate which are the repositories to use in /etc/apt/source.list
in my case from my pc disk
deb file: /// media / Disk-Name / Oniric-Ocelot / mirror / ubuntu / oneiric main multiverse restricted universe deb file: /// media / Disk-Name / Oniric-Ocelot / mirror / ubuntu / oneiric-backports main multiverse restricted universe deb file: /// media / Disk-Name / Oniric-Ocelot / mirror / ubuntu / oneiric-proposed main multiverse restricted universe deb file: /// media / Disk-Name / Oniric-Ocelot / mirror / ubuntu / oneiric -security main multiverse restricted universe deb file: /// media / Disk-Name / Oniric-Ocelot / mirror / ubuntu / oneiric-updates main multiverse restricted universe deb file: /// media / Disk-Name / Oniric-Ocelot / mirror / medibuntu / oneiric free non-free deb file: /// media / Disk-Name / Oniric-Ocelot / mirror / canonical / oneiric partner
If we use the traditional method from a web page and we use a proxy address, we will need to tell it to use this proxy from the same cage with the following command:
# export http_proxy = "http: // user: firstname.lastname@example.org: 3128" # export ftp_proxy = "http: // user: email@example.com: 3128"
# apt-get update # apt-get upgrade # apt-get upgrade # apt-get dist-upgrade
Install the locales (languages)
# aptitude install locales # dpkg-reconfigure locales # aptitude install localepurge # localepurge
Install the version of the kernel that we are going to use, example:
# apt-get install GNU / Linux-image-3.0.0-14-generic depmod 3.0.0-14-generic user-setup
Proceed to install essential software for the correct boot of the system and subsequent creation of the LiveCD.
# apt-get install aptitude grub2 sysGNU / Linux squashfs-tools casper archdetect-deb mkisofs genisoimage xorriso console-tools console-keymaps mc blkid parted
Create some essential configuration files
# mcedit / etc / network / interfaces
and add this:
auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp
Edit the file:
# mcedit / etc / hostname
and add this:
# mcedit / etc / hosts
and add this:
127.0.0.1 localhost Host-Name
Create the mtab and fstab file.
# grep -v rootfs / proc / mounts> / etc / mtab # grep / etc / mtab -e "/"> / etc / fstab
Note: To avoid conflicts it is recommended to give the address to the root disk by the uuid, with the blkid command you can obtain the uuid and replace / dev / sdax in / etc / fstab inside this cage with the uuid, for example if it is
/ dev / sda1 replace by UUID = uuid thus: UUID = 476efe22-73ec-4276-915d-c4gga65f668b / ext3 errors = remount-ro 0 0
Step # 11
Install the graphical environment -Optional if you do not need to install a graphical environment.
# apt-get install xserver-xorg-video-all xorg xserver-xorg
Install the grub, if we do not have any grub installed in the boot sector we can do it in the following way:
In case of not having any GNU / Linux system already installed, we will proceed as follows:
We left the cage:
# exit # sudo grub-install --root-directory = / mnt / dev / sda
We return to the cage:
# chroot / mnt # update-grub
- In case of having the grub file already installed, we simply edit the file
We left the cage:
# exit # update-grub
We install our preferred desktop environment as well as our session manager that we want. In my case, I installed the desktop environment e17 (enlightenment) together with the spacefm file explorer and thus created my own LiveCD to make backup copies, as well as I included the debootstrap program to install my new operating systems directly from the repositories without need to use other LiveCDs or text mode installations.
# apt-get install e17 e17-data gparted mtools testdisk secure-delete partimage gzip zip unzip tar pkill xterm
You can choose the desktop environment of your preference, as well as the set of applications to use.
The session manager.
- In this case I do not need a session manager that asks me for username and password since its objective is to directly start the session, for this we create a text file in / etc / startX
# touch /etc/init.d/startX # chmod + x /etc/init.d/startX
Copy the following into this file
#! / bin / sh. / lib / lsb / init-functions PATH = / sbin: / bin: / usr / sbin: / usr / bin case $ 1 in start) echo "Starting graphical system" echo "You can check the LOG in / var / log / boot_x. log "X: 0 1 >> / var / log / boot_x.log 2 >> / var / log / boot_x.log & DISPLAY =: 0 su root -c enlightenment_start 1> / dev / null 2> / dev / null & ;; stop) echo "Stopping all X processes" pkill X ;; *) echo "Invalid option" ;; esac exit 0
To tell the system to start this file with the system we execute the following from the console.
# update-rc.d startX defaults 99
This is to avoid having to use any window manager like lxdm, gdm among others.
We restart the PC with the new installation.
As I had indicated install spacefm for this I download the source code from this page.
http://spacefm.sourceforge.net/ (el fichero .tar.gz o .tar.xz) al disco de la maquina.
I install the dependencies of this software:
# apt-get install autotools-dev bash desktop-file-utils build-essential libc6 libcairo2 libglib2.0-0 libgtk2.0-0 libgtk2.0-bin libpango1.0-0 libx11-6 shared-mime-info intltool pkg- config libgtk2.0-dev libglib2.0-dev fakeroot libudev0 libudev-dev
We uncompact said file
tar -xf /path/file/spacefm.tar.xz cd / path / file / spacefm ./configure # make -s # make install # update-mime-database / usr / local / share / mime> / dev / null # update-desktop-database -q # gtk-update-icon-cache -q -t -f / usr / local / share / icons / hicolor # gtk-update-icon-cache -q -t -f / usr / local / share / icons / Faenza
With this, if there was no problem we will have spacefm installed.
Remastersys can find it on their official website http://remastersys.sourceforge.net/, but I recommend you use the one that you attached to maintain compatibility, since it does not install or uninstall any application during the LiveCD creation process, as well as leave some scripts to install the LiveCD on a usb memory.
Download remastersys and install.
# dpkg -i /path/a/remastersys.deb
Creation of the LiveCD with remastersys.
Remastersys has 2 LiveCD creation modes, one saving the configuration of all users and another removing all configuration and registration of another user, which is what we are used to seeing in traditional Ubuntu LiveCDs.
To create LiveCD saving your settings.
# remastersys backup
- To create LiveCD without users or configurations (Recommended).
# remastersys dist cdfs # remastersys dist iso custom.iso
Installation of any Debian LiveCD or derivatives made with remastersys.
First verify that your partition is marked as boatable with gparted or parted as follows:
# parted / dev / sdb set 1 boot on - To activate it # parted / dev / sdb set 1 boot off - To deactivate it
- We install the iso on a cd dvd, or if you wish on a usb device in the following way (All this as root):
mkdir -p / mnt / cdrom mkdir -p / mnt / usb mount -o loop / path / file.iso / mnt / cdrom mount / dev / sdbx / mnt / usb cp -r / mnt / cdrom / * / mnt / usb cp -r / mnt / cdrom / isoGNU / Linux / * / mnt / usb mv /mnt/usb/isoGNU/Linux.cfg /mnt/usb/sysGNU/Linux.cfg umount / mnt / usb umount / mnt / cdrom
# EYE look at the partition of your usb device if the partition you mounted is / dev / sdb1 the boot sector will have to be installed in / dev / sdb
# cat /usr/lib/sysGNU/Linux/mbr.bin> / dev / sdb # sysGNU / Linux --install / dev / sdb1
Step # 16.1.
First we start from the LiveCD or usb if we have it in memory.
If the required partitions such as swap (swap area) are not created, as well as a partition of more than 1 GB or more depending on the size of the livecd.
Step # 16.2.
Mount the partition created in / mnt
# fsck -a / dev / sdax # mount / dev / sdax / mnt
Copy all files inside the / rofs folder to / mnt
# cp -r / rofs / * / mnt
Note: all this as root user.
Step # 16.4.
# grub-install --root-directory = / mnt / dev / sda
Step # 16.5.
Prepare the system to boot the grub properly.
mount -t proc none / mnt / proc mount -o bind / dev / mnt / dev chroot / mnt update-grub
Step # 16.6.
Without leaving the chroot cage we prepare the essential files / etc / fstab and / etc / mtab
grep -v rootfs / proc / mounts> / etc / mtab grep / etc / mtab -e "/"> / etc / fstab
useradd -m -c "Administrative User" -G adm, admin, sudo, dialout, cdrom, plugdev, lpadmin, sambashare -d / home / user -s / bin / bash user
With this, this broad but simple guide is finished, which you can put into practice if you wish and share your own livecd with your friends, the quality of all livecd / dvd relies on the user's own knowledge, the implementation of new technologies that save hard disk space.
As you saw, it is not necessary to use unetbootin to convert a LiveCD into live usb, if you use spacefm you will have everything you need in terms of a graphical application either to convert videos, audio files among others, you will only need the program that performs this from command line and create or download a plugin to perform these tasks.