BuildKernelWithChroot

Differences between revisions 11 and 12
Revision 11 as of 2009-06-18 10:06:14
Size: 2573
Editor: 210
Comment:
Revision 12 as of 2009-06-18 10:31:30
Size: 2745
Editor: 210
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>> 9. apt-get install wget debconf devscripts nano vim debhelper locales sudo kernel-wedge #install necessary packages<<BR>>
Line 27: Line 27:
15. sudo vi /etc/fstab and add following line 15. 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 39: Line 39:
17. sudo cp /etc/passwd /var/chroot/hardy-lpia/etc/<<BR>> 17. sudo cp /etc/passwd /var/chroot/hardy-lpia/etc/ # setup user/passwd in chroot<<BR>>
Line 48: Line 48:
26. exit # from chroot <<BR>>
27. echo hardy-lpia > etc/debian_chroot<<BR>>
27. echo hardy-lpia > /etc/debian_chroot<<BR>>
26. exit # exit from chroot <<BR>>

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
11. locale-gen en_US.UTF-8
12. tzselect; echo "export TZ='Asia/Taipei'" >> /root/.profile
14. exit # exit from chroot
15. 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

16. sudo mount -a
17. sudo cp /etc/passwd /var/chroot/hardy-lpia/etc/ # setup user/passwd in chroot
18. sudo sed 's/\([:]*\):[:]*:/\1:*:/' /etc/shadow | sudo tee /var/chroot/hardy-lpia/etc/shadow
19. sudo cp /etc/group /var/chroot/hardy-lpia/etc/
20. sudo cp /etc/hosts /var/chroot/hardy-lpia/etc/
21. sudo cp /etc/sudoers /var/chroot/hardy-lpia/etc/
22. sudo chroot /var/chroot/hardy-lpia/
23. dpkg-reconfigure passwd
24. passwd <your-user-id>
25. apt-get install sudo
27. echo hardy-lpia > /etc/debian_chroot
26. exit # exit from chroot
28. sudo vi /etc/dchroot.conf and add following line

hardy-lpia /var/chroot/hardy-lpia/

29. dchroot -c hardy-lpia -d

KernelTeam/BuildKernelWithChroot (last edited 2009-11-11 07:58:25 by 210)