@@ -37,23 +37,16 @@ if ! podman inspect "${buildtag}" >/dev/null 2>&1; then
37
37
fi
38
38
fi
39
39
40
- buildtmp=" $( mktemp -d ) " || error " cannot create build directory"
41
- mkdir -p " ${buildtmp} /out" || error " cannot create output directory"
42
- mkdir -p " ${buildtmp} /etc/dracut.conf.d" || error " cannot create config tree"
43
-
44
- # Copy configuration components in place
45
- cp ./etc/zfsbootmenu/release.yaml " ${buildtmp} /etc"
46
- cp ./etc/zfsbootmenu/dracut.conf.d/* .conf " ${buildtmp} /etc/dracut.conf.d"
47
-
48
- # Files in release.conf.d are allowed to shadow regular defaults
49
- cp ./etc/zfsbootmenu/release.conf.d/* .conf " ${buildtmp} /etc/dracut.conf.d"
50
-
51
40
arch=" $( uname -m ) "
52
41
case " ${arch} " in
53
42
x86_64) BUILD_EFI=" true" ;;
54
43
* ) BUILD_EFI=" false" ;;
55
44
esac
56
45
46
+ buildtmp=" $( mktemp -d ) " || error " cannot create build directory"
47
+ mkdir -p " ${buildtmp} /out" || error " cannot create output directory"
48
+ mkdir -p " ${buildtmp} /etc/dracut.conf.d" || error " cannot create config tree"
49
+
57
50
# Volume mounts for the container; make sure stock config tree, with release
58
51
# addendum, is available in-container at /etc/zfsbootmenu
59
52
volmounts=(
@@ -62,19 +55,6 @@ volmounts=(
62
55
" -v" " ${buildtmp} /out:/out"
63
56
)
64
57
65
- # Specify options for the build st
66
- buildopts=(
67
- " -o" " /out"
68
- " -e" " .EFI.Enabled = ${BUILD_EFI} "
69
- " -c" " /etc/zfsbootmenu/release.yaml"
70
- )
71
-
72
- # For the containerized build, use current repo by mounting at /zbm
73
- # Custom configs and outputs will be in the temp dir, mounted at /build
74
- if ! podman run --rm " ${volmounts[@]} " " ${buildtag} " " ${buildopts[@]} " ; then
75
- error " failed to create image"
76
- fi
77
-
78
58
if ! assets=" $( realpath -e releng ) /assets/${release} " ; then
79
59
error " unable to define path to built assets"
80
60
fi
85
65
mkdir -p " ${assets} "
86
66
fi
87
67
88
- zbmtriplet=" zfsbootmenu-vmlinuz-${arch} -v${release} "
68
+ for style in release recovery; do
69
+ echo " Building style: ${style} "
70
+ # Copy configuration components in place
71
+ cp " ./etc/zfsbootmenu/${style} .yaml" " ${buildtmp} /etc"
72
+ cp ./etc/zfsbootmenu/dracut.conf.d/* .conf " ${buildtmp} /etc/dracut.conf.d"
73
+
74
+ # Files in release.conf.d are allowed to shadow regular defaults
75
+ cp ./etc/zfsbootmenu/" ${style} " .conf.d/* .conf " ${buildtmp} /etc/dracut.conf.d"
76
+
77
+ # Specify options for the build st
78
+ buildopts=(
79
+ " -o" " /out"
80
+ " -e" " .EFI.Enabled = ${BUILD_EFI} "
81
+ " -c" " /etc/zfsbootmenu/${style} .yaml"
82
+ )
83
+
84
+ # For the containerized build, use current repo by mounting at /zbm
85
+ # Custom configs and outputs will be in the temp dir, mounted at /build
86
+ if ! podman run --rm " ${volmounts[@]} " " ${buildtag} " " ${buildopts[@]} " ; then
87
+ error " failed to create image"
88
+ fi
89
+
90
+ zbmtriplet=" zfsbootmenu-${style} -vmlinuz-${arch} -v${release} "
89
91
90
- # EFI file is currently only built on x86_64
91
- if [ " ${BUILD_EFI} " = " true" ]; then
92
- if ! cp " ${buildtmp} /out/vmlinuz.EFI" " ${assets} /${zbmtriplet} .EFI" ; then
93
- error " failed to copy UEFI bundle"
92
+ # EFI file is currently only built on x86_64
93
+ if [ " ${BUILD_EFI} " = " true" ]; then
94
+ if ! cp " ${buildtmp} /out/vmlinuz.EFI" " ${assets} /${zbmtriplet} .EFI" ; then
95
+ error " failed to copy UEFI bundle"
96
+ fi
94
97
fi
95
- fi
96
98
97
- # Nothing to archive if no components were produced
98
- [ -d " ${buildtmp} /out/components" ] || exit 0
99
+ # Nothing to archive if no components were produced
100
+ [ -d " ${buildtmp} /out/components" ] || exit 0
101
+
102
+ zbmtriplet=" zfsbootmenu-${style} -${arch} -v${release} "
103
+ # If components were produced, archive them
104
+ ( cd " ${buildtmp} /out" && mv components " ${zbmtriplet} " && \
105
+ tar czvf " ${assets} /${zbmtriplet} .tar.gz" " ${zbmtriplet} "
106
+ ) || error " failed to pack components"
99
107
100
- zbmtriplet=" zfsbootmenu-${arch} -v${release} "
101
- # If components were produced, archive them
102
- ( cd " ${buildtmp} /out" && mv components " ${zbmtriplet} " && \
103
- tar czvf " ${assets} /${zbmtriplet} .tar.gz" " ${zbmtriplet} "
104
- ) || error " failed to pack components"
108
+ rm " ${buildtmp} " /etc/* .yaml
109
+ rm " ${buildtmp} " /etc/dracut.conf.d/* .conf
110
+ done
0 commit comments