SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2009-05-21 04:02:57

omns
#! wanderer
From: ~/
Registered: 2008-11-25
Posts: 5,131

Remastersys Guide - Create Your Own Ubuntu-based Distro

*First, I must take no credit for this how-to. I stumbled upon it here and have reproduced it for easy access. Full credits to the original author*

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

REMASTERSYS RESOURCES
+ IMPORTANT resources & files:

  • Remastersys Home

  • Remastersys Forum Home

  • Remastersys Wiki

  • Capink's in-depth explanation of Fragadelic's Remastersys script

  • Or if you're a scripter, examine /usr/bin/remastersys.  I tried adding the -noI -noD -noF switches inside the script so that squashfs would be uncompressed, but the boot and install take nearly 40% longer on machines with only 512MB of ram.  That, in addition to wasted disk space and possibly bandwidth, means you should prolly just avoid making that same change.

  • And when you edit /etc/remastersys.conf, DO NOT change the LIVEUSER variable to "user" or "gdm".

  • Add one of these repositories, depending on your distro:

# Remastersys Debian
deb http://www.geekconnection.org/remastersys/repository debian/

# Remastersys Ubuntu (For Gutsy and Earlier - up to version 2.0.11-1)
deb http://www.geekconnection.org/remastersys/repository remastersys/

# Remastersys Ubuntu (For Hardy and Newer - version 2.0.12-1 and up)
deb http://www.geekconnection.org/remastersys/repository ubuntu/ 

REMASTERSYS 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, 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.

DISTRO 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 organize 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 SYSTEM 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 SPLASH

  • Only way I know of to customize 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

  • 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

PRESEEDING

  • Preseeding allows you to customize 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 zone, & 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

# 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/zoneinfo/ for valid values.
d-i time/zone 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 

STATIC DNS (OpenDNS), EVEN WITH DHCP

  • EDIT resolvconf:

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

+ ADD:

nameserver 208.67.222.222
nameserver 208.67.220.220 
  • EDIT the DHCP client:

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

prepend domain-name-servers 208.67.222.222,208.67.220.220; 

RESTRICTED FIRMWARE AND DRIVERS

  • It's probably a good idea to add restricted hardware drivers or firmware, especially for wireless networking.

  • It's also probably 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 resizing of Windows partitions, so I installed these packages:

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

USB PERSISTENCE

  • 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 *:

* 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 size 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.

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...

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 USB>
$ grub > root (hd<1>,0)
$ grub > setup (hd<1>,0)
$ grub > quit

Offline

Help fund CrunchBang, donate to the project!

#2 2009-05-28 03:15:28

grndslm
New Member
Registered: 2009-05-28
Posts: 2

Re: Remastersys Guide - Create Your Own Ubuntu-based Distro

Thanks for stealing my work!!  tongue

Just kiddin'... I'm flattered!  cool big_smile cool

I can get you the original "code", which you lost some of due to my [mis]use of the {quote} tags...

Thanks again!  It was pretty random that I even found this thread.  I do have a fancy for CrunchBang, tho... so keep up the good work, guys!!

Offline

#3 2009-05-28 12:11:45

omns
#! wanderer
From: ~/
Registered: 2008-11-25
Posts: 5,131

Re: Remastersys Guide - Create Your Own Ubuntu-based Distro

grndslm wrote:

I can get you the original "code", which you lost some of due to my [mis]use of the {quote} tags...

Oops, completely missed those roll

Thanks for pointing it out smile All fixed .... I think

Offline

#4 2009-05-28 23:12:32

avb
Member
Registered: 2008-12-09
Posts: 10

Re: Remastersys Guide - Create Your Own Ubuntu-based Distro

Nice tutorial, thanks a lot big_smile

Offline

#5 2009-09-24 17:24:27

drewsus
New Member
Registered: 2009-09-24
Posts: 1

Re: Remastersys Guide - Create Your Own Ubuntu-based Distro

Hello,
Great Guide, but I have some issues that I am hoping you can help with.
My problem is in regards to themes and icons.
I have copied mine to /usr/share/<appropriate folder> and copied and pasted the chown -R root:root parts. I didn't continue on with the tut after that as I don't need to GMD etc portions.
Now, I applied the ClearGlow Green theme, Minty icons, a custom background and fonts.
Then I made a Dist Live CD.
I booted the live CD, and it shows the fonts and backgrounds fine. I can select all my backgrounds too.
But, none of my themes are available and ClearGlow Green is removed and an ugly grey default theme is applied. Furthermore, none of my icons are available nor is Minty being used.
Everything else I want is okay (I think).
Any help?
I tried phyically moving my stuff to /usr/share/themes (~/icons) and applied sudo chown -R root:root to them but the ownership doesn't stick (resets on reboot/doesn't apply to dist live CD)
I am using Ubuntu 9.04, fairly fresh install
Thanks in advance,
Drew

Offline

#6 2009-11-25 05:48:40

grndslm
New Member
Registered: 2009-05-28
Posts: 2

Re: Remastersys Guide - Create Your Own Ubuntu-based Distro

Hello, drewsus!!  Thanks so much for your kind words.

I have not been able to mess with Remastersys in several months now due to numerous computer issues I've been having.  Last one involved me trying to organize my CDs/DVDs, and a cracked disc ended up breaking my DVD burner... so it's gonna take me about a week to get back into the swing of things.

As for your questions, you seem to be doing everything just fine.  The root:root permissions should stick, but after you make your dist CD... you're not seeing the links to /usr/share/themes/whatever_theme_you_have/.  Makes sense to me, since you'd need to manually add those themes to the GNOME "theme center" or whatever you want to call it.  That's what that huge "Make your graphical changes (GNOME, KDE, etc.) ..." point is for under "DISTRO PREP".  Once you add it for GNOME (or whatever desktop GUI you like), then the next step would be to copy those config files.

But that "Make your graphical changes ..." bullet point is definitely too lengthy.  Perhaps I'll make that its own step in a newer revision.

Thanks for the feedback!!

Last edited by grndslm (2009-11-25 05:49:03)

Offline

#7 2011-03-12 08:34:32

Will09600
New Member
Registered: 2011-03-12
Posts: 1

Re: Remastersys Guide - Create Your Own Ubuntu-based Distro

Hi, came across this old topic while searching for a tutorial like this ... followed it and when trying in wirtualbox, after install, it starts the plymouth animation, then kicks straight to text-based login (like ctrl-alt-f1), so i log in, username and password, no errors reported, so i do startx, it plays the login sound and has a black screen with loading cursor and looks like it's not doing anything... please help smile

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo