/
mdadm_%.bbappend
43 lines (36 loc) · 1.48 KB
/
mdadm_%.bbappend
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#
# Use a "here" document, as it saves the SRC_URI and FILES_PN
# stuff for something otherwise so simple.
#
do_install:append() {
cat <<EOF > ${S}/mdadm.conf.sample
# mdadm.conf
#
# Please refer to mdadm.conf(5) for information about this file.
#
# Remember! If this file lives in your initrd, then changing it
# here is only 1/2 the job. You will also need to update the initrd
# version; either with initrd-tools "update-initramfs" or manually via:
#
# mv /boot/initramfs-3.17.6-cube-standard.img /boot/initramfs-3.17.6-cube-standard.img~
# cd /tmp
# rm -rf x ; mkdir x ; cd x
# zcat /boot/initramfs-3.17.6-cube-standard.img~ | cpio -id -H newc
# cp -a /etc/mdadm/mdadm.conf ./etc/mdadm/mdadm.conf
# find . | cpio -o -H newc |gzip -9 > /boot/initramfs-3.17.6-cube-standard.img
# by default, scan all partitions (/proc/partitions) for MD superblocks.
# alternatively, specify devices to scan, using wildcards if desired.
DEVICE partitions
# auto-create devices with Debian standard permissions
CREATE owner=root group=disk mode=0660 auto=yes
# automatically tag new arrays as belonging to the local system
HOMEHOST <system>
# instruct the monitoring daemon where to send mail alerts
MAILADDR root
# sample definitions of existing MD arrays
# ARRAY /dev/md0 metadata=1.2 devices=/dev/sda1,/dev/sdb1
# ARRAY /dev/md0 level=raid0 num-devices=2 UUID=a533f2d7:056ebe90:eb55ac39:69133cc1
EOF
install -d -m 755 ${D}${sysconfdir}/mdadm
install -m 644 ${S}/mdadm.conf.sample ${D}${sysconfdir}/mdadm/mdadm.conf
}