Linux_free (zh)

Source: Internet
Author: User

Building a Linux release is a dream of every free and open source software enthusiast. this was once a very difficult task. It was rare to be able to make a Linux release. It was also a great honor to be able to make a Linux release. however, if we advocate a free and open-source world with full potential and hands-on spirit, we will not deliberately dress what everyone expects as an ice-and-snow beauty away from the masses, he will constantly reform his own development mechanism, so that everyone can gradually participate in his own development, and thus promote his own development.
In short, it is not difficult to make a Linux release.
First, make a basic problem about the Linux release.
To create a Linux release, you must first consider the following:
1. Why is a Linux release required?
2. Do I plan to start from scratch or make changes on the basis of other Linux releases?
3. What are the key and difficult points of making a Linux release?
4. Select an existing Linux release to start your work.
First, let's look at the first question. Why is a Linux release required?
There are many answers to this question. One of the most common ones is that I want to do it. I have no reason. If I have to say the reason, I will borrow a fashionable word: Just for fun !, This is a good reason.
Another important reason is that I need a Linux release that meets my own special needs. For example, I am learning Perl programming and I need a small one, follow my Perl compilation system at any time, and do anything else, so I need to make a Linux release that supports USB startup. The above is only the basic system and editor plus Perl, I can carry it with me. If I have a computer, I can start learning at any time.
The reason why I want to make a Linux release is simple: I am a teacher! I think it is necessary to make a Linux release that complies with the laws of education and focuses on education-related software. To be more specific, I am a geography teacher. The new curriculum standards keep pace with the times, students are required to learn GIS knowledge, either required or optional. I don't get used to GIS education, which must be called ArcInfo and MapInfo, it seems that even the rich academic research institutions in China are not willing to pay for the software. in the Free and Open Source Software world, there is an extremely rich 3 S (GIS, GPS, RS) Geographic software. as far as GIS software is concerned, there are dozens or even hundreds of famous ones, such as grass qgis. Although these free software is less functional than commercial software, however, it is sufficient for General GIS teaching to understand basic GIS concepts. these software also has some advantages and advantages. taking into account the fact that all our current school computers are running Windows, I want to be a self-developed computer that starts and runs in the form of a CD, mainly using GIS software, linux releases with satisfactory performance and running speed.
(Note: there are already many similar systems in the world, including the UNESCO freeduc, which contains qgis, but does not yet support Chinese)
The third reason for making a Linux release is profit. Some people make a release to make money and make profits, which is not in conflict with free software and GPL copyright, the recent profit of RedHat has brought new fantasies to many young people, hoping that they may become the next generation of Bill Gates. others make their own releases and provide free downloads on the Internet. The more users they use, the more happy they are, he gains only the good names he values and the praise for his technology.
In short, there are many reasons for us to build a Linux release, especially for the majority of teachers working on the front line of education!
2. How to start a Linux release
Then we need to solve the second problem. Do I choose to make a Linux release from scratch or modify it as needed on the basis of other Linux releases?
In fact, we are talking about starting from scratch. Where do you start from? Is it from writing an OS? Or does it start with compiling and configuring the existing Linux kernel?
I think it is impossible for us to start from the very beginning. It is absolutely impossible for us to do the work that one can do. We should start our work on the basis of the work of our predecessors. for the production of your own Linux release, this inheritance of previous work can be divided into two situations:
A is only based on the existing Linux kernel and other source code.
This situation is actually based on LFS (Linux from scratch) to create your own Linux release. because LFS uses source code to build its own Linux release from scratch, using this method to create your own release version gives the producer a better understanding of the relationship between various software in Linux and the operating mechanisms in Linux. however, this method takes a long time and is relatively difficult. It is suitable for people who like to answer things.
Linux releases based on LFS seem to be personal works, and few are well-known.
B. Create your own Linux release based on other existing Linux releases
In this case, in the existing famous Linux release, select your preferred Linux release, and then crop, add, process, and make it your own Linux release.
This method is simple and fast, and is suitable for general users or users eager to produce finished products. now, the Linux release made in this way is like a sanded version, which is hard to count. There are many famous works, and it is hard to say whether one or two of them will become the next generation of OS overlord.
In order to quickly and easily achieve the purpose of making a Linux release, we chose to build a new version based on the existing Linux release. So which release should we choose as our starting point? Before answering this question, let's solve the third question first.
3. What are the key and difficult points of making a Linux release?
What are the key and difficult points for creating a Linux release? Beginners may find it difficult to start a Linux system. The key to customizing a Linux release is to solve the relationship between various software packages in the release.
Free Open-source software uses both the source code of its predecessors and the source code of its own for future generations. Therefore, free open-source software always uses different software packages for each other, on the one hand, this has brought great convenience to software development. On the other hand, it also makes the relationship between various software packages complicated and often brings disastrous consequences to software integration. For example, if you want to install software A, B, and C in your release, and the running of a depends on packages A1, A2, A3, and B, c depends on C1. to install software A, B, C, you must install A1, A2, A3, B1, B2, C1, it is found that the A1 runtime must use the database A11 and A12, And the C1 runtime must use the database C11. After you have spent a lot of effort to find the source code for A11, A12, and C11, after the installation, only then can we find that A12 and C11 conflict with each other! You cry!
Therefore, I think the key to making a Linux release is to correctly solve the dependency between various software packages.
4. Select an existing Linux release to start your work.
So which existing Linux release version should I choose to start my work? I think this is a problem with radish and vegetables. You can choose FC or slackware, obviously, I prefer to develop and customize my release version based on Debian. I think the greatest strength of Debian lies in its advanced and unique software package management method. Through the hard work of excellent programmers from all over the world, the dependency and conflicts among various free and open source software are well solved, so that Debian supports installing software in the most convenient way in all operating systems, it also brings great convenience to Debian-based development and customization of its own release version.
Of course, some may say that FreeBSD's software package management method is also very convenient and powerful. Why not choose FreeBSD? This is because FreeBSD does not comply with the GPL copyright, and its own FreeBSD license does not allow the development of personalized releases based on FreeBSD, so we can only sigh.
Now I plan to customize my release version based on Debian development. Can I develop it more easily? Considering my actual development needs, I only need to develop a demo system for teaching. I 'd better make it a livecd, that is, a Linux custom system running on a CD, I plan to develop my custom system based on the knoppix or morphix system.
Knoppix is a well-known livecd system developed based on Debian. It uses some unique technologies to make redevelopment easier than Debian, morphix is a modular livecd developed based on knoppix. From its name, morphix refers to deformation of Linux, which is born for customized Linux! It makes Linux customization easier!
However, people are still not satisfied. Some people are still developing remaster, developing trom, etc. Their goal is to click a few mouse clicks on a graphic interface, A new custom release is available! This day may not take long! Is it exciting or horrible? At least I feel quite nervous. I want to write this article quickly and finish it before the software is generated. Otherwise, just a few clicks to create your own release. Who will read my article?
Debian --> knoppix --> morphix, custom development based on these three releases is more and more easy, but in my practical application, development Based on morphix and simpler trom tools often fails, while development based on knoppix is stable. Therefore, I decided to develop a Chinese version of GIS release based on knoppix.
2. Specific development process.
The following is my specific development process. Of course, I wrote it based on my own understanding and made some changes to the new knoppix version. The article is entirely written on a Windows machine based on memory, so there are some details of the error.
1. preparations:
The first step in preparation is to check whether your computer is powerful enough! It is best to have one GB of memory, two GB swap partition, and more than 10 Gb hard disk! Of course, the M memory + 1g swap partition can also work, it is slower. The hard disk space is as big as possible. At the beginning, I made great efforts to customize the hard disk space. In fact, 8 GB hard disk space was not enough! Of course, the process I wrote below is to carefully use the hard disk space and promptly Delete and detach unnecessary space. 3-4G hard disks should be available.
Then install the relevant cloop software. When cloop is introduced, I think it is the biggest feature of knoppix. I am using a Debian system, so:
# Apt-Get install cloop-utils
You can.
Then get the latest version of knoppix. The latest version is 3.7, but it does not seem to have been officially announced. Let's use the version 3.6, next let's assume that I downloaded knoppix36.iso. If you do not engrave a disk, it will not affect the subsequent customization work.
Then, create a working directory. I created a/Wen directory in the working directory, and created two subdirectories, old and new. Obviously, the former stores the original content of knoppix36.iso, the latter will store the modified content.
2. Start customization and transformation.
First, mount the Rolling Disk Image File knoppix36.iso:
# Mount-o loop-T iso9660/root/knoppix36.iso/mnt/CDROM
Obviously, the knoppix I downloaded is in the root directory and I mounted it to/mnt/CDROM. The following two parameters can be modified according to the actual situation.
Now you can go to/mnt/CDROM to check what is in knoppix. There is a boot directory. Obviously, this is related to startup. You need to modify the startup screen in the future, we have to modify the content here. We will ignore it now. There is also a knoppix Directory, which contains some files, one of which is nearly 700 mb! This is the subject to be modified!
Next, we will first copy all the content under/mnt/CDROM to/Wen/new, because all we need to modify is the knoppix file, which will be deleted later, but it is still used:
# Cd/mnt/CDROM
# Cp-R */Wen/New/
# Umount/mnt/CDROM
You can even delete the knoppix36.iso file to save disk space.
Next we need to operate on the/Wen/New/knoppix file. The file size is 700 mb, And the cloop file is used for compression. Therefore, we need to decompress the file first:
# Cd/Wen/New/knoppix/
# Extract_compressed_fs knoppix> TMP. ISO
Put the extracted results in the form of TMP. ISO in the root directory. Note that the decompression process is extremely long. I usually boil water, soak in instant noodles, eat it slowly, clean the desktop, and decompress it?
No! It's early! Go out and exercise. When you have consumed almost all of your work, decompress the package and check the root directory. The TMP. ISO is actually nearly 2 GB!
Now you must delete the file/Wen/New/knoppix, because we need to transform TMP. ISO to generate a new knoppix file. Remember!
Mount TMP. ISO and copy all the content to/Wen/old/knoppix. You should be quite familiar with it:
# Mount-o loop-T iso9660/tmp. ISO/mnt/CDROM
# Mkdir/Wen/old/knoppix
# Cd/mnt/CDROM
# Cp-R */Wen/old/knoppix
# Umount/mnt/CDROM
To save disk space, you can also delete/tmp. ISO.
Next, we will enter the specific transformation phase. Here we mainly use the chroot command and the APT-Get installation and uninstall software, which is convenient for the Debian system. We need to pay attention to the following:
To use the network, you need to mount proc in the chroot environment, but also note that the domain name can be correctly resolved in the chroot environment. I solve this problem in the following way. Open another console window and execute:
# Cp/etc/APT/sources. LIST/Wen/old/knoppix/etc/APT/sources. List
# Cp/etc/resolv. CONF/Wen/old/knoppix/etc/resolv. conf
The premise is that your network is smooth before you have chroot. Another solution is to ping the apt source in the sources. List table to obtain the IP address and directly write it to the sources. list file after the chroot to save the trouble of DNS resolution.
# Chroot/Wen/old/knoppix/
$ Mount-T proc/proc
Now you have entered the old knoppix3.6. You can treat it as a common Debian system and use common commands to transform the old system:
$ Apt-Get remove OpenOffice.org
$ Apt-Get remove kde-i18n-{es, de, FR, IT, NL}
(Delete a few large software packages that I don't commonly use, which can save-MB of space. You can run the command dpkg-query-L to check which software packages are installed and delete them as needed)
$ Apt-Get install grass
$ Apt-Get install qgis
(I installed two required software)
After a simple transformation is completed, you can exit after a little cleanup:
$ Apt-Get clean
(Delete the downloaded software package to avoid being included in the new release)
$ Updatedb
(Update Software database)
$ Update-menus
(Update menu)
$ Umount proc
(Remember !)
Run Ctrl-D to exit the chroot environment. At last, we need to do two things: first, compress the transformed/Wen/old/knoppix file to the knoppix file and write/Wen/New/knoppix. Second,/Wen/New/is used as a CD image file. You must use the makeisofs command in both steps. If you do not have the makeisofs command in the system, you must install it on your own. These two commands are very long. I generally write them as script files to facilitate reuse.
# Mkisofs-r-u-V "www.wen.net"-P "www.wen.net"-hide-rr-moved-Cache-inodes-no-Bak-pad/Wen/old/knoppix | nice -5 create_compressed_fs-65536>/Wen/New/knoppix
Note that the above content should be written in one line. The compression process takes as long as the decompression time. Please try another pack of instant noodles!
Do not delete the/Wen/old directory. You can continue to modify it later.
Make a CD image file: (for version 3.6, version 3.3 is different)
# Mkisofs-Pad-l-R-J-v "wenppix"-no-emul-boot-load-size 4-boot-Info-table-B boot/ isolinux/isolinux. bin-C boot/isolinux/boot. cat-hide-rr-moved-O/home/FTP/knoppix. ISO/Wen/New
The second-to-last parameter refers to the position of the newly generated ISO, which can be adjusted by yourself. Note the directory location when executing this command! Although the absolute path is used, it seems that this command cannot be executed in other directories.
The new release is easy, but it is difficult to do well. We still have a lot of details to do:
1. Modify the startup screen.
2. Modify the Startup Script
3. It is time-consuming to delete a software package to make its release as small as possible.
4. The self-Modified Release usually runs slowly than the original version and needs to be optimized.
5. How to install the disk and USB flash drive.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.