Debian Codegraph @

dracut/modules.d/55kiwi-live/module-setup.sh

raw
1 #!/bin/bash
2
3 # called by dracut
4 check() {
5 # a live host-only image doesn't really make a lot of sense
6 declare hostonly=${hostonly}
7 [[ ${hostonly} ]] && return 1
8 return 255
9 }
10
11 # called by dracut
12 depends() {
13 echo network rootfs-block dm
14 return 0
15 }
16
17 # called by dracut
18 installkernel() {
19 instmods squashfs loop aoe brd iso9660 overlay
20 }
21
22 # called by dracut
23 install() {
24 declare moddir=${moddir}
25 declare systemdutildir=${systemdutildir}
26 declare dracutbasedir=${dracutbasedir}
27 local dmsquashdir=
28 inst_multiple -o checkmedia
29 inst_multiple \
30 umount dmsetup partx blkid lsblk dd losetup \
31 grep cut find wc fdisk tail mkfs.ext4 mkfs.xfs \
32 dialog cat mountpoint curl dolly dd cryptsetup veritysetup \
33 flock udevadm sed
34
35 dmsquashdir=$(find "${dracutbasedir}/modules.d" -name "*dmsquash-live")
36 if [ -n "${dmsquashdir}" ] && \
37 [ -f "${dmsquashdir}/parse-iso-scan.sh" ] && \
38 [ -f "${dmsquashdir}/iso-scan.sh" ]; then
39 inst_hook cmdline 31 "${dmsquashdir}/parse-iso-scan.sh"
40 inst_script "${dmsquashdir}/iso-scan.sh" "/sbin/iso-scan"
41 fi
42
43 inst_hook cmdline 30 "${moddir}/parse-kiwi-live.sh"
44 inst_hook pre-udev 30 "${moddir}/kiwi-live-genrules.sh"
45 inst_hook pre-udev 60 "${moddir}/kiwi-live-net-genrules.sh"
46 inst_hook pre-mount 30 "${moddir}/kiwi-live-checkmedia.sh"
47 inst_script "${moddir}/kiwi-live-root.sh" "/sbin/kiwi-live-root"
48 inst_script "${moddir}/kiwi-generator.sh" \
49 "${systemdutildir}/system-generators/dracut-kiwi-generator"
50 inst_simple "${moddir}/kiwi-live-lib.sh" "/lib/kiwi-live-lib.sh"
51 inst_rules 60-cdrom_id.rules
52 dracut_need_initqueue
53 }