Debian Codegraph @

debian/tests/initramfs

raw
1 #!/bin/bash
2
3 set -ex -o pipefail
4
5 find_file() {
6 echo "checking for file $1 in initramfs"
7 FILES=$(find initramfs -name "$1")
8 if [ -z "$FILES" ]; then
9 echo "not found"
10 exit 1
11 fi
12 }
13
14 update-initramfs -kall -u
15 INITRDS=(/boot/initrd.img-*)
16
17 unmkinitramfs "${INITRDS[0]}" initramfs/
18 find initramfs/
19
20 echo "check our modules are installed in initramfs"
21 find_file 'dm-multipath.ko*'
22 find_file 'scsi_dh_alua.ko*'
23
24 echo "check our rules are installed in initramfs"
25 find_file '*-dm-mpath.rules'
26 find_file '*-multipath.rules'
27 find_file '*-dm-parts.rules'
28 find_file '*-del-part-nodes.rules'
29 find_file '*-kpartx.rules'
30
31 echo "check multipath binary is executable"
32 chroot initramfs /usr/sbin/multipath -h
33
34 echo "check helper programs are installed in initramfs"
35 find_file 'grep'
36 find_file 'pidof'