Changes between Initial Version and Version 1 of howto/FedoraChroot


Ignore:
Timestamp:
12/15/08 14:59:36 (15 years ago)
Author:
Edwin Eefting
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • howto/FedoraChroot

    v1 v1  
     1= Chroot login met fedora core 9 =
     2
     3Deze howto beschrijft een chrooted login shell voor fedora core 9.
     4
     5
     6== Opzetten chroot basis omgeving ==
     7
     8Het opzetten van een chroot basis omgeving is normaal een hoop kopieer en puzzel werk.
     9
     10Echter bevat yum een handige --installroot optie om alles op ene automatische en nette manier te doen.
     11
     12Het enige wat nodig is voor een minimale omgeving is bash en alle dependencys. Deze proberen we als volgt te installeren:
     13{{{
     14[root@localhost ~]# yum --installroot=/chrootedlogin install bash
     15removing mirrorlist with no valid mirrors: /chrootedlogin/var/cache/yum/fedora/mirrorlist.txt
     16Error: Cannot retrieve repository metadata (repomd.xml) for repository: fedora. Please verify its path and try again
     17[root@localhost ~]# cp /var/cache/yum/fedora/mirrorlist.txt /chrootedlogin/var/cache/yum/fedora/mirrorlist.txt
     18[root@localhost ~]# yum --installroot=/chrootedlogin install bash
     19fedora                                                                                                 | 2.4 kB     00:00
     20primary.sqlite.bz2                                                                                     | 6.1 MB     00:09
     21removing mirrorlist with no valid mirrors: /chrootedlogin/var/cache/yum/updates/mirrorlist.txt
     22Error: Cannot retrieve repository metadata (repomd.xml) for repository: updates. Please verify its path and try again
     23You have new mail in /var/spool/mail/root
     24[root@localhost ~]# cp /var/cache/yum/updates/mirrorlist.txt /chrootedlogin/var/cache/yum/updates/mirrorlist.txt
     25}}}
     26
     27De files die ontbreken kopieren we van het hoofd systeem, totdat yum het doet. (Dit zijn slechts 2 mirrorlist files)
     28
     29Hierna gaat het installeren van bash correct:
     30{{{
     31[root@localhost ~]# yum --installroot=/chrootedlogin install bash
     32updates                                                                                                | 2.6 kB     00:00
     33primary.sqlite.bz2                                                                                     | 9.1 kB     00:00
     34Setting up Install Process
     35Parsing package install arguments
     36Resolving Dependencies
     37--> Running transaction check
     38---> Package bash.i386 0:3.2-22.fc9 set to be updated
     39--> Processing Dependency: libc.so.6(GLIBC_2.2) for package: bash
     40--> Processing Dependency: libc.so.6(GLIBC_2.4) for package: bash
     41--> Processing Dependency: rtld(GNU_HASH) for package: bash
     42--> Processing Dependency: libc.so.6(GLIBC_2.1) for package: bash
     43--> Processing Dependency: libc.so.6(GLIBC_2.3.4) for package: bash
     44--> Processing Dependency: mktemp for package: bash
     45--> Processing Dependency: libtinfo.so.5 for package: bash
     46--> Processing Dependency: libdl.so.2(GLIBC_2.1) for package: bash
     47--> Processing Dependency: libc.so.6 for package: bash
     48--> Processing Dependency: libdl.so.2(GLIBC_2.0) for package: bash
     49--> Processing Dependency: ncurses for package: bash
     50--> Processing Dependency: libdl.so.2 for package: bash
     51--> Processing Dependency: libc.so.6(GLIBC_2.0) for package: bash
     52--> Processing Dependency: libc.so.6(GLIBC_2.3) for package: bash
     53--> Running transaction check
     54---> Package ncurses-libs.i386 0:5.6-16.20080301.fc9 set to be updated
     55--> Processing Dependency: ncurses-base = 5.6-16.20080301.fc9 for package: ncurses-libs
     56---> Package glibc.i686 0:2.8-3 set to be updated
     57--> Processing Dependency: basesystem for package: glibc
     58--> Processing Dependency: libgcc for package: glibc
     59--> Processing Dependency: glibc-common = 2.8-3 for package: glibc
     60---> Package coreutils.i386 0:6.10-18.fc9 set to be updated
     61--> Processing Dependency: libacl.so.1 for package: coreutils
     62--> Processing Dependency: libacl.so.1(ACL_1.0) for package: coreutils
     63--> Processing Dependency: /sbin/install-info for package: coreutils
     64--> Processing Dependency: libpam.so.0 for package: coreutils
     65--> Processing Dependency: libselinux.so.1 for package: coreutils
     66--> Processing Dependency: grep for package: coreutils
     67--> Processing Dependency: libpam.so.0(LIBPAM_1.0) for package: coreutils
     68--> Processing Dependency: libselinux >= 1.25.6-1 for package: coreutils
     69--> Processing Dependency: libpam_misc.so.0 for package: coreutils
     70--> Processing Dependency: pam >= 0.66-12 for package: coreutils
     71--> Processing Dependency: libpam_misc.so.0(LIBPAM_MISC_1.0) for package: coreutils
     72---> Package ncurses.i386 0:5.6-16.20080301.fc9 set to be updated
     73--> Running transaction check
     74---> Package pam.i386 0:1.0.1-2.fc9 set to be updated
     75--> Processing Dependency: audit-libs >= 1.0.8 for package: pam
     76--> Processing Dependency: cracklib-dicts >= 2.8 for package: pam
     77--> Processing Dependency: libaudit.so.0 for package: pam
     78--> Processing Dependency: cracklib for package: pam
     79--> Processing Dependency: libcrack.so.2 for package: pam
     80---> Package libselinux.i386 0:2.0.61-1.fc9 set to be updated
     81--> Processing Dependency: libsepol >= 2.0.18-2 for package: libselinux
     82---> Package libacl.i386 0:2.2.47-1.fc9 set to be updated
     83--> Processing Dependency: libattr.so.1(ATTR_1.0) for package: libacl
     84--> Processing Dependency: libattr.so.1 for package: libacl
     85---> Package basesystem.noarch 0:8.1-1 set to be updated
     86--> Processing Dependency: filesystem for package: basesystem
     87--> Processing Dependency: setup for package: basesystem
     88---> Package info.i386 0:4.11-5.fc9 set to be updated
     89--> Processing Dependency: libz.so.1 for package: info
     90---> Package glibc-common.i386 0:2.8-3 set to be updated
     91--> Processing Dependency: tzdata >= 2003a for package: glibc-common
     92---> Package libgcc.i386 0:4.3.0-8 set to be updated
     93---> Package ncurses-base.i386 0:5.6-16.20080301.fc9 set to be updated
     94---> Package grep.i386 0:2.5.1-59.fc9 set to be updated
     95--> Processing Dependency: libpcre.so.0 for package: grep
     96--> Running transaction check
     97---> Package libattr.i386 0:2.4.41-1.fc9 set to be updated
     98---> Package audit-libs.i386 0:1.7.2-6.fc9 set to be updated
     99---> Package setup.noarch 0:2.6.14-1.fc9 set to be updated
     100---> Package filesystem.i386 0:2.4.13-1.fc9 set to be updated
     101---> Package zlib.i386 0:1.2.3-18.fc9 set to be updated
     102---> Package cracklib-dicts.i386 0:2.8.12-2 set to be updated
     103---> Package pcre.i386 0:7.3-3.fc9 set to be updated
     104--> Processing Dependency: libstdc++.so.6(CXXABI_1.3) for package: pcre
     105--> Processing Dependency: libstdc++.so.6(GLIBCXX_3.4.9) for package: pcre
     106--> Processing Dependency: libstdc++.so.6(GLIBCXX_3.4) for package: pcre
     107--> Processing Dependency: libstdc++.so.6 for package: pcre
     108---> Package tzdata.noarch 0:2008b-1.fc9 set to be updated
     109---> Package cracklib.i386 0:2.8.12-2 set to be updated
     110---> Package libsepol.i386 0:2.0.26-1.fc9 set to be updated
     111--> Running transaction check
     112---> Package libstdc++.i386 0:4.3.0-8 set to be updated
     113--> Finished Dependency Resolution
     114
     115Dependencies Resolved
     116
     117=============================================================================
     118 Package                 Arch       Version          Repository        Size
     119=============================================================================
     120Installing:
     121 bash                    i386       3.2-22.fc9       fedora            1.8 M
     122Installing for dependencies:
     123 audit-libs              i386       1.7.2-6.fc9      fedora             74 k
     124 basesystem              noarch     8.1-1            fedora            2.9 k
     125 coreutils               i386       6.10-18.fc9      fedora            4.4 M
     126 cracklib                i386       2.8.12-2         fedora             47 k
     127 cracklib-dicts          i386       2.8.12-2         fedora            3.7 M
     128 filesystem              i386       2.4.13-1.fc9     fedora            119 k
     129 glibc                   i686       2.8-3            fedora            5.5 M
     130 glibc-common            i386       2.8-3            fedora             21 M
     131 grep                    i386       2.5.1-59.fc9     fedora            182 k
     132 info                    i386       4.11-5.fc9       fedora            167 k
     133 libacl                  i386       2.2.47-1.fc9     fedora             22 k
     134 libattr                 i386       2.4.41-1.fc9     fedora             13 k
     135 libgcc                  i386       4.3.0-8          fedora             45 k
     136 libselinux              i386       2.0.61-1.fc9     fedora            116 k
     137 libsepol                i386       2.0.26-1.fc9     fedora            129 k
     138 libstdc++               i386       4.3.0-8          fedora            317 k
     139 ncurses                 i386       5.6-16.20080301.fc9  fedora            169 k
     140 ncurses-base            i386       5.6-16.20080301.fc9  fedora             59 k
     141 ncurses-libs            i386       5.6-16.20080301.fc9  fedora            326 k
     142 pam                     i386       1.0.1-2.fc9      fedora            1.1 M
     143 pcre                    i386       7.3-3.fc9        fedora            140 k
     144 setup                   noarch     2.6.14-1.fc9     fedora            140 k
     145 tzdata                  noarch     2008b-1.fc9      fedora            752 k
     146 zlib                    i386       1.2.3-18.fc9     fedora             74 k
     147
     148Transaction Summary
     149=============================================================================
     150Install     25 Package(s)
     151Update       0 Package(s)
     152Remove       0 Package(s)
     153
     154Total download size: 41 M
     155Is this ok [y/N]: y
     156Downloading Packages:
     157(1/25): basesystem-8.1-1.noarch.rpm                                                                    | 2.9 kB     00:00
     158(2/25): libattr-2.4.41-1.fc9.i386.rpm                                                                  |  13 kB     00:00
     159(3/25): libacl-2.2.47-1.fc9.i386.rpm                                                                   |  22 kB     00:00
     160(4/25): libgcc-4.3.0-8.i386.rpm                                                                        |  45 kB     00:00
     161(5/25): cracklib-2.8.12-2.i386.rpm                                                                     |  47 kB     00:00
     162(6/25): ncurses-base-5.6-16.20080301.fc9.i386.rpm                                                      |  59 kB     00:00
     163(7/25): audit-libs-1.7.2-6.fc9.i386.rpm                                                                |  74 kB     00:00
     164(8/25): zlib-1.2.3-18.fc9.i386.rpm                                                                     |  74 kB     00:00
     165(9/25): libselinux-2.0.61-1.fc9.i386.rpm                                                               | 116 kB     00:00
     166(10/25): filesystem-2.4.13-1.fc9.i386.rpm                                                              | 119 kB     00:00
     167(11/25): libsepol-2.0.26-1.fc9.i386.rpm                                                                | 129 kB     00:00
     168(12/25): setup-2.6.14-1.fc9.noarch.rpm                                                                 | 140 kB     00:00
     169(13/25): pcre-7.3-3.fc9.i386.rpm                                                                       | 140 kB     00:00
     170(14/25): info-4.11-5.fc9.i386.rpm                                                                      | 167 kB     00:00
     171(15/25): ncurses-5.6-16.20080301.fc9.i386.rpm                                                          | 169 kB     00:00
     172(16/25): grep-2.5.1-59.fc9.i386.rpm                                                                    | 182 kB     00:00
     173(17/25): libstdc++-4.3.0-8.i386.rpm                                                                    | 317 kB     00:00
     174(18/25): ncurses-libs-5.6-16.20080301.fc9.i386.rpm                                                     | 326 kB     00:00
     175(19/25): tzdata-2008b-1.fc9.noarch.rpm                                                                 | 752 kB     00:01
     176(20/25): pam-1.0.1-2.fc9.i386.rpm                                                                      | 1.1 MB     00:02
     177(21/25): bash-3.2-22.fc9.i386.rpm                                                                      | 1.8 MB     00:02
     178(22/25): cracklib-dicts-2.8.12-2.i386.rpm                                                              | 3.7 MB     00:06
     179(23/25): coreutils-6.10-18.fc9.i386.rpm                                                                | 4.4 MB     00:08
     180(24/25): glibc-2.8-3.i686.rpm                                                                          | 5.5 MB     00:10
     181(25/25): glibc-common-2.8-3.i386.rpm                                                                   |  21 MB     00:38
     182warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2
     183Importing GPG key 0x4F2A6FD2 "Fedora Project <fedora@redhat.com>" from /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
     184Is this ok [y/N]: y
     185Importing GPG key 0xDB42A60E "Red Hat, Inc <security@redhat.com>" from /etc/pki/rpm-gpg/RPM-GPG-KEY
     186Is this ok [y/N]: y
     187Running rpm_check_debug
     188Running Transaction Test
     189Finished Transaction Test
     190Transaction Test Succeeded
     191Running Transaction
     192  Installing     : setup                                           [ 1/25]
     193  Installing     : filesystem                                      [ 2/25]
     194  Installing     : basesystem                                      [ 3/25]
     195  Installing     : ncurses-base                                    [ 4/25]
     196  Installing     : tzdata                                          [ 5/25]
     197  Installing     : libgcc                                          [ 6/25]
     198  Installing     : glibc                                           [ 7/25]
     199  Installing     : ncurses-libs                                    [ 8/25]
     200  Installing     : ncurses                                         [ 9/25]
     201  Installing     : bash                                            [10/25]
     202  Installing     : cracklib                                        [11/25]
     203  Installing     : libsepol                                        [12/25]
     204  Installing     : libselinux                                      [13/25]
     205  Installing     : libattr                                         [14/25]
     206  Installing     : libacl                                          [15/25]
     207  Installing     : libstdc++                                       [16/25]
     208  Installing     : pcre                                            [17/25]
     209  Installing     : glibc-common                                    [18/25]
     210  Installing     : zlib                                            [19/25]
     211  Installing     : info                                            [20/25]
     212  Installing     : grep                                            [21/25]
     213  Installing     : audit-libs                                      [22/25]
     214  Installing     : cracklib-dicts                                  [23/25]
     215  Installing     : coreutils                                       [24/25]
     216  Installing     : pam                                             [25/25]
     217
     218Installed: bash.i386 0:3.2-22.fc9
     219Dependency Installed: audit-libs.i386 0:1.7.2-6.fc9 basesystem.noarch 0:8.1-1 coreutils.i386 0:6.10-18.fc9 cracklib.i386 0:2.8.12-2 cracklib-dicts.i386 0:2.8.12-2 filesystem.i386 0:2.4.13-1.fc9 glibc.i686 0:2.8-3 glibc-common.i386 0:2.8-3 grep.i386 0:2.5.1-59.fc9 info.i386 0:4.11-5.fc9 libacl.i386 0:2.2.47-1.fc9 libattr.i386 0:2.4.41-1.fc9 libgcc.i386 0:4.3.0-8 libselinux.i386 0:2.0.61-1.fc9 libsepol.i386 0:2.0.26-1.fc9 libstdc++.i386 0:4.3.0-8 ncurses.i386 0:5.6-16.20080301.fc9 ncurses-base.i386 0:5.6-16.20080301.fc9 ncurses-libs.i386 0:5.6-16.20080301.fc9 pam.i386 0:1.0.1-2.fc9 pcre.i386 0:7.3-3.fc9 setup.noarch 0:2.6.14-1.fc9 tzdata.noarch 0:2008b-1.fc9 zlib.i386 0:1.2.3-18.fc9
     220Complete!
     221}}}
     222
     223Nu kunnen we onze chroot omgeving testen:
     224{{{
     225[root@localhost ~]# chroot /chrootedlogin/
     226bash-3.2# ls /
     227bin  boot  chrootedlogin  dev  etc  home  lib  media  mnt  opt  proc  root  sbin  selinux  srv  sys  tmp  usr  var
     228}}}
     229
     230We hebben nu een basis omgeving.
     231
     232== Inloggen in chroot omgeving ==
     233