Gentoo Archives: gentoo-doc-cvs

From: "Sven Vermeulen (swift)" <swift@g.o>
To: gentoo-doc-cvs@l.g.o
Subject: [gentoo-doc-cvs] gentoo commit in xml/htdocs/doc/en: gentoo-upgrading.xml
Date: Sat, 06 Apr 2013 12:07:45
Message-Id: 20130406120740.B0BEC2171D@flycatcher.gentoo.org
1 swift 13/04/06 12:07:40
2
3 Modified: gentoo-upgrading.xml
4 Log:
5 Fix bug #457148 - Add instructions for potentially upgrading very old systems; thanks to Migal Gorny for the instructions
6
7 Revision Changes Path
8 1.46 xml/htdocs/doc/en/gentoo-upgrading.xml
9
10 file : http://sources.gentoo.org/viewvc.cgi/gentoo/xml/htdocs/doc/en/gentoo-upgrading.xml?rev=1.46&view=markup
11 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/xml/htdocs/doc/en/gentoo-upgrading.xml?rev=1.46&content-type=text/plain
12 diff : http://sources.gentoo.org/viewvc.cgi/gentoo/xml/htdocs/doc/en/gentoo-upgrading.xml?r1=1.45&r2=1.46
13
14 Index: gentoo-upgrading.xml
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/gentoo-upgrading.xml,v
17 retrieving revision 1.45
18 retrieving revision 1.46
19 diff -u -r1.45 -r1.46
20 --- gentoo-upgrading.xml 9 Feb 2013 08:46:08 -0000 1.45
21 +++ gentoo-upgrading.xml 6 Apr 2013 12:07:40 -0000 1.46
22 @@ -1,6 +1,6 @@
23 <?xml version='1.0' encoding="UTF-8"?>
24 <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
25 -<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/gentoo-upgrading.xml,v 1.45 2013/02/09 08:46:08 swift Exp $ -->
26 +<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/gentoo-upgrading.xml,v 1.46 2013/04/06 12:07:40 swift Exp $ -->
27
28 <guide>
29 <title>Gentoo Upgrading Guide</title>
30 @@ -23,8 +23,8 @@
31 <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
32 <license/>
33
34 -<version>5</version>
35 -<date>2013-02-09</date>
36 +<version>6</version>
37 +<date>2013-04-06</date>
38
39 <chapter>
40 <title>Gentoo and Upgrades</title>
41 @@ -208,6 +208,25 @@
42
43 </body>
44 </section>
45 +<section>
46 +<title>Upgrading from (too) old systems</title>
47 +<body>
48 +
49 +<p>
50 +Sometimes, systems are too old to easily upgrade. The upgrade path might need
51 +intermediate versions of software (such as portage) that does not exist anymore,
52 +and you might need to update the portage tree in steps (for instance incremental
53 +tree updates with steps of 3 to 4 months).
54 +</p>
55 +
56 +<p>
57 +To upgrade such systems, you can use a recent stage3 to update the system.
58 +Instructions for that are given in the <uri link="#old_system">Updating old
59 +systems</uri> section.
60 +</p>
61 +
62 +</body>
63 +</section>
64 </chapter>
65
66 <chapter id="instructions">
67 @@ -683,4 +702,84 @@
68 </section>
69 </chapter>
70
71 +<chapter id="old_system">
72 +<title>Updating old systems</title>
73 +<section>
74 +<title>Idea of the upgrade</title>
75 +<body>
76 +
77 +<p>
78 +The idea with this upgrade approach is that we create an intermediate build
79 +chroot in which a recent stage3 is extracted. Then, using the tools available in
80 +the stage3 chroot we upgrade the packages on the live system.
81 +</p>
82 +
83 +</body>
84 +</section>
85 +<section>
86 +<title>Preparing the intermediate build chroot</title>
87 +<body>
88 +
89 +<p>
90 +Let's first create the intermediate build chroot location, say
91 +<path>/mnt/build</path>, and extract a recent stage3 archive into it.
92 +</p>
93 +
94 +<pre caption="Preparing the intermediate build chroot">
95 +# <i>mkdir /mnt/build</i>
96 +# <i>tar -xf -C /mnt/build /path/to/stage3-somearch-somedate.tar.bz2</i>
97 +# <i>mount --rbind /dev /mnt/build/dev</i>
98 +# <i>mount --rbind /proc /mnt/build/proc</i>
99 +# <i>mount --rbind /sys /mnt/build/sys</i>
100 +</pre>
101 +
102 +<p>
103 +Next, we create a mount point inside this chroot environment, on which we then
104 +bind-mount the live (old) environment.
105 +</p>
106 +
107 +<pre caption="Create host mountpoint">
108 +# <i>mkdir /mnt/build/mnt/host</i>
109 +# <i>mount --rbind / /mnt/build/mnt/host</i>
110 +</pre>
111 +
112 +<p>
113 +So now the live (old) system is also reachable within
114 +<path>/mnt/build/mnt/host</path>. This will allow us to reach the live (old)
115 +system and update the packages even when chrooted inside the intermediate build
116 +chroot.
117 +</p>
118 +
119 +</body>
120 +</section>
121 +<section>
122 +<title>Chroot and update</title>
123 +<body>
124 +
125 +<p>
126 +We now chroot into the intermediate build location, and start updating vital
127 +packages on the live system, until we can continue updating the live system from
128 +within the live system (rather than through the intermediate build chroot).
129 +</p>
130 +
131 +<pre caption="Chrooting and updating important packages">
132 +# <i>chroot /mnt/build</i>
133 +# <i>source /etc/profile</i>
134 +
135 +<comment># Now we start building packages onto the live system</comment>
136 +# <i>ROOT=/mnt/host emerge -1v portage</i>
137 +</pre>
138 +
139 +<p>
140 +Keep this chrooted session open and try to update the live system. When you hit
141 +failures, you can use this chrooted session to update packages using the build
142 +tools available in the intermediate build chroot (which includes recent glibc,
143 +gcc, etc.) Don't forget to prefix all <c>emerge</c> commands with
144 +<c>ROOT=/mnt/host</c> within the chroot!
145 +</p>
146 +
147 +</body>
148 +</section>
149 +</chapter>
150 +
151 </guide>