Knoppix, with just one CD, allows us to use Linux1 at any place and at will, breaking the traditional concept that the operating system can only be installed and used first. Knoppix was originally designed to teach, but because of the popularity of this technology, the LiveCD technology has evolved and is now widely used, involving: system demonstrations, System first aid, network firewalls, product promotion, games, and more.
There are a lot of LiveCD to choose from, but sometimes it's not easy to find a version that completely meets your needs. But it doesn't matter, because the vast majority of LiveCD use of open source free software, which allows us to do their own, according to their own requirements to make LiveCD. This article is a demonstration of how to customize the LiveCD that meets your requirements based on existing LiveCD.
2.
- To have a Web browser. Easy access to mail via WebMail.
- To be able to open MS Word and PDF files.
- Capacity not exceeding 200M, can be burned to MINICD, easy to carry.
Knoppix is the most famous LiveCD, estimated that many people will first think of it, but Knoppix using KDE as a desktop environment, according to the last one of the requirements, Knoppix how can not be reduced to 200M, so inappropriate.
After looking for and comparing various existing LiveCD, found that Morphix meet the requirements, it and Debian,knoppix same strain, the use of modular design is its main feature, is the LiveCD of the various parts into modules, can be arbitrarily combined into different uses of LiveCD. Thanks to the choice of lightweight desktop manager, the LiveCD can be easily controlled within 200M.
3 As a basis, you can download from SourceForge.net's Morphix project.
4
# mkdir-p mod/light# module-extract iso/morphix/mainmod/light.mod mod/light
- Mount/proc
# Mount--bind-t Proc/proc Mod/light/proc
- Chroot
# chroot Mod/light
- Add a Chinese locale. In the downloaded Morphix LiveCD, the locale is only C and POSIX, so to modify the/etc/locale.gen file, include the following content
en_US Iso-8859-1en_us. UTF-8 UTF-8ZH_CN GB2312ZH_CN. GB18030 GB18030ZH_CN. GBK GBKZH_CN. UTF-8 UTF-8
Then execute the locale-gen command to generate a new locale.
- Modify resolv.conf, Unicom network. For example, using
# echo "NameServer 202.96.134.133" >/etc/resolv.conf
- Change the default Debian package source to point to the image closest to yourself. For example, I use the source of cn99
Deb Http://debian.cn99.com/debian unstable main contrib non-free
- Update the package. Add and remove packages according to your own customization requirements.
# apt-get update# apt-get install some software # Apt-get remove--purge unwanted software # apt-get upgrade# apt-get Clean
- Clean up space. To facilitate cleanup, first install the Deborphan tool and then clean it with the following command:
# Deborphan | Xargs apt-get-y--purge Remove
- Empty Package Cache
# cd/var/lib/apt/lists/# Rm-f *# touch lock# cd/var/cache/apt/# rm-f *# cd/var/tmp/# rm-f *
- Clean up the rest of the space. For maximum space savings, you can remove the MO files in the/usr/share/locale directory that do not use the language. In addition to/usr/share/doc,/usr/share/man below also have such files, can also be deleted.
- Update file name database
# UpdateDB
- Restore Configuration
# rm/etc/resolv.conf# touch/etc/resolv.conf# Umount/proc
- Pressed Mainmodule
# module-builder-t ext3 mod/light Iso/morphix/mainmod/light.mod
The Morphix website downloads the kernel source it provides. If you have added Morphix to source.list, you can easily get the files you need using Apt-get.
In addition to Kernel-source, LiveCD also need to Cloop and cowloop the two additional kernel modules, cloop in the source of the Debian name is CLOOP-SRC, and cowloop need to download to the Cowloop website.
The methods and procedures for compiling the kernel, as usual, can be found in the Debian reference manual. Finally, you can generate the Deb package format, or you can use Linux in the normal way. Morphix provides a script morphix-changekernel for kernel substitution, but it is for the 2.4 kernel and cannot be used directly with the current 2.6 kernel, but we can use it as a reference to understand the entire replacement process.
The other thing to note is that the kernel you compile is consistent with the GCC version and architecture of the module, which can be determined by using the strings command to view the vermagic.
Modify Bootsplash
LiveCD Start-up screen can also be customized, can be replaced with their own LiveCD theme matching instructions and images.
The splash screen image is saved in the LiveCD root directory boot/miniroot.gz file, unzip it, mount it to a temporary directory
# mkdir-p tmp/miniroot# gzip-d miniroot.gz# mount-o loop miniroot tmp/miniroot
The images and settings at startup are located in the Bootsplash directory, and we can modify the configuration file in config or directly replace the files under the images directory.
These images are saved in JPEG format, but Bootsplash currently only supports 16bit colors, and if your JPEG is 24bit color, you need to convert it first.
The following is the use of tools inside the NETPBM package to complete the conversion work.
$ jpegtopnm image24.jpg |ppmtojpeg > Image16.jpg
Suppress ISO files
Once the customization is complete, you can generate an ISO file that can be started with the following command
# mkisofs-pad-l-r-j-v-v "Soforge"-B boot/grub/iso9660_stage1_5 \-c base/boot.cat-no-emul-boot-boot-load-size 4-b Oot-info-table \-hide-rr-moved-o Soforge.iso Iso/morphix
The production of Linux LiveCD