Logo

 Home | Contact   | Resume   | Ubuntu OEM


How to use Ubuntu 10.04 OEM installer to build a custom preload image

First you need to install an OEM build of Ubuntu on many computers. You want each user to setup their

own username, password, and select keyboard type with language. Next you want the image to be easily

updated each time there are updates so when you install it, the image  is up to date. You also want to be

able to install it on different size hard drives and different sizes of memory configurations. You also want

the swap size to be double the size of the memory. If so read on.

For the impatient  types: all files needed except your OEM image

I do this with a modified version of RIP Linux and  partimage  with a  small (5gig) image of an updated

Ubuntu 10.04 OEM preload image. After making a 5 gig Ubuntu OEM build from the Alternate CD on a

5gb partition set to ext2 with no swap partition. Then updating it and loading in all of the repos and

software that you like. You can also make some other customizations (gnome setting and background

image). Next up save this image with  RIP Linux and the built in partimage to another USB stick or

an external hard drive. You will need this image every time there is a update from Ubuntu. Next up

close the image on your test machine by clicking the "Prepare for shipping to the end user". Close

down Ubuntu then boot to a RIP linux USB stick. Use partimage to save an image of the Ubuntu OEM

load naming it ubuntu.partimg.gz  Next copy this image to the dvd_build/restore folder and run the mkiso.sh

file to generate the install dvd iso file. Boot the dvd on the computer you wish to load, push enter and

in 10 to 15 minutes your computer should kick out the dvd and reboot to a new load of Ubuntu. Enjoy!

 

Details Details:

To start off download Ubuntu Alternate disk from Canonical then my files.

Next up load Ubuntu 32 or 64 on to your test machine in OEM mode (F4) after selecting your language.

When you get to the hard drive partitioning selection select MANUAL. Delete all existing partitions!

Then create a 5.0 GB ext2 partition leave the rest of the space empty, NO swap and set to be bootable.

Ignore the warning about not having a swap then write the changes to disk. Finish installing and boot

up the new load.

At this point you should have a base load of Ubuntu with the "Prepare for shipping to the end user"

icon on the desktop. Next thing to do is update the sources list "System/Administration/Software Sources"

add in the two unused sources under "Other Software". Reload before closing!

Run the Update Manager, this will take awhile! Reboot if there is a new kernel. Count on it!

Next thing to do is customize the build to your needs. Here is a text file that I use on mine.

How and what you do to your load is up to you. Your mileage may vary.....

When you get everything tweaked just like you want it reboot the box but DO NOT click on the

"Prepare for shipping to the end user" button yet. If everything then is still the way you want it,

shut down the load but AGAIN DO NOT CLICK "Prepare for shipping to the end user" button.

 

SAVE the image!

Now you will want to save the 5 GB partition to another drive with partimage. For this you will

need something bootable that has partimage on it. My favorite is RIP Linux on a usb stick. It

has saved my bacon many times! Just boot to your RIP Linux stick into it's gui. Right mouse

click and pick "MOUNT" select your other usb stick or external hd. This is where you are going

to save the OEM load that has NOT been finalized (so you can use it again and update it). Bring

up the terminal and type:

partimage -z1 -o -b -d save /dev/sda1 /mnt/sdb1/notset.ubuntu.partimg.gz

That is assuming that your hd was sda1 and the drive to save to is sdb1 (the one you just mounted)

if not make the changes needed for you. Then close everything down and reboot the OEM build on

your test box and now you can click on "Prepare for shipping to the end user"  then shut down.

Then "rinse and repeat" with the RIP linux and partimage process but this time use the command:

partimage -z1 -o -b -d save /dev/sda1 /mnt/sdb1/ubuntu.partimg.gz

Now you have your new image that we are going to use to make a install DVD.

 

Making to ISO:

By now you should have already made your image and are ready to create the ISO file. Copy the

image that you made in the first part "ubuntu.partimg.gz.000" (partimage puts the "000" on it) to the

folder that you downloaded from me "oem_build/dvd_build/restore/ubuntu.partimg.gz.000". It should have

a folder dvd_build and a file named mkiso.sh If mkiso.sh is not executable make it so. 

sudo chmod +x mkiso.sh

change to the folder where the file "mkiso.sh" is.    cd /path/to/oem_build

Then run is command:

sudo ./mkiso.sh  /path/to/dvd_build   /path/to/output   name_of_your_file.iso

Example:    sudo ./mkiso.sh /dvd_build  /home/tim/Desktop 1004_64.iso

Where ever you put the iso file you will need to change the owner and permissions.

sudo chown tim:tim /home/tim/desktop/1004_64.iso

sudo chmod 777 /home/tim/Desktop/1004_64.iso

All that is needed now is to burn this iso to a DVD. Then use this DVD to

load all of your friends and family members computers with it. Remember to

save their stuff (pics and files) before using it because it will wipe out everything!

 

Updating the base image:

Everytime Ubuntu gets updates your base image will need to be updated. This can be

done with a little effort. Boot your test box with your Rip Linux usb stick and the drive with

the base image "notset.ubuntu.partimg.gz.000", it can even be on the stick with RIP Linux

if you have the space. Mount the drive with your image. Next run Gparted and make a 5.0 GB

partition on sda,then from a terminal run partimage.

partimage restore /dev/sda1 /mnt/sdb1/noset.ubuntu.partimg.gz.000

NOTICE: the "/dev/sda1" above is  where you want to put the image!

After the image is transferred shutdown and reboot the test box with the Ubuntu Alt. disk.

Choose the language and select "Rescue a broken system". Click through till you get to

where you select the root file system and select it. (/dev/sda1) Then select "Reinstall GRUB

boot loader" Reboot to the hard drive, redo the steps above to save a base image and a load

image.

Notes:

Do this at your own risk! I have tested this on most types of Thinkpads and some custom made

desktops without a glich but as with every thing you may not get the same results!

To customize your build you can change the install message on the DVD by editing the

oem_build/dvd_build/boot/isolinux/isolinux.cfg file, Change after "LABEL"

To change the label of the DVD edit the mkiso.sh file and make changes to:

-V "tjkling@gmail.com 10.04-64" -A "tjkling@gmail.com 10.04-64" $source_dir || exit

I leave my email address on them to give a little tech support to friends and family.