Difference between revisions of "Livedvd-makingoff"
(→References) |
|||
(12 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Title|VNUML Live DVD 2.0 making-off}} | {{Title|VNUML Live DVD 2.0 making-off}} | ||
− | + | == Procedure == | |
− | Download | + | VNUML Live DVD 2.0 was created using [http://uck.sourceforge.net ''Ubuntu Customization Kit (UCK)''] v1.3, a tool that helps you customizing official Ubuntu Live CDs. |
+ | |||
+ | <ol> | ||
+ | <li>Download UCK v1.3 from [http://sourceforge.net/project/showfiles.php?group_id=169959 here] and install it:</li> | ||
dpkg -i uck_1.3_all.deb | dpkg -i uck_1.3_all.deb | ||
− | Create a directory to hold all the vnumllive stuff: | + | <li>Create a directory to hold all the vnumllive stuff and download Ubuntu 6.06 iso file:</li> |
mkdir vnumllive | mkdir vnumllive | ||
Line 15: | Line 18: | ||
cd live | cd live | ||
− | Create a directory named vnuml and copy the kernel and rootfilesystem: | + | <li>Create a directory named vnuml and copy the kernel and rootfilesystem:</li> |
+ | |||
mkdir vnuml | mkdir vnuml | ||
cd vnuml | cd vnuml | ||
Line 21: | Line 25: | ||
wget ...linux-... | wget ...linux-... | ||
− | Copy also the directories with the examples and other information needed to be copied to the live dvd: | + | <li>Copy also the directories with the examples and other information needed to be copied to the live dvd: |
<pre> | <pre> | ||
Line 29: | Line 33: | ||
examples/ root_fs_tutorial-0.4.1 | examples/ root_fs_tutorial-0.4.1 | ||
examples2/ ssh_host_rsa_key.pub | examples2/ ssh_host_rsa_key.pub | ||
− | init-vnuml | + | init-vnuml |
</pre> | </pre> | ||
+ | <li>Get a local copy of vnuml web server following the procedure described [[Wiki2html|here]] and copy it to vnumllive/live/vnuml/doc/vnuml directory. | ||
− | Create a file '''vnumllive/live/customize''' with the following content: | + | <li>Create a file '''vnumllive/live/customize''' with the content shown below.</li> |
+ | |||
+ | <li>Create a file '''vnumllive/live/customize_iso''' with the content shown below.</li> | ||
+ | |||
+ | <li> Give both scripts execution permissions:</li> | ||
+ | |||
+ | chmod +x customize customize_iso | ||
+ | |||
+ | <li>Create a file '''vnumllive/live/iso_description''' with the following content:</li> | ||
+ | |||
+ | VNUML Live DVD v2 | ||
+ | |||
+ | <li>Create a file '''vnumllive/live/vnuml/init-vnuml''' with the content listed below and give it execution permissions:</li> | ||
+ | |||
+ | chmod +x init-vnuml | ||
+ | |||
+ | <li>Execute the following command:</li> | ||
+ | |||
+ | remaster-live-cd ubuntu-6.06.1-desktop-i386.iso live | ||
+ | |||
+ | <li>If everything goes well, the dvd iso file and its md5 are stored in /root/tmp/remaster-new-files. Just rename and copy them:</li> | ||
+ | |||
+ | mv /root/tmp/remaster-new-files/livecd.iso vnuml-live-2.0.iso | ||
+ | mv /root/tmp/remaster-new-files/livecd.iso.md5 vnuml-live-2.0.iso.md5 | ||
+ | |||
+ | </ol> | ||
+ | |||
+ | |||
+ | == customize script == | ||
<pre> | <pre> | ||
Line 40: | Line 73: | ||
# VARIABLES | # VARIABLES | ||
ROOTFS='root_fs_tutorial-0.4.1' | ROOTFS='root_fs_tutorial-0.4.1' | ||
− | KERNEL='linux-2.6. | + | KERNEL='linux-2.6.18.1-bb2-xt-1m' |
function prepare_install() | function prepare_install() | ||
Line 59: | Line 92: | ||
# update apt sources.list | # update apt sources.list | ||
− | echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources. | + | echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list |
− | list | + | echo "deb http://archive.ubuntu.com/ubuntu dapper universe" >> /etc/apt/sources.list |
− | echo "deb http://archive.ubuntu.com/ubuntu dapper universe" >> /etc/apt/sources. | + | echo "deb-src http://archive.ubuntu.com/ubuntu dapper universe" >> /etc/apt/sources.list |
− | list | ||
− | echo "deb-src http://archive.ubuntu.com/ubuntu dapper universe" >> /etc/apt/ | ||
− | |||
prepare_install | prepare_install | ||
Line 73: | Line 103: | ||
# Create user ubuntu | # Create user ubuntu | ||
− | /usr/sbin/useradd --home /home/ubuntu -m -g adm -G dialout,cdrom,floppy,audio, | + | /usr/sbin/useradd --home /home/ubuntu -m -g adm -G dialout,cdrom,floppy,audio,dip,video,plugdev,lpadmin,scanner,admin,ubuntu -p `perl -le "print crypt ('ubuntu','(A..z)[rand 25].(A..z)[rand ');"` -s /bin/bash ubuntu |
− | |||
− | ,'(A..z)[rand 25].(A..z)[rand ');"` -s /bin/bash ubuntu | ||
# Add privileges to admin group | # Add privileges to admin group | ||
Line 82: | Line 110: | ||
# Install vnuml | # Install vnuml | ||
− | install_packages vnuml | + | install_packages vnuml bridge-utils libpcap0.8 |
# Change VNUML timeout to 120 secs | # Change VNUML timeout to 120 secs | ||
cp /usr/bin/vnumlparser.pl /tmp | cp /usr/bin/vnumlparser.pl /tmp | ||
− | cat /tmp/vnumlparser.pl | sed -e 's/my $boot_timeout = 30;/my $boot_timeout = | + | cat /tmp/vnumlparser.pl | sed -e 's/my $boot_timeout = 30;/my $boot_timeout = 120;/' | sed -e 's/getpwnam("vnuml")/getpwnam("ubuntu")/' | sed -e '/Ferm/d' > /usr/bin/vnumlparser.pl |
− | |||
− | |||
rm -f /tmp/vnumlparser.pl | rm -f /tmp/vnumlparser.pl | ||
Line 94: | Line 120: | ||
cp /tmp/customize-dir/vnuml/$ROOTFS /usr/share/vnuml/filesystems | cp /tmp/customize-dir/vnuml/$ROOTFS /usr/share/vnuml/filesystems | ||
cp /tmp/customize-dir/vnuml/$KERNEL /usr/share/vnuml/kernels | cp /tmp/customize-dir/vnuml/$KERNEL /usr/share/vnuml/kernels | ||
− | ln -s /usr/share/vnuml/filesystems/$ROOTFS /usr/share/vnuml/filesystems/ | + | ln -s /usr/share/vnuml/filesystems/$ROOTFS /usr/share/vnuml/filesystems/root_fs_tutorial |
− | |||
ln -s /usr/share/vnuml/kernels/$KERNEL /usr/share/vnuml/kernels/linux | ln -s /usr/share/vnuml/kernels/$KERNEL /usr/share/vnuml/kernels/linux | ||
Line 113: | Line 138: | ||
# Copy firefox bookmarks file | # Copy firefox bookmarks file | ||
cp /tmp/customize-dir/vnuml/bookmarks.html /etc/firefox/profile | cp /tmp/customize-dir/vnuml/bookmarks.html /etc/firefox/profile | ||
− | + | ||
− | # | + | </pre> |
− | + | ||
+ | == customize_iso script == | ||
+ | |||
+ | <pre> | ||
+ | #!/bin/bash | ||
+ | BUILD_DIR=`mktemp -d` | ||
+ | |||
+ | function failure() | ||
+ | { | ||
+ | echo "$@" | ||
+ | exit 1 | ||
+ | } | ||
+ | |||
+ | pushd "$BUILD_DIR" || failure "Cannot change directory to $BUILD_DIR, error=$?" | ||
+ | apt-get source gfxboot-theme-ubuntu || failure "Failed to fetch gfxboot-theme-ubuntu source, check if you have deb-src line enabled for repository main in /etc/apt/sources.list, error=$?" | ||
+ | |||
+ | cd gfxboot-theme-ubuntu*/ | ||
+ | |||
+ | make DEFAULT_LANG=en || failure "Failed to build gfxboot theme, error=$?" | ||
+ | |||
+ | cp -af boot/* "$ISO_REMASTER_DIR/isolinux/" || failure "Error while copying boot files ( " boot/* " ) to $ISO_REMASTER_DIR/isolinux/, error=$?" | ||
+ | |||
+ | popd | ||
+ | |||
+ | if [ "$BUILD_DIR" = "/" ] ; then | ||
+ | failure "Trying to remove root dir" | ||
+ | else | ||
+ | rm -rf "$BUILD_DIR" | ||
+ | fi | ||
</pre> | </pre> | ||
− | + | == init-vnuml script == | |
− | + | <pre> | |
− | + | #!/bin/sh | |
− | + | # Create ssh keys for root and ubuntu users | |
+ | if [ ! -f /root/.ssh/identity.pub ] | ||
+ | then | ||
+ | echo "ssh keys for user root does not exists" | ||
+ | mkdir -p /root/.ssh | ||
+ | chown root.root /root/.ssh | ||
+ | sudo ssh-keygen -t rsa1 -f /root/.ssh/identity -N "" | ||
+ | else | ||
+ | echo "ssh keys for user root exists" | ||
+ | fi | ||
− | + | if [ ! -f /home/ubuntu/.ssh/identity.pub ] | |
+ | then | ||
+ | echo "ssh keys for user ubuntu does not exists" | ||
+ | mkdir -p /home/ubuntu/.ssh | ||
+ | chown ubuntu.adm /home/ubuntu/.ssh | ||
+ | sudo ssh-keygen -t rsa1 -f /home/ubuntu/.ssh/identity -N "" | ||
+ | else | ||
+ | echo "ssh keys for user ubuntu exists" | ||
+ | fi | ||
− | + | # Copy vnuml examples to /home/ubuntu/vnuml/examples, | |
+ | # to allow the user to modify them (/usr/share/vnuml directory | ||
+ | # is read only) | ||
+ | mkdir -p /home/ubuntu/vnuml | ||
+ | cp -r /usr/share/vnuml/examples /home/ubuntu/vnuml | ||
+ | cp -r /usr/share/vnuml/doc /home/ubuntu/vnuml | ||
+ | chown -R ubuntu.adm /home/ubuntu/* | ||
− | + | # To autostart firefox with home page | |
+ | mkdir -p /home/ubuntu/.config/autostart/ | ||
+ | cp /usr/share/vnuml/doc/firefox.desktop /home/ubuntu/.config/autostart | ||
+ | cp /usr/share/vnuml/doc/xhost.desktop /home/ubuntu/.config/autostart | ||
+ | chown -R ubuntu.adm /home/ubuntu/.* | ||
− | + | # Create /var/run/vnuml directory | |
− | + | mkdir -p /var/run/vnuml | |
+ | chown vnuml.vnuml /var/run/vnuml | ||
+ | chmod 755 /var/run/vnuml | ||
+ | # Copy known_hosts file | ||
+ | cp /usr/share/vnuml/aux/known_hosts /home/ubuntu/.ssh | ||
+ | chown ubuntu.adm /home/ubuntu/.ssh/known_hosts | ||
+ | cp /usr/share/vnuml/aux/known_hosts /root/.ssh | ||
+ | chown root.root /root/.ssh/known_hosts | ||
+ | rm -rf /usr/share/vnuml/aux | ||
− | |||
+ | </pre> | ||
== References == | == References == | ||
− | * [https://help.ubuntu.com/community/LiveCDCustomization/6 | + | * [https://help.ubuntu.com/community/LiveCDCustomization/6%2e06 LiveCDCustomization/6.06] |
+ | * [http://uck.sourceforge.net Ubuntu Customization Kit (UCK)] | ||
<!-- | <!-- |
Latest revision as of 01:27, 4 April 2007
VNUML Live DVD 2.0 making-off
Procedure
VNUML Live DVD 2.0 was created using Ubuntu Customization Kit (UCK) v1.3, a tool that helps you customizing official Ubuntu Live CDs.
- Download UCK v1.3 from here and install it:
- Create a directory to hold all the vnumllive stuff and download Ubuntu 6.06 iso file:
- Create a directory named vnuml and copy the kernel and rootfilesystem:
- Copy also the directories with the examples and other information needed to be copied to the live dvd:
# ls vnuml bookmarks.html known_hosts doc/ linux-2.6.16.27-bs2-xt-1m examples/ root_fs_tutorial-0.4.1 examples2/ ssh_host_rsa_key.pub init-vnuml
- Get a local copy of vnuml web server following the procedure described here and copy it to vnumllive/live/vnuml/doc/vnuml directory.
- Create a file vnumllive/live/customize with the content shown below.
- Create a file vnumllive/live/customize_iso with the content shown below.
- Give both scripts execution permissions:
- Create a file vnumllive/live/iso_description with the following content:
- Create a file vnumllive/live/vnuml/init-vnuml with the content listed below and give it execution permissions:
- Execute the following command:
- If everything goes well, the dvd iso file and its md5 are stored in /root/tmp/remaster-new-files. Just rename and copy them:
dpkg -i uck_1.3_all.deb
mkdir vnumllive cd vnumllive wget ... ubuntu-6.06.1-desktop-i386.iso mkdir live cd live
mkdir vnuml cd vnuml wget ...root_fs_tutorial... wget ...linux-...
chmod +x customize customize_iso
VNUML Live DVD v2
chmod +x init-vnuml
remaster-live-cd ubuntu-6.06.1-desktop-i386.iso live
mv /root/tmp/remaster-new-files/livecd.iso vnuml-live-2.0.iso mv /root/tmp/remaster-new-files/livecd.iso.md5 vnuml-live-2.0.iso.md5
customize script
#!/bin/bash # VARIABLES ROOTFS='root_fs_tutorial-0.4.1' KERNEL='linux-2.6.18.1-bb2-xt-1m' function prepare_install() { apt-get update apt-get -y upgrade } function install_packages() { apt-get install --assume-yes --force-yes "$@" } function remove_packages() { apt-get --purge remove --assume-yes --force-yes "$@" } # update apt sources.list echo "deb http://jungla.dit.upm.es/~vnuml/debian binary/" >> /etc/apt/sources.list echo "deb http://archive.ubuntu.com/ubuntu dapper universe" >> /etc/apt/sources.list echo "deb-src http://archive.ubuntu.com/ubuntu dapper universe" >> /etc/apt/sources.list prepare_install # Create groups /usr/sbin/addgroup admin /usr/sbin/addgroup ubuntu # Create user ubuntu /usr/sbin/useradd --home /home/ubuntu -m -g adm -G dialout,cdrom,floppy,audio,dip,video,plugdev,lpadmin,scanner,admin,ubuntu -p `perl -le "print crypt ('ubuntu','(A..z)[rand 25].(A..z)[rand ');"` -s /bin/bash ubuntu # Add privileges to admin group echo "# Members of the admin group may gain root privileges" >> /etc/sudoers echo "%admin ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers # Install vnuml install_packages vnuml bridge-utils libpcap0.8 # Change VNUML timeout to 120 secs cp /usr/bin/vnumlparser.pl /tmp cat /tmp/vnumlparser.pl | sed -e 's/my $boot_timeout = 30;/my $boot_timeout = 120;/' | sed -e 's/getpwnam("vnuml")/getpwnam("ubuntu")/' | sed -e '/Ferm/d' > /usr/bin/vnumlparser.pl rm -f /tmp/vnumlparser.pl # Copy root_fs and kernel cp /tmp/customize-dir/vnuml/$ROOTFS /usr/share/vnuml/filesystems cp /tmp/customize-dir/vnuml/$KERNEL /usr/share/vnuml/kernels ln -s /usr/share/vnuml/filesystems/$ROOTFS /usr/share/vnuml/filesystems/root_fs_tutorial ln -s /usr/share/vnuml/kernels/$KERNEL /usr/share/vnuml/kernels/linux # Add vnuml-init script to startup cp /tmp/customize-dir/vnuml/init-vnuml /etc/init.d update-rc.d init-vnuml defaults 12 # 12 is to start it before gdm... # Copy aditional examples and docs cp -r /tmp/customize-dir/vnuml/examples/* /usr/share/vnuml/examples cp -r /tmp/customize-dir/vnuml/doc /usr/share/vnuml # Copy ssh_host_rsa_key.pub temporarily to /tmp file mkdir -p /usr/share/vnuml/aux cp /tmp/customize-dir/vnuml/ssh_host_rsa_key.pub /usr/share/vnuml/aux cp /tmp/customize-dir/vnuml/known_hosts /usr/share/vnuml/aux # Copy firefox bookmarks file cp /tmp/customize-dir/vnuml/bookmarks.html /etc/firefox/profile
customize_iso script
#!/bin/bash BUILD_DIR=`mktemp -d` function failure() { echo "$@" exit 1 } pushd "$BUILD_DIR" || failure "Cannot change directory to $BUILD_DIR, error=$?" apt-get source gfxboot-theme-ubuntu || failure "Failed to fetch gfxboot-theme-ubuntu source, check if you have deb-src line enabled for repository main in /etc/apt/sources.list, error=$?" cd gfxboot-theme-ubuntu*/ make DEFAULT_LANG=en || failure "Failed to build gfxboot theme, error=$?" cp -af boot/* "$ISO_REMASTER_DIR/isolinux/" || failure "Error while copying boot files ( " boot/* " ) to $ISO_REMASTER_DIR/isolinux/, error=$?" popd if [ "$BUILD_DIR" = "/" ] ; then failure "Trying to remove root dir" else rm -rf "$BUILD_DIR" fi
init-vnuml script
#!/bin/sh # Create ssh keys for root and ubuntu users if [ ! -f /root/.ssh/identity.pub ] then echo "ssh keys for user root does not exists" mkdir -p /root/.ssh chown root.root /root/.ssh sudo ssh-keygen -t rsa1 -f /root/.ssh/identity -N "" else echo "ssh keys for user root exists" fi if [ ! -f /home/ubuntu/.ssh/identity.pub ] then echo "ssh keys for user ubuntu does not exists" mkdir -p /home/ubuntu/.ssh chown ubuntu.adm /home/ubuntu/.ssh sudo ssh-keygen -t rsa1 -f /home/ubuntu/.ssh/identity -N "" else echo "ssh keys for user ubuntu exists" fi # Copy vnuml examples to /home/ubuntu/vnuml/examples, # to allow the user to modify them (/usr/share/vnuml directory # is read only) mkdir -p /home/ubuntu/vnuml cp -r /usr/share/vnuml/examples /home/ubuntu/vnuml cp -r /usr/share/vnuml/doc /home/ubuntu/vnuml chown -R ubuntu.adm /home/ubuntu/* # To autostart firefox with home page mkdir -p /home/ubuntu/.config/autostart/ cp /usr/share/vnuml/doc/firefox.desktop /home/ubuntu/.config/autostart cp /usr/share/vnuml/doc/xhost.desktop /home/ubuntu/.config/autostart chown -R ubuntu.adm /home/ubuntu/.* # Create /var/run/vnuml directory mkdir -p /var/run/vnuml chown vnuml.vnuml /var/run/vnuml chmod 755 /var/run/vnuml # Copy known_hosts file cp /usr/share/vnuml/aux/known_hosts /home/ubuntu/.ssh chown ubuntu.adm /home/ubuntu/.ssh/known_hosts cp /usr/share/vnuml/aux/known_hosts /root/.ssh chown root.root /root/.ssh/known_hosts rm -rf /usr/share/vnuml/aux
References