tools/mkrpm: allow different rpm package name

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Config.mk: move directory list into BUILD_MAKE_VARS

To maintain the list of directories in a single place, move the existing
list into its own variable and use it in buildmakevars2file.
Required for upcoming changes.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Config.mk: replace dependency to genpath with actual target

genpath is a detail of buildmakevars2file. Replace the dependency to
genpath with the actual buildmakevars2file target. This change by itself
does not fix any bug. Upcoming changes will add dependencies to
$(target), but no rule exist to create $(target).

With this change a rule for $(target) is added, which in turn depends on
genpath. No change in behaviour is expected by this patch.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Config.mk: add new macro buildmakevars2header

This macro is similar to buildmakevars2file, it just creates a C header
file instead of shell style syntax. Upcoming changes will use this macro
in libxl and libxc.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
tools/libxl: use buildmakevars2header to create _paths.h

Replace usage of buildmakevars2file with buildmakevars2header. The macro
generates a C header file, so remove code which converts shell variables
into C defines. Also update the dependency, the macro itself creates a
dependency to genpath for _paths.h. A temporary file is not needed
anymore.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
tools/libxc: provide variable paths to libxc

In preparation to remove hardcoded /var/run/xen paths, provide
XEN_RUN_DIR and related directories to xc_private.h. Similar code exists
already for libxl, stubdom and other parts.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
tools/libxc: use XEN_RUN_DIR for SUSPEND_LOCK_FILE

Remove hardcoded /var/run/xen directory path, use XEN_RUN_DIR instead.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/pygrub: store kernels in /var/run/xen/pygrub

Move location of temporary bootfiles from /var/run/xend/boot to
/var/run/xen/pygrub. Create the subdirectory if does not exist, unless
--output-directory=<dir> was specified.

The reason for this change is that all entrys below /var/run have to be
created at runtime in case /var/run is cleared on every boot.

v4:
 update mkdir exception handling
v3:
 use /var/run/xen/pygrub instead of /var/run/pygrub
v2:
 update exception handling for python 2.4

Signed-off-by: Olaf Hering <olaf@aepfle.de>
tools/hotplug: use XEN_SCRIPT_DIR instead of hardcoded path

Helper scripts get installed into XEN_SCRIPT_DIR, but initscripts,
helper scripts and udev rules still refer to the hardcoded location
/etc/xen/scripts/. Update scripts, rules and Makefile to refer to
@@XEN_SCRIPT_DIR@@ instead.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
tools/hotplug: create XEN_RUN_DIR at runtime

Create XEN_RUN_DIR instead of hardcoded path at runtime.
/var/run might be empty on startup.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
tools/hotplug: create XEN_LOCK_DIR at runtime

XEN_LOCK_DIR is a compile-time setting and may not exist on the target
host.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
tools/examples: remove obsolete install targets

install-hotplug and install-udev are obsolete since commit 57bcfa11
("tools/hotplug: Separate OS-specific scripts.")

Signed-off-by: Olaf Hering <olaf@aepfle.de>
remove obsolete SUBSYS_DIR variable

/var/run is a runtime directory. It is not supposed to be packaged. The
xendomains runlevel script checks at runtime if /var/run/subsys or
/var/run has to be used. Remove the unused SUBSYS_DIR variable from
Config.mk and distro_mapping.txt.

Signed-off-by: Olaf Hering <olaf@aepfle.de>