~ubuntu-branches/ubuntu/utopic/mdadm/utopic

« back to all changes in this revision

Viewing changes to .pc/debian/conffile-location.diff/Makefile

  • Committer: Package Import Robot
  • Author(s): Dmitrijs Ledkovs
  • Date: 2012-06-15 15:31:59 UTC
  • mfrom: (1.1.30 sid)
  • Revision ID: package-import@ubuntu.com-20120615153159-9lp7jykbq7vua4bo
Tags: 3.2.5-1ubuntu1
* Merge from Debian testing. (LP: #920324)  Remaining changes:
  - Call checks in local-premount to avoid race condition with udev
    and opening a degraded array.
  - d/initramfs/mdadm-functions: Record in /run when boot-degraded 
    question has been asked so that it is only asked once
  - pass --test to mdadm to enable result codes for degraded arrays. 
  - debian/control: we need udev and util-linux in the right version. We
    also remove the build dependency from quilt and docbook-to-man as both
    are not used in Ubuntus mdadm.
  - debian/initramfs/hook: kept the Ubuntus version for handling the absence
    of active raid arrays in <initramfs>/etc/mdadm/mdadm.conf
  - debian/initramfs/script.local-top.DEBIAN, debian/mdadm-startall,
    debian/mdadm.raid.DEBIAN: removed. udev does its job now instead.
  - debian/mdadm-startall.sgml, debian/mdadm-startall.8: documentation of
    unused startall script
  - debian/mdadm.config, debian/mdadm.postinst - let udev do the handling
    instead. Resolved merge conflict by keeping Ubuntu's version.
  - debian/mdadm.postinst, debian/mdadm.config, initramfs/init-premount:
    boot-degraded enablement; maintain udev starting of RAID devices;
    init-premount hook script for the initramfs, to provide information at
    boot
  - debian/mkconf.in is the older mkconf. Kept the Ubuntu version.
  - debian/rules: Kept Ubuntus version for installing apport hooks, not
    installing un-used startall script.
  - debian/install-rc, check.d/_numbers, check.d/root_on_raid: Ubuntu partman
    installer changes
  - debian/presubj: Dropped this unused bug reporting file. Instead use
    source_mdadm.py act as an apport hook for bug handling.
  - d/p/debian-changes-3.1.4-1+8efb9d1ubuntu4: mdadm udev rule
    incrementally adds mdadm member when detected. Starting such an
    array in degraded mode is possible by mdadm -IRs. Using mdadm
    -ARs without stopping the array first does nothing when no
    mdarray-unassociated device is available. Using mdadm -IRs to
    start a previously partially assembled array through incremental
    mode. Keeping the mdadm -ARs for assembling arrays which were for
    some reason not assembled through incremental mode (i.e through
    mdadm's udev rule).

* Additional Ubuntu changes:
    - debian/initramfs/local-premount: add call wait_for_udev to wait a
    little longer for RAID devices to appear (LP: #942106)

* Dropped Ubuntu changes:
  - Build udeb with -O2 on ppc64, working around a link error. Builds
    fine without it on debian.
  - rename debian/mdadm.vol_id.udev to debian/mdadm.mdadm-blkid.udev so
    that the rules file ends up with a more reasonable name. debian/rules
    changes for adding ubuntu's udev rule corresponding to mdadm. As we
    are now using 'upstream' udev rules see 3.2.3-2ubuntu2.

* Changes to Ubuntu changes:
  - debian/source_mdadm.py: make apport hook python 2 and 3 compatible
    (LP: #1013171).

* New upstream release closes this bugs:
  - mdadm --detail --scan segfaults during update-initramfs (LP: #969384)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#
2
 
# mdadm - manage Linux "md" devices aka RAID arrays.
3
 
#
4
 
# Copyright (C) 2001-2002 Neil Brown <neilb@cse.unsw.edu.au>
5
 
#
6
 
#
7
 
#    This program is free software; you can redistribute it and/or modify
8
 
#    it under the terms of the GNU General Public License as published by
9
 
#    the Free Software Foundation; either version 2 of the License, or
10
 
#    (at your option) any later version.
11
 
#
12
 
#    This program is distributed in the hope that it will be useful,
13
 
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 
#    GNU General Public License for more details.
16
 
#
17
 
#    You should have received a copy of the GNU General Public License
18
 
#    along with this program; if not, write to the Free Software
19
 
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20
 
#
21
 
#    Author: Neil Brown
22
 
#    Email: <neilb@cse.unsw.edu.au>
23
 
#    Paper: Neil Brown
24
 
#           School of Computer Science and Engineering
25
 
#           The University of New South Wales
26
 
#           Sydney, 2052
27
 
#           Australia
28
 
#
29
 
 
30
 
# define "CXFLAGS" to give extra flags to CC.
31
 
# e.g.  make CXFLAGS=-O to optimise
32
 
TCC = tcc
33
 
UCLIBC_GCC = $(shell for nm in i386-uclibc-linux-gcc i386-uclibc-gcc; do which $$nm > /dev/null && { echo $$nm ; exit; } ; done; echo false No uclibc found )
34
 
#DIET_GCC = diet gcc
35
 
# sorry, but diet-libc doesn't know about posix_memalign, 
36
 
# so we cannot use it any more.
37
 
DIET_GCC = gcc -DHAVE_STDINT_H
38
 
 
39
 
KLIBC=/home/src/klibc/klibc-0.77
40
 
 
41
 
KLIBC_GCC = gcc -nostdinc -iwithprefix include -I$(KLIBC)/klibc/include -I$(KLIBC)/linux/include -I$(KLIBC)/klibc/arch/i386/include -I$(KLIBC)/klibc/include/bits32
42
 
 
43
 
CC = $(CROSS_COMPILE)gcc
44
 
CXFLAGS = -ggdb
45
 
CWFLAGS = -Wall -Werror -Wstrict-prototypes -Wextra -Wno-unused-parameter
46
 
ifdef WARN_UNUSED
47
 
CWFLAGS += -Wp,-D_FORTIFY_SOURCE=2 -O
48
 
endif
49
 
 
50
 
ifdef DEBIAN
51
 
CPPFLAGS := -DDEBIAN
52
 
else
53
 
CPPFLAGS :=
54
 
endif
55
 
ifdef DEFAULT_OLD_METADATA
56
 
 CPPFLAG += -DDEFAULT_OLD_METADATA
57
 
 DEFAULT_METADATA=0.90
58
 
else
59
 
 DEFAULT_METADATA=1.2
60
 
endif
61
 
 
62
 
SYSCONFDIR = /etc
63
 
CONFFILE = $(SYSCONFDIR)/mdadm.conf
64
 
CONFFILE2 = $(SYSCONFDIR)/mdadm/mdadm.conf
65
 
MAILCMD =/usr/sbin/sendmail -t
66
 
CONFFILEFLAGS = -DCONFFILE=\"$(CONFFILE)\" -DCONFFILE2=\"$(CONFFILE2)\"
67
 
# Both MAP_DIR and MDMON_DIR should be somewhere that persists across the
68
 
# pivotroot from early boot to late boot.
69
 
# /dev is an odd place to put this, but it is the only directory that
70
 
# meets the requirements.
71
 
MAP_DIR=/dev/.mdadm
72
 
MAP_FILE = map
73
 
MDMON_DIR = /dev/.mdadm
74
 
# place for autoreplace cookies
75
 
FAILED_SLOTS_DIR = /dev/.mdadm/failed-slots
76
 
DIRFLAGS = -DMAP_DIR=\"$(MAP_DIR)\" -DMAP_FILE=\"$(MAP_FILE)\"
77
 
DIRFLAGS += -DMDMON_DIR=\"$(MDMON_DIR)\"
78
 
DIRFLAGS += -DFAILED_SLOTS_DIR=\"$(FAILED_SLOTS_DIR)\"
79
 
CFLAGS = $(CWFLAGS) $(CXFLAGS) -DSendmail=\""$(MAILCMD)"\" $(CONFFILEFLAGS) $(DIRFLAGS)
80
 
 
81
 
# The glibc TLS ABI requires applications that call clone(2) to set up
82
 
# TLS data structures, use pthreads until mdmon implements this support
83
 
USE_PTHREADS = 1
84
 
ifdef USE_PTHREADS
85
 
CFLAGS += -DUSE_PTHREADS
86
 
MON_LDFLAGS += -pthread
87
 
endif
88
 
 
89
 
# If you want a static binary, you might uncomment these
90
 
# LDFLAGS = -static
91
 
# STRIP = -s
92
 
 
93
 
INSTALL = /usr/bin/install
94
 
DESTDIR = 
95
 
BINDIR  = /sbin
96
 
MANDIR  = /usr/share/man
97
 
MAN4DIR = $(MANDIR)/man4
98
 
MAN5DIR = $(MANDIR)/man5
99
 
MAN8DIR = $(MANDIR)/man8
100
 
 
101
 
OBJS =  mdadm.o config.o policy.o mdstat.o  ReadMe.o util.o maps.o lib.o \
102
 
        Manage.o Assemble.o Build.o \
103
 
        Create.o Detail.o Examine.o Grow.o Monitor.o dlink.o Kill.o Query.o \
104
 
        Incremental.o \
105
 
        mdopen.o super0.o super1.o super-ddf.o super-intel.o bitmap.o \
106
 
        super-mbr.o super-gpt.o \
107
 
        restripe.o sysfs.o sha1.o mapfile.o crc32.o sg_io.o msg.o \
108
 
        platform-intel.o probe_roms.o
109
 
 
110
 
CHECK_OBJS = restripe.o sysfs.o maps.o lib.o
111
 
 
112
 
SRCS =  $(patsubst %.o,%.c,$(OBJS))
113
 
 
114
 
INCL = mdadm.h part.h bitmap.h
115
 
 
116
 
MON_OBJS = mdmon.o monitor.o managemon.o util.o maps.o mdstat.o sysfs.o \
117
 
        config.o policy.o lib.o \
118
 
        Kill.o sg_io.o dlink.o ReadMe.o super0.o super1.o super-intel.o \
119
 
        super-mbr.o super-gpt.o \
120
 
        super-ddf.o sha1.o crc32.o msg.o bitmap.o \
121
 
        platform-intel.o probe_roms.o
122
 
 
123
 
MON_SRCS = $(patsubst %.o,%.c,$(MON_OBJS))
124
 
 
125
 
STATICSRC = pwgr.c
126
 
STATICOBJS = pwgr.o
127
 
 
128
 
ASSEMBLE_SRCS := mdassemble.c Assemble.c Manage.c config.c policy.c dlink.c util.c \
129
 
        maps.c lib.c \
130
 
        super0.c super1.c super-ddf.c super-intel.c sha1.c crc32.c sg_io.c mdstat.c \
131
 
        platform-intel.c probe_roms.c sysfs.c super-mbr.c super-gpt.c
132
 
ASSEMBLE_AUTO_SRCS := mdopen.c
133
 
ASSEMBLE_FLAGS:= $(CFLAGS) -DMDASSEMBLE
134
 
ifdef MDASSEMBLE_AUTO
135
 
ASSEMBLE_SRCS += $(ASSEMBLE_AUTO_SRCS)
136
 
ASSEMBLE_FLAGS += -DMDASSEMBLE_AUTO
137
 
endif
138
 
 
139
 
all : mdadm mdmon
140
 
man : mdadm.man md.man mdadm.conf.man mdmon.man raid6check.man
141
 
 
142
 
everything: all mdadm.static swap_super test_stripe \
143
 
        mdassemble mdassemble.auto mdassemble.static mdassemble.man \
144
 
        mdadm.Os mdadm.O2 man
145
 
everything-test: all mdadm.static swap_super test_stripe \
146
 
        mdassemble.auto mdassemble.static mdassemble.man \
147
 
        mdadm.Os mdadm.O2 man
148
 
# mdadm.uclibc and mdassemble.uclibc don't work on x86-64
149
 
# mdadm.tcc doesn't work..
150
 
 
151
 
mdadm : $(OBJS)
152
 
        $(CC) $(CFLAGS) $(LDFLAGS) -o mdadm $(OBJS) $(LDLIBS)
153
 
 
154
 
mdadm.static : $(OBJS) $(STATICOBJS)
155
 
        $(CC) $(CFLAGS) $(LDFLAGS) -static -o mdadm.static $(OBJS) $(STATICOBJS)
156
 
 
157
 
mdadm.tcc : $(SRCS) $(INCL)
158
 
        $(TCC) -o mdadm.tcc $(SRCS)
159
 
 
160
 
mdadm.klibc : $(SRCS) $(INCL)
161
 
        rm -f $(OBJS) 
162
 
        $(CC) -nostdinc -iwithprefix include -I$(KLIBC)/klibc/include -I$(KLIBC)/linux/include -I$(KLIBC)/klibc/arch/i386/include -I$(KLIBC)/klibc/include/bits32 $(CFLAGS) $(SRCS)
163
 
 
164
 
mdadm.Os : $(SRCS) $(INCL)
165
 
        $(CC) -o mdadm.Os $(CFLAGS) $(LDFLAGS) -DHAVE_STDINT_H -Os $(SRCS)
166
 
 
167
 
mdadm.O2 : $(SRCS) $(INCL) mdmon.O2
168
 
        $(CC) -o mdadm.O2 $(CFLAGS) $(LDFLAGS) -DHAVE_STDINT_H -O2 -D_FORTIFY_SOURCE=2 $(SRCS)
169
 
 
170
 
mdmon.O2 : $(MON_SRCS) $(INCL) mdmon.h
171
 
        $(CC) -o mdmon.O2 $(CFLAGS) $(LDFLAGS) $(MON_LDFLAGS) -DHAVE_STDINT_H -O2 -D_FORTIFY_SOURCE=2 $(MON_SRCS)
172
 
 
173
 
# use '-z now' to guarantee no dynamic linker interactions with the monitor thread
174
 
mdmon : $(MON_OBJS)
175
 
        $(CC) $(CFLAGS) $(LDFLAGS) $(MON_LDFLAGS) -Wl,-z,now -o mdmon $(MON_OBJS) $(LDLIBS)
176
 
msg.o: msg.c msg.h
177
 
 
178
 
test_stripe : restripe.c mdadm.h
179
 
        $(CC) $(CXFLAGS) $(LDFLAGS) -o test_stripe -DMAIN restripe.c
180
 
 
181
 
raid6check : raid6check.o mdadm.h $(CHECK_OBJS)
182
 
        $(CC) $(CXFLAGS) $(LDFLAGS) -o raid6check raid6check.o $(CHECK_OBJS)
183
 
 
184
 
mdassemble : $(ASSEMBLE_SRCS) $(INCL)
185
 
        rm -f $(OBJS)
186
 
        $(DIET_GCC) $(ASSEMBLE_FLAGS) -o mdassemble $(ASSEMBLE_SRCS)  $(STATICSRC)
187
 
 
188
 
mdassemble.static : $(ASSEMBLE_SRCS) $(INCL)
189
 
        rm -f $(OBJS)
190
 
        $(CC) $(LDFLAGS) $(ASSEMBLE_FLAGS) -static -DHAVE_STDINT_H -o mdassemble.static $(ASSEMBLE_SRCS) $(STATICSRC)
191
 
 
192
 
mdassemble.auto : $(ASSEMBLE_SRCS) $(INCL) $(ASSEMBLE_AUTO_SRCS)
193
 
        rm -f mdassemble.static
194
 
        $(MAKE) MDASSEMBLE_AUTO=1 mdassemble.static
195
 
        mv mdassemble.static mdassemble.auto
196
 
 
197
 
mdassemble.uclibc : $(ASSEMBLE_SRCS) $(INCL)
198
 
        rm -f $(OJS)
199
 
        $(UCLIBC_GCC) $(ASSEMBLE_FLAGS) -DUCLIBC -DHAVE_STDINT_H -static -o mdassemble.uclibc $(ASSEMBLE_SRCS) $(STATICSRC)
200
 
 
201
 
# This doesn't work
202
 
mdassemble.klibc : $(ASSEMBLE_SRCS) $(INCL)
203
 
        rm -f $(OBJS)
204
 
        $(KLIBC_GCC) $(ASSEMBLE_FLAGS) -o mdassemble $(ASSEMBLE_SRCS)
205
 
 
206
 
mdadm.8 : mdadm.8.in
207
 
        sed -e 's/{DEFAULT_METADATA}/$(DEFAULT_METADATA)/g' mdadm.8.in > mdadm.8
208
 
 
209
 
mdadm.man : mdadm.8
210
 
        nroff -man mdadm.8 > mdadm.man
211
 
 
212
 
mdmon.man : mdmon.8
213
 
        nroff -man mdmon.8 > mdmon.man
214
 
 
215
 
md.man : md.4
216
 
        nroff -man md.4 > md.man
217
 
 
218
 
mdadm.conf.man : mdadm.conf.5
219
 
        nroff -man mdadm.conf.5 > mdadm.conf.man
220
 
 
221
 
mdassemble.man : mdassemble.8
222
 
        nroff -man mdassemble.8 > mdassemble.man
223
 
 
224
 
raid6check.man : raid6check.8
225
 
        nroff -man raid6check.8 > raid6check.man
226
 
 
227
 
$(OBJS) : $(INCL) mdmon.h
228
 
$(MON_OBJS) : $(INCL) mdmon.h
229
 
 
230
 
sha1.o : sha1.c sha1.h md5.h
231
 
        $(CC) $(CFLAGS) -DHAVE_STDINT_H -o sha1.o -c sha1.c
232
 
 
233
 
install : mdadm mdmon install-man install-udev
234
 
        $(INSTALL) -D $(STRIP) -m 755 mdadm $(DESTDIR)$(BINDIR)/mdadm
235
 
        $(INSTALL) -D $(STRIP) -m 755 mdmon $(DESTDIR)$(BINDIR)/mdmon
236
 
 
237
 
install-static : mdadm.static install-man
238
 
        $(INSTALL) -D $(STRIP) -m 755 mdadm.static $(DESTDIR)$(BINDIR)/mdadm
239
 
 
240
 
install-tcc : mdadm.tcc install-man
241
 
        $(INSTALL) -D $(STRIP) -m 755 mdadm.tcc $(DESTDIR)$(BINDIR)/mdadm
242
 
 
243
 
install-uclibc : mdadm.uclibc install-man
244
 
        $(INSTALL) -D $(STRIP) -m 755 mdadm.uclibc $(DESTDIR)$(BINDIR)/mdadm
245
 
 
246
 
install-klibc : mdadm.klibc install-man
247
 
        $(INSTALL) -D $(STRIP) -m 755 mdadm.klibc $(DESTDIR)$(BINDIR)/mdadm
248
 
 
249
 
install-man: mdadm.8 md.4 mdadm.conf.5 mdmon.8
250
 
        $(INSTALL) -D -m 644 mdadm.8 $(DESTDIR)$(MAN8DIR)/mdadm.8
251
 
        $(INSTALL) -D -m 644 mdmon.8 $(DESTDIR)$(MAN8DIR)/mdmon.8
252
 
        $(INSTALL) -D -m 644 md.4 $(DESTDIR)$(MAN4DIR)/md.4
253
 
        $(INSTALL) -D -m 644 mdadm.conf.5 $(DESTDIR)$(MAN5DIR)/mdadm.conf.5
254
 
 
255
 
install-udev: udev-md-raid.rules
256
 
        $(INSTALL) -D -m 644 udev-md-raid.rules $(DESTDIR)/lib/udev/rules.d/64-md-raid.rules
257
 
 
258
 
uninstall:
259
 
        rm -f $(DESTDIR)$(MAN8DIR)/mdadm.8 $(DESTDIR)$(MAN8DIR)/mdmon.8 $(DESTDIR)$(MAN4DIR)/md.4 $(DESTDIR)$(MAN5DIR)/mdadm.conf.5 $(DESTDIR)$(BINDIR)/mdadm
260
 
 
261
 
test: mdadm mdmon test_stripe swap_super
262
 
        @echo "Please run 'sh ./test' as root"
263
 
 
264
 
clean : 
265
 
        rm -f mdadm mdmon $(OBJS) $(MON_OBJS) $(STATICOBJS) core *.man \
266
 
        mdadm.tcc mdadm.uclibc mdadm.static *.orig *.porig *.rej *.alt .merge_file_* \
267
 
        mdadm.Os mdadm.O2 mdmon.O2 \
268
 
        mdassemble mdassemble.static mdassemble.auto mdassemble.uclibc \
269
 
        mdassemble.klibc swap_super \
270
 
        init.cpio.gz mdadm.uclibc.static test_stripe raid6check raid6check.o mdmon \
271
 
        mdadm.8
272
 
 
273
 
dist : clean
274
 
        ./makedist
275
 
 
276
 
testdist : everything-test clean
277
 
        ./makedist test
278
 
 
279
 
TAGS :
280
 
        etags *.h *.c
281
 
 
282
 
DISTRO_MAKEFILE := $(wildcard distropkg/Makefile)
283
 
ifdef DISTRO_MAKEFILE
284
 
include $(DISTRO_MAKEFILE)
285
 
endif
286