Article Title: How the crazy diyunctulinux system is developed. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
At the end of the 21st century, everyone emphasized their own personality, so something called DIY was quietly emerging.
As the crystallization of the wisdom of all mankind, the operating system is naturally difficult to DIY. Therefore, the sense of accomplishment of DIY is definitely greater than that of purchasing Ikea.
To avoid writing an operating system from the beginning, we certainly adopt a ready-made operating system as the bottom line.
Of course, we can use LFS to make us feel better, but it is rare for people who can implement LFS. What's more, LFS is simply challenging my patience.
This article teaches you how to DIY a ubuntu release. It saves a lot of time for cool purposes.
Like LFS, we need a creation base. First, create a variable. The benefit of creating this variable is obvious, even if you don't need it ~ /Diy_ubuntu directory, you can follow this article to continue.
$ Export WORK = ~ /Diy_ubuntu
$ Mkdir-p $ WORK
Then we mounted the CD image file to/mnt.
$ Sudo mount-t iso9660-o loop dapper-live-i386.iso/mnt
$ Cd $ WORK
Copy a file and a CD File
$ Mkdir ubuntu-livecd
$ Cp-a/mnt/. ubuntu-livecd
$ Chmod-R u + w ubuntu-livecd
$ Sudo umount/mnt
Because the CD contains a lot of free software under windows, we can delete unnecessary files. Of course you can keep it.
$ Rm-rf $ WORK/ubuntu-livecd/programs
After mounting the compressed files on the CD, you can see a complete linux operating system directory in the $ WORK/old directory.
$ Mkdir $ WORK/old
$ Sudo mount-t squashfs-o loop, ro $ WORK/ubuntu-livecd/casper/filesystem. squashfs $ WORK/old
We created a 2 GB file system and formatted the file as a device file. As a result, the system gave a warning. Ignore it and choose yes.
$ Sudo dd if =/dev/zero of = $ WORK/ubuntu-fs.ext2 bs = 1 M count = 2147
$ Sudo mke2fs $ WORK/ubuntu-fs.ext2.
Then we mount the empty file system.
$ Mkdir $ WORK/new
$ Sudo mount-o loop $ working/ubuntu-fs.ext2 $ WORK/new
Copy the file of the linux operating system. Because the linux File we obtained in advance is compressed, We decompress it.
$ Sudo cp-a $ WORK/old/. $ WORK/new
Of course, $ WORK/old is useless now. Discard it
$ Sudo umount $ WORK/old
First, go to the operating system we just obtained.
$ Sudo cp/etc/resolv. conf $ WORK/new/etc/
$ Sudo mount-t proc-o bind/proc $ WORK/new/proc
$ Sudo chroot $ WORK/new/bin/bash
[1] [2] Next page