2 # Thierry Parmentelat - INRIA Sophia Antipolis
10 # uses $(PLCSSH) as an ssh address for the destination host
11 # first copies everything on a separate rpm repo, prepares it,
12 # and then renames it into planetlab
14 # Upload packages to boot server
18 PLCSSH:=root@$(PLCHOST)
20 # if nothing's defined : use this default
22 PLCSSH := root@private.one-lab.org
25 RPMSAREA := /var/www/html/install-rpms/
27 BUILD_BASE := $(shell cat .base)
28 BASENEW := build-$(BUILD_BASE)
29 BASEBAK := planetlab-bak
33 # if make is invoked with -n, run rsync, but with --dry-run
34 RSYNC_COND_DRY_RUN := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,)
35 RSYNC := rsync $(RSYNC_COND_DRY_RUN)
37 INSTALL-TARGETS := install-rpms install-index install-adopt install-bootstrap
38 install: $(INSTALL-TARGETS)
39 .PHONY: install $(INSTALL-TARGETS)
42 @echo install: $(INSTALL-TARGETS)
44 # compute the exact set of rpms to install - we do not need bootstrapfs nor myplc here
45 node_packages=$(sort $(IN_VSERVER) $(IN_BOOTSTRAPFS))
46 node_rpms=$(foreach package,$(node_packages),$($(package).rpms))
48 install-rpms:RPMS/yumgroups.xml
50 ssh $(PLCSSH) mkdir -p /plc/data/$(RPMSAREA)/$(BASENEW)
52 +$(RSYNC) -v --perms --times --group --compress --rsh=ssh \
53 RPMS/yumgroups.xml $(node_rpms) $(PLCSSH):/plc/data/$(RPMSAREA)/$(BASENEW)/
56 # sign and index new repository
57 ssh $(PLCSSH) chroot /plc/root /etc/plc.d/packages start $(RPMSAREA)/$(BASENEW)/ 2>> install-index.log
60 # sign and index new repository
61 ssh $(PLCSSH) chroot /plc/root /etc/plc.d/packages clean $(RPMSAREA)/$(BASENEW)/ 2>> install-index.log
65 ssh $(PLCSSH) rm -rf /plc/data/$(RPMSAREA)/$(BASEBAK)
67 ssh $(PLCSSH) mv /plc/data/$(RPMSAREA)/$(BASE) /plc/data/$(RPMSAREA)/$(BASEBAK)
69 ssh $(PLCSSH) mv /plc/data/$(RPMSAREA)/$(BASENEW) /plc/data/$(RPMSAREA)/$(BASE)
73 ssh $(PLCSSH) chroot /plc/root yum -y update bootstrapfs