Thank you.
It is a good method to copy the whole existing linux OS.
If I want to build a Linux system as tiny as possible just by copying the files from existing linux system.
How to do this?
I believe that there must be a way to do this, but I can't do.
A Chinese website has explain how to do this, but not clearly.
I try to translate shortly, it maybe is useful to someone, my English is poor:
1.edit /boot/grub/grub.conf
2.create some necessary empty directories: /dev; /proc; /etc; /sbin; /bin; /lib; /mnt; /usr.
3.copy some necessary files from the existing linux OS's directories to the new linux OS's corresponding directories.
/dev:
console、kmem、mem、null、ram、tty*, etc. (I don't like the word "etc" here, my installation was failed maybe just because of it. note that some files such as console can be copyed by the command: cp, a friend told me use the command:
Code:
#cd /;
#tar cf - dev | (cd /NEWLINUX; tar xf -)
)
/etc:
rc.d/*; fstab; inittab; passwd; group; shadow;
/bin and /sbin:
init、getty (mingetty)、login、mount、bash。
/lib;
ld.so (it is to a.out), or ld-linux.so (it is to ELF).
There is a file ld-linux.so.2 in /lib of my existing OS, however, there are no ld.so and ld-linux.so. So I copy /lib/ld-linux.so.2 to /NEWLINUX/lib/.
Finally, I can boot up the new OS and into its partition, however a error message said init mising, try to boot up without init. Maybe I can use some commands to boot up it without init. The website said: "if you don't want boot up the system through init, you can link init to /bin/bash. However, the person ddidn't point out how to make this link, maybe it is very simple in his opinion.
Thank you.
To do this, I should know much more knowledges about operating system than now I know, I am afraid. It is very difficult to me.