BuildKernelWithChroot
Size: 2573
Comment:
|
Size: 2772
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 23: | Line 23: |
9. apt-get install wget debconf devscripts nano vim debhelper locales dialog kernel-wedge #install necessary packages<<BR>> 11. locale-gen en_US.UTF-8<<BR>> 12. tzselect; echo "export TZ='Asia/Taipei'" >> /root/.profile<<BR>> 14. exit # exit from chroot<<BR>> 15. sudo vi /etc/fstab and add following line |
9. apt-get install wget debconf devscripts nano vim debhelper locales sudo kernel-wedge #install necessary packages<<BR>> 10. locale-gen en_US.UTF-8<<BR>> 11. tzselect; echo "export TZ='Asia/Taipei'" >> /root/.profile<<BR>> 12. exit # exit from chroot<<BR>> 13. sudo vi /etc/fstab # append the following lines, take care it will bind /home between your host and chroot environment, if you want to remove chroot environment, umount them first |
Line 38: | Line 38: |
16. sudo mount -a<<BR>> 17. sudo cp /etc/passwd /var/chroot/hardy-lpia/etc/<<BR>> 18. sudo sed 's/\([^:]*\):[^:]*:/\1:*:/' /etc/shadow | sudo tee /var/chroot/hardy-lpia/etc/shadow<<BR>> 19. sudo cp /etc/group /var/chroot/hardy-lpia/etc/<<BR>> 20. sudo cp /etc/hosts /var/chroot/hardy-lpia/etc/<<BR>> 21. sudo cp /etc/sudoers /var/chroot/hardy-lpia/etc/<<BR>> 22. sudo chroot /var/chroot/hardy-lpia/<<BR>> 23. dpkg-reconfigure passwd<<BR>> 24. passwd <your-user-id><<BR>> 25. apt-get install sudo<<BR>> 26. exit # from chroot <<BR>> 27. echo hardy-lpia > etc/debian_chroot<<BR>> 28. sudo vi /etc/dchroot.conf and add following line |
14. sudo mount -a<<BR>> 15. setup user/passwd in chroot environment with following commands {{{ # sudo cp /etc/passwd /var/chroot/hardy-lpia/etc/ # setup user/passwd in chroot<<BR>> # sudo sed 's/\([^:]*\):[^:]*:/\1:*:/' /etc/shadow | sudo tee /var/chroot/hardy-lpia/etc/shadow<<BR>> # sudo cp /etc/group /var/chroot/hardy-lpia/etc/<<BR>> # sudo cp /etc/hosts /var/chroot/hardy-lpia/etc/<<BR>> # sudo cp /etc/sudoers /var/chroot/hardy-lpia/etc/<<BR>> # sudo chroot /var/chroot/hardy-lpia/<<BR>> # dpkg-reconfigure passwd<<BR>> # passwd <your-user-id><<BR>> # echo hardy-lpia > /etc/debian_chroot<<BR>> # exit # exit from chroot <<BR>> }}} 16. sudo vi /etc/dchroot.conf and add following line |
Line 54: | Line 56: |
29. dchroot -c hardy-lpia -d | 17. dchroot -c hardy-lpia -d |
1. sudo apt-get install schroot # install necessary package on host
2. sudo mkdir /var/chroot # Where you put root of chroot
3. sudo vi /etc/schroot/schroot.conf # Add following content to the end of it
[hardy-lpia] description=Ubuntu hardy lpia 32 bit location=/var/chroot/hardy-lpia priority=3 users=<your_userid_on_your_machine> groups=sbuild root-groups=root personality=linux32
4. sudo debootstrap --variant=buildd --arch lpia hardy /var/chroot/hardy-lpia http://ports.ubuntu.com/ # install basic filesystem into chroot environment
5. sudo cp /etc/resolv.conf /var/chroot/hardy-lpia/etc/resolv.conf
6. sudo vi /var/chroot/hardy-lpia/etc/apt/sources.list # Remove everything and add following line
deb http://ports.ubuntu.com hardy main restricted multiverse universe deb-src http://ports.ubuntu.com hardy main restricted multiverse universe
7. sudo chroot /var/chroot/hardy-lpia # go into chroot environment
8. apt-get install gnupg; apt-get update # resynchronize the package index files from sources
9. apt-get install wget debconf devscripts nano vim debhelper locales sudo kernel-wedge #install necessary packages
10. locale-gen en_US.UTF-8
11. tzselect; echo "export TZ='Asia/Taipei'" >> /root/.profile
12. exit # exit from chroot
13. sudo vi /etc/fstab # append the following lines, take care it will bind /home between your host and chroot environment, if you want to remove chroot environment, umount them first
# # Hardy-lpia # /home /var/chroot/hardy-lpia/home none bind 0 0 /tmp /var/chroot/hardy-lpia/tmp none bind 0 0 /dev /var/chroot/hardy-lpia/dev none bind 0 0 proc-chroot /var/chroot/hardy-lpia/proc proc defaults 0 0 devpts-chroot /var/chroot/hardy-lpia/dev/pts devpts defaults 0 0
14. sudo mount -a
15. setup user/passwd in chroot environment with following commands
# sudo cp /etc/passwd /var/chroot/hardy-lpia/etc/ # setup user/passwd in chroot<<BR>> # sudo sed 's/\([^:]*\):[^:]*:/\1:*:/' /etc/shadow | sudo tee /var/chroot/hardy-lpia/etc/shadow<<BR>> # sudo cp /etc/group /var/chroot/hardy-lpia/etc/<<BR>> # sudo cp /etc/hosts /var/chroot/hardy-lpia/etc/<<BR>> # sudo cp /etc/sudoers /var/chroot/hardy-lpia/etc/<<BR>> # sudo chroot /var/chroot/hardy-lpia/<<BR>> # dpkg-reconfigure passwd<<BR>> # passwd <your-user-id><<BR>> # echo hardy-lpia > /etc/debian_chroot<<BR>> # exit # exit from chroot <<BR>>
16. sudo vi /etc/dchroot.conf and add following line
hardy-lpia /var/chroot/hardy-lpia/
17. dchroot -c hardy-lpia -d
KernelTeam/BuildKernelWithChroot (last edited 2009-11-11 07:58:25 by 210)