A Project Report on
Developing necLinux
Submitted By:-
Deepak Kumar Karn
Balaram Sharma
Bijay Kumar Thakur
Submitted to:-
...
I
Abstract
This report describes the distribution/customization of Linux and development of
localized Live-CDs of necLinux...
II
Acknowledgement
First of all, we would like to thank Pokhara University and Nepal Engineering
College for including thi...
III
Table of Contents
Titles Page No
Abstract ……………………………………………………………………… I
Acknowledgement …………………………………………………………… II
Tab...
IV
3.1 Live CD Architecture…………………………………… 33
3.2 Use case diagram………………………………………… 37
3.3 Data Flow diagram………………………………………....
V
List of figure
Figure No. Title Page No.
3.1 Live CD Architecture……………………………………… 33
3.2 Use Case Diagram ………………………………………...
VI
Abbreviations
GNU: General Public Licensed
APT: Advanced Packaging Tool
DPKG: Debian Package Management
PAN: Pan Asia N...
1
Chapter 1
Introduction
1.1 Background
Linux is an open source operating system. The Linux-based operating systems are
ca...
2
Live CD is a complete bootable computer operating system that runs on computers
memory rather than loading it from the H...
3
very important for understanding about kernel of operating system for engineering
students and it is very easy throughou...
4
of operating system and for further operation of operating system. Linux is said to be
one of the secure operating syste...
5
At the more constrained spectrum of consumer devices, mobile devices and tablets
are demonstrating significant growth. T...
6
1.7 Applications
This distribution is build in favor of both the single user and for college use. This is
very useful fo...
7
 providing a secure server platform where crucial files cannot be permanently
altered
 providing a secure, reliable pl...
8
Chapter 2
Literature Review
Linux is a Unix-like computer operating system assembled under the model of free
and open so...
9
Some of the most popular Linux distributions are :
1) RedHat
Red Hat is the leader in development, deployment, and manag...
10
stability: "unstable" (also known as "sid"), "testing" and "stable". This progressive
integration and stabilization of ...
11
of proprietary device drivers for ATI and NVIDIA graphics cards and wireless
networking, and on-demand support for non-...
12
Live CD Linux distributions
Live CD based Linux distribution has the operating system kernel, scripts and
software stor...
13
The second thing is to working with Debian system. It consists of a lot of basic tools
of the operating system from the...
14
program depends upon to run correctly. This automatic satisfying of dependencies
can save we a lot of time when install...
15
Chapter 3
Methodology
We followed different methodology to create our custom distribution. The Standard
procedures for ...
16
to deal with the complexity of the manual installation of localized applications and
tools.
We carried out the followin...
17
3) Morphing tools:
A number of command line tools and scripts are provided in order to create the
modules for the Live ...
18
cd project/
mkdir myiso/
Then mount the basemod in folder myiso/ as:
sudo mount –o loop “path to basemod” “path to fold...
19
mkdir mainmodule
1) Creating the Core Debian Image
The package debootstrap is used to create a Debian base system from ...
20
chroot mainmodule/
3) Make entry for the apt sources.
The Debian sid repositories are added to sources.list of mainmodu...
21
apt-get install xserver-xorg and press option y while it is installing. After installing
xserver-xorg we need to make s...
22
6) Fonts
In order to display the translated string at the Gnome Desktop you need to have
OpenType fonts installed opera...
23
chroot mainmodule/
passwd root
Type the password
umount mainmodule/
9) Using own Gnome splash screen
While the Gnome De...
24
mybackground.png.Then the following steps listed below should be followed:
chroot /mainmodule
cd /etc/alternatives
rm d...
25
1) Extract the base module
mkdir basemodule
extract_compressed_fs livecd/base/morphix > /tmp/morphix.iso
mount -o loop ...
26
cd message/
ls . | cpio -o > /mylivecd/boot/grub/message
While modification, the specification of background.pcx image ...
27
bootsplash-1024x768.jpg 21KB
1024x768 silent-1024x768.jpg 22KB
1024x768 silent2-1024x768.jpg 35KB
1024x768 silent3-1024...
28
Edit the file basemodule/etc/init.d/morphix-start and
basemodule/etc/init.d/knoppixautoconfig of the base module. In th...
29
with the following lines
chroot /mnt/main useradd -m $USERNAME -s /bin/bash -p
`/usr/bin/mkpasswd $USERNAME`
chroot /mn...
30
9) Generating the Base Module after Customization
After modification and making the necessary changes we need to create...
31
If we place files in this directory, they will be executed at boot time. Note that this
does not mean that programs usi...
32
-J Generate Joliet directory records in addition to regular iso9660 file names. This is
primarily useful when the discs...
33
directory will be hidden. In order to match a directory name, make sure the pathname
does not include a trailing '/' ch...
34
Fig 3 Live CD structure.
The Kernel
We use basically the same kernel configuration as Knoppix (look at
/usr/src/linux/....
35
Before the system proper starts up, there are two important things we must do. First,
we need to mount the cloop image,...
36
the least-buggy code on the planet. It's been suggested that some manufacturers
happily ignore the actual specification...
37
3.3 Use case diagram
Fig.1 use case diagram
38
3.4 Data Flow diagram
Fig.2 data flow diagram
39
Chapter 4
Implementation and Discussion
4.1 Black Box Testing
We use the term “black box testing” to mean test methods ...
40
for e.g to test whether the package gnome-desktop-environment is installed in Live
CD or not we use
dpkg -l|grep gnome-...
41
4.2 White Box Testing
Black box testing is different from white box testing, which is testing based on
knowledge of the...
42
Chapter 5
Future plan
This project is still on the growing phase and we finished our minimal works
scheduled for minor ...
43
Bibliography
1) http://www.ibm.com/developerworks/library/l-linuxuniversal/l-linuxuniversal-
pdf.pdf
2) http://en.wikip...
44
Appendix 1
Base module preparatory work
Download a morphix base module to use as template.
The base module is formed by...
45
extract_compressed_fs ~/livecd/basedir/base/morphix > ~/livecd/morphix.iso
mkdir morphixmnt
sudo mount -o loop ~/livecd...
46
1. Download theLinux kerneland compile it.
tar xvzf linux-2.6.17/tar.gz ~/livecd/linux-2.6.17
cd linux-2.6.17
make mrpr...
47
tar xvzf cloop-2.06-2.tar.gz
cd cloop-2.06
make KERNEL_DIR=~/livecd/linux-2.6.17
sudo cp cloop.ko ~/livecd/morphixdir/l...
48
print 'Copied ' + src + ' to ' + dst
return status,output
for dir in moddir:
path = HOME + '/livecd/minirootdir/modules...
49
cp( HOME+'/livecd/linux-2.6.17/drivers/usb/storage/libusual.ko' , path )
# Finally copy the ide-cd and cloop drivers
pa...
50
sudo cp unionfs.ko ~/livecd/morphixdir/lib/modules/2.6.17/kernel/fs/
5. And if we plan to boot from a USB drive, we nee...
51
Putting it all back together
sudo umount ~/livecd/minirootdir
gzip ~/livecd/miniroot
sudo cp ~/livecd/miniroot.gz ~/liv...
52
rm morphix.iso
rm newmorphix.iso
sudo rm miniroot.gz
Upcoming SlideShare
Loading in …5
×

necLinuxProjectReport

717 views

Published on

how to customize GNU/Linux?
This is the report of necLinux, which was a distribution of linux on the basis of Morphix.

Published in: Engineering, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
717
On SlideShare
0
From Embeds
0
Number of Embeds
91
Actions
Shares
0
Downloads
16
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

necLinuxProjectReport

  1. 1. A Project Report on Developing necLinux Submitted By:- Deepak Kumar Karn Balaram Sharma Bijay Kumar Thakur Submitted to:- Nepal Engineering College Changunarayan Bhaktapur ©2013 http://deepakkarn.wordpress.com/
  2. 2. I Abstract This report describes the distribution/customization of Linux and development of localized Live-CDs of necLinux, based on popular Debian GNU/Linux and Morphix Live CD. The 21 century is the age of science and technology and With the advancement of new technology, computer end users have today become more and more demanding and sophisticated and they are raising their freedom and rights on computer system too . The philosophy FOSS is “modify the system according to your need and share your ideas to others”. Actually the development of necLinux is continuity of several distribution/customizations of Linux. The development of a bootable Live-CD , thus avails the end-users with various options, for example, installing the operating system only if it is impressive and effective enough in the eyes of the end-users or running the operating system from the Live-CD itself, thus not necessarily installing on the hard disk. There exist certain steps and procedures for creating a bootable Live-CD for several Linux Distributions. This report basically deal with the procedures that are undertaken for creating one such Live-CD. For the development of this project, we go through different type of popular Linux distributions namely : Knoppix, Morphix, Gnoppix,Debian, Ubuntu etc and collected ideas that we can take any base system for customization because they are functionally distinct(in this project we have taken Morphix as a base system). Then we created core Debian image and add software packages like Gnome desktop environment and other educational and multimedia softwares. necLinux have own login screen, boot splash screen, themes, icons, panel etc.
  3. 3. II Acknowledgement First of all, we would like to thank Pokhara University and Nepal Engineering College for including this course Minor Project. We would like to express our deep gratitude to Mr. Daya Ram Budhathoki, Assistant Professor of Nepal Engineering College for his proper guidance; support and encouragement for this project and our special thank goes to him. His supervision and support, helped progression and smoothness of the project. Our grateful thank also goes to Mr. Dinesh Dangol, Nischal Regmi and Mrs. Netu Bharati for their proper guidance for project, and for preparing the proposal and report. We are very much inspired from Computer Department Teachers and we express our sincere gratitude to all of them who suggested us frequently for this project, share their ideas and also for giving feedbacks on our project. It is not possible for completion of this project without yours support and proper guidance. Besides, working on team made us more friendship and it developed the habit of doing work on team. And at last we dedicate to rest of all members of Department of Computer Science, and all of our friends for their proper support and feedbacks.
  4. 4. III Table of Contents Titles Page No Abstract ……………………………………………………………………… I Acknowledgement …………………………………………………………… II Table of Content ……………………………………………………………... III List of figure …………………………………………………………………. V Abbreviations ………………………………………………………………… VI Chapter 1: Introduction………………………………………………………. 1 1.1Background………………………………..…………………….... 1 1.2 Problem Statement……………………………………………….. 1 1.3 Objectives………………………………………………………… 2 1.4 Aim………………………………………………………………. 2 1.5 Motivation……………………………………………………….. 3 1.6 Scope…………………………………………………….………. 3 1.7 Applications……………………………………………................ 6 Chapter 2: Literature Review………………………………………………... 7 2.1 System Requirement …………………………………….. 14 Chapter 3: Methodology……………………………………………………… 15
  5. 5. IV 3.1 Live CD Architecture…………………………………… 33 3.2 Use case diagram………………………………………… 37 3.3 Data Flow diagram………………………………………. 38 Chapter 4: Implementation and discussion…………..……………………… 39 4.1 Black Box Testing……………………………………….. 39 4.2 White Box Testing……………………………………….. 41 Chapter 5: Future Plan……………………………………………………….. 42 Bibliography…….…………………………………………………………… 43 Appendix 1........................................................................................................ 44
  6. 6. V List of figure Figure No. Title Page No. 3.1 Live CD Architecture……………………………………… 33 3.2 Use Case Diagram ………………………………………… 37 3.3 Data Flow Diagram………………………………………… 38
  7. 7. VI Abbreviations GNU: General Public Licensed APT: Advanced Packaging Tool DPKG: Debian Package Management PAN: Pan Asia Networking CD: Compact Disk RPM: Red Hat Package Manager GPL: General Public License API: Application Programming Interface
  8. 8. 1 Chapter 1 Introduction 1.1 Background Linux is an open source operating system. The Linux-based operating systems are called Linux distributions i.e Linux distros . Linux is an open source operating system i.e. source code is freely available for modification or distribution by anyone. Because open source software is developed by large communities of programmers distributed throughout the globe, it benefits from rapid development cycles and speedy security releases (in the event that someone discovers bugs in the software). In other words, open source software is updated, enhanced, and made more secure every day as programmers all over the world continue to improve it. Aside from these technical advantages, the people can modify the system as per their wish and take advantage of using the system as their wish with no costs. necLinux, basically focuses on building the customized Linux distribution based on Morhpix and Debian. Selection of Morphix is due to the reason that it have modular approach so that it is easy-to-use and customize. A Debian Live CD is a Debian distribution (that contains as much software as possible) stored on a bootable CD- ROM that can be executed from it, without installation on a hard drive. Nothing is installed, and the system returns to its previous OS once we pop the Live CD out. necLinux is an educational distribution consisting of GNOME, Office Packages, Java, GCC compiler, and other educational packages. Packages are taken from the Debain core repositories. 1.2 Problem Statement
  9. 9. 2 Live CD is a complete bootable computer operating system that runs on computers memory rather than loading it from the Hard Drive. neclinux is a Linux Live CD based distribution based on Morphix Live CD architecture and debian packages. Two modules base-module and main-module have to be considered while building such distribution. With the help of debootstrap we install a Debian base system into a subdirectory of another, already installed system. Base-module is taken from morphix repository and is customized accordingly to include our own boot splashy, login prompt, default user and password etc. Main module is made on Debian base system with the package we needed. 1.3 Objectives The main objectives of our project are:  To make our own Linux distribution by taking Morphix as a base system, Debian packages and GNOME Desktop environment.  To make bootable Live-CD. 1.4 Aim The main aim behind customization of Linux is to make our own localized Linux distribution. Mainly customization is done for specific purpose. Distributions are developed according to their usage . For example : desktops, servers, routers, multimedia, clusters etc. So, one may choose the distribution according to his/her need. The aims of this customization are to show off a particular application, localise to a certain language, remove software packages, add software packages of interest, update software packages, change system defaults (theme, icons, desktop background, panels, browser homepage, etc) etc. The another aim is to study about Linux and Open Source and various Linux distribution and their architectures. It is
  10. 10. 3 very important for understanding about kernel of operating system for engineering students and it is very easy throughout the Linux because it is free and open source. The main aim is to build own Linux distribution having many educational packages as far as possible which are beneficial for engineering students. It is also beneficial for other general users. 1.5 Motivation We are doing this project because we are motivated with Linux operating system. Linux operating system is an open source operating system and these days it is growing up rapidly. That’s why, we have selected this project to gain the knowledge of operating system and also for justification of question which was arose while using linux operating system. Also, the another reason to choose this project is, to modify the linux distribution, to develop our own distribution by taking the existing base system (i.e Live CD) , to understand Live CD architecture and its working and to work with Linux kernel. Since we belong to the computer science’s student, we must have some better idea about Linux kernel, Linux OS, and their distribution. 1.6 Scope Day by day, development and customization (distribution) of Linux is going onward for various purposes like: for PCs, mobiles, and for the different organizations. Ubuntu Linux is best example of Linux distribution, it is widely used in PCs, and Laptops now a days. Linux distribution is also designed for the different organization like: Oracle Company customized the Linux named as Oracle Linux for their organization. Since Linux operating system is an open source so it does not need any license key for the registration of the operating system. That’s why it is very useful for students and poor country’s people for their works. It also helps the student for different purposes like research in kernel of operating system, memory management
  11. 11. 4 of operating system and for further operation of operating system. Linux is said to be one of the secure operating system and widely used for networking. The current scenario of use of Linux includes following: 1.6.1 Desktop and Netbooks Desktops and netbooks, where many of people use Linux, is the area in which Linux struggles the most. Recent market share data indicates that Linux captures around 1.5% of the desktop market but around 32% of the Netbook market. 1.6.2 Server In the server market (consisting of web servers, mail servers, Domain Name System servers, and other back-end devices), Linux rules. Recent surveys found that more than 60% of all servers run a form of Linux. Outside of traditional web services, Linux powers many of the biggest Internet properties (Facebook, eBay, Twitter, and Amazon, to name a few), with the varying usage models and requirements. Beyond traditional options (such as web or mail), Linux offers the largest array of web services (and varying options for those services). 1.6.3 Cluster and distributed computing Linux is not only a staple in clusters and distributed computing models, it is a driving force and at the core of many new usage models. Two key models that are quickly growing today are cloud computing and big data. Cloud computing is about delivery of IT as a service and relies on a cluster of shared resources that scale to the need of a given application. Clouds also rely on virtualization to support the automated management of nodes within a massive infrastructure. Within cloud environments, 66% rely on Linux as their primary platform. 1.6.4 Mobile devices and tablets
  12. 12. 5 At the more constrained spectrum of consumer devices, mobile devices and tablets are demonstrating significant growth. These devices represent a Linux kernel coupled with a custom graphical user interface (GUI). A key example of this area is the Google Android operating system, which is used both in smart phones and in tablet computers. Today, more than 25% of smart phones run a form of Linux (primarily Android), with almost 40% of tablet computers running Android. 1.6.5 Embedded At the bottom of the spectrum are embedded devices, with varying degrees of constraints (processor performance, resources such as memory, and so on). Linux is ideal in most of these cases because of its ability to scale down and use any of the available embedded processors on the market. This flexibility makes Linux a highly used platform in televisions, in-car entertainment, navigation systems, and many other types of devices 1.6.6 Virtualization platform One of the most interesting areas in which Linux drives innovation is in the virtualization domain. Linux is the operating system home to every kind of virtualization solution available, whether platform or Para-virtualization, operating system virtualization, or more obscure ideas such as cooperative virtualization. Linux as an operating system is able to transform itself into a hypervisor (such as the Look at Linux, the operating system and universal platform. Kernel Virtual Machine [KVM]) as well as hosting a number of research hypervisors. To bring additional efficiency to virtualization, Linux implements Kernel Same Page Merging to efficiently de-duplicate memory pages. [1]
  13. 13. 6 1.7 Applications This distribution is build in favor of both the single user and for college use. This is very useful for students since it contains many educational packages required for students. The peoples, who are using Linux first time and have no internet facility to install and update software packages, will get advantages. The system will be easy for beginners. In this distribution, we are providing tips for safe installation guide which will be very helpful for beginners to install the system. Our distribution can be used in colleges also. Out of this it can be used in any purpose and sectors with our need. Apart from this the Linux Live CDs have following general uses.  installing a Linux distribution to a hard drive  testing new versions of software  listing & testing hardware  system repair and restoration  high security/non-invasive environment for a guest  cracking/stealing passwords  network security testing  window's virus removal  being the primary or backup operating system for any computer  quick and simple clustering of computers  playing video games or running applications that require a different operating system
  14. 14. 7  providing a secure server platform where crucial files cannot be permanently altered  providing a secure, reliable platform for the performance of high-vulnerability tasks such as Internet banking.
  15. 15. 8 Chapter 2 Literature Review Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. Linux is a name of core kernel, having all functionality of an operating system created by Linux Trovald in 1991. The GNU Project is free software, mass collaboration project, announced on 27 September 1983, by Richard Stallman at MIT. Its aim is to give computer users freedom and control in their use of their computers and computing devices, by collaboratively developing and providing software that is based on the following freedom rights: users are free to run the software, share it (copy, distribute), study it and modify it. GNU software guarantees these freedom-rights legally (via its license), and is therefore free software; the use of the word "free" always being taken to refer to freedom.[2] As Trovald build Linux kernel he decided to work for free and open, he did agreement with GNU Project to work together for free and open source software. After this a free and open source operating system called Linux Operating System is developed. Later, due to naming controversy Linux is also popularly known as GNU/Linux. The thousands of developers worldwide have contributed to its development and have also been supported by major corporations as: IBM, Novell , HP etc. The kernel, at the heart of all Linux systems, is developed and released under the GNU and its source code is freely available to everyone. It is one of the most prominent examples of free software and open source development. It is this kernel that forms the base around which a Linux operating system is developed and we call this the Linux Distribution. The distribution consists of several GNU applications and tools.
  16. 16. 9 Some of the most popular Linux distributions are : 1) RedHat Red Hat is the leader in development, deployment, and management of Linux and open source solutions for Internet infrastructure - ranging from embedded devices to secure Web servers. Red Hat was founded in 1994 by visionary entrepreneurs Bob Weng and Marc Ewing. Open source is the foundation of our business model. It represents a fundamental shift in how software is created. The code that makes up the software is available to anyone. Developers who use the software are free to improve the software. The result: rapid innovation. Red Hat solutions combine Red Hat Linux, developer and embedded technologies, training, management services, technical support. We deliver this open source innovation to our customers via an Internet platform called Red Hat Network. Red Hat is headquartered in Raleigh, North Carolina, USA.[3] 2) Debian/GNU Linux. Debian GNU/Linux was first announced in 1993. Its founder, Ian Murdock, envisaged the creation of a completely non-commercial project developed by hundreds of volunteer developers in their spare time. With sceptics far outnumbering optimists at the time, it was destined to disintegrate and collapse, but the reality was very different. Debian not only survived, it thrived and, in less than a decade, it became the largest Linux distribution and possibly the largest collaborative software project ever created. The success of Debian GNU/Linux can be illustrated by the following numbers. It is developed by over 1,000 volunteer developers, its software repositories contain more than 20,000 packages (compiled for 11 processor architectures), and it is responsible for inspiring over 120 Debian-based distributions and Live CDs. These figures are unmatched by any other Linux-based operating system. The actual development of Debian takes place in three main branches (or four if one includes the bleeding-edge "experimental" branch) of increasing levels of
  17. 17. 10 stability: "unstable" (also known as "sid"), "testing" and "stable". This progressive integration and stabilization of packages and features, together with the project's well- established quality control mechanisms, has earned Debian its reputation of being one of the best-tested and most bug-free distributions available today.[4] 3) Ubuntu The launch of Ubuntu was first announced in September 2004. Although a relative newcomer to the Linux distribution scene, the project took off like no other before, with its mailing lists soon filled in with discussions by eager users and enthusiastic developers. In the few years that followed, Ubuntu has grown to become the most popular desktop Linux distribution and has greatly contributed towards developing an easy-to-use and free desktop operating system that can compete well with any proprietary ones available on the market. What was the reason for Ubuntu's stunning success? Firstly, the project was created by Mark Shuttleworth, a charismatic South African multimillionaire, a former Debian developer and the world's second space tourist, whose company, the Isle of Man-based Canonical Ltd, is currently financing the project. Secondly, Ubuntu had learnt from the mistakes of other similar projects and avoided them from the start - it created an excellent web-based infrastructure with a Wiki-style documentation, creative bug-reporting facility, and professional approach to the end users. And thirdly, thanks to its wealthy founder, Ubuntu has been able to ship free CDs to all interested users, thus contributing to the rapid spread of the distribution.On the technical side of things, Ubuntu is based on Debian "Sid" (unstable branch), but with some prominent packages, such as GNOME, Firefox and LibreOffice, updated to their latest versions. It has a predictable, 6-month release schedule, with an occasional Long Term Support (LTS) release that is supported with security updates for 3 - 5 years, depending on the edition (non-LTS release are supported for 18 months). Other special features of Ubuntu include an installable Live CD, creative artwork and desktop themes, migration assistant for Windows users, support for the latest technologies, such as 3D desktop effects, easy installation
  18. 18. 11 of proprietary device drivers for ATI and NVIDIA graphics cards and wireless networking, and on-demand support for non-free or patent-encumbered media codecs.[5] Linux distribution is a Unix-like system comprising of software components such as the GNU/Linux kernel and assorted free, open source, and possibly proprietary software. There are currently hundreds of Linux distribution projects in active development, their respective distributions being revised and improved. A Linux Distribution can be derived from another Linux distribution by the necessary customizations to the original ones. Distributions are developed and supported by communities or commercial companies. Debian GNU/Linux for example is supported by the community. It is up to the user, which one to use, either commercial or the other. Distributions are developed according to their usage. For example: desktops, servers, routers, multimedia, clusters etc. So, one may choose the distribution according to his/her need. Distributions are normally segmented into packages, each package holding a specific application or service. This is achieved with the aid of the package management system. A package management system is a collection of tools to automate the process of installing, upgrading, configuring, and removing software packages from a computer. Some of the popular package management tools are: rpm, dpkg etc. The most popular Linux distributions use in today are Hard Disk based Linux Distributions This type of Linux distribution is the most common type Distribution. The method of installing Linux is by booting from a CD that contains the installation program and installable software. The CD can be burned from a downloaded ISO image, purchased alone for a low price, or can be obtained as part of a box that may also include manuals and additional commercial software. The most popular Red Hat Linux falls into this category.
  19. 19. 12 Live CD Linux distributions Live CD based Linux distribution has the operating system kernel, scripts and software stored on a bootable CD or DVD that can be run directly from the CD or DVD drive, without installing into permanent memory, such as a hard drive. It runs with the help of Ram disk. A Ram disk is a virtual solid state disk that uses a segment of active computer memory. Ram disk provides a role typically functioned by hard drives. A Live CD does not alter the current operating system or files without a user's intervention. The system returns to its previous OS state when the Live CD is ejected and the computer is rebooted. Morphix and Knoppix are the most popular Live CD Linux Distributions. [6] The customization of Linux first of all requires working with base system Knoppix or with its derivatives. KNOPPIX is a bootable Live system on CD or DVD, consisting of a representative collection of GNU/Linux software, automatic hardware detection, and support for many graphics cards, sound cards, SCSI and USB devices and other peripherals. KNOPPIX can be used as a productive Linux system for the desktop, educational CD, rescue system, or adapted and used as a platform for commercial software product demos. It is not necessary to install anything on a hard disk[ 3] . Morphix, Gnoppix, Ubuntu etc are derivatives of Knoppix. Knoppix, and most Knoppix' derivatives, are fairly monolithic in nature: They are essentially complete ready-made filesystems all compressed into one file. Morphix on the other hand is built up around the idea of modules: we have one module that boots wer Live CD and detects wer hardware, another that contains wer Live CD filesystem and zero or more extra modules that can contain minor or major changes and additions to the system. This way, Morphix promotes the reusing of smaller, existing modules instead of one large KNOPPIX file. That’s why we use Morphix in our customization.
  20. 20. 13 The second thing is to working with Debian system. It consists of a lot of basic tools of the operating system from the GNU project and supports the common computer architectures like: x86, Power PC etc. Debian GNU/Linux is the basis for several other distributions, including Knoppix, Ubuntu Linux, linspire, etc. Debian is also supported by donations made available by the Software in the Public Interest, a non- profit umbrella organization for free software projects. Debian is also well known for its package management system, especially APT, the Advanced Packaging Tool. APT simplifies the process of installing and removing software on Debian systems, by automating the retrieval, the configuration, the compiling (sometimes) and the installation of software from APT sources. Lots of Debian derivatives exist today. Debian Derivatives are subsets of Debian which are configured to support a particular target group out-of-the-box. For example: Debian aimed for science, Debian aimed for schools etc.[6]. This customized Linux distribution contains GNOME desktop environment. The GNOME Project was started in 1997 by two then university students, Miguel de Icaza and Federico Mena. Their aim: to produce a free (as in freedom) desktop environment. Since then, GNOME has grown into a hugely successful enterprise. Used by millions of people across the world, it is the most popular desktop environment for GNU/Linux and UNIX-type operating systems. The desktop has been utilised in successful, large-scale enterprise and public deployments, and the project's developer technologies are utilized in a large number of popular mobile devices [7]. Many Linux distributions offer a package management system to simplify the processes associated with installing, removing, upgrading, and configuring various software packages for our computer. In a package management system, software is distributed in packages that include information dictating how the software should be installed. In addition to ensuring wer software will be installed appropriately, the package manager will also determine whether we have any other software wer
  21. 21. 14 program depends upon to run correctly. This automatic satisfying of dependencies can save we a lot of time when installing new programs.The most common package management programs are Red Hat Package Manager (RPM) and Advanced Packaging Tool (APT) [8]. Out of several customizations our distribution is similar to Nepali Linux called NepaLinux. NepaLinux is a localized Debian and Morphix based GNU/Linux Distribution in Nepali. It is a Free Open Source Software released under the GNU General Public License(GPL). MPP has been conducting development works of NepaLinux since the year 2004. It is developed under the PAN Localization Project, which is a software localization initiative in some eleven countries of South and South East Asia. The project is supported by the International Development and Research Center (IDRC), Canada and administered through the Center for Research in Urdu Language Processing (CRULP), National University of Computer and Emerging Sciences (NUCES), Pakistan. NepaLinux 3.0 like the previous NepaLinux 2.0 version, features two separate CDs with respectively GNOME and KDE Desktop environments and a combined DVD containing both of these. Some of the chief attractions of this version are the two new applications, respectively, the Nepali Text- to-Speech Application and Nepali Sabdakos. Among other useful packages included in this version are offline English dictionary and several other useful educational tools like Gcompris, TuxType, Nepali Spell Checker and KTouch typing tutor. Mainly, Nepali linux is designed to help non-English speaking Nepali people to access computers. [9] 2.1 System Requirement  At least 3-5 GB of free space  At least 512 MB RAM and 1 GB swap (recommended)  At least Pentium 4 processor
  22. 22. 15 Chapter 3 Methodology We followed different methodology to create our custom distribution. The Standard procedures for creating a bootable Live-CD were studied from different sources. We would study the standard procedure for creating Live CD such Knoppix, Morphix and Ubuntu. Later we take Morphix as a base system and packages are added from Debian and desktop environment is taken from Gnome for the development of “necLinux”. First of all we followed the Morphix mannual to create necLinux but because of a lot of problems occurred we couldn't proceed further. But, we learnt lots of ideas from this documents. The work that we done referring this document is kept in Appendix 1. Later we followed the documents of Nepali Linux(called NepaLinux) to create Live - CD of necLinux. The idea behind the development of the Linux Live-CDs, first of all is to take any base system(i.e to take any Live -CD distributions of Linux e.g KNOPPIX,Morphix, Debian, Ubuntu). In this project we have taken Morphix. The basemod is extracted in some folder and later base module is constructed from it. The second and main task to be performed to create custom distribution is to create mainmodule. The mainmodule contains all the packages required for Live-CD, Desktop Environment etc. necLinux uses Debian packages and popular desktop environment GNOME. After all the works finished the .iso file (i.e disk image of an ISO 9660 file system) is created. At last, the iso file is burned in CD or DVD to create Live-CD or DVD. For this kind of Linux distributions, most preferred type of Linux distribution is a Live CD or a Live DVD, which can run directly without installing in the Hard disks. This will help the community with a single source of all the localized applications and users do not have
  23. 23. 16 to deal with the complexity of the manual installation of localized applications and tools. We carried out the following steps to create custom distribution. The most of the steps listed below are taken from GLOSS.pdf of NepaLinux. 3.1.1 Installing Required Tools or Software 1) Cloop tools: Compressed loopback device or cloop is mostly used as a convenient way to compress conventional file systems onto LiveCDs. Cloop is a module for the Linux Kernel. The module image that is used on the Morphix , Knoppix based or some other Live CDs uses cloop system for the compression. A compression ratio of about 2.5:1 is common for software. While building the module for the LiveCD cloop tools must beinstalled. Use the steps to install cloop tools. a) apt-get install cloop-utils b) apt-get install cloop-src 2) Debootstrap: When it comes to installing new installations of Debian GNU/Linux there is one tool which should not be ignored. Whether we're dealing with a real system, or a virtualised one, the debootstrap tool is ideal for quickly installing new Debian environments. Debootstrap bootstraps a basic Debian system into the target folder from the debian mirror. After debootstrap, the downloaded debian system will only contain the basic minimal packages. Install debootstrap using the following command. apt-get install debootstrap
  24. 24. 17 3) Morphing tools: A number of command line tools and scripts are provided in order to create the modules for the Live CD. Basic steps to install morphing tools is to add "deb http://www.morphix.org/debian ./" to /etc/apt/source.list apt-get update apt-get install morphing-tools If the installation of morphing-tools failed due to some reasons or dependencies then we use morphix module-builder which can be installed by following command: apt-get install morphix-modulebuilder 3.1.2 Working with base system The foremost thing required for creating a bootable Live-CD would be download the Base system from morphix website http://www.morphix.org or from morphix autobuilds or from any other. The latest base system available in morphix website is “MorphixBase-0.5-pre5.iso” but it is very old, build around 2005. This base system contain Linux kernel which is very old and doesn’t work. The latest morphix base system is available in morphix autobuild. Now a days the content of autobuild site are not accessible. In this project we downloaded base system from the site “http://ftp.vim.org/ibiblio/distributions/morphix/autobuilds/base/basemod-2.6.26- 2010-06-07_0022.iso“ .The file is an .iso archive and has the name basemod-2.6.23- 2010-06-15_0015.iso build in 2010.We then need to extract the iso to some folder say project/. mkdir project
  25. 25. 18 cd project/ mkdir myiso/ Then mount the basemod in folder myiso/ as: sudo mount –o loop “path to basemod” “path to folder myiso/” as sudo mount –o loop basemod-2.6.23-2010-06-15_0015.iso myiso/ All the files and folders should be copied to some directory say livecd/ mkdir livecd cd myiso/ The contents of directory myiso/ are copied into directory livecd/ cp -Rp project/ * livecd/ Then unmount the folder project by executing following command: umount myiso/ 3.1.3 Mainmodule construction The Main Module is a compressed image of .mod format, which will be loaded during the Live-CD boot up. This contains the Core Debian System and other softwarepackages like: Gnome Desktop, Office applications, x server-xorg, Netbeans, vlc player etc. The mainmodule is main component of any Live CD and it takes number of times to create it. In this section, we will create a main module for our Live CD which is considered as a major task. The foremost thing to construct mainmodule is to create mainmodule folder inside project directory. i.e
  26. 26. 19 mkdir mainmodule 1) Creating the Core Debian Image The package debootstrap is used to create a Debian base system from scratch, without requiring the availability of dpkg or apt. Debootstrap is a tool which will install a Debian base system into a subdirectory of another, already installed system. It doesn't require an installation CD, just access to a Debian repository. It does this by downloading .deb files from a mirror site, and carefully unpacking them into a directory which can eventually be chrooted into. For installing the tool debootstrap, the following command should be run: apt-get install debootstrap Once we have installed debootstrap, download the Debian Core System using debootstrap as debootstrap sid mainmodule/ Here we used sid (Unastable) for debootstrap. We may use sarge ( Stable ) , etch ( Testing) ,lenny , squeeze with debootstrap. If we want to work with the latest packages, we need to use lenny, which is not currently unavailable so sid is used. When debootstrap is complete, change the directory to mainmodue/. It will look like installation of Linux on the hard disk. After that, we may add packages like: Gnome, KDE, Apache whatever we would want in wer Live-CD. 2) Chroot mainmodule After debootstraping the Debian Core System, we now need chroot(i.e change root) to the mainmodule and add packages. Chroot is an operation which changes the root directory. Root directory is the first or top-most directory in a hierarchy. The root directory is changed by executing the following command:
  27. 27. 20 chroot mainmodule/ 3) Make entry for the apt sources. The Debian sid repositories are added to sources.list of mainmodule. The entries in this file normally follow this format: deb http://site.example.com/debian distribution component1 component2 component3 deb-src http://site.example.com/debian distribution component1 component2 component3 Following two lines are added to the /etc/apt/sources.list file using any text editors like vi,vim.tiny, gedit, nano etc. deb http://ftp.debian.org/debian/ sid main contrib non-free deb http://security.debian.org/ sid/updates main contrib After adding these repositories we need to update the system by executing following command. This is compulsory because we couldn't install any software packages on Live CD without updating the system. apt-get update 4) Adding Packages in mainmodule After chroot to the mainmodule, we can install different Debian packages by executing the command: apt-get install package_name First of all we install xserver-xorg by executing the command:
  28. 28. 21 apt-get install xserver-xorg and press option y while it is installing. After installing xserver-xorg we need to make sure that directory /tmp inside mainmodule should have file permission like this drwxrwxrwt. If not, execute command below to change the permission chown 1777 /tmp -R The Gnome desktop environment is installed using the command: apt-get install gnome-desktop-environment After the installation of the packages, the system will ask some questions for configuration for which we can use the default option. Similarly other packages can be installed in same manner. 5) Input methods For installing Input method system and adding input tables, There are many input method systems for Linux as: scim, iiimf . xkb etc. Below are the steps for using scim method. chroot mainmodule/ apt-get install scim apt-get install scim-gtk2-immodule Copy the generated input tables at /usr/share/scim/tables/ Copy the icon to be shown for input system at /usr/share/scim/icons in the form of png exit
  29. 29. 22 6) Fonts In order to display the translated string at the Gnome Desktop you need to have OpenType fonts installed operating system. For adding up Fonts: Copy your open type fonts at /usr/share/fonts/truetype Run fc-cache -f -v Verify using fc-list 7) Necessary Configurations For cleaning unnecessary packages from the base directory to save disc space: chroot mainmodule/ apt-get clean For making necessary directories: mkdir MorphixCD cdrom1 morphix floppy cdrom Then following files are created inside morphix folder. a) loadmod.sh b) init.sh c) main_module 8) Set the root password After the Live CD starts and ready to use, in some cases we need the password of root.
  30. 30. 23 chroot mainmodule/ passwd root Type the password umount mainmodule/ 9) Using own Gnome splash screen While the Gnome Desktop starts , a splash screen is displayed. This image resides in the folder /usr/share/images/desktop-base of the main module. If we want to use our own created splash screen, first create the image in png format , 450x200 in size and copy it in the folder mainmodule/usr/share/images/desktop-base/ . Then follow the steps listed below. Let the filename of the newly created image be mysplash.png. chroot mainmodule/ cd /etc/alternatives rm desktop-splash ln -s /usr/share/images/desktop-base/mysplash.png desktop-splash exit. 10) Changing the default Background of the Gnome Desktop If we want to use our own background for the Gnome Desktop, create an image which is 1600x1200 in size of png file format and copy it to the folder /usr/share/images/desktopbase of the main module. Let's say the name of the background image we created is
  31. 31. 24 mybackground.png.Then the following steps listed below should be followed: chroot /mainmodule cd /etc/alternatives rm desktop-background ln -s /usr/share/images/desktop-base/mybackground.png desktop-background exit 11) Generate the main module Before creating the main module, if we want to save space on the CD, we can remove the deb files that are used to install the packages. Run: apt-get clean This will remove the deb files of the folder: /var/cache/apt/archives Exit the chroot environment Type: exit Execute: module-builder /mainmodule /mylivecd//mainmod/mymainmodule.mod 3.1.4 Basemodule construction Base module customization and modification is useful if we want to add language on the Live CD boot menu, changing images , adding modified icons etc.
  32. 32. 25 1) Extract the base module mkdir basemodule extract_compressed_fs livecd/base/morphix > /tmp/morphix.iso mount -o loop /tmp/morphix.iso iso/ cd iso cp -Rp * basemodule/ umount iso/ 2) Grub Boot Image modification Grub boot Image here refers to the first background image which is in blue and white image displayed when we boot from the CD. We can modify the existing image to a new image. The steps for modification of grub boot image are: Create a directory message to work: mkdir message cd /message The image resides in the file livecd/boot/grub/message. Since it is cpio archive we use the following command to extract it: cpio -i < livecd/boot/grub/message Modify the background.pcx Create the message file from the message/ folder
  33. 33. 26 cd message/ ls . | cpio -o > /mylivecd/boot/grub/message While modification, the specification of background.pcx image should be exactly as below  A pcx format file  640x503 Resolution  Size not exceeding 35KB  14 Color Image 3) Boot Splash Images Customization Boot Splash Images of the Live CD refers to the images that are displayed while the Live CD boots. The current base module uses 6 images. So, create wer own 6 images and replace the existing ones. Find the steps for the modification. gunzip livecd/boot/miniroot.gz mount -o loop livecd/boot/miniroot /iso Boot splash images resides under iso/bootsplash/images. Replace them with the new ones. umount /iso gzip /mylivecd/boot/miniroot File name Size (not exceeding) Resolution
  34. 34. 27 bootsplash-1024x768.jpg 21KB 1024x768 silent-1024x768.jpg 22KB 1024x768 silent2-1024x768.jpg 35KB 1024x768 silent3-1024x768.jpg 88KB 1024x768 silent4-1024x768.jpg 84KB 1024x768 silent5-1024x768.jpg 91KB 4) Changing the Distribution name and other texts that are displayed while booting the Live CD gunzip livecd/boot/miniroot.gz mount -o loop livecd/boot/miniroot iso/ Check the file /iso/linuxrc and do the necessary changes. To change the distribution name to “necLinux” set DERIVATIVE =necLinux everywhere in file linuxrc. umount /iso gzip livecd/boot/miniroot 5) Changing Default username The Live CD boots to GUI using the username morph. To change the username, follow the steps below:
  35. 35. 28 Edit the file basemodule/etc/init.d/morphix-start and basemodule/etc/init.d/knoppixautoconfig of the base module. In this file change username=morph to username=newusername. Change morph to newusername in file basemodule/etc/passwd Change the user in the file passwd and group file of miniroot.gz gunzip livecd/boot/miniroot.gz mount -o loop livecd/boot/miniroot /iso Change user morph to newusername in the files /iso/etc/passwd and /iso/etc/group umount /iso gzip livecd/boot/miniroot 6) Setting password for the newusername After changing the default username to newusername, the password should be set to the newusername. Steps to set the password are: Copy the binary mkpasswd to basemodule cp mkpasswd basemodule/usr/bin/ Replace chroot /mnt/main useradd -m $USERNAME -s /bin/bash chroot /mnt/main useradd -s /bin/bash $USERNAME
  36. 36. 29 with the following lines chroot /mnt/main useradd -m $USERNAME -s /bin/bash -p `/usr/bin/mkpasswd $USERNAME` chroot /mnt/main useradd -s /bin/bash $USERNAME -p `/usr/bin/mkpasswd $USERNAME` in the file basemodule/etc/init.d/morphix-start. This will set the password same as the username. 7) Hostname modification Hostname is used to either set or display the current host or domain name of the system. This name is used by many of the networking programs to identify the machine. The default hostname is Morphix. See below to change to a new one. Edit the basemodule file basemodule/etc/init.d/knoppix-autoconfig. Change 'hostname Morphix' to 'hostname newname' Replace the existing hostname in the file Base module file basemodule/etc/hostname with the newname Change Morphix to newname in the Base module file basemodule/etc/hosts 8) Changing the Distribution name while Live CD is going to be halt or reboot Check the file basemodule/etc/init.d/knoppix-halt and replace MORPHIX with WERDISTRIBUTIONNAME
  37. 37. 30 9) Generating the Base Module after Customization After modification and making the necessary changes we need to create the modified basemodule. Use the steps below to do the same. i) mkisofs -R -U -V "morphix" -P "Morphix" -cache-inodes -nobak -pad /basemodule >/tmp/morphix.iso ii) create_compressed_fs /tmp/morphix.iso 65536 > mylivecd/base/morphix 3.1.5 Creating Live-CD ISO Before generating a final ISO for Live CD, the minimal mandatory directories are base, boot and mainmod. These directories are located inside livecd/ directory. A o /boot contains the init ramdisk, grub menu and kernel 1) /base /base contains morphix, the module that detects/configures wer hardware and contains wer standard kernel modules. 2) /mainmod It contains mainmodule; is a cloop image, comparable to the /base/morphix file, but using a different structure. mainmodule contains our file system, except for kernel, loadable kernel modules, and hardware detection scripts. 3) /minimod Contains minimodule, again these are cloop images. We don't need them, but we can add extra functionality by including extra minimodules. 4) /exec
  38. 38. 31 If we place files in this directory, they will be executed at boot time. Note that this does not mean that programs using X will be executed, the proper way would be to add a line to .xinitrc for this. 5) /copy If we place files in this directory, they will be copied over to the root of our file system. Use directories to place files in a certain directory instead. For example, have:/copy/home/morph/.xfce4/xfcerc to copy the xfcerc file to /home/morph/.xfce4/xfcerc at boot time. An ISO image (.iso) is an informal term for a disk image of an ISO 9660 file system. Hence we create an ISO image of our Live CD Linux distribution to burn it to the CD. Use the command below to generate the iso file. mkisofs -pad -l -r -J -v -V "Live CD" -b boot/grub/iso9660_stage1_5 -c base/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -hide -rr -moved -o /neclinux.iso livecd/ Options: -pad The end of the ISO9660 by 16 sectors (32kB). If the total size then is not a multiple of 16 sectors, the needed number of sectors is added. If the option -B is used, then there is a second padding at the end of the boot partitions. -L Allow ISO9660 filenames to begin with a period. Usually, a leading dot is replaced with an underscore in order to maintain MS-DOS compatibility. This violates the ISO9660 standard, but it happens to work on many systems. Use with caution. -r This is like the -R option, but file ownership and modes are set to more useful values. The uid and gid are set to zero, because they are usually only useful on the author's system, and not useful to the client.
  39. 39. 32 -J Generate Joliet directory records in addition to regular iso9660 file names. This is primarily useful when the discs are to be used on Windows-NT or Windows-95 machines. The Joliet filenames are specified in Unicode and each path component can be up to 64 Unicode characters long. Note that Joliet is no standard - CD's that use only Joliet extensions but no standard Rock Ridge extensions may usually only be used on Microsoft Win32 systems -v Verbose execution. If given twice on the command line, extra debug information will be printed. -V Specifies the volume ID (volume name or label) to be written into the master block. There is space on the disc for 32 characters of information. This parameter can also be set in the file. -no-emul-boot Specifies that the boot image used to create "El Torito" bootable CDs is a 'no emulation' image. The system will load and execute this image without performing any disk emulation. -boot-load-size load_sectors Specifies the number of "virtual" (512-byte) sectors to load in no-emulation mode. The default is to load the entire boot file. Some BIOSes may have problems if this is not a multiple of 4. -boot-info-table Specifies that a 56-byte table with information of the CD-ROM lawet will be patched in at offset 8 in the boot file. If this option is given, the boot file is modified in the source filesystem, so make sure to make a copy if this file cannot be easily regenerated! -hide glob Hide glob from being seen on the ISO9660 or Rock Ridge directory. glob is a shell wild-card-style pattern that must match any part of the filename or path. Multiple globs may be hidden. If glob matches a directory, then the contents of that
  40. 40. 33 directory will be hidden. In order to match a directory name, make sure the pathname does not include a trailing '/' character. All the hidden files will still be written to the output CD image file. Should be used with the -hide-joliet option. 3.1.6 Testing ISO using QEMU QEMU is a generic and open source machine emulator and virtualizer. When used as a machine emulator, QEMU can run OSes and programs made for one machine (e.g. an ARM board) on a different machine (e.g. wer own PC). By using dynamic translation, it achieves very good performance. When used as a virtualizer, QEMU achieves near native performances by executing the guest code directly on the host CPU. QEMU supports virtualization when executing under the Xen hypervisor or using the KVM kernel module in Linux. When using KVM, QEMU can virtualize x86, server and embedded PowerPC, and S390 guests. QEMU is command line virtualization application, the iso file is tested by executing following command from terminal. qemu -system -i386 -m memory_size_in_MB M -cdrom path_to iso_file or qemu -system-i386 --cdrom path_to_iso_file 3.1.7 Burning the ISO There are a lot of tools to burn iso file. Use any of them. 3.2 Live CD Architecture
  41. 41. 34 Fig 3 Live CD structure. The Kernel We use basically the same kernel configuration as Knoppix (look at /usr/src/linux/.config in a running Knoppix system, or kernel-config in our tarball), but we remove support for a few obviously unused things, such as ZISOFS. The standard Debian make-kpkg tool patches, builds and installs the kernel. This is a Debian dependency on the host system (we need the cloop-src package), and as it's probably the only nontrivial such dependency, it might be worth moving into the chroot in a later version. initrd
  42. 42. 35 Before the system proper starts up, there are two important things we must do. First, we need to mount the cloop image, load whatever modules the CD-ROM needs, then find and mount the CD. Next, we install the cloop device and mount the inner filesystem on it. Second, we create a ramdisk for the root filesystem and copy the root_fs.tgz image from the CD into it. We use the initrd (initial ramdisk) support to create a mini root filesystem that the kernel mounts and runs before the real init starts. This is a gzipped filesystem. When a kernel with initrd support is booted with the command line initrd=filename, it loads the contents of that filename and creates a ramdisk out of it. It then starts running the /linuxrc file in that ramdisk. When linuxrc has finished, it uses the pivot_root call to change onto the real root directory, which was /ramdisk, and executes the real init. Busybox, dietlibc Busybox is a small shell that can be configured at build time to include many common utilities as built-ins, and dietlibc is an alternative C library optimized for small size. Booting The standard for booting from CD-ROM is known as El Torito and was originally produced by the Phoenix BIOS writers. El Torito allows the creation of one or more disk images on the CD-ROM. At boot time, the BIOS locates these and creates an emulated disk from which it then boots. There's also a no-emulation mode, in which the BIOS loads sectors from the specified file and executes them without setting up an emulated disk. There's a catch, of course: El Torito is implemented by BIOS writers. Linux users with laptops or other interesting hardware already know that BIOSes are not always
  43. 43. 36 the least-buggy code on the planet. It's been suggested that some manufacturers happily ignore the actual specification as long as whatever they concoct manages to load the current version of Windows. boot.img What do we put in this 1.44MB? We could boot a raw Linux kernel, or we could use a normal Linux boot loader such as LILO or Grub. H Peter Anvin's SYSLINUX tool beats both of these options for ease of use, though. SYSLINUX creates boot disks that use an MS-DOS file system, so we can create the floppy disk image using the userland mtools. The disk needs the kernel vmlinuz file, syslinux.cfg, any ancillary help files and the initrd image. When done, we run SYSLINUX on it. [10]
  44. 44. 37 3.3 Use case diagram Fig.1 use case diagram
  45. 45. 38 3.4 Data Flow diagram Fig.2 data flow diagram
  46. 46. 39 Chapter 4 Implementation and Discussion 4.1 Black Box Testing We use the term “black box testing” to mean test methods that are not based directly on a program’s architecture source code. The term connotes a situation in which either the tester does not have access to the source code or the details of the source code are irrelevant to the properties being tested. This means that black box testing focuses on the externally visible behavior of the software. For example, it may be based on requirements, protocol specifications, APIs, or even attempted attacks. In some formulations, a black box tester has access only to the application’s user interface, either for entering data or observing program behavior. For example, in black box security testing, we get some idea of what an attacker could do to an application. The testing is preformed to check whether the .iso file build works or not, it runs correctly or not and also the packages we imported in the .iso are working or not.Also this testing is done to check, the iso we build runs from CD or removable disks live or not and it is supported by hardware or not. This testing also deals with languages, fonts, desktop environment, icons, themes etc that we changed is working correctly or not. The packages we installed in Live CD are tested by executing following command from terminal: dpkg -l|grep Package_Name
  47. 47. 40 for e.g to test whether the package gnome-desktop-environment is installed in Live CD or not we use dpkg -l|grep gnome-desktop-environment if it shows information about some installed files of gnome-desktop-environment then we are sured that this package have been installed. If it doesn't shows anything, then it is known that gnome-desktop-environment is not installed. Similarly to test works done in different steps we build iso file of livecd/ directory and test this iso file using QEMU to determine whether different modules(i.e. Basemodule and mainmodule) or packages are working correctly or not. The iso file is tested as qemu -system-i386 --cdrom livecd.iso Initially, we had used basemod “MorphixBase-0.5-pre5.iso”. As we build iso file and run using QEMU, then it failed to load showing the error in basemodule, named “kernel too old”. Also we made iso file of livecd/ directory without any packages in mainmodule and when it was run then it showed error in mainmodule, “mainmodule not found”. Similarly after installing packages in livecd we tested wheather they run correctly or not and they work or not.
  48. 48. 41 4.2 White Box Testing Black box testing is different from white box testing, which is testing based on knowledge of the source code. In fact, white box tests are generally derived from source code artifacts in some way or another. For example, the tests might target specific constructs found in the source code or try to achieve a certain level of code coverage. In white box testing, internal structures or workings of an iso file is tested as opposed to its functionality . In white-box testing an internal perspective of the system, as well as programming skills, are used to design test cases. The tester chooses inputs to exercise paths through the code and determine the appropriate outputs. Black box testing is used to derive various test cases ,that tests or detects various logical errors due to : 1) interfacing of different modules 2) bad files or missing file systems 3) errors in packages 4) redundant files Science we are not building our Live CD from source code but by customization of different Linux distributions and Packages of Debian. So we are not gone in depth to test from source code.
  49. 49. 42 Chapter 5 Future plan This project is still on the growing phase and we finished our minimal works scheduled for minor project. The summary or works we finished up to this final report for minor project are: working with base system, creating the core Debian image, adding Packages for the Live CD, locales and Live-CD, adding up Translations, selection of Language, input systems, changing Fonts, Grub Splash Screen Modification, generation of mainmodule, creating Live-CD ISO, burning CD Image. However this may be enough for minor project but we are not still satisfying i.e. we want to go further steps for better customization. Our plan is to work further in base module. In mainmodule we want to add as many packages as possible that are useful for engineering students. i.e building a system of many things. In this customization we are using all the packages or software that we are not build and it is impossible for us to build all the packages for our Live CD. So our dream it to build some applications and to run in this customization. This project is not done only for us but for motivation of students who want to work in open source. Our vision is to create a open source committee in college and motivating students who are interested in open source and hand over this project to this committee for development and management.
  50. 50. 43 Bibliography 1) http://www.ibm.com/developerworks/library/l-linuxuniversal/l-linuxuniversal- pdf.pdf 2) http://en.wikipedia.org/wiki/GNU_Project 25 feb 2013 3) http://distrowatch.com/table.php?distribution=redhat 4) http://distrowatch.com/table.php?distribution=debian 5) http://distrowatch.com/dwres.php?resource=major 6) http://www.panl10n.net/english/outputs/GLOSS.pdf 7) http://gnome.org/about/ 8) http://kb.iu.edu/data/acjk.html 9) http://www.nepalinux.org/ 10) www.debian.org/filestructure
  51. 51. 44 Appendix 1 Base module preparatory work Download a morphix base module to use as template. The base module is formed by: 1. The morphix file system 2. The miniroot file system We will need to modify both those filesystems, so we need to do some preparatory work to make them accessible. 1. Mount the base module: mkdir ~/livecd cd ~/livecd mkdir basemnt sudo mount -t iso9660 -o loop ~/livecd/basemod-2.6.17-2007-09-28_0330.iso ~/livecd/basemnt mkdir basedir sudo cp -a ~/livecd/basemnt/* ~/livecd/basedir sudo umount ~/livecd/basemnt 2. Get the morphix file system,
  52. 52. 45 extract_compressed_fs ~/livecd/basedir/base/morphix > ~/livecd/morphix.iso mkdir morphixmnt sudo mount -o loop ~/livecd/morphix.iso ~/livecd/morphixmnt mkdir morphixdir sudo cp -a ~/livecd/morphixmnt/* ~/livecd/morphixdir sudo umount ~/livecd/morphixmnt rmdir morphixmnt 3. Get the miniroot, sudo cp ~/livecd/basedir/boot/miniroot.gz ~/livecd/ gunzip ~/livecd/miniroot.gz mkdir minirootdir sudo mount -o loop ~/livecd/miniroot ~/livecd/minirootdir We have finished with the morphix filesystem copied to~/livecd/morphixdir, the miniroot filesystem mounted at~/livecd/minirootdirand the base copied to~/livecd/basedir. Before going on the with the kernel installation let's clean up any other kernel modules not to add size to the final result: sudo rm -R ~/livecd/morphixdir/lib/modules/* Kernel preparatory work
  53. 53. 46 1. Download theLinux kerneland compile it. tar xvzf linux-2.6.17/tar.gz ~/livecd/linux-2.6.17 cd linux-2.6.17 make mrproper cp ~/livecd/morphixdir/boot/config-2.6.17-morphix .config make all sudo cp arch/i386/boot/bzImage ~/livecd/morphixdir/boot/vmlinuz-2.6.17 sudo rm ~/livecd/morphixdir/boot/vmlinuz sudo rm ~/livecd/morphixdir/boot/config-2.6.17-morphix sudo rm ~/livecd/morphixdir/boot/System.map-2.6.17-morphix sudo cp .config ~/livecd/morphixdir/boot/config-2.6.17 sudo cp System.map ~/livecd/morphixdir/boot/System.map-2.6.17 sudo ln -s vmlinuz-2.6.17 ~/livecd/morphixdir/boot/vmlinuz sudo cp arch/i386/boot/bzImage ~/livecd/basedir/boot/vmlinuz sudo make INSTALL_MOD_PATH=~/livecd/morphixdir/ modules_install Building the 2.6.17 kernel on Ubuntu Feisty reports a undefined reference to `__stack_chk_fail' error. The solution to this can be found here. 2. Compressed loopback device or cloop Download the latest cloop driver, and compile it.
  54. 54. 47 tar xvzf cloop-2.06-2.tar.gz cd cloop-2.06 make KERNEL_DIR=~/livecd/linux-2.6.17 sudo cp cloop.ko ~/livecd/morphixdir/lib/modules/2.6.17/ 3. Copy all the needed kernel modules to miniroot, which include cdrom/usb drivers (scsi, ide-cd and usb) and cloop. I have used this simple python script to do it. We may have to change it or customise it. #!/usr/bin/python import os,commands HOME='/home/alex' moddir = ('scsi','usb') def cp(src,dst,verbose=False): (status,output) = commands.getstatusoutput('sudo cp -v ' + src + ' ' + dst) if verbose: print 'Copying ' + src + ' to ' + dst if status == 0:
  55. 55. 48 print 'Copied ' + src + ' to ' + dst return status,output for dir in moddir: path = HOME + '/livecd/minirootdir/modules/' + dir modules = os.listdir(path) commands.getstatusoutput('rm ' + path + '*') print 'Copying modules from ' + path for mod in modules: modpath= HOME + '/livecd/linux-2.6.17/drivers/'+ dir + '/' + mod cp( modpath , path ) if dir == 'usb': modpath = HOME + '/livecd/linux-2.6.17/drivers/'+ dir + '/host/' + mod cp( modpath , path ) modpath = HOME + '/livecd/linux-2.6.17/drivers/'+ dir + '/core/' + mod cp( modpath , path ) modpath = HOME + '/livecd/linux-2.6.17/drivers/'+ dir + '/storage/' + mod cp( modpath , path ) # Add a new USB driver
  56. 56. 49 cp( HOME+'/livecd/linux-2.6.17/drivers/usb/storage/libusual.ko' , path ) # Finally copy the ide-cd and cloop drivers path=HOME+'/livecd/minirootdir/modules/' cp(HOME+'/livecd/linux-2.6.17/drivers/ide/ide-cd.ko' , path) cp(HOME+'/livecd/cloop-2.06/cloop.ko' , path) 4. If we plan to use the main module as described in my earlier post, we'll find out we need the unionfs module which is not included in the 2.6.17 kernel. tar xvzf unionfs-1.3.tar.gz Reading the INSTALL file we will see it needs the uuid-dev package installed in wer system, sudo apt-get install uuid-dev And it also needs to be told where to find the Linux kernel in a fistdev.mk file as follows, LINUXSRC=~/livecd/linux-2.6.17 TOPINC=-I$(LINUXSRC)/include MODDIR=~/livecd/minirootdir/modules/2.6.17 We can now compile it, cd unionfs-1.3 make
  57. 57. 50 sudo cp unionfs.ko ~/livecd/morphixdir/lib/modules/2.6.17/kernel/fs/ 5. And if we plan to boot from a USB drive, we need copy the libusual module (as done in the python script), and add the following line (in red) to the linuxrc file in minirootdir: $INSMOD -f /modules/usb/usbcore$KEXT >/dev/null FOUNDUSB="" if test -n "$USBBOOT2" then $INSMOD -f /modules/usb/ehci-hcd$KEXT >/dev/null && FOUNDUSB="yes" fi if test -n "$USBBOOT1" then $INSMOD -f /modules/usb/uhci-hcd$KEXT >/dev/null && FOUNDUSB="yes" $INSMOD -f /modules/usb/ohci-hcd$KEXT >/dev/null && FOUNDUSB="yes" fi $INSMOD -f /modules/usb/libusual$KEXT >/dev/null $INSMOD -f /modules/usb/usb-storage$KEXT >/dev/null
  58. 58. 51 Putting it all back together sudo umount ~/livecd/minirootdir gzip ~/livecd/miniroot sudo cp ~/livecd/miniroot.gz ~/livecd/basedir/boot/ Creating the iso images sudo mkisofs -R -U -V "Morphix" -P "Morphix" -cache-inodes -no-bak -pad ~/livecd/morphixdir > ~/livecd/newmorphix.iso For the creation of the compressed image, I use a temporary file as I don't have enough free memory for a huge file. sudo nice -5 /usr/bin/create_compressed_fs -B 65536 -f /tmp/isotmp /home/alex/livecd/newmorphix.iso /home/alex/livecd/basedir/base/morphix We might need to run the last command as root if sudo fails with 'Permission denied', and wait for about 45 minutes as it is trying to create the ISO and compress it. And finally, sudo make-iso ~/livecd/basedir/ base-2.6.17.iso Cleaning up, sudo rm -Rf ~/livecd/basedir sudo rm -Rf ~/livecd/basemnt sudo rm -Rf ~/livecd/morphixdir sudo rm -Rf ~/livecd/minirootdir
  59. 59. 52 rm morphix.iso rm newmorphix.iso sudo rm miniroot.gz

×