You are on page 1of 26

Remastersys Tips and Tricks http://remastersys.sourceforge.net/tips.

html

HOME FORUM INFO CONTACT

Remastersys Tips and Tricks

by Tony Brijeski aka Fragadelic

Remastersys Tips and Tricks


Links
Ubuntu LiveCDCustomiz ation

Ubuntu Ubiquity Installer Options

GDM/KDM Theme Customiz ation

Usplash Howto

Gnome Desktop Basics

Linux Command Reference

Linux Manpages

Ubuntu Bootsplash Howto

Old Remastersys Wiki

Important note: The livecd username MUS T be in lowercase letters only.

If you have issues with livecd user login for the dist mode livecd chances are that there is a problem with either the
/etc/passwd or /etc/group files or you have set auto login during install. These store the users and groups for the system.
If you set autologin in kdm or gdm the live scripts will not be able to create the live user.

To fix any issues with the passwd or group files, run the following commands in a terminal window:

/etc/passwd file fix:


sudo pwck

/etc/group file fix:


sudo grpck

After running those and having the issues corrected, try to run remastersys dist again.

1 de 26 13-03-2011 07:49
Remastersys Tips and Tricks http://remastersys.sourceforge.net/tips.html

Please note, backup mode just uses the ones you have on your system in whatever state they are in.

The errors come up when there are inconsistencies between /etc/passwd and /etc/group. This really should never happen unless you have manually
deleted entries in either file or somehow had a problem with creating or deleting users.

If it still fails, try the following to find out why.

You can see why it is failing if you add "break=bottom" to the kernel line when booting the livecd.

This will show you what is failing and then you can correct it.

Here is a link to a nice tutorial on how to use Remastersys.

http://www.dedoimedo.com/computers/remastersys.html

Thanks to dedoimedo for creating it and allowing me to use it.

Here is some commands to check for large files so you can verify that they are needed or maybe they can be removed and help reduce the siz e of
your iso.

To list files larger than 10M:


find / -type f -siz e +10000k -exec ls -lh {} \; | awk '{ print $8 ": " $5 }'

To list files larger than 100M:


find / -type f -siz e +100000k -exec ls -lh {} \; | awk '{ print $8 ": " $5 }'

If they are in /home and you are using dist mode, you can ignore them.

To check just in the directory you are in and those under it:
find . -type f -siz e +10000k -exec ls -lh {} \; | awk '{ print $8 ": " $5 }'

NOTE: Beware of copying and pasting commands with < > brackets as it completely depends on
your individual setup.

REMAS TERS YS NOTES

The only real difference between backup and dist modes is that backup mode copies the /home directory to the CD/DVD. Dist mode
auto-logins to the desktop with the LIVEUSER you create, whereas backup mode stops at GDM, waiting for a specific user on your current
machine to login and eventually find their normal desktop on the CD/DVD and the installed system.
Either way, the compressed filesystem will need to be 4GB or less. No buts about it, unless of course, you're a genius with ample time on your
hands. That also means backup mode will need to include your /home folder in that 4 GB iso.
Run aptitude clean to get rid of unnecessary .debs.
When you run remastersys dist, you create your dist CDFS, which is eventually converted into your dist ISO. If you only need to edit one file,
such as menu.lst so you can change Grub's timeout... just go to the CDFS chroot ( /home/remastersys/ISOTMP/ ) and you'll see the filesystem
layout of your dist CD. In this example, edit /home/remastersys/ISOTMP/boot/grub/menu.lst and then you'll be ready to run remastersys dist iso
since there's no reason to run the regular dist command and completely re-create the CDFS.
If you've already run remastersys, and you need to make drastic changes, make sure to run remastersys clean before remastersys dist.
When you're ready to test the .iso out, use a virtual machine like VMware, VirtualBox, or QEMU... so you don't have to waste any CDs or time
burning the CDs.
And just FAIR WARNING: I would highly consider avoiding Intrepid & Jaunty if you're planning on many, many people using this,

2 de 26 13-03-2011 07:49
Remastersys Tips and Tricks http://remastersys.sourceforge.net/tips.html

particularly machines with Intel-based graphics... as I've found two Intel machines that display a cruddy Xorg immediately after only
upgrading default Ubuntu packages (NOT installing anything extra yet)... but I do like most of the software better in Intrepid. Jaunty is
definitely still too new right now. Debian Lenny might be best for a larger, supported distro as it is now officially stable.

DIS TRO PREP

Upgrade and install all your packages. Google Desktop might be a possible addition to your dist.
Remove all unnecessary packages. Here is a nice guide with an example of what I've chosen to remove from my system:

aptitude purge ubuntu-desktop ttf-arabeyes ttf-arphic-uming ttf-indic-fonts-core ttf-kochi-gothic ttf-kochi-mincho ttf-lao ttf-malayalam-fonts ttf-thai-tlwg
ttf-unfonts-core language-support-en language-support-translations-en language-support-writing-en myspell-en-za openoffice.org-thesaurus-en-au
openoffice.org-l10n-en-za openoffice.org-l10n-en-gb openoffice.org-help-en-gb scim scim-bridge-agent scim-bridge-client-gtk scim-gtk2-immodule
scim-modules-socket libscim8c2a libchewing3 brltty brltty-x11 gnome-app-install ubufox apturl tracker tracker-search-tool libdeskbar-tracker
libtracker-gtk0 deskbar-applet fast-user-switch-applet tomboy

Move all backgrounds to /usr/share/backgrounds/


Move all GDM themes to /usr/share/gdm/themes/
Move all other themes to /usr/share/themes/
Move all icons & cursors to /usr/share/icons/
Likewise, move all usplash themes somewhere in /usr/share/, or splashy themes to /etc/splashy/themes/
Make your graphical changes (GNOME, KDE, etc.). I use GNOME, and I like to move my volume applet to the top right for easy wheel
scrolling of volume. Everybody I know that uses Ubuntu says that's their favorite part about the way I configure it for them. I add the weather
applet to the left of the volume applet, and then I add the system monitor applet somewhere on the top panel and enable the memory,
networking, swap, & hard disk graphs. I lock the applets and panels. It's best to organiz e these applets thru the gconf-editor. Then, I
right-click the applications menu to edit it and do a little trimming. I use the GNOME Keyboard app to make the CapsLock an extra Ctrl key.
I also edit the GNOME "Sessions" and "Services" apps to trim them down to something I find more reasonable (i.e. - no bluetooth, no
automatic upgrade manager, & no "user folders update", among other things). Then I use sysv-rc-conf to trim some more. If you want to use
Compiz Fusion, it's prolly best to install fusion-icon and switch to metacity right before copying your config files to /etc/skel/. I make sure
Nautilus, Firefox [extensions], and other programs are setup the way I like...

COPY WORTHY CONFIG FOLDERS TO S YS TEM WIDE FOLDERS

Don't copy .xchat/ as it saves your username in the config.


Don't copy .wine/ as it is very problematic, try using the global wine folder, which is (??).
Clear all Firefox cache and GNOME Recent Documents cache right before doing this.
Clearly, you must be a superuser to do this, so don't forget about sudo. Now might be a good time to use sudo's -s switch so you don't need to
type sudo before all these commands:

sudo -s
cp -Rf .config/ .fontconfig/ .gconf/ .gconfd/ .gnome2/ .mozilla/ .nautilus/ /etc/skel/
cp -Rf .config/ .fontconfig/ .gconf/ .gconfd/ .gnome2/ .mozilla/ .nautilus/ /root/
cd /etc/skel
chown -R root:root .config/ .fontconfig/ .gconf/ .gconfd/ .gnome2/ .mozilla/ .nautilus/
cd /root
chown -R root:root .config/ .fontconfig/ .gconf/ .gconfd/ .gnome2/ .mozilla/ .nautilus/

GDM

Use GNOME "Login Window" app to select your new theme and login background colors.
Remember the HEX values for the color, as you'll need them later.
Search for the terms GraphicalTheme & GtkTheme in these two files and you'll see 4 variables you need to change your GDM theme,
GtkTheme, and 2 background color for pre- and post-login. Should be near lines 504, 347, & 466.

sudo <EDITOR> /etc/gdm/gdm.conf


sudo <EDITOR> /etc/gdm.conf-custom

BOOT S PLAS H

Only way I know of to customiz e Usplash is to use the Startup Manager program.
Using most Usplash themes was buggy for me on recent versions of Ubuntu.
As long as the theme works on your computer, it should work on both the dist cd & dist install.
Splashy is an easy alternative to Ubuntu's default Usplash.
Splashy allows you to create boot, shutdown, suspend, resume, & error images of your choice with a progress bar. Just make sure to use
PNGs otherwise you'll get an Error -3.
Simply this command to create splashy themes:

splashy -c

BOOT LOADER

3 de 26 13-03-2011 07:49
Remastersys Tips and Tricks http://remastersys.sourceforge.net/tips.html

This is only for the CD, it will not copy to the dist install as ubiquity & update-grub create a custom Grub config for the new system during
install.
If you want to alter the installed Grub, update-grub must be altered, then the package must be flagged to never upgrade.
You could also choose ISOLINUX if GRUB doesn't work on some extremely rare chipsets.
EDIT the Grub config files in /etc/remastersys/grub/:

sudo <EDITOR> menu.lst.gutsyandbefore -OR- menu.lst.hardyandlater

CREATE Grub background & move to proper folder:

convert infile.jpg -resize 640x480 -colors 14 -depth 8 splash.xpm.gz


mv splash.xpm.gz /etc/remastersys/grub/

If you plan on editing the update-grub script to reflect your changes on the installed system, you can move your splash image to the shared
folder:

mv splash.xpm.gz /usr/share/grub-installer/splash.xpm.gz

PRES EEDING

Preseeding allows you to customiz e what variables are passed to the Ubiquity installer, but it only works if you use ubiquity's --automatic
switch. I don't need to make it automatic for everybody yet, but whenever I install it I can simply press Alt+F2 and type in "ubiquity
--automatic" so that my language, time z one, & keyboard layout are automatically passed to the installer. I only use this in my config right
now, but there are more options available which can be seen here, in this example guide.
Eventually remastersys will copy all preseeds from the /etc/remastersys/preseed/ folder for multiple machines and/or purposes.
Until then, just add your own preseed options to /etc/remastersys/preseed/custom.preseed

Quote

# Locale sets language and country.


d-i debian-installer/locale string en_US

# Keyboard selection.
# Disable automatic (interactive) keymap detection.
d-i console-setup/ask_detect boolean false
#d-i console-setup/modelcode string pc105
d-i console-setup/layoutcode string us
# To select a variant of the selected layout (if you leave this out, the
# basic form of the layout will be used):
#d-i console-setup/variantcode string dvorak

# Controls whether or not the hardware clock is set to UTC.


d-i clock-setup/utc boolean false

# You may set this to any valid setting for $TZ; see the contents of
# /usr/share/z oneinfo/ for valid values.
d-i time/z one string US/Central

# Controls whether to use NTP to set the clock during the install
d-i clock-setup/ntp boolean true
# NTP server to use. The default is almost always fine here.
#d-i clock-setup/ntp-server ntp.example.com

S TATIC DNS (OpenDNS ), EVEN WITH DHCP

EDIT resolvconf:

sudo -s
mkdir /etc/resolvconf/resolv.conf/
<EDITOR> /etc/resolvconf/resolv.conf/base
+ ADD:

Quote

nameserver 208.67.222.222
nameserver 208.67.220.220

EDIT the DHCP client:

4 de 26 13-03-2011 07:49
Remastersys Tips and Tricks http://remastersys.sourceforge.net/tips.html

<EDITOR> /etc/dhcp3/dhclient.conf
+ REPLACE the "#prepend domain-name-servers" line with this:

Quote

prepend domain-name-servers 208.67.222.222,208.67.220.220;

RES TRICTED FIRMWARE AND DRIVERS

It's prolly a good idea to add restricted hardware drivers or firmware, especially for wireless networking.
It's also prolly a good idea to let the jockey-gtk "Hardware Drivers" app juggle between the multiple Nvidia and ATI drivers *after*
installation. There are older, legacy graphics cards that won't work with the newest drivers from these manufacturers' websites.
I only wanted to support all the wireless cards possible and NTFS support for easy resiz ing of Windows partitions, so I installed these
packages:

sudo aptitude install b43-fwcutter ndisgtk madwifi linux-restricted-modules ntfs-3g ntfs-config

US B PERS IS TENCE

If using 8.10 or later, simply use the usb-creator tool, which is installed by default in Intrepid.
If using 8.04 LTS, you can add usb-creator by following these instructions... however, persistence still won't work with the default 8.04 initrd.
As long as you can copy and paste, it might be easier to just ignore this program and follow these manual instructions... (NOTE: Everything
before the fdisk command must be run before remastersys dist to work properly)

---- BEGIN PREPARATION ----

sudo -s
<EDITOR> /usr/share/initramfs-tools/scripts/casper (for 8.04 and earlier ONLY)
+ REMOVE this section: ",mode=755"
<EDITOR> /usr/share/initramfs-tools/init (for 8.04 and earlier ONLY)
+ ADD the lines preceded by a + between the lines preceded by a *:

Quote

* break)
* break=premount
* ;;
*
+ persistent)
+ PERSISTENT=yes
+ root_persistence=casper-rw
+ home_persistence=home-rw
+ ;;
+
* esac

For all versions of Ubuntu, if you'd like to take away the prompt at shutdown to remove the CD from the tray and press ENTER, consider this
step [...'cause I'm not positive it's the right solution]:

chmod -x /etc/rc[06].d/*casper

Now re-run remastersys to implement these new initramfs changes:

remastersys clean; remastersys dist

---- END PREPARATION ----

fdisk /dev/sd<X> (replacing < X> with what you believe, 110% sure, is your flash drive)

Now, add 2 to 4 partitions depending on the siz e of your distro, whether you want a separate partition for your home directory, and whether
you want a FAT16/32 partition for easy access on Windows machines. Make sure the first partition is bootable. Now format and label your
partitions:

mkfs.ext2 -L <distroName> /dev/sd<X>1


mkfs.ext2 -L casper-rw /dev/sd<X>2
mkfs.ext2 -L home-rw /dev/sd<X>3
mkfs.vfat -F 16 -n files /dev/sd<X>4

Now pull out the drive & plug it back in.

5 de 26 13-03-2011 07:49
Remastersys Tips and Tricks http://remastersys.sourceforge.net/tips.html

cd /media/cdrom/
cp -R boot boot.catalog casper/ .disk/ md5sum.txt preseed/ README.diskdefines /media/<distroName>/
cd /boot/grub/
cp ./*stage* /media/<distroName>/boot/grub/
<EDITOR> /media/<distroName>/boot/grub/menu.lst
+ ADD a boot menu along these lines...

Quote

default 0
timeout 7

#color cyan/blue white/blue


#splashimage=/boot/splash.xpm.gz

title Start Ubuntu in Graphical Mode


kernel /casper/vmlinuz file=/cdrom/preseed/custom.seed boot=casper root=/dev/ram rw persistent
initrd /casper/initrd.gz

#title Install Ubuntu


#kernel /casper/vmlinuz file=/cdrom/preseed/custom.seed boot=casper root=/dev/ram #only-ubiquity
#initrd /casper/initrd.gz

title Start Ubuntu in Demo Mode


kernel /casper/vmlinuz file=/cdrom/preseed/custom.seed boot=casper root=/dev/ram
initrd /casper/initrd.gz

title Start Ubuntu in Safe Graphical Mode


kernel /casper/vmlinuz file=/cdrom/preseed/custom.seed boot=casper root=/dev/ram xforcevesa rw persistent
initrd /casper/initrd.gz

#title Start Ubuntu in Text Only Mode


#kernel /casper/vmlinuz file=/cdrom/preseed/custom.seed boot=casper root=/dev/ram #textonly rw persistent
#initrd /casper/initrd.gz

#title Check the CD/DVD for defects


#kernel /casper/vmlinuz boot=casper integrity-check
#initrd /casper/initrd.gz

title Memory Test


kernel /boot/memtest

title Boot the First Hard Disk


root (hd1)
chainloader +1

Install grub to the MBR of the flash drive:

grub
$ grub > geometry (hd <Press TAB key now, making sure to realize which one is your US B>
$ grub > root (hd<1>,0)
$ grub > setup (hd<1>,0)
$ grub > quit

ADD WUBI TO YOUR DIS T

For right now, there's a decent bit of editing to /usr/bin/remastersys and /etc/remastersys.conf.
Just read the Remastersys + Wubi Guide, which I'm thinking could be made simpler by just offering a copy of the edited remastersys script.

Hi everyone,
Its just a co-incidence that when I came up with guide to Linux Customiz ation promised earlier,I was surprised with a whole new exclusive board
!!!

This has really been a long overdue.Ive been contemplating this for long but it was only the time constraints which prevented me to come up these
tips (well, I won’t call this a tutorial)...Nagging apart, below are the points that should be kept into the mind while making and preserving any sort of

6 de 26 13-03-2011 07:49
Remastersys Tips and Tricks http://remastersys.sourceforge.net/tips.html

customiz ation/preferences over the GNOME system...


I here presume that you are aware with /etc/skel folder in the linux filesystem.Yes,itsa folder which stands for 'skeleton' which transfers all its
contents to the User's home folder everytime a New user is being created. I also presume that it must be in your knowledge that the most of the
settings you make over the system are preserved in the User's home. And etc/skel transfer method just copies the settings you have previously made
and restores it to the user's home.
Now the question is what folders and subfolders should be copied to /etc/skel folder so that its preserves almost all the settings that the user
intends to. By observing closely we may find several files and folders lying in the user's home, but there are only 6-7 folders and subs which need to
be transferred discarding the rest.

Note: This by no means is a rule of thumb but just a set of examples which worked flawlessly for my Distro. Secondly, due to the variance in
environments like apps installed or restoration desired, the result & mileage may both vary to some degree,hence,examples are the only way to go.
Rest I leave it over your own R&D!!!

Enough of talking, I shall now begin:


_____________________________________________________________________________________________________________________
========================================================================================================

Go to the user's home and press ctrl+h to reveal all the hidden folders sitting in there. Now choose the following folders explained below and copy it
to /etc/skel.(But,here you don't need almost all the sub-folders so further cleaning should be done as the next step.Just try to observe which are the
sub-folders you can do without...)

Those folders are:

1) Desktop - If you want to show or place any of the files and folders over the user's dektop,that should be dropped in here. Suppose you wanna
place a shortcut for some application over the desktop, then put that shortcut in Desktop folder and transfer it to /etc/skel.

2) .config - This basically preserves the settings & customiz ation that are made to the applications and programs.
Let's take Audacious (audio player) for an example. Suppose you want the tweaked version of the Audacious to be present in you distro (like
skins applied,equliz ations made,fonts configured etc),leave the folder named Audacious intact. Also make sure that there were no songs present in
its playlist while closing it before copying, otherwise a different user using your Distro may raise his eyebrow over Madonna's Beautiful Stranger
present in the existing playlist !!! These are the small nuggets that should be kept in the mind while doing an import.
In an another example,there also exists a folder named "autostart" which should also be left intact which takes care of the programs that starts
automatically commissioned by the administrator. If you tend to tinker with "Sessions Preference" in session manager utility,this may come
handy.Also,if you have tweaked compiz ,then it also makes sense to leave this folder intact too.All the menu settings will be preserved by leaving
menu folder untouched.
To some up,preserve the folders and sub-folders of the apps that you are interested in, and delete the rest. Also delete the files called
user-dirs.dirs and users-dirs.locale as this won’t allow the folders like music,videos,pictures to be created in the user's home.

3) .gconf - Similar to the above folder which also preserves the Configurations made to apps and GNOME itself. Just follow the same what has been
explained above.
As an example here,a sub-folder named /apps/gnome-session will take care of the splash screen configured to run while logging in.Plus,
".../.gconf/desktop/gnome/background/%gconf.xml" will preserve wallpaper settings.Deletion of ".../.gconf/system" is must as it preserves the
network settings.The xml file in "...apps/gconf-editor" plus ".../apps/nautilus/desktop/" will held the data regarding the icons present over the
desktop(computer,trash,network etc).A folder named "panel" would help retaining panel configurations like its applets and position.
This folder has most number of directories and sub-directories, so be careful while fiddling up with this.Some of the folder name can be quite
tricky too. What I knew as an Image Viewer was actually EOG,and I have been sparing this under the impression that it may be something critical to
GNOME !!!A personal suggestion here.If you dont know what this folder actually stands for,goto synaptic and type the exact name and it may bring
you some details,otherwise,google is always there.Secondly,reading the *.xml files located in that particular folder can also bring in some info.

4) .gnome2 - Not all is important here. The funda here is the same as above - what to choose and what not to.
This I’ve found to have been preserving logs & history of some programs like "gedit" etc.I basically use this for the container of the "nautilus-
scripts" that I have on my system. A file called backgrounds.xml will reflect the number of wallpapers present in the system when you choose
"change desktop background”. You will also find your power management profile which is safe to delete as you may have it for laptop but you target
audience maybe a desktop pc user. Rest I leave it upon you to explore.

5) .local - I’ve found only one directory to be important in here i.e. ".local/share/applications".When you edit the gnome main menu using
alacarte,all the shortcuts like added and removed apps are stored in here.It also works in conjunction with the "menu" folder located in ".config"
folder.Added to this,"mimeapps.list" file should also be an important consideration as it maintains the database of the default program assigned for
certain filetypes.

6) .nautilus - A directory named ".nautilus/metafiles" will preserve the different view-states of the different locations like computer,drive & folder
icon siz e,Side Pane,icon views or list views or compact views etc.I personally recommend to use only the file named "computer:%2F%2F%2F.xml"
only(if you have made some changes here) and delete the rest. This is because it makes no sense storing the view state of each and every
directories you have visited.

7) .themes & .icons (optional) - These can also be carried over to /etc/skel,but I prefer to transfer it over to /usr/share/themes or /usr/share/icons. It
makes me feel that as if I am using system's default themes and icons. The preferences you make for themes and icons are already stored in above
mentioned folders.

7 de 26 13-03-2011 07:49
Remastersys Tips and Tricks http://remastersys.sourceforge.net/tips.html

Rest of the folders that you would observe in user's home is basically meant for storing their respective cache,plugins,data etc.But you can still go forth
copying them if you need the one. But I must still insist on copying the above folders only until and unless you have sound reason doing that.

More Miscellaneous:

a. Never hesitate experimenting (but you should actually know what you are doing so that you can revert to the original state if somehow you get
screwed).Lots and lots of hits & trials is really the key here.

b. Peep deep into the *.xml files you'd find in the above directories. This will give you the detailed insight of what they are meant for. If you find
something important, leave it, else your finger should kiss delete button.

c.If some file or configuration is pointing towards the local directory,you have gotta delete this.For example,if a line in any of the *xml (or other)file
reads something like "/home/yourname/xyz /*.jpg",it won’t work over another system. A little common sense will answer why.

f.There's also the possibility that customiz ation can be done without /etc/skel method.A solution for this will be manipulating the default parameters
set somewhere in the system itself(Ubuntu's skel folder all empty exept three files) but that is slightly cumbersome and frustrating and beyond the scope
of this howto.

g.When you are done with all the transfers & cleaning made to the /etc/skel folder, create a dummy user.This is the fastest way to ensure if it’s
working or not. Also compare it with the default state you started with and the environment you received from your hardship. If you are satisfied with
the outcome,fire up the remastersys,else,be ready for one more hair-splitting session.

h. Copy the /etc/skel contents to /root folder too,just to ensure that root environment also gets the same look n feel plus configurations of the current
user.For example,while running administrator apps,you'd find them coming in with their default themes and icon sets.My synaptic and gdebi
package installer looked quite ugly without this.Ive also found it to be safe to wipe out all the folders and replacing it with mine (leave default
common folders like music,picture,video etc untouched).
This step for me is quite justified too.Because if you create a new user,contents from skel folder is automatically transfered, but it’s not the case
with root as it is already existing.So you have to manually edit this,and you won’t do this by logging in as root and spend hours bringing it in the same
state as you have with others user account(s).And now dont say that nobody logs in as a root user,so you won’t be caught.

i. Install the scripts like "browse as root" and "open with gedit" as it comes quite handy at times.It may be boon for those who aren't comfortable
with CLI method of copy-paste and delete.To paste something in /etc/skel folder,it needs to have a root privilage,aint it?!

j. GDM Preferences - This falls beyond the GNOME preferences which has been bugging down the users since time imemmorial.No matter what
parameters you would set for your custom GDM Screen,it'll always rolls back to Ubuntu Human.The reason for this is that the settings for GDM is not
preserved in user's home but elsewhere.Open up /etc/gdm/gdm.conf and goto line number 504 and replace GraphicalTheme=Human with
GraphicalTheme=YOUR OWN THEME.Also line number 347 i.e. GtkTheme=Human can be replaced with your own to customiz e GtkTheme for
the dialog boxes coming up at login screen.Consicutively,line number 465 & 466 can be edited for the custom color againt that brownish camel
color reflected pre and post login.
Also edit gdm.conf-custom manually as this also tends to get copied.

k. Cosmetic S urgery Over IS OLINUX - I personally prefer ISOLINUX mehtod over GRUB to boot my distro off the CD,reason,more appealing
look.But what remastersys offers is certainly not meant for the professional approach for you custom distro.But I must again defend remastersys here
by saying that its beyond its scope and far too complicated.I once partially succeded by modifying remastersys script,but that was when I was in
playful mood.There is other way around which is more feasible.Just copy and replace the contents of "isolinux" folder from Ubuntu's original
CD.Furthermore,replace splash.pcx file with your own.And it is more important to edit isolinux.cfg and isolinux.txt along with other text files sitting in
that particular folder.Be more cautious while tinkering up with isolinux.cfg file as it holds the menu label and paths for the preseeds plus boot
configurations.You can preserve Ubuntu's preseed or remastersys' custom.seed is equally potent (Just assign the right paths).Others are memtest file
which also needs some attention if yo are providing a menu meant for "memory test".There are lots and lots of etc. etc. etc. in here,so if you can do it
by yourself,Ill feel spared.Ive just given you the hint here,rest is your homework !
Now put the folder into some safe location.Then, start remastersys and choose "Distcdfs" option that will create CD filesystem.Then replace that
"isolinux" folder lying in "/home/remastersys/remastersys/ISOTMP" with what you have just created.And then finally repackage it with "Distiso"
command found in remastersys.Burn,reboot and cross your finger for unexpected delight !

l. Keep on cursing (and blessing) Fragadelic for coming up such an addictive script that my girlfriend once scolded me of banging down my
computer !!!

=========================================================================================================
______________________________________________________________________________________________________________________

Finally, My Own Gripe and I need some help here:

Though I’ve been able to remaster my own distro to my heart content,I'm still stuck up with one single isuue that spoils everything oterwise.After
installing the remastered distribution,you'd notice that the GRUB screen rolls back to Ubuntu's default,not that what you have previously set in
menu.lst in GRUB folder.I guess there are two possible solution for this:

a)Getting the custom kernel by recompiling it.While peeping deep into the grub-install commands and allies run by ubiquity,I found it picking the
values from Ubuntu's kernel.Hence,getting a custom kernel may help.Since Im not that much comfortable with Kernel recompilation for this purpose,I
need some guide here.

8 de 26 13-03-2011 07:49
Remastersys Tips and Tricks http://remastersys.sourceforge.net/tips.html

b)Automatically running a script (only for once after installation) which replaces the defined parameters like "title" field & splash images in the
menu.lst file.

I even noticed this issue with biggies like gOS (not sure about their current version)

Maybe I’m exaggerating above, but this is just an idea not imposition. Anyone from Linux Mint??? SOS calls here!!! Cry

Now I hope that Frag could now focus more on his stuffs rather that being distracted by such an issue ...

PS : All the tips & tricks explained above are from my personal experiences,hence,there may and may not be better solutions.Hence do let me know
if I’ve missed something. And I shall be frequently doing some amendments.Criticism,suggestions & queries are all humbly awaited.

Aamit Wraj,
www.tuxrepublic.org/aRenOS.html

you won't find a better one on the net anywhere. Sorry it's a PDF, I will convert it to a long post or wiki page if you want when i get a chance
(probably this weekend).

http://weaknetlabs.com/texts/PDF/e17_customiz ing.pdf

sorry it took a while, it's a damn huge guide, and for a few days i couldn't axx these forums
thanks, hope that helps.

EDIT: hrmm, when i exported to PDF it seems i lost some data? I am choosing a different font and re-exporting it.. sorry about that. I initially used
the DejaVu Sans font.

It is highly recommended to run a clean either before or immediately after the installatioin of a new version of remastersys. This will ensure that
nothing is leftover to cause issues.

It is also highly recommended to run a clean if you change the boot type - ie. ISOLINUX to GRUB or vice versa.

I won't make this automatic since some folks may have forgotten to copy their previous iso's beforehand and I don't want to wipe those out.

Due to some common questions I keep getting asked repeatedly I have put the answers here.

There are some limitations for remastering right now and they have absolutely nothing to do with Remastersys itlself.

1 - Nvidia and ATI proprietary drivers are disabled at the kernel level by ubuntu's casper scripts - no workaround

2 - limit of 4Gig for any single file on the iso file which is a limitation of the iso9660 spec which means the compressed filesystem must be 4G or less
- no workaround

3 - no text mode installer for the livecd so all remasters that you want to be able to install must have a gui - no workaround

4 - Install options limited to what Ubuntu's installer, Ubiquity can do - no workaround

9 de 26 13-03-2011 07:49
Remastersys Tips and Tricks http://remastersys.sourceforge.net/tips.html

5 - In order for the Ubuntu casper scripts to create and boot into the livecd user, either gdm or kdm must be used as the login manager - no
workaround

6 - the livecd is limited to 1 iso file as casper only look for a single filesystem.squashfs file - no workaround

7 - compression level of the filesystem.squashfs doesn't have lz ma as the Ubuntu kernel and mksquashfs would need to be patched - unsupported/no
workaround.

8 - livecd only works properly with linux-generic livecd kernel - if you make your own kernel you are on your own - unsupported so please don't ask
for help with this

9 - if it isn't in the normal Ubuntu repositories or requires a patch of an app that changes it from stock ubuntu apps it is completely unsupported so
please don't ask me for help with these

10 - there are certain apps and libraries that Ubuntu doesn't have on their livecd's and for whatever reason they cause the livecd to fail if they are
installed - no workaround

11 - if your customiz ations are not showing up on the livecd then it means you have not made the changes in the correct place. You must figure out
what files need to be changed or where the global configuration of the settings are that you are trying to change. I only use KDE so I couldn't answer
any gnome related questions anyway. - you are on your own.

I have no intentions of maintaining a fork of casper or ubiquity or any other app so please don't ask me to change any of the above. I make
remastersys which helps you remaster a base Ubuntu desktop live system and thats it.

These are not limitations of remastersys but rather the underlying tools that are used to remaster the livecd/run the livecd/install the livecd.

These may change in the future if Ubuntu changes them but for now they are the limitations and there are no workarounds.

Remastersys simply builds the livecd from the system you are running. If you have it setup correctly and nothing conflicts with Ubuntu's casper or
ubiquity then it should build, run and install just fine.

Transforming your Installation Manually into a Live DVD/CD


by capink from the Ubuntu Forums

This HOWTO is about making a live CD/DVD from the main system on your hard drive. This might be desired if you have customiz ed your system
and want to have it on CD. It can be useful also if you want to create a recovery CD from scratch, as you can make a minimal system using
debootstrap and transform it into a live CD.

The live CD is usually created with a filesystem called squashfs. Squashfs is read only compressed filesystem that allow us to squeez e our system
into a single CD. Note that your system has to be about 2GB (this might need some trial an error) to produce a compressed image that fits on the CD.
Ofcourse compression incurs performance penalties. If you are using DVD and your installation is less than 4GB you don't have to use compression,
instead you can use ordinary unix (e.g ext2) filesystem as pointed out at the end of this guide.

Quote:

Background on live CD/DVD


Note: This section is a clarification of how live CD work s. You don't have to read it. You can sk ip it if you want.

A live CD/DVD is basically a normal linux installation just like an ordinary harddrive installation. However, simply copying the harddirve
installation over to a CD/DVD is not enough to produce a working system. Why? because there are still minor differences between a live CD/DVD
and on ordinary harddrive installation. So in addition to copying our harddirve installation to the CD/DVD we must address those differences as
well.

So what are these differences?

1. The CD or DVD is read only media. Linux needs to have write access to certain parts of the system to be able to operate properly (like
"/dev" "/proc" "/var" "/tmp"). There are a lot of approaches to address this problem. All of which utiliz e the system RAM. Some of these
approaches enable write access only to essential directories and files, and hence, they do not allow the user to modify the system or install
new packages while in the live CD. Other approaches, like unionfs which is what is used in this guide, allows the user to write to any part of
the system. This is done by merging part of the RAM with the read-only filesystem of the live CD/DVD and making the look like one
filesystem that have read-write access. Unionfs has to be mounted at boot in a certain manner.

10 de 26 13-03-2011 07:49
Remastersys Tips and Tricks http://remastersys.sourceforge.net/tips.html

2. With the harddrive installation the location of the root filesystem is fixed. So it is passed to the kernel at boot time using the root=/dev/...
parameter. With a live CD/DVD, the location of the root device is not fixed as the user might have multiple cdrom drives, these drives can be
ide, scsi ... etc. So for the root filesystem to be mounted, there must be a way to identify the root device, and then we have to load the
suitable kernel modules (to be able to access the cdrom controller as well as the CD filesystem). All this has to be done even before we have
a root filesystem mounted.
3. To fit on a CD, the filesystem is usually compressed using squashfs. So we need to autodetect the filesystem type. We also need to have the
proper modules for mounting it.

These considerations require special preparation at boot time, some of which must be performed even before mounting the actual filesystem. How
can we do this?

Linux introduced a mechanism that allow for such preparations at boot time before the actual root filesystem is mounted. It is called the initial root
filesystem or initramfs. This mechanism is used also in mounting normal harddirve installations, as it adds flexibilty to the boot process.

initramfs is virtual filesystem. It is a compressed cpio (cpio is an archive format similar to tar) archive that contains a minimal shell, kernel modules
necessary for mounting the root filesystem and number of scripts that perform some tasks at boot time. The most important of these scripts is a script
called init located at the root of the initramfs.

How does initramfs work?

The boot loader loads both the kernel and the initramfs into memory and starts the kernel. The kernel then unpacks the initramfs and mount it as
initial root filesystem, and then looks for the init program within the initial filesystem, and once it finds it, it executes it and hand the boot process
over to it. This init scirpt is responsible for finding the real root filesystem and mounting it. It is also responsible for any special preparations
required at boot time.

So any special operations required for booting the system from live media can be coded into the initramfs boot scripts.

How is initramfs is created?

We do not have to create initramfs manually (although it can be done). There are tools for creating and updating initramfs like the command
update-initramfs. Moreover, these tools can include custom scripts into the initramfs if they are placed in a certain preset locations (/usr/share
/initramfs/scripts). So all we have to do is dump our custom scripts (which will do all the required preparation for booting the live CD/DVD) into
these preset locations, and then create a custom initramfs by running update-initramfs.

We don't even have to write these scripts. Why? becuase there are packages that have scripts tailored for booting form live CDs. One of these
packages is called casper (this is the package used in this howto). By installing casper into the system, it places the scripts in there proper locations
(where they can be spotted by update-initrfamfs). The only thing we need to do after installing casper is running update-initramfs to create an
initramfs suitable for live CD/DVD.

The live CD/DVD structure:


The directory tree of the live CD/DVD we are going to create is going to look like this:

Code:

(CD ROOT)
|-------+casper
| |-------filesystem.${FORMAT}
| |-------filesystem.manifest
| |-------filesystem.manifest-desktop
|
|-------+boot
| |--------+grub
| | |--------menu.lst
| | |--------stage2_eltorito
| |
| |-------vmlinuz
| |-------initrd.gz

11 de 26 13-03-2011 07:49
Remastersys Tips and Tricks http://remastersys.sourceforge.net/tips.html

| |-------memtest86+
|
|--------md5sum.txt

/casper/filesystem.${FORMAT}: This is the container of the linux filesystem we are going to copy from our harddisk. It is usually a
compressed filesystem like squahsfs. But it can be an ordinary unix filesystem like ext2.

/casper/filesystem.manifest: This file is optional. You only need it if you decide to include the Ubuntu installer in the CD. The purpose of this
file will be explained later.

/casper/filesystem.manifest-desktop: This file is optional. You only need it if you decide to include the Ubuntu installer in the CD. The
purpose of this file will be explained later.

/boot/grub/menu.lst: File containing boot options for the live CD/DVD.

/boot/grub/stage2_eltorito: The boot loader of the CD. (stage2 of grub).

/boot/vmlinuz : The linux kernel. This is copied form the linux filesystem.

/boot/initrd.gz : the initramfs that contain the customiz ations necessary for the live CD/DVD.

/boot/memtest86+: Optional file used to test the RAM of the machine form the live CD/DVD.

/md5sum.txt: Optional file containing checksums for all the files in the CD.

What you need:


A working Debian or Ubuntu machine with internet access.

CD/DVD Writer.

Enough space in your harddirve. At least two times as much space as your installation siz e.

Outline of the steps:


A. Prepare Our work environment.

B. Copy the Source system to the target directory.

C. Chroot into the new system and make some modifications.

D. Prepare The CD directory tree.

E. Build the CD/DVD

Appendix 1. Using a non compressed filesystem.

Appendix 2. Adapting this guide to Debian.

Appendix 3. Building the live media form scratch using Debootstrap.

Conventions used in this HOWTO:


Text highlighted in Magenta is meant to be replaced by the user's custom value .

Commands performed within a chroot will be in Blue.

Optional arguments or steps will be highlighted in Gray.


I will use gedit as my default text editor. Replace gedit with your favorite text editor.

A. Preparing the environment


1. Set some variables

Code:

12 de 26 13-03-2011 07:49
Remastersys Tips and Tricks http://remastersys.sourceforge.net/tips.html

export WORK=~/work

export CD=~ /cd

export FORMAT=squashfs

export FS_DIR=casper

The WORK Directory is where our temporary files and mount point will reside.

The CD is the location of the CD tree.

FORMAT is the filesystem type. We you are going to use a compressed squashfs

FS_DIR is the location of the actual filesystem image within the cd tree.

Replace only the values highlighted in Magenta.

< People opting for ext2 look at Appendix.1 for modification of this step >

UPDATE: Using ext2 is not necessary as you can use squashfs without compression. See appendix 1 for more details

2. Create the CD and the WORK directory structure:

Code:

sudo mkdir -p ${CD}/{${FS_DIR},boot/grub} ${WORK}/rootfs

3. Install some packages on the source system:

Code:

sudo apt-get update

Code:

sudo apt-get install mkisofs grub squashfs-tools linux-ubuntu-modules-$(uname -r) qemu

qemu is optional. It is only needed for testing the cd before burning it. It can be substituted with any other virtualiz ation software like virtualbox.

linux-ubuntu-modules-$(uname -r) is only needed for Ubuntu Gutsy and later. If using an Ubuntu version prior to Gutsy omit this package as it is part
of the main kerenl package.

< People opting for ext2 look at Appendix.1 for additional step to done right here > .

UPDATE: Using ext2 is not necessary as you can use squashfs without compression. See appendix 1 for more details

B. Copy your installation into the new filesystem.


Code:

sudo rsync -av --one-file-system --exclude=/proc/* --exclude=/dev/*\

--exclude=/sys/* --exclude=/tmp/* --exclude=/home/*\

--exclude=/lost+found / ${WORK}/rootfs

Note: rsync is used instead of cp to take advantage of the --one-file-system and the --exclude options.

If you have a separate boot partition you will have to copy it using the following command:

Code:

sudo cp -av /boot/* ${WORK}/rootfs/boot

13 de 26 13-03-2011 07:49
Remastersys Tips and Tricks http://remastersys.sourceforge.net/tips.html

(Optional) Copy settings in your home dir:

If you want to preseve your user account settings which are stored in your home directory, you can copy them to ${WORK}/rootfs/etc/skel/.

But first we have to define what files we want to copy. For example I am using xcfe4 as my DE, and it stores all it settings in a directory called
.config in my home directory, so I am going to add .config to the variable $CONFIG:

C. Chroot into the new system and modify it:


1. Chroot into the copied system after mounting proc and dev:

Code:

CONFIG='.config .bashrc'

Now, Copy the CONFIG files using the following command:

Code:

cd ~ && for i in $CONFIG

do

sudo cp -rpv --parents $i ${WORK}/rootfs/etc/skel

done

Code:

sudo mount -o bind /dev/ ${WORK}/rootfs/dev

Code:

sudo mount -t proc proc ${WORK}/rootfs/proc

Code:

sudo chroot ${WORK}/rootfs /bin/bash

N.B: All commands in Blue are done within a chroot.

Now you are within chroot environment, type the following command:

Code:

LANG=

2. Install Packages Essential for live CD:

Code:

apt-get update

Code:

apt-get install casper discover1 xresprobe

14 de 26 13-03-2011 07:49
Remastersys Tips and Tricks http://remastersys.sourceforge.net/tips.html

casper contain the live scirpts.

discover1 & xresprobe are used for autodetectin hardware at startup.

3. (Optional) If you want your live cd to have an installer, install the Ubuntu installer:

Code:

apt-get install ubiquity

(Optional Step)Install any packages you want to be in the CD. Some of the following packages are useful in emergency situations:

sudo apt-get install gparted ms-sys testdisk wipe partimage xfsprogs reiserfsprogs jfsutils ntfs-3g ntfsprogs dosfstools mtools[/code]

gparted: patitioning tool. It is automatically installed as a dependecy of ubiquity.

ms-sys: writing a Microsoft compatible boot record (MBR).

testdisk: Partition scanner and disk recovery tool.

wipe: Secure file deletion.

partimage: backup partitions into a compressed image file (like norton ghost).

xfsprogs reiserfsprogs jfsutils: Tools for handling different filesystems.

mtools: Tools for manipulating MSDOS files

4. Update the initramfs:

First update modules.dep:

Code:

depmod -a $(uname -r)

Code:

update-initramfs -u -k $(uname -r)

As already metioned above, the initramfs is reponsible for much of the preparation required at the boot time of the CD/DVD. The updated initramfs
now contain the live scirpts installed with casper.

5. Remove non system users

Code:

for i in `cat /etc/passwd | awk -F":" '{print $1}'`

do

uid=`cat /etc/passwd | grep "^${i}:" | awk -F":" '{print $3}'`

[ "$uid" -gt "999" -a "$uid" -ne "65534" ] && userdel --force ${i} 2> /dev/null

done

Non-system users are users created by you that have user id more than 999.

6. Delete these files.

Code:

15 de 26 13-03-2011 07:49
Remastersys Tips and Tricks http://remastersys.sourceforge.net/tips.html

for i in "/etc/hosts /etc/hostname /etc/resolv.conf /etc/timezone /etc/fstab /etc/mtab /etc/shadow /etc/shadow-


/etc/gshadow /etc/gshadow- /etc/gdm/gdm-cdd.conf /etc/gdm/gdm.conf-custom /etc/X11/xorg.conf /boot/grub/menu.lst
/boot/grub/device.map"

do

rm $i

done 2> /dev/null

These files are not needed in the CD/DVD. some of them are could interfer with the CD/DVD boot process. (e.g. shadow and gdm.conf-custom can
interfere with autologin).

7. Clean the chroot environment form unnecessary files:

Code:

apt-get clean

Code:

find /var/run /var/log /var/mail /var/spool /var/lock /var/backups /var/tmp -type f -exec rm {} \;

Code:

rm -r /tmp/* /root/* 2>/dev/null

8. If you are using GDM recreate it's config file:

Code:

[ -f "/etc/gdm/factory-gdm.conf" ] && cp -f /etc/gdm/factory-gdm.conf /etc/gdm/gdm.conf 2> /dev/null

Sometimes a customiz ed /etc/gdm/gdm.conf can interfere with the live CD/DVD autologin.

9. Create some files in /var/log:

Code:

for i in dpkg.log lastlog mail.log syslog auth.log daemon.log faillog lpr.log mail.warn user.log boot debug mail.err
messages wtmp bootstrap.log dmesg kern.log mail.info

do

touch /var/log/${i}

done

Most of these files are log files that have been cleaned in step 7. We created an empty files in their place to prevent the system from complaining at
boot.

10. Exit chroot

Code:

exit

D. Prepare The CD directory tree:


1. Copy the kernel, the updated initrd and memtest prepared in the chroot:

16 de 26 13-03-2011 07:49
Remastersys Tips and Tricks http://remastersys.sourceforge.net/tips.html

Code:

sudo cp -vp ${WORK}/rootfs/boot/vmlinuz-$(uname -r) ${CD}/boot/vmlinuz

Code:

sudo cp -vp ${WORK}/rootfs/boot/initrd.img-$(uname -r) ${CD}/boot/initrd.gz

Code:

sudo cp -vp ${WORK}/rootfs/boot/memtest86+.bin ${CD}/boot

2. Generate manifest:

Note: This step is only needed if you installed the Ubuntu installer ubiquity. This step generates two files (filesystem.manifest & filesystem.manifest-
desktop).

3. Unmount bind mounted dirs:

Code:

sudo chroot ${WORK}/rootfs dpkg-query -W --showformat='${Package} ${Version}\n' | sudo tee ${CD}/${FS_DIR}


/filesystem.manifest

Code:

sudo cp -v ${CD}/${FS_DIR}/filesystem.manifest{,-desktop}

Code:

REMOVE='ubiquity casper live-initramfs user-setup discover1 xresprobe os-prober libdebian-installer4'

Code:

for i in $REMOVE

do

sudo sed -i "/${i}/d" ${CD}/${FS_DIR}/filesystem.manifest-desktop

done

These two files are used by the ubiquity installer when installing to harddisk. These two files are just lists of packages. Ubiquity compares these two
files and removes packages unique to filesystem.manifest. This way when installing to harddisk, packages like casper which is only useful in a live
CD/DVD are removed. These packages that will be removed at install are defined in the variable $REMOVE

Code:

sudo umount ${WORK}/rootfs/dev ${WORK}/rootfs/proc

4. Convert the directory tree into a squashfs:

Code:

sudo mksquashfs ${WORK}/rootfs ${CD}/${FS_DIR}/filesystem.${FORMAT}

17 de 26 13-03-2011 07:49
Remastersys Tips and Tricks http://remastersys.sourceforge.net/tips.html

Note: Make sure the resulting file siz e can fit into your live media.

< People opting for ext2 look at Appendix.1 for modification of this step >

UPDATE: Using ext2 is not necessary as you can use squashfs without compression. See appendix 1 for more details

5. Make Grub the bootloader of the CD

Copy grub file:

Code:

sudo find /boot /usr/lib/grub/ -iname 'stage2_eltorito' -exec cp -v {} ${CD}/boot/grub \;

Make the menu.lst

Code:

sudo gedit ${CD}/boot/grub/menu.lst

Copy the following text into it and save it.

Code:

# By default, boot the first entry.

default 0

# Boot automatically after 30 secs.

timeout 30

color cyan/blue white/blue

title Start Linux in Graphical Mode

kernel /boot/vmlinuz BOOT=casper boot=casper nopersistent rw quiet splash

initrd /boot/initrd.gz

title Start Linux in Safe Graphical Mode

kernel /boot/vmlinuz BOOT=casper boot=casper xforcevesa rw quiet splash

initrd /boot/initrd.gz

title Start Linux in Text Mode

kernel /boot/vmlinuz BOOT=casper boot=casper nopersistent textonly rw quiet

initrd /boot/initrd.gz

title Start Presistent Live CD

kernel /boot/vmlinuz BOOT=casper boot=casper persistent rw quiet splash

initrd /boot/initrd.gz

title Start Linux Graphical Mode from RAM

kernel /boot/vmlinuz BOOT=casper boot=casper toram nopersistent rw quiet splash

initrd /boot/initrd.gz

title Memory Test

kernel /boot/memtest86+.bin

title Boot the First Hard Disk

18 de 26 13-03-2011 07:49
Remastersys Tips and Tricks http://remastersys.sourceforge.net/tips.html

root (hd0)

chainloader +1

6. Calculate MD5

Code:

cd $CD && find . -type f -print0 | xargs -0 sudo md5sum | sudo tee ${CD}/md5sum.txt

E. Build the CD/DVD


1. Make the ISO file

Code:

sudo mkisofs -b boot/grub/stage2_eltorito \

-no-emul-boot -boot-load-siz e 4 -boot-info-table \

-V "Custom Live CD" -cache-inodes -r -J -l \

-o ~ /live-cd.iso $CD

2. Test the CD

Test using qemu emulator

Code:

qemu -cdrom ~\live-cd.iso -boot d

Or use any other virtualiz ation program you like.

3. (Optional) Clean our workspace

Final Notes:
Code:

[ -d "$WORK" ] && rm -r $WORK $CD

Note: If you are using ext2 instead of squashfs you may want to skip this step. Keeping these files in place will be handy whenever you update your
CD.

UPDATE: Using ext2 is not necessary as you can use squashfs without compression. See appendix 1 for more details

You can add a splash image to the grub menu.

If you are using a custom kernel make sure it has support for the following:
1. Support of loopback device.
2. Support for the filesystem format you are using (e.g. squashfs or ext2).
3. Support for unionfs.
4. Support for initramfs.

There are some extra options I put in the grub menu. The ones that I have not tried are highlighted in Red below:
1. Start linux form RAM. This option is only possible if your ram is larger than data on the live media. This option can be useful if you are
building a minimal command line rescue disc as it would enhance performance to start it from RAM.
2. Start in presistent mode. To learn about it more look here.
3. Start Linux in Text Mode. This will not start X. The user will be autologged into a virtual terminal (the kind of terminal you get when you

19 de 26 13-03-2011 07:49
Remastersys Tips and Tricks http://remastersys.sourceforge.net/tips.html

press Alt+Ctrl+F1). Note that this option will not work in all Ubuntu versions prior to Gutsy.

Appendix 1. Building the CD/DVD using a non compressed filesystem (e.g. ext2)
Update: You can use squashfs without compression by adding the -noI -noD -noF switches to mksquashfs. This is easier than using a unix
filesystem. It also has the advantage that you do not have to predict the size of the system in advance, which is needed for ext2 in order to
create a virtual filesystem with enough space ( with squashfs you do not need to create a virtual filesystem, you just use mksquashfs to create
the squashfs form a directory tree ). I have not tried this option yet. But I imagine it would make using a unix filesystem totally unnecessary.

Instead of using squashfs for the live DVD filesystem you can use an ordinary unix filesystem like ext2.

Advantages of using a unix filesystem:

- The CD/DVD will be faster than a CD/DVD with a compressed fileystem.

- Easier update of the live media provided you have not cleaned your workspace. An ordinary filesystem can be remounted and modified, then you
can recreate the ISO image. Squashfs on the other hand, is a read only filesystem so it not as easy to update.

Disadvantages of using a unix filesystem:

- You lose the advantages of filesystem compression. So you will end up with large image.

- You need a DVD unless you are building a minimal system that can fit within a CD without compression (e.g. a non graphical rescue disk).

- Your system siz e cannot exceed 4GB as that is the maximum filesiz e supported by ISO9660. Of course this also applies when using squahsfs. But
the differece is that a 4GB squashfs can contain roughly 12GB of data within it.

Note: If you are opting for the non compressed filesystem, it makes sesne to go for ext2 instead of ext3. It does not make sense to user a journaling
filesystem with it's overhead in a read only media

To use ext2 instead of squashf follow the same steps above with the following modifications:

In Step A.1 you have to define FORMAT=ext2:

Code:

export FORMAT=ext2

Or replace ext2 with the filesystem of your choice (e.g. xfs or jfs)

NOTE: The only filesystem I have tried is ext2. I have not tried any other filesystem and I do not know if they will work.

Step A.3 there is no need to install squashfs-tools, so we replace the command with:

Code:

sudo apt-get install mkisofs grub qemu

After doing the A.3 step (Before going into step B) you have to preform these extra commands:

We need to make a virtual filesystem and then format it:

Code:

sudo dd if=/dev/zero of=${CD}/${FS_DIR}/filesystem.${FORMAT} bs=1024 count=4000000

Note: This file siz e should not exceed 4 Gb because that is the maximum filesiz e ISO9660 can handle.

Note: The siz e of the virtual filesystem is the bs (block siz e) multiplied by the count. In the above example it is 1024 * 4000000 = 4096000000
(4 GB)

Note: You want to make the siz e of the virtual filesystem more than the space taken up by your hard drive installation to allow the filesystem
structures and extra packages that will be installed later.

Format the filesystem:

Code:

20 de 26 13-03-2011 07:49
Remastersys Tips and Tricks http://remastersys.sourceforge.net/tips.html

sudo mkfs.${FORMAT} -m 0 -b 1024 ${CD}/${FS_DIR}/filesystem.${FORMAT}

You may notice a warning prompt, saying that filesystem.${FORMAT} is not a block device, would you like to proceed? Say yes.

Note: The options in Magenta are specific to ext2 filesystem. Omit them if you opt for other format like xfs.

Mount the filesystem:

Code:

sudo mount -o loop -t $FORMAT ${CD}/${FS_DIR}/filesystem.${FORMAT} ${WORK}/rootfs

Replace Step D.4 with this:

Unmount the loopback device you created:

Code:

sudo umount ${WORK}/rootfs/

Appendix 2. Adapting this guide to Debian


This guide can be modified to apply to Debian systems as well. There are number of differeces between Ubuntu and Debian that we must take into
account:

1. As of Debian lenny, casper is deprecated and replaced with live-initramfs. live-initramfs is a fork of casper and it has the same options, with
one difference in the CD directory tree sturcute. This can be solved by setting the variable FS_DIR=live instead of FS_DIR=casper.
2. Sqaushfs modules and unionfs modules are in two separate packages.
3. Ubiquity installer is not present in the Debain repositories. Ubiquity is only needed if you intend to install Linux from the live CD/DVD to the
harddisk. I have not tried using ubiquity on Debian so I am not sure if it will work. To install it on Debian you have to add Ubuntu main
repository to your sources.list.

So in light of the points mentioned above we have to make the following modifications to adapt the guide to Debian:

In step A.1 replace FS_DIR=casper with

Code:

FS_DIR=live

Replace the command in Step A.3 with:

Code:

sudo apt-get install mkisofs grub squashfs-tools squashfs-modules-$(uname -r) qemu

Replace the command in Step C.2 with:

Code:

apt-get install live-initramfs unionfs-modules-$(uname -r) discover1 xresprobe

Skip step C.3 and D.2 if you do not intend to try ubiquity on Debian.

In Step D.5 Replace every occurence of BOOT=casper and boot=casper in menu.lst with BOOT=live and boot=live respectively

Appendix 3. Building the live media form Debootstrap installed system.


Instead of using your current installation to be the basis of you live CD, you can install a custom system into any directory in your system using

21 de 26 13-03-2011 07:49
Remastersys Tips and Tricks http://remastersys.sourceforge.net/tips.html

debootstrap, and then use that as the basis of your CD. The modifications you have to make are

Before doing the steps in this howto, install your custom system using debootstrap.

Step A.3 has to be done after chrooting into the debootstrap installed system. And to be able to access the internet you have to copy your
system's resolv.conf. Also we replace $(uname -r) with the kernel version of the debootstrap system. So the commands in A.3 should be
replaced with:

Code:

sudo cp -pv /etc/resolv.conf ~/debootstrap/*

Code:

sudo LANG= chroot ~/debootstrap/* /bin/bash

Code:

apt-get update && apt-get install mkisofs grub squashfs-tools linux-ubuntu-modules-$(uname -r) qemu

Code:

exit

Where version is the version of the kernel of your debootstrap installed system.

Replace ~ /debootstrap/* with the path of the debootstrap installed system.[/list]

In Step B Replace "/" with the directory you installed your new system in. So if you installed your new system in ~ /debootstrap the command
would be:

Code:

sudo rsync -av --one-file-system --exclude=/proc/* --exclude=/dev/* --exclude=/sys/* --exclude=/tmp/*


--exclude=/home/* --exclude=/lost+found ~/debootstrap/* ${WORK}/rootfs

Modify the two commands in step C.4 so they look lik this:

Code:

depmod -a version

Code:

update-initramfs -u -k version

Where version is the version of the kernel of your debootstrap installed system.

Replace $(uname -r) in Step D.1 with the kernel version of debootstarp system, so the commands should be:

Code:

sudo cp -vp ${WORK}/rootfs/boot/vmlinuz-version ${CD}/boot/vmlinuz \;

Code:

22 de 26 13-03-2011 07:49
Remastersys Tips and Tricks http://remastersys.sourceforge.net/tips.html

sudo cp -vp ${WORK}/rootfs/boot/initrd.img-version ${CD}/boot/initrd.gz \;

Code:

sudo cp -vp ${WORK}/rootfs/boot/memtest86+.bin ${CD}/boot

Where version is the version of the kernel of your new system.

Edit (1): 20/02/08

1. Added Suggestions for packages useful in rescue CD.


2. Added ext2 tag as per RumorsOfWar suggestion.
3. Modified step D.5 as per RumorsOfWar suggestion.

Edit (2): 22/02/08

If you want a non compressed filesystem (in case of DVD), using a unix filesystem like ext2 is not recommended anymore as you can use squashfs
without compression by adding the -noI -noD -noF switches to mksquashfs. The option for creating ext2 filesystem is still present in the guide but with
notes to use an uncom

How to make your own simple home server starting with Xubuntu as the base

My server was running pclinuxos from a few years back and I decided I wanted to upgrade it since that version hasn't been supported in years
anyway and I wanted to upgrade my hardware.

My old server was an AMD k6-2/550 with 2 drives - 1 for the OS and the other for storage.

My new one is an old IBM P4 1.8 with 512MB ram. 20Gig for the OS and 250GB for the data.

I started with Xubuntu 7.10 and first removed the xubuntu-desktop package so I can remove individual packages I didn't need. I stripped out
everything client related and left just X and the base. I then installed LXDE http://lxde.sourceforge.net/ to use as a light desktop environment and
webmin http://www.webmin.com/ for server administration.

This is what I installed for the server:

dhcp - dhcp server

proftpd - ftp server

23 de 26 13-03-2011 07:49
Remastersys Tips and Tricks http://remastersys.sourceforge.net/tips.html

lighttpd - small http server

samba - windows networking server side

cupsys - print server package

sshd - secure shell for remote command line access

webmin - for local and remote server administration

iceape - simple web browser for the webmin local administration

remastersys - to make a livecd from this

gdm - login manager that the ubunut livecd scripts need for auto login

lxde - lightweight desktop environment that is freedesktop.org compliant which means any .desktop files in /usr/share/applications show up
automatically on the menu

graveman - for simple cd burning needs

I customiz ed gdm by changing the factory gdm conf file and removed all the ubuntu themed stuff and colours - I like blue.

The resulting iso file was 462 MB in siz e. The install went very smoothly on the new server and it only took 1 hour from the time I put the livecd in
until I had my server completely configured like the old one.

This was the easiest and quickest server install I've ever done so I was very pleased with how everything went. This is just for my internal home
server that serves our videos, pictures and music to the various network enabled media devices I have throughout the house(all old stuff that other
folks had thrown away).

I setup the static networking stuff on the server first and then used webmin to configure all of the services I needed. I use lighttpd to serve a home
page for my kids so I already had the index.thml and just put it in /var/www which is where the default root of lighttpd is.

I am actually thinking of sharing my iso which I now just called Remastersys Home Server and might become Klikit Home Server if there is interest
in it. The webmin package allows a nice browser based config utility for all of the server side applications with the exception of lighttpd which is
easy anyway. You can browse to this from anywhere on the local network and administer the server securely since webmin uses the https protocol.

As long as you don't mind your server having a gui, its easy to do starting with Xubuntu.

This is not a lamp server although it can be turned into one if you want to and is meant to serve only a local network. webmin includes configuration
utilities for ppp and a linux firewall so it can be setup to be a simple home gateway as well but I'd advise against webserving to the outside.

24 de 26 13-03-2011 07:49
Remastersys Tips and Tricks http://remastersys.sourceforge.net/tips.html

Back

25 de 26 13-03-2011 07:49
Remastersys Tips and Tricks http://remastersys.sourceforge.net/tips.html

© 2007-2010 Tony Brijeski. All rights reserved

26 de 26 13-03-2011 07:49

You might also like