Revision 5293052e

b/Makefile.am
1
osdir=$(OS_DIR)/$(OS_NAME)
2 1
customdir=${sysconfdir}/ganeti/instance-image/hooks
3 2
configdir=${sysconfdir}/ganeti/instance-image
4 3
variantsdir=${sysconfdir}/ganeti/instance-image/variants
5 4
networksdir=${sysconfdir}/ganeti/instance-image/networks
6 5
overlaysdir=${sysconfdir}/ganeti/instance-image/overlays
7
toolsdir=$(OS_DIR)/$(OS_NAME)/tools
6
toolsdir=${osdir}/${osname}/tools
8 7

  
9
dist_os_SCRIPTS = create import export rename verify
10
dist_tools_SCRIPTS = tools/*
11
dist_os_DATA = ganeti_api_version parameters.list
12
dist_config_DATA = variants.list
8
dist_os_SCRIPTS = ${srcdir}/create ${srcdir}/import ${srcdir}/export ${srcdir}/rename ${srcdir}/verify
9
dist_tools_SCRIPTS = ${srcdir}/tools/*
10
dist_os_DATA = ${srcdir}/ganeti_api_version ${srcdir}/parameters.list
11
dist_config_DATA = ${srcdir}/variants.list
13 12
os_DATA = common.sh
14 13

  
15
dist_custom_DATA = example/hooks/*
14
dist_custom_DATA = ${srcdir}/example/hooks/*
16 15

  
17
dist_doc_DATA = COPYING NEWS README
16
dist_doc_DATA = ${srcdir}/COPYING ${srcdir}/NEWS ${srcdir}/README
18 17

  
19 18
EXTRA_DIST = common.sh.in defaults
20 19

  
21
common.sh: common.sh.in 
20
edit = sed \
21
	   -e 's|@sysconfdir[@]|$(sysconfdir)|g' \
22
	   -e 's|@localstatedir[@]|$(localstatedir)|g' \
23
	   -e 's|@osdir[@]|$(osdir)|g' \
24
	   -e 's|@osname[@]|$(osname)|g' \
25
	   -e 's|@AWK[@]|$(AWK)|g' \
26
	   -e 's|@MKDIR_P[@]|$(MKDIR_P)|g' \
27
	   -e 's|@DUMP[@]|$(DUMP)|g' \
28
	   -e 's|@LOSETUP[@]|$(LOSETUP)|g' \
29
	   -e 's|@KPARTX[@]|$(KPARTX)|g' \
30
	   -e 's|@SFDISK[@]|$(SFDISK)|g' \
31
	   -e 's|@QEMU_IMG[@]|$(QEMU_IMG)|g'
32

  
33
common.sh: $(srcdir)/common.sh.in Makefile
34
	rm -f $@ $@.tmp
35
	srcdir=''; \
36
		   test -f ./$@.in || srcdir=$(srcdir)/; \
37
		   $(edit) $${srcdir}$@.in >$@.tmp
38
	mv $@.tmp $@
22 39

  
23 40
install-exec-local:
24
	@mkdir_p@ "$(DESTDIR)$(osdir)"
41
	@mkdir_p@ "$(DESTDIR)$(osdir)/$(osname)"
25 42
	@mkdir_p@ "$(DESTDIR)$(variantsdir)"
26 43
	@mkdir_p@ "$(DESTDIR)$(networksdir)/subnets"
27 44
	@mkdir_p@ "$(DESTDIR)$(networksdir)/instances"
28 45
	@mkdir_p@ "$(DESTDIR)$(overlaysdir)"
29 46
	@mkdir_p@ "$(DESTDIR)$(localstatedir)/cache/ganeti-instance-image"
30 47
	touch "$(DESTDIR)$(variantsdir)/default.conf"
31
	ln -s $(DESTDIR)$(configdir)/variants.list $(DESTDIR)$(osdir)/variants.list
48
	ln -fs $(DESTDIR)$(configdir)/variants.list $(DESTDIR)$(osdir)/variants.list
32 49

  
33 50
CLEANFILES = common.sh
b/common.sh.in
18 18
# 02110-1301, USA.
19 19

  
20 20
AWK="@AWK@"
21
MKDIR_P="@MKDIR_P@"
21 22
DUMP="@DUMP@"
22 23
LOSETUP="@LOSETUP@"
23 24
KPARTX="@KPARTX@"
24 25
SFDISK="@SFDISK@"
25 26
QEMU_IMG="@QEMU_IMG@"
26
MKDIR_P="@MKDIR_P@"
27 27

  
28 28
CLEANUP=( )
29 29

  
......
442 442
: ${OVERLAYS_DIR:="@sysconfdir@/ganeti/instance-image/overlays"}
443 443
: ${IMAGE_DIR:="@localstatedir@/cache/ganeti-instance-image"}
444 444
: ${IMAGE_DEBUG:="no"}
445
: ${TOOLS_DIR:="@OS_DIR@/@OS_NAME@/tools"}
445
: ${TOOLS_DIR:="@osdir@/@osname@/tools"}
446 446

  
447 447
SCRIPT_NAME=$(basename $0)
448 448
KERNEL_PATH="$INSTANCE_HV_kernel_path"
b/configure.ac
10 10
AC_ARG_WITH([os-dir],
11 11
  [AS_HELP_STRING([--with-os-dir=DIR],
12 12
    [top-level OS directory under which to install]
13
    [ (default is $datadir/ganeti/os)]
13
    [ [DATADIR/ganeti/os]]
14 14
  )],
15 15
  [os_dir="$withval"],
16 16
  [os_dir="$datadir/ganeti/os"])
17
AC_SUBST(OS_DIR, $os_dir)
17
AC_SUBST(osdir, $os_dir)
18 18

  
19 19
# --with-os-name=...
20 20
AC_ARG_WITH([os-name],
21 21
  [AS_HELP_STRING([--with-os-name=OSNAME],
22 22
    [the name of the OS provider which will be the directory to install its files]
23
    [ (default is image)]
23
    [ [image]]
24 24
  )],
25 25
  [os_name="$withval"],
26 26
  [os_name="image"])
27
AC_SUBST(OS_NAME, $os_name)
27
AC_SUBST(osname, $os_name)
28 28

  
29 29
# --with-default-dir=...
30 30
AC_ARG_WITH([default-dir],
31 31
  [AS_HELP_STRING([--with-default-dir=DIR],
32 32
    [top-level default config directory under which to install]
33
    [ (default is $sysconfdir/default)]
33
    [ [SYSCONFDIR/default]]
34 34
  )],
35 35
  [default_dir="$withval"],
36 36
  [default_dir="$sysconfdir/default"])
......
69 69

  
70 70
AC_CONFIG_FILES([
71 71
    Makefile
72
    common.sh
73 72
])
74 73

  
75 74
AC_OUTPUT

Also available in: Unified diff