Skip to content

Commit ae7f4fd

Browse files
aplanasjuliogonzalez
authored andcommitted
Relax the name of assets
KIWI change the name of some assets (like the kernel or initrd files) in newer versions. This change relax the name, and drop the support for append.
1 parent 7f8d0ed commit ae7f4fd

5 files changed

+44
-23
lines changed

containment-rpm-pxe.changes

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1+
-------------------------------------------------------------------
2+
Fri Feb 28 15:51:21 UTC 2020 - Alberto Planas Dominguez <aplanas@suse.com>
3+
4+
- Update to version 0.2.1:
5+
* Relax the name of asset
6+
17
-------------------------------------------------------------------
28
Thu Feb 27 14:13:41 UTC 2020 - Alberto Planas Dominguez <aplanas@suse.com>
39

410
- Update to version 0.2:
511
* Support old PXE and new OEM PXE Kiwi images
612
* Be explicit on bash dependency
713
* Add example for rpm-properties.xml
8-
* spec-clean the spec.in file
914
- Add _service to fetch code from openSUSE's github
1015
- Require perl-TimeDate for changelog2spec call and fdupes
1116

containment-rpm-pxe.spec

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818

1919
Name: containment-rpm-pxe
20-
Version: 0.2
20+
Version: 0.2.1
2121
Release: 0
2222
Summary: Wraps OBS/kiwi-built PXE images in rpms.
2323
License: MIT

image.spec.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ install -p -m 644 __SOURCE_MD5_IMAGE__ %{buildroot}__TARGET_IMAGE__/__MD5_IMAGE_
5656
%if %{type} == oem
5757
install -p -m 644 __SOURCE_KERNEL_IMAGE__ %{buildroot}__TARGET_IMAGE__/__KERNEL_IMAGE__
5858
install -p -m 644 __SOURCE_INITRD_IMAGE__ %{buildroot}__TARGET_IMAGE__/__INITRD_IMAGE__
59-
install -p -m 644 __SOURCE_BOOTOPTIONS__ %{buildroot}__TARGET_IMAGE__/__BOOTOPTIONS__
59+
# install -p -m 644 __SOURCE_BOOTOPTIONS__ %{buildroot}__TARGET_IMAGE__/__BOOTOPTIONS__
6060
install -p -m 644 __SOURCE_APPEND__ %{buildroot}__TARGET_IMAGE__/__APPEND__
6161
%endif
6262
%endif

kiwi_post_run

+30-14
Original file line numberDiff line numberDiff line change
@@ -61,24 +61,32 @@ parse_source() {
6161
;;
6262
*.install.tar)
6363
_cfg['type']='oem'
64-
_cfg['sourcekernelboot']="pxeboot.${_cfg[name]}.${_cfg[arch]}-${_cfg[version]}.kernel"
65-
_cfg['sourceinitrdboot']="pxeboot.${_cfg[name]}.${_cfg[arch]}-${_cfg[version]}.initrd.xz"
66-
_cfg['sourceimage']="${_cfg[name]}.${_cfg[arch]}-${_cfg[version]}.xz"
64+
# "pxeboot.${_cfg[name]}.${_cfg[arch]}-${_cfg[version]}.kernel"
65+
_cfg['sourcekernelboot']="pxeboot*.kernel"
66+
# "pxeboot.${_cfg[name]}.${_cfg[arch]}-${_cfg[version]}.initrd.xz"
67+
_cfg['sourceinitrdboot']="pxeboot*.initrd.xz"
68+
# "${_cfg[name]}.${_cfg[arch]}-${_cfg[version]}.xz"
69+
_cfg['sourceimage']="${_cfg[name]}*.xz"
6770
;;
6871
*)
6972
echo "ERROR: Unkown image type for ${source}"
7073
exit 1
7174
;;
7275
esac
73-
_cfg['sourcemd5image']="${_cfg[name]}.${_cfg[arch]}-${_cfg[version]}.md5"
76+
# "${_cfg[name]}.${_cfg[arch]}-${_cfg[version]}.md5"
77+
_cfg['sourcemd5image']="${_cfg[name]}*.md5"
7478

75-
# It could not apply, but is good to have a sane default here, the
76-
# spec file macro will skip over those values
77-
_cfg['sourcekernelimage']="${_cfg[name]}.${_cfg[arch]}-${_cfg[version]}.kernel"
78-
_cfg['sourceinitrdimage']="${_cfg[name]}.${_cfg[arch]}-${_cfg[version]}.initrd"
79+
# It could not apply, but is good to have a sane defaults here,
80+
# the spec file macro will skip over those values
81+
# "${_cfg[name]}.${_cfg[arch]}-${_cfg[version]}.kernel"
82+
_cfg['sourcekernelimage']="${_cfg[name]}*.kernel"
83+
# "${_cfg[name]}.${_cfg[arch]}-${_cfg[version]}.initrd"
84+
_cfg['sourceinitrdimage']="${_cfg[name]}*.initrd"
7985
# https://github.com/OSInside/kiwi/issues/1346
80-
_cfg['sourcebootoptions']="pxeboot.${_cfg[name]}.${_cfg[arch]}-${_cfg[version]}.config.bootoptions"
81-
_cfg['sourceappend']="${_cfg[name]}.${_cfg[arch]}-${_cfg[version]}.append"
86+
# "pxeboot.${_cfg[name]}.${_cfg[arch]}-${_cfg[version]}.config.bootoptions"
87+
_cfg['sourcebootoptions']="*.config.bootoptions"
88+
# "${_cfg[name]}.${_cfg[arch]}-${_cfg[version]}.append"
89+
_cfg['sourceappend']="${_cfg[name]}*.append"
8290
}
8391

8492
untar_source() {
@@ -116,13 +124,21 @@ parse_properties_xml() {
116124
['initrdboot']='initrd'
117125
['ignoreimage']='false'
118126
['image']="${_cfg[sourceimage]}"
119-
['md5image']="${_cfg[sourcemd5image]}"
120-
['kernelimage']="${_cfg[sourcekernelimage]}"
121-
['initrdimage']="${_cfg[sourceinitrdimage]}"
127+
# "${_cfg[sourcemd5image]}"
128+
['md5image']="${_cfg[name]}.${_cfg[arch]}-${_cfg[version]}.md5"
129+
# "${_cfg[sourcekernelimage]}"
130+
['kernelimage']="${_cfg[name]}.${_cfg[arch]}-${_cfg[version]}.kernel"
131+
# "${_cfg[sourceinitrdimage]}"
132+
['initrdimage']="${_cfg[name]}.${_cfg[arch]}-${_cfg[version]}.initrd"
122133
# https://github.com/OSInside/kiwi/issues/1346
123134
['bootoptions']="${_cfg[name]}-${_cfg[arch]}-${_cfg[version]}.config.bootoptions"
124-
['append']="${_cfg[sourceappend]}"
135+
# "${_cfg[sourceappend]}"
136+
['append']="${_cfg[name]}.${_cfg[arch]}-${_cfg[version]}.append"
125137
)
138+
if [ "${_cfg[type]}" == "oem" ]; then
139+
_cfg['image']="${_cfg[name]}.${_cfg[arch]}-${_cfg[version]}.xz"
140+
fi
141+
126142
for key in "${!_cfg[@]}"; do
127143
if [ "${_cfg[$key]}" == "''" -o -z "${_cfg[$key]}" ]; then
128144
_cfg[$key]="${default[$key]-}"

rpm-properties.xml.example

+6-6
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@
3131

3232
<!-- Optional, one line, default: ${targetboot}/image -->
3333
<targetimage>/srv/tftpboot/image</targetimage>
34-
<!-- Optional, one line, default: ${name}-${arch}-${version}.xz -->
34+
<!-- Optional, one line, default: ${name}.${arch}-${version}.xz -->
3535
<image>pxe-opensuse-image.xz</image>
36-
<!-- Optional, one line, default: ${name}-${arch}-${version}.md5 -->
36+
<!-- Optional, one line, default: ${name}.${arch}-${version}.md5 -->
3737
<md5image>pxe-opensuse-image.md5</md5image>
3838

39-
<!-- Optional, one line, default: ${name}-${arch}-${version}.kernel -->
39+
<!-- Optional, one line, default: ${name}.${arch}-${version}.kernel -->
4040
<kernelimage>pxe-opensuse-image.kernel</kernelimage>
41-
<!-- Optional, one line, default: ${name}-${arch}-${version}.initrd -->
41+
<!-- Optional, one line, default: ${name}.${arch}-${version}.initrd -->
4242
<initrdimage>pxe-opensuse-image.initrd</initrdimage>
43-
<!-- Optional, one line, default: ${name}-${arch}-${version}.config.bootoptions -->
43+
<!-- Optional, one line, default: ${name}.${arch}-${version}.config.bootoptions -->
4444
<bootoptions>pxe-opensuse-image.config.bootoptions</bootoptions>
45-
<!-- Optional, one line, default: ${name}-${arch}-${version}.append -->
45+
<!-- Optional, one line, default: ${name}.${arch}-${version}.append -->
4646
<append>pxe-opensuse-image.config.append</append>
4747
</props>

0 commit comments

Comments
 (0)