June 02, 2012

Live CD Ubuntu Customization Kit (UCK) without Internet

Hi friends,

As many of you know that, UCK (Ubuntu Customization Kit) requires Internet when customizing the Live CD.

Why we need Internet while customization?

  • To get the updates from the repositories we need the internet.
  • To install any software using apt-get/synaptic package manager.
Do we need Internet all the time?

According to me, We may not need the Internet for small updates.
So, I have modified the customization scripts to work without Internet.


Pre-requisites:

Please download the following files.

sources.gz: 
According the ubuntu distro, we need to get the sources.gz from the link
http://archive.ubuntu.com/ubuntu/ubuntu/ubuntu/dists/$DISTRO_CODENAME/main/source/Sources.gz

gfxboot-theme-ubuntu_x.x.x:
http://archive.ubuntu.com/ubuntu/ubuntu/ubuntu/pool/main/g/gfxboot-theme-ubuntu/

Please place these two files in ~/Softwares/UCK/ directory

Note: ~ is home directory of the user.

Apply Patches

If you installed UCK, you will having the /usr/lib/uck/customization-profiles/localized_cd/ directory
In that directory, you will be having customize and customize_iso scripts.

Those two scripts will be copies to /home//tmp folder while running the UCK.

So, please apply the following patches in /usr/lib/uck/customization-profiles/localized_cd/ 

Now apply the patch as shown below

$ patch -u customize customize.patch
$ patch -u customize_iso customize_iso.patch

customize.patch


--- customize 2012-06-01 21:47:31.905741928 +0530
+++ customize_old 2012-06-01 21:46:03.509742149 +0530
@@ -121,8 +121,7 @@
arch=`if [ -d /lib64 ]; then echo x86_64; else echo i586; fi`
echo ">> Customizing: $rel, $kernel $arch"

-# Commented by PSR
-#prepare_install || failure "Preparing installation failed, error=$?"
+prepare_install || failure "Preparing installation failed, error=$?"

# List of packages to install to support the selected languages:
PACKAGES_TO_INSTALL=""
@@ -153,16 +152,16 @@
fi
done

-# Commented by PSR
- #install_packages $PACKAGES_TO_INSTALL || failure "Installing language packs failed, error=$?"
+ install_packages $PACKAGES_TO_INSTALL ||
+ failure "Installing language packs failed, error=$?"

# NOTE: we first install selected language packs, then remove others as
# installing a language pack might pull in packages that were not
# previously present
echo "Removing unnecessary language packages..."
REMOVED_PACKAGES=`dpkg-query --show | cut -f1 | grep -E '^(language-pack|language-support|firefox-locale)' | grep -Ev "[-]($LANGPACKS_CONCATENATED)\>"`
-# Commented by PSR
-# remove_packages $REMOVED_PACKAGES || failure "Removing packages failed, error=$?"
+ remove_packages $REMOVED_PACKAGES ||
+ failure "Removing packages failed, error=$?"
fi

if [ "$RUN_MANUAL_CUSTOMIZATIONS" = "yes" ] ; then

customize_iso.patch


--- customize_iso 2012-06-01 21:47:38.369741917 +0530
+++customize_iso_old 2012-06-01 21:46:00.441742156 +0530
@@ -50,9 +50,6 @@
REMASTER_DIR="$REMASTER_HOME/remaster-root"
BOOT_LANG=`cat "$SCRIPT_DIR/livecd_locale"`

-# Added by PSR
-SOURCES_DIR="/home/user/Softwares/UCK"
-
function failure()
{
echo "$@"
@@ -83,21 +80,12 @@
DISTRO_CODENAME=`cd "$ISO_REMASTER_DIR"/dists && find . -maxdepth 1 -type d | grep '/' | cut -d '/' -f2` || failure "Unable to identify Ubuntu distro codename"
APT_SOURCES_TMP_DIR=`mktemp -d`
-# Commented by PSR
-# wget -c http://archive.ubuntu.com/ubuntu/ubuntu/ubuntu/dists/$DISTRO_CODENAME/main/source/Sources.gz -O "$APT_SOURCES_TMP_DIR"/Sources.gz
-
-# Added by PSR
- cp "$SOURCES_DIR"/"$DISTRO_CODENAME"_Sources.gz "$APT_SOURCES_TMP_DIR"/Sources.gz
-
-# Commented by PSR
-# GFXBOOT_THEME_UBUNTU_SOURCE_PACKAGE=http://archive.ubuntu.com/ubuntu/ubuntu/ubuntu/pool/main/g/gfxboot-theme-ubuntu/$(zgrep gz "$APT_SOURCES_TMP_DIR"/Sources.gz | grep gfxboot-theme-ubuntu | sed -n 1p | awk '{ print $3 }')
+ wget -c http://archive.ubuntu.com/ubuntu/ubuntu/ubuntu/dists/$DISTRO_CODENAME/main/source/Sources.gz -O "$APT_SOURCES_TMP_DIR"/Sources.gz
+ GFXBOOT_THEME_UBUNTU_SOURCE_PACKAGE=http://archive.ubuntu.com/ubuntu/ubuntu/ubuntu/pool/main/g/gfxboot-theme-ubuntu/$(zgrep gz "$APT_SOURCES_TMP_DIR"/Sources.gz | grep gfxboot-theme-ubuntu | sed -n 1p | awk '{ print $3 }')

-# Commented by PSR
-# wget $GFXBOOT_THEME_UBUNTU_SOURCE_PACKAGE || -# failure "Unable to download gfxboot-theme-ubuntu source package from $GFXBOOT_THEME_UBUNTU_SOURCE_PACKAGE"
+ wget $GFXBOOT_THEME_UBUNTU_SOURCE_PACKAGE || + failure "Unable to download gfxboot-theme-ubuntu source package from $GFXBOOT_THEME_UBUNTU_SOURCE_PACKAGE"

-# Added by PSR
- cp "$SOURCES_DIR"/gfxboot-theme-ubuntu_0.14.2.tar.gz .
tar xfz *.tar.gz || failure "Unable to extract gfxboot-theme-ubuntu source package"
fi

Please apply the patch files and run the UCK without Internet.

Enjoy a quick Ubuntu Customization.

Please send you comments and feedback
Post a Comment

Featured Post

Java Introdcution

Please send your review and feedback to psrdotcom@gmail.com