debootstrap
debootstrap can be use to install a debian package based linux system.
Including same arch or not.
How to install a chroot arm linux environment :
https://wiki.ubuntu.com/ARM/BuildEABIChroot
So that can be use a powerful host system for native compile application for arm arch.
debootstrap is actually a generic script to install all kind version of debian based system.
Per distro/version specific information is store at /usr/share/debootstrap.
It will report to below information.
1. DEF_MIRROR
mirror site : where store the .deb files
per distro script will call default_mirror in /usr/share/debootstrap/functions, then export DEF_MIRROR
2. DOWNLOAD_DEBS, DOWNLOAD_INDICES
mirror style : release or main
1. parse necessary information
depends on 1st, 2nd stage, add necessary job item
2. include per distro script
3. run job item
for install a deb based linux system, it may need below step :
1. finddebs :
download_indices :
(1) get release file : http://ports.ubuntu.com/ubuntu-ports/dists/karmic/Release
(2) grep Components from release file, found main restricted universe multiverse
(3) get package.gz according to arch/distro, ex from :
http://ports.ubuntu.com/ubuntu-ports/dists/karmic/main/binary-armel/
http://ports.ubuntu.com/ubuntu-ports/dists/karmic/restricted/binary-armel/
http://ports.ubuntu.com/ubuntu-ports/dists/karmic/universe/binary-armel/
http://ports.ubuntu.com/ubuntu-ports/dists/karmic/multiverse/binary-armel/
work_out_debs :
work_out_debs parse out three catalog, from unpacked Package file.
required : for package that list as "Priority: required"
base : for package that list as "Priority: important"
if buildd then base will be "Build-Essential: yes"
if fakechroot, minbase then base will be "apt"
finally, set up all_debs="$required $base"
2. printdebs - if assigned
just echo $all_debs
3. dldebs
download all .deb into ${target}/var/lib/apt, ${target}/var/cache/apt
download_main will parse file name from Package, then download package, also check md5.
4. maketarball - if assigned
tar ${target}/var/lib/apt,${target}/ var/cache/apt into one tarball.
... stay tune ...
No comments:
Post a Comment