File: README

package info (click to toggle)
base-installer 1.13.4sarge3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 808 kB
  • ctags: 19
  • sloc: sh: 693; ansic: 356; makefile: 45
file content (103 lines) | stat: -rw-r--r-- 3,726 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
On progress bars:

run-debootstrap translates the debootstrap progress stream into debconf
progress bars. There are essentially two ways the progress information from
debootstrap can be dislayed. The naive way is to start a new progress bar
for each new progress id debootstrap dislays; the problem with this
approach is it gives the user no clue as to the overall progress as they
just see a bewildering series of progress bars.

A more sophisticated approach is to use only one logical progress bar, and
know about various debootstrap waypoints, using each as it appears to
update the bar to a given point, and using the more detailed progress
information to keep the bar updating in between. The waypoints we currently
care about, and where the progress bar will be when they complete are
listed in waypoints.h.

Say between 30 and 50%, while downloading debs, debootstrap sends us
progress commands telling us what the current amount done is, and what the
total amount is. For example:

P: 22422934 31625258 DOWNDEBS

This is 22422934 / 31625258 = 70% of the way done with downloading debs.
Since the DOWNDEBS waypoint uses 20% of the progress bar, that scales to
70% of 20, or 14%. So the progress bar should be positioned to 30+14, or
44%.

Since we want to use the same progress bar for both run-debootstrap and
for the end of the base-installer postinst, the actual setup of the
progress bar should happen in base-installer's postinst. Then
run-debootstrap just updates it to 90%, and finally the end of the
postinst takes care of updating it to the final waypoint as it does the
apt-install stuff.


Appendix A: The debootstrap --debian-installer progress stream.

As far as I know, there is no other documentation of the data deboostrap
outputs on fd 3 if run with --debian-installer (except its source). 
But then I have not looked too hard. Here is what I have been able to piece
together.

The stream consists of a number of lines. Each line is of the form:
CODE: arg1 [arg2 .. argn]

The codes are:

P (progress)
arg1 is an integer, the current amount done
arg2 is the total amount of work that must be done for this progress item
arg3 is a unique identifier for the progress item. It may be omitted
sometimes.

P is generally followed by PA and PF to build up a message to dislay. If
they are left off, an earlier info message can be displayed to indicate what
is being done.

PA (progress arguments)
args combine to form the value of one argument

PF (progress format)
args combine to be a progress format string.

PF (progress format)
args combine to form a format string. The info arguments are then
substituted in turn into the %s tokens in the string to form the message to
display to the user to indicate progress.

I (info)
arg1 is an identifier for the information message in question
Generally followed by an IA and IF.

IA (info arguments)
args combine to form the value of one argument

IF (info format)
args combine to form a format string. The info arguments are then
substituted in turn into the %s tokens in the string to form the message to
display to the user to indicate info.

E (error)
arg1 is the id of the error
May be followed by EA, and EF

EA (error arguments)
args combine to form the value of one argument

EF (error format)
args combine to form a format string. The info arguments are then
substituted in turn into the %s tokens in the string to form the error
message.

W (warning)
arg1 is the id of the warning
May be followed by WA, and WF

WA (warning arguments)
args combine to form the value of one argument

WF (warning format)
args combine to form a format string. The info arguments are then
substituted in turn into the %s tokens in the string to form the warning
message.