reguire gnupg1 on f>=31; sense the system to use gpg1 when installed
[bootmanager.git] / bootmanager.spec
1 #
2 %define name bootmanager
3 %define version 6.0
4 %define taglevel 0
5
6 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
7
8 Vendor: PlanetLab
9 Packager: PlanetLab Central <support@planet-lab.org>
10 Distribution: PlanetLab %{plrelease}
11 URL: %{SCMURL}
12
13 Summary: The PlanetLab Boot Manager
14 Name: %{name}
15 Version: %{version}
16 Release: %{release}
17 License: BSD
18 Group: System Environment/Base
19 Source0: %{name}-%{version}.tar.gz
20 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
21 # in theory this should be a noarch rpm
22 # however because of libc-opendir-hack (which apparently targets f12 bootCDs)
23 # this is not true anymore and fedora23 won't let us build this as noarch anymore
24 # BuildArch: noarch
25
26 Requires: tar, sharutils, bzip2
27 # see myplc/plc.d/gpg for more details on the gnupg / gpg topic
28 %if "%{distro}" == "Fedora" && %{distrorelease} >= 31
29 Requires: gnupg1
30 %else
31 Requires: gnupg
32 %endif
33
34 # need the apache user at install-time
35 Requires: httpd 
36
37 Requires: plcapi >= 5.2
38 # we need to install these on the myplc side too, although this is suboptimal
39 # b/c this python code gets shipped on the nodes as well
40 Requires: pypcilib pyplnet
41
42 ### avoid having yum complain about updates, as stuff is moving around
43 # plc.d/bootmanager
44 Conflicts: myplc <= 4.3
45 # nodeconfig/boot/*
46 Conflicts: nodeconfig <= 4.3
47
48 AutoReqProv: no
49 %define debug_package %{nil}
50
51 %description
52 The PlanetLab Boot Manager securely authenticates and boots PlanetLab
53 nodes.
54
55 %prep
56 %setup -q
57
58 %build
59 gcc -shared -fPIC -ldl -Os -o source/libc-opendir-hack.so source/libc-opendir-hack.c
60
61 %install
62 rm -rf $RPM_BUILD_ROOT
63
64 # Install source so that it can be rebuilt
65 find build.sh source | cpio -p -d -u $RPM_BUILD_ROOT/%{_datadir}/%{name}/regular/
66
67 install -m 644 README  $RPM_BUILD_ROOT/%{_datadir}/%{name}/README
68
69 # formerly in the nodeconfig module
70 install -D -m 755 nodeconfig/boot/index.php $RPM_BUILD_ROOT/var/www/html/boot/index.php
71 install -D -m 755 nodeconfig/boot/upload-bmlog.php $RPM_BUILD_ROOT/var/www/html/boot/upload-bmlog.php
72 install -D -m 755 nodeconfig/boot/getnodeid.php $RPM_BUILD_ROOT/var/www/html/boot/getnodeid.php
73
74 # formerly in the MyPLC module
75 install -D -m 755 plc.d/bootmanager $RPM_BUILD_ROOT/etc/plc.d/bootmanager
76
77 %clean
78 rm -rf $RPM_BUILD_ROOT
79
80 %post
81 # initialize the boot manager upload area
82 mkdir -p /var/log/bm
83 chown apache:apache /var/log/bm
84 chmod 700 /var/log/bm
85
86 %files
87 %defattr(-,root,root,-)
88 %{_datadir}/%{name}
89 /var/www/html/boot/index.php
90 /var/www/html/boot/upload-bmlog.php
91 /var/www/html/boot/getnodeid.php
92 /etc/plc.d/bootmanager
93
94 %changelog
95 * Mon Jan 07 2019 Thierry <Parmentelat> - bootmanager-6.0-0
96 - * this is STILL BASED ON PYTHON2, but relies on 2 accessory libraries that are pypcilib and pyplnet
97 - for this reason, the relevant files are COPIED at packaging time
98 - * new settings lxc_ROOT_SIZE=12G (was 70G) and SWAP_SIZE=4G (was 1G)
99 - and lxc_TOTAL_MINIMUM_DISK_SIZE=50 (was 120)
100 - * invoke conf_files.py as a plain script (i.e. expects a shebang) since we ideally can still
101 - use this code against a python2 nodemanager
102 - * skip nodeupdate step, will be redone later anyway
103 - * rely on NetworkManager utilities when ifconfig can't be found
104 - * tear down patch for very old 2.6.12 kernels
105 - * a little closer to python3 though
106
107 * Sun Jan 10 2016 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootmanager-5.3-4
108 - runlevelagent was not able to reach myplc because of
109 - server verification that is now implicit in python 2.7.9
110
111 * Tue Dec 08 2015 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootmanager-5.3-3
112 - patch for f23 as of dec. 2015 where kernel and initrd show up in
113 - a new location under /boot
114 - plus bugfix with format and single { and } for awk args
115
116 * Fri Nov 13 2015 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootmanager-5.3-2
117 - not a noarch package anymore (indeed it does come with binaries)
118 - fix ssl connection for runlevelagent for recent pythons
119 - for fedora23, ignore if rsa1 key generation fails
120
121 * Fri Jun 26 2015 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootmanager-5.3-1
122 - Use TLSv1 to connect to myplc, instead of SSLv3 that is known to be broken
123 - Can implement 'upgrade' in addition to 'reinstall' boot state
124 - upgrade does essentially the same as reinstall except that slices are preserved
125 - upgrade works only on nodes already running containers
126 - because /vservers/ needs to be a btrfs filesystem
127 - pycurl is now a strong requirement (old curl-based code removed)
128 - bugfix for ssh key generation (were all typed rsa1)
129 - a lot of prettification
130
131 * Wed Jul 16 2014 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootmanager-5.2-5
132 - runs AnsibleHook, that optionnally runs playbooks (by default, usual behaviour)
133 - introduces the ONE_PARTITION configuration variable
134 - some suport for chainbooting ubuntu
135
136 * Mon Apr 28 2014 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootmanager-5.2-4
137 - no functional change, only tweaks in Makefile for interating with test environment
138
139 * Tue Mar 25 2014 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootmanager-5.2-3
140 - some old f18 bootCDs do not support mkfs.btrfs -f
141 - so invoke this option only when supported
142
143 * Fri Mar 21 2014 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootmanager-5.2-2
144 - conf_files.py is expected in /usr/share/NodeManager, not in /etc/init.d any more
145 - smarter for locating initrd, for f20
146 - add -f to mkfs.btrfs - sometimes hangs otherwise
147
148 * Thu Mar 07 2013 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootmanager-5.2-1
149 - merged the branches for vserver and lxc
150 - requires the rest of 5.2 - notably 'virt' in GetNodeFlavour
151 - note that WriteModprobeConfig and MakeInitrd are turned off for lxc nodes
152 - also note that fsck management for btrfs/lxc is still weak
153 - vs_ROOT_SIZE=14G lxc_ROOT_SIZE=70G
154 - vs_TOTAL_MINIMUM_DISK_SIZE=50G lxc_TOTAL_MINIMUM_DISK_SIZE=120G
155 - expects ntpd to be turned on in the nodeimage
156
157 * Fri Feb 22 2013 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootmanager-5.1-5
158 - fix for heterogeneous bootimage/nodeimage
159
160 * Thu Feb 21 2013 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootmanager-5.1-4
161 - Turn off WriteModprobeConfig for f18
162 - enable btrfs quota
163 - fix very old ssh DSA key generation
164
165 * Tue Oct 16 2012 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootmanager-5.1-3
166 - run parted with --script to keep it from hanging
167
168 * Fri Aug 31 2012 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootmanager-5.0-24
169 - run parted with --script to avoid it to hang
170
171 * Wed Jul 18 2012 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootmanager-5.1-2
172 - pour the 5.0-22 and 5.0-23 features into the lxc mix
173
174 * Mon Jul 09 2012 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootmanager-5.0-23
175 - added support for disks larger than 2Tb using gpt instead of msdos
176
177 * Tue May 15 2012 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootmanager-5.0-22
178 - bootmanager log clearly states duration of download and extraction of node image
179
180 * Fri Apr 13 2012 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootmanager-5.1-1
181 - first working draft for dealing with f16 nodes
182 - not expected to work with mainline nodes (use 5.0 for that for now)
183
184 * Fri Apr 13 2012 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootmanager-5.0-21
185 - no significant change, just checkpoint as 5.1 is addressing lxc
186
187 * Thu Jul 07 2011 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootmanager-5.0-20
188 - be more explicit on the node conf_file actually used
189 - did this after a former PLC node tried to boot at PLE with its PLC plnode.txt still on a usb stick
190
191 * Fri Jun 10 2011 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootmanager-5.0-19
192 - nicer log - was intended for previous tag
193
194 * Wed Jun 08 2011 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootmanager-5.0-18
195 - {Start,Stop,}RunLevelAgent now ship with bootmanager
196 - new UpdateLastBootOnce
197 - root_size bumped to 14Gb which is more in line with modern h/w
198 - more safely tries to umount /dev/ and /sys
199 - support for raid partitions
200 - mkswap -f
201 - blacklist files from /etc/modprobe.conf/* instead
202
203 * Thu Feb 17 2011 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootmanager-5.0-17
204 - on install of boostrapfs, keep track in /bm-install.log with date & flavour
205
206 * Sun Jan 23 2011 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootmanager-5.0-16
207 - for f14 : try to mount /dev as devtmpfs before bind-mounting to on the hdd's /dev
208 - fix for chosing version of parted - for f14
209 - added support for virtio deveices in /dev/vd
210 - fixed scanning of new disks
211 - slightly reviewed logs - default mode is verbose
212 - removed deprecated mkinitrd.sh
213
214 * Fri Dec 10 2010 S.Çağlar Onur <caglar@cs.princeton.edu> - bootmanager-5.0-15
215 - Fix problems caused by shell redirection
216
217 * Thu Dec 09 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootmanager-5.0-14
218 - tag 5.0-13 is broken
219
220 * Wed Dec 08 2010 S.Çağlar Onur <caglar@cs.princeton.edu> - bootmanager-5.0-13
221 - Add support for uploading bash_history to a central server for failboot nodes.
222 - Start to use subprocess instead of deprecated popen2 module
223 - Fix typo for VSERVERS_SIZE
224 - Add --allow-missing parameter to support different kernel configs with mkinitrd
225
226 * Thu Aug 26 2010 S.Çağlar Onur <caglar@cs.princeton.edu> - bootmanager-5.0-12
227 - Revert "replace deprecated popen2 with subprocess"
228
229 * Wed Aug 11 2010 S.Çağlar Onur <caglar@cs.princeton.edu> - bootmanager-5.0-11
230 - replace deprecated popen2 with subprocess and handle fsck return codes in a different code path
231
232 * Fri Jul 30 2010 S.Çağlar Onur <caglar@cs.princeton.edu> - bootmanager-5.0-10
233 - Fix typo
234
235 * Fri Jul 30 2010 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - bootmanager-5.0-9
236 - fix typo
237
238 * Wed Jul 28 2010 S.Çağlar Onur <caglar@cs.princeton.edu> - bootmanager-5.0-8
239 - disable time/count based filesystem checks
240
241 * Tue Jul 27 2010 S.Çağlar Onur <caglar@cs.princeton.edu> - bootmanager-5.0-7
242 - Fix new disk additions to LVM array
243
244 * Wed Jul 07 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootManager-5.0-6
245 - bugfix for centos5/python2.4 missing hashlib
246
247 * Mon Jul 05 2010 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - BootManager-5.0-5
248 - check sha1sum of downloaded bootstrapfs
249 - try recovering filesystem errors
250
251 * Wed Jun 23 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootManager-5.0-4
252 - nicer initscript now uses 'action' from /etc/init.d/functions
253 - bugfix for nodes with extensions
254
255 * Fri Apr 02 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootManager-5.0-3
256 - create /etc/planetlab if missing
257 - uses key 'ssh_rsa_key' in BootUpdateNode (requires PLCAPI-5.0.5)
258
259 * Sat Feb 13 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootManager-5.0-2
260 - caglar's change to run MkInitrd right before kexec
261 - plus clean up old code
262
263 * Fri Jan 29 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootManager-5.0-1
264 - first working version of 5.0:
265 - pld.c/, db-config.d/ and nodeconfig/ scripts should now sit in the module they belong to
266 - uses PLCAPI's GetNodeFlavour to get all info on the bootstrapfs tarball(s) to install
267 - installation layout on the plc side has changed, more consistent for e.g. 'alpha' bootmanagers
268
269 * Sat Jan 09 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootManager-4.3-16
270 - support for fedora 12
271
272 * Sat Dec 19 2009 Marc Fiuczynski <mef@cs.princeton.edu> - BootManager-4.3-15
273 - - support for when the node is behind a NAT
274 - - clean up RUN_LEVEL support
275 - - support for early sshd
276
277 * Thu Nov 19 2009 Daniel Hokka Zakrisson <daniel@hozac.com> - BootManager-4.3-14
278 - Add NAT model option for nodes which don't resolve properly.
279
280 * Mon Sep 07 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - BootManager-4.3-12
281 - Moved some configuration values from BootServerRequest.py to 'configuration' file.
282 - BootServerRequest takes the 'VARS' variable to read these values.
283 - UPLOAD_LOG_SCRIPT can point optionally to the 'upload-bmlog.php' or 'monitor/upload'
284 - (or any other interface that accepts a POST file)
285 - build.sh bundles cacerts for boot and monitor servers (if present) to
286 - authenticate the UPLOAD_LOG_SCRIPT.
287 - Previously, these certs were re-used from the bootcd, now they are bundled
288 - with BM.  This allows the BM to point to a completely different myplc if
289 - desired, and it is still secure, because the original download is
290 - authenticated.
291
292 * Wed Aug 26 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - BootManager-4.3-11
293 - raise a single exception for nodes with authentication errors
294 - fix syntax error in MakeInitrd.py
295
296 * Mon Aug 10 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - BootManager-4.3-10
297 - Replace UpdateBootstate with UpdateRunlevel where appropriate.
298 - Removed failboot and install from forced states.
299 - Removed checks for initrd in Validate
300 - Added extra messages for Validate failures, not-installed, no kernel, failed fsck
301 - Added libc-opendir-hack.so patch from 3.2 branch for 2.6.12 bootcds on PL.
302
303 * Mon Jun 29 2009 Marc Fiuczynski <mef@cs.princeton.edu> - BootManager-4.3-9
304 - Special handling for "forcedeth" ethernet NIC.
305
306 * Mon Jun 15 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - BootManager-4.3-8
307 - include a fix for public pl dealing with old/new boot images and root
308 - environments
309
310 * Fri May 15 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootManager-4.3-7
311 - review selection nodefamily at bootstrapfs install-time
312 - now based on (1) tags (2) nodefamily and (3) defaults
313 - this is required on very old bootcd
314
315 * Wed Apr 29 2009 Marc Fiuczynski <mef@cs.princeton.edu> - BootManager-4.3-6
316 - Use modprobe module to write out /etc/modprobe.conf.
317
318 * Wed Apr 22 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootManager-4.3-5
319 - minor updates - using the new modprobe module *not* in this tag
320
321 * Wed Apr 08 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootManager-4.3-4
322 - load device mapper if needed, for centos5-based bootcd variant
323
324 * Wed Mar 25 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootManager-4.3-3
325 - renumbered 4.3
326 - New step StartRunLevelAgent
327 - various other tweaks
328
329 * Wed Jan 28 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootManager-4.3-2
330 - most of the actual network config job moved to (py)plnet
331 - support for RAWDISK
332 - network interfaces deterministically sorted
333 - does not use nodegroups anymore for getting node arch and other extensions
334 - drop yum-based extensions
335 - debug sshd started as early as possible
336 - timestamped and uploadable logs (requires upload-bmlog.php from nodeconfig/)
337 - cleaned up (drop support for bootcdv2)
338 - still needs testing
339
340 * Wed Sep 10 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootManager-4.3-1
341 - reflects new names from the data model
342
343 * Sat May 24 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootManager-3.2-7
344 - dont unload cpqphp
345
346 * Thu Apr 24 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootManager-3.2-6
347 - changes in the state automaton logic 
348 - root+swap = 7G
349 - usb-key threshhold increased to 17 G
350 - bootstrafs selection logic altered - uses /etc/planetlab/nodefamily instead of GetPlcRelease
351
352 * Wed Mar 26 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - BootManager-3.2-4 BootManager-3.2-5
353 - renamed step InstallBootstrapRPM into InstallBootstrapFS
354 - reviewed selection of bootstrapfs, based on nodegroups, for multi-arch deployment
355 - import pypcimap rather than pypciscan
356 - initial downlaoding of plc_config made more robust
357 - root and /vservers file systems mounted ext3
358 - calls to BootGetNodeDetails replaced with GetNodes/GetNodeNetworks
359 - also seems to be using session-based authentication rather than former hmac-based one
360
361 * Fri Feb 08 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootmanager-3.2-3 bootmanager-3.2-4
362 - usage of wireless attributes fixed and tested
363 - breakpoints cleaned up (no change for production)
364 - less alarming message when floppy does not get unloaded
365
366 * Thu Jan 31 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - bootmanager-3.2-2 bootmanager-3.2-3
367 - network config : support the full set of settings from ifup-wireless - see also http://svn.planet-lab.org/svn/MyPLC/tags/myplc-4.2-1/db-config
368 - removes legacy calls to PlanetLabConf.py 
369 - refrains from unloading floppy 
370 - first draft of the dual-method for implementing extensions (bootstrapfs-like images or yum install)
371
372 * Fri Sep  2 2005 Mark Huang <mlhuang@cotton.CS.Princeton.EDU> - 
373 - Initial build.
374