2 # Thierry Parmentelat - INRIA Sophia Antipolis
10 @echo WARNING: this target is deprecated
11 @echo you might siwh to use the noderepo rpm instead
12 @echo former behaviour is available throuhg make install-obsolete
15 # uses $(PLCSSH) as an ssh address for the destination host
16 # first copies everything on a separate rpm repo, prepares it,
17 # and then renames it into planetlab
19 # Upload packages to boot server
23 PLCSSH:=root@$(PLCHOST)
25 # if nothing's defined : use this default
27 PLCSSH := root@private.one-lab.org
30 RPMSAREA := /var/www/html/install-rpms/
32 BUILD_BASE := $(shell cat .base 2> /dev/null || echo base-undefined)
33 BASENEW := build-$(BUILD_BASE)
34 BASEBAK := planetlab-bak
38 # if make is invoked with -n, run rsync, but with --dry-run
39 RSYNC_COND_DRY_RUN := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,)
40 RSYNC := rsync $(RSYNC_COND_DRY_RUN)
42 INSTALL-TARGETS := install-rpms install-index install-adopt install-bootstrap
43 install-obsolete: $(INSTALL-TARGETS)
44 .PHONY: install install-obsolete $(INSTALL-TARGETS)
47 @echo install-obsolete: $(INSTALL-TARGETS)
49 # compute the exact set of rpms to install - we do not need bootstrapfs nor myplc here
50 node_packages=$(sort $(IN_VSERVER) $(IN_BOOTSTRAPFS))
51 node_rpms=$(foreach package,$(node_packages),$($(package).rpms))
53 install-rpms:RPMS/yumgroups.xml
55 ssh $(PLCSSH) mkdir -p /plc/data/$(RPMSAREA)/$(BASENEW)
57 +$(RSYNC) -v --perms --times --group --compress --rsh=ssh \
58 RPMS/yumgroups.xml $(node_rpms) $(PLCSSH):/plc/data/$(RPMSAREA)/$(BASENEW)/
61 # sign and index new repository
62 ssh $(PLCSSH) chroot /plc/root /etc/plc.d/packages start $(RPMSAREA)/$(BASENEW)/ 2>> install-index.log
65 # sign and index new repository
66 ssh $(PLCSSH) chroot /plc/root /etc/plc.d/packages clean $(RPMSAREA)/$(BASENEW)/ 2>> install-index.log
70 ssh $(PLCSSH) rm -rf /plc/data/$(RPMSAREA)/$(BASEBAK)
72 ssh $(PLCSSH) mv /plc/data/$(RPMSAREA)/$(BASE) /plc/data/$(RPMSAREA)/$(BASEBAK)
74 ssh $(PLCSSH) mv /plc/data/$(RPMSAREA)/$(BASENEW) /plc/data/$(RPMSAREA)/$(BASE)
78 ssh $(PLCSSH) chroot /plc/root yum -y update bootstrapfs