simp-rake-helpers 7.0.0 → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 17a61d8752d73045b67c31db5865a27333eb179929cbe3547077293196212f9a
4
- data.tar.gz: 3a207e85eb8c285d67cf1f013db9da5f9ce4bef508eea997d796cd3b08632e99
3
+ metadata.gz: 882585049719ee4df781d182924138c7422ab0ce8f5bdb60b54a3c04eac0e107
4
+ data.tar.gz: 4ebd1cc72cf822f153f1b505deab527992aa010a72206ad18add3eaa5e8b57db
5
5
  SHA512:
6
- metadata.gz: cd50a6943242009704ebb20410c4ed70b14af882268b648d6dd5ffbaf206c2394e2244b93bee220e6b40d96baeb86048dd8b8b0cd026afdc1b6c369d0a6f0f89
7
- data.tar.gz: 891d1280e437f99c3a8fdba93b20d7931bfb6e3eaa86887a1eb9e5567f241505436a569eb057f805d979d188b84d92d2a312256fd8f43d5f01df4e2900d51ff1
6
+ metadata.gz: 2b2cc59ab90334947814df84ca0cf9a1c4377c9e73e29ae02aafc77d7a72d0551281f33de9f23c1c41ca351aa2fca10c79be774a093066e4d6b415671a37ef3c
7
+ data.tar.gz: 6f4f3288db92dcba114a32e3ab675d01de4c6d65d596d00147c4d743693416b6173d74d5381924a8c624715e4aad56b372a9946fe68fb0873f2f9211b0ee30e6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,28 @@
1
+ ### 7.1.0 / 2026-11-25
2
+ - Added
3
+ - `build:auto` builds EL9 ISOs. SIMP 7 accepts EL8, EL9 and EL10 media;
4
+ EL10 media, which have no `isolinux` or `efiboot.img`, can't be built yet
5
+ - `unpack` identifies vendor media from its `.treeinfo`, so AlmaLinux,
6
+ Rocky, CentOS Stream and current RHEL ISOs unpack whatever their file
7
+ names
8
+ - Changed
9
+ - The build distribution is the OS family (`RedHat`) rather than its name,
10
+ so the AlmaLinux and Rocky build containers use the `RedHat` tree without
11
+ `SIMP_BUILD_distro`
12
+ - ISOs are built with `xorrisofs`, falling back to `mkisofs`, and boot
13
+ with whichever of `isolinux` (BIOS) and `efiboot.img` (UEFI) the media has
14
+ - `iso:build` always warns when it skips media that `vermap.yaml` doesn't
15
+ map to the SIMP version, not only with `SIMP_ISO_verbose=yes`
16
+ - Fixed
17
+ - `unpack` failed when no version was given
18
+
19
+ ### 7.0.1 / 2026-10-14
20
+ - Fixed
21
+ - RPM builds for SIMP 7 failed with `Could not find template for SIMP
22
+ version 7.0.0-...`, because the RPM spec template was looked up only
23
+ for the exact SIMP major. A SIMP major without its own template now uses
24
+ the newest older one (`simp6.spec` for SIMP 7)
25
+
1
26
  ### 7.0.0 / 2026-10-05
2
27
  - Changed
3
28
  - **BREAKING:** `pkg:compare_latest_tag` decides whether a Puppet module
data/Gemfile CHANGED
@@ -27,6 +27,6 @@ group :test do
27
27
  # rubocop, rubocop-rake, and rubocop-rspec are pulled in and version-pinned by
28
28
  # voxpupuli-test; pinning them here conflicts with its constraints.
29
29
  # rubocop-performance is not a voxpupuli-test dependency, so it stays explicit.
30
- gem 'rubocop-performance', '~> 1.26.0'
30
+ gem 'rubocop-performance', '~> 1.27.0'
31
31
  end
32
32
 
@@ -22,9 +22,12 @@ module Simp::Rake::Build::Constants
22
22
  distro, version, arch = ENV['SIMP_BUILD_distro'].split(%r{,|/})
23
23
  end
24
24
 
25
- @build_distro = distro || Facter.fact('operatingsystem').value
26
- @build_version = version || Facter.fact('operatingsystemmajrelease').value
27
- @build_arch = arch || Facter.fact('architecture').value
25
+ # The OS family, not its name: simp-core builds every RHEL-compatible
26
+ # OS (RHEL, AlmaLinux, Rocky, ...) from `build/distributions/RedHat`
27
+ os = Facter.value(:os) || {}
28
+ @build_distro = distro || os['family']
29
+ @build_version = version || os.dig('release', 'major')
30
+ @build_arch = arch || os['architecture']
28
31
 
29
32
  # Working around the SIMP::RPM.system_dist workaround
30
33
  if ENV['SIMP_RPM_dist'].nil? && @build_distro =~ %r{CentOS|RedHat}i
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'simp/rake'
4
4
  require 'simp/rake/build/constants'
5
+ require 'simp/rake/build/media'
5
6
 
6
7
  module Simp; end
7
8
  module Simp::Rake; end
@@ -143,36 +144,18 @@ class Simp::Rake::Build::Iso < Rake::TaskLib
143
144
 
144
145
  # Process each unpacked base OS ISO directory found
145
146
  iso_dirs.each do |dir|
146
- baseosver = '???'
147
- arch = '???'
148
-
149
- # read the .treeinfo file (INI format)
150
- # ------------------------------------
151
- require 'puppet'
152
- require 'puppet/util/inifile'
153
-
154
147
  file = "#{dir}/.treeinfo"
155
148
  raise("ERROR: no file '#{file}'") unless File.file?(file)
156
149
 
157
- ini = Puppet::Util::IniConfig::PhysicalFile.new(file)
158
- ini.read
159
- sections = ini.sections.map { |s| s.name }
160
-
161
- # NOTE: RHEL7 discs claim [general] section is deprecated.
162
- if sections.include?('general')
163
- h = ini.get_section('general').entries.to_h { |k, v| [k, v] }
164
- arch = h.fetch('arch', arch).strip
165
- baseosver = h.fetch('version', baseosver).strip
166
- baseosver += '.0' if baseosver.count('.') < 1
167
- end
168
- # ------------------------------------
150
+ treeinfo = Simp::Rake::Build::Media.read_treeinfo(file)
151
+ arch = treeinfo['arch'] || '???'
152
+ baseosver = treeinfo['version'] || '???'
153
+ baseosver += '.0' if baseosver.count('.') < 1
169
154
 
170
155
  # Skip if SIMP version doesn't match target base OS version
171
156
  unless Array(vermap[simpver.split('.').first]).include?(baseosver.split('.').first)
172
- if verbose
173
- warn("Could not find SIMP version mapping for #{simpver} for Base OS #{baseosver}")
174
- warn('Do you need to update vermap.yaml in the Gem?')
175
- end
157
+ warn("Skipping #{dir}: could not find SIMP version mapping for #{simpver} for Base OS #{baseosver}")
158
+ warn('Do you need to update vermap.yaml in the Gem?')
176
159
 
177
160
  next
178
161
  end
@@ -426,37 +409,15 @@ class Simp::Rake::Build::Iso < Rake::TaskLib
426
409
  simp_output_name = "SIMP-#{simpver}-#{baseos}-#{baseosver}-#{arch}"
427
410
  @simp_output_iso = "#{simp_output_name}.iso"
428
411
 
429
- mkisofs_cmd = [
430
- 'mkisofs',
431
- "-A SIMP-#{simpver}",
432
- "-V SIMP-#{simpver}",
433
- "-volset SIMP-#{simpver}",
434
- '-uid 0',
435
- '-gid 0',
436
- '-J',
437
- '-joliet-long',
438
- '-r',
439
- '-v',
440
- '-T',
441
- '-b isolinux/isolinux.bin',
442
- '-c boot.cat',
443
- '-boot-load-size 4',
444
- '-boot-info-table',
445
- '-no-emul-boot',
446
- '-eltorito-alt-boot',
447
- '-e images/efiboot.img',
448
- # This is apparently needed twice to get the lines above it to
449
- # take. Not sure why.
450
- '-no-emul-boot',
451
- '-m TRANS.TBL',
452
- '-x ./lost+found',
453
- "-o #{@simp_output_iso}",
454
- dir,
455
- ].join(' ')
456
-
457
- $stdout.puts "Running: #{mkisofs_cmd}"
458
-
459
- system(mkisofs_cmd)
412
+ # xorriso's mkisofs emulation; genisoimage isn't in EL9+
413
+ mkisofs = ['xorrisofs', 'mkisofs'].find { |cmd| Facter::Core::Execution.which(cmd) }
414
+ raise('Error: Could not find xorrisofs or mkisofs. Please install xorriso.') unless mkisofs
415
+
416
+ mkisofs_cmd = [mkisofs] + Simp::Rake::Build::Media.mkisofs_args(dir, "SIMP-#{simpver}", @simp_output_iso)
417
+
418
+ $stdout.puts "Running: #{mkisofs_cmd.join(' ')}"
419
+
420
+ system(*mkisofs_cmd)
460
421
  end
461
422
  end
462
423
 
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Simp; end
4
+ module Simp::Rake; end
5
+ module Simp::Rake::Build; end
6
+
7
+ # Helpers for identifying vendor install media and building ISOs from them
8
+ module Simp::Rake::Build::Media
9
+ # `.treeinfo` families that SIMP builds as `RedHat`
10
+ RHEL_FAMILIES = %r{\A(Red Hat|RHEL|CentOS|AlmaLinux|Rocky|Oracle|Scientific)}i.freeze
11
+
12
+ # Returns the `[general]` family, version and arch of a `.treeinfo` file
13
+ # (the productmd INI file at the root of every RHEL-family install tree).
14
+ # Missing values are nil.
15
+ def self.read_treeinfo(file)
16
+ require 'puppet'
17
+ require 'puppet/util/inifile'
18
+
19
+ ini = Puppet::Util::IniConfig::PhysicalFile.new(file)
20
+ ini.read
21
+ general = ini.get_section('general')
22
+ h = general ? general.entries.to_h { |k, v| [k, v] } : {}
23
+
24
+ ['family', 'version', 'arch'].to_h { |k| [k, h[k]&.strip] }
25
+ end
26
+
27
+ # The SIMP build distribution name for a `.treeinfo` family, or nil when
28
+ # the family isn't RHEL-compatible. simp-core keeps one tree for all of
29
+ # them, under `build/distributions/RedHat`.
30
+ def self.baseos(family)
31
+ 'RedHat' if family.to_s.match?(RHEL_FAMILIES)
32
+ end
33
+
34
+ # Returns the arguments for `xorrisofs` (or `mkisofs`) to make a bootable
35
+ # ISO of `dir`, booting with whichever El Torito images `dir` has:
36
+ # `isolinux/isolinux.bin` for BIOS and `images/efiboot.img` for UEFI.
37
+ def self.mkisofs_args(dir, label, output)
38
+ bios = File.exist?(File.join(dir, 'isolinux', 'isolinux.bin'))
39
+ uefi = File.exist?(File.join(dir, 'images', 'efiboot.img'))
40
+
41
+ unless bios || uefi
42
+ raise("Error: '#{dir}' has neither isolinux/isolinux.bin (BIOS) nor images/efiboot.img (UEFI) to boot from")
43
+ end
44
+
45
+ args = ['-A', label, '-V', label, '-volset', label,
46
+ '-uid', '0', '-gid', '0', '-J', '-joliet-long', '-r', '-v',
47
+ '-c', 'boot.cat']
48
+ args += ['-b', 'isolinux/isolinux.bin', '-boot-load-size', '4', '-boot-info-table', '-no-emul-boot'] if bios
49
+ args << '-eltorito-alt-boot' if bios && uefi
50
+ args += ['-e', 'images/efiboot.img', '-no-emul-boot'] if uefi
51
+ # A full path: xorrisofs doesn't match 'lost+found' as a bare name
52
+ args + ['-m', 'TRANS.TBL', '-m', File.join(dir, 'lost+found'), '-o', output, dir]
53
+ end
54
+ end
@@ -2,6 +2,8 @@
2
2
 
3
3
  require 'ruby-progressbar'
4
4
  require 'simp/rake/build/constants'
5
+ require 'simp/rake/build/media'
6
+ require 'tmpdir'
5
7
 
6
8
  module Simp; end
7
9
  module Simp::Rake; end
@@ -18,8 +20,9 @@ class Simp::Rake::Build::Unpack < Rake::TaskLib
18
20
  def define_tasks
19
21
  # !/usr/bin/rake -T
20
22
 
21
- # desc "Unpack an ISO. Unpacks either a RHEL or CentOS ISO into
22
- # <targetdir>/<RHEL|CentOS><version>-<arch>.
23
+ # desc "Unpack an ISO. Unpacks a RHEL-compatible ISO into
24
+ # <targetdir>/RedHat<version>-<arch>, identifying it from its
25
+ # .treeinfo (or, without one, from a rhel-server-* or CentOS-* name).
23
26
  # * :iso_path - Full path to the ISO image to unpack.
24
27
  # * :merge - If true, then automatically merge any existing
25
28
  # directories. Defaults to prompting.
@@ -55,6 +58,14 @@ class Simp::Rake::Build::Unpack < Rake::TaskLib
55
58
  `file --keep-going '#{iso_path}'`.split(':')[1..].to_s.include?('ISO') or
56
59
  raise 'Error: The file provided is not a valid ISO.'
57
60
 
61
+ # Identify the media from its .treeinfo
62
+ treeinfo = Dir.mktmpdir do |tmp|
63
+ file = File.join(tmp, 'treeinfo')
64
+ system("#{iso_info} -R -x /.treeinfo -i '#{iso_path}' > '#{file}' 2>/dev/null")
65
+ Simp::Rake::Build::Media.read_treeinfo(file) unless File.empty?(file)
66
+ end
67
+ baseos = Simp::Rake::Build::Media.baseos(treeinfo && treeinfo['family'])
68
+
58
69
  pieces = File.basename(iso_path, '.iso').split('-')
59
70
 
60
71
  # Mappings of ISO name to target directory name.
@@ -77,7 +88,11 @@ class Simp::Rake::Build::Unpack < Rake::TaskLib
77
88
  }
78
89
 
79
90
  # Determine the target directory
80
- map = dvd_map[pieces[0]]
91
+ map = if baseos
92
+ { 'baseos' => baseos, 'version' => version || treeinfo['version'], 'arch' => treeinfo['arch'] }
93
+ else
94
+ dvd_map[pieces[0]]
95
+ end
81
96
  map.nil? and raise "Error: Could not find a mapping for '#{iso_path}'."
82
97
  out_dir = "#{File.expand_path(targetdir)}/#{map['baseos']}#{map['version']}-#{map['arch']}"
83
98
 
@@ -119,7 +134,7 @@ class Simp::Rake::Build::Unpack < Rake::TaskLib
119
134
  end
120
135
 
121
136
  # The repodata directory needs to exist (but not be copied) for el7 distros
122
- FileUtils.mkdir("#{out_dir}/repodata") if version.start_with?('7')
137
+ FileUtils.mkdir_p("#{out_dir}/repodata") if map['version'].to_s.start_with?('7')
123
138
  end
124
139
  end
125
140
  end
@@ -1,4 +1,5 @@
1
1
  ---
2
+ "7": ["8","9","10"]
2
3
  "6": ["6","7","8"]
3
4
  "5": "7"
4
5
  "4": "6"
@@ -8,4 +8,4 @@ gem_sources = ENV.key?('SIMP_GEM_SERVERS') ? ENV['SIMP_GEM_SERVERS'].split(/[,
8
8
 
9
9
  gem_sources.each { |gem_source| source gem_source }
10
10
 
11
- gem 'simp-rake-helpers', '~> 6.0'
11
+ gem 'simp-rake-helpers', '~> 7.0'
@@ -9,18 +9,26 @@ class Simp::Rake::Helpers
9
9
 
10
10
  include Simp::Rake::Build::Constants
11
11
 
12
+ TEMPLATE_DIR = File.join(File.dirname(__FILE__), 'assets', 'rpm_spec')
13
+
14
+ # The RPM spec template for a SIMP version: simp<N>.spec for the newest N
15
+ # that does not exceed the version's major, so a new SIMP major keeps
16
+ # using the previous template until it needs a different one. Without a
17
+ # version, simpdefault.spec.
12
18
  def rpm_template(simp_version = nil)
13
19
  simp_version = ENV.fetch('SIMP_BUILD_version', simp_version)
14
20
 
15
- simp_main_version = if simp_version
16
- simp_version.split('.').first
17
- else
18
- 'default'
19
- end
20
-
21
- template_file = File.join(File.dirname(__FILE__), 'assets', 'rpm_spec', "simp#{simp_main_version}.spec")
22
-
23
- raise "Error: Could not find template for SIMP version #{simp_version}" unless File.exist?(template_file)
21
+ template_file = if simp_version
22
+ simp_main_version = simp_version.split('.').first.to_i
23
+ versioned = Dir.glob(File.join(TEMPLATE_DIR, 'simp[0-9]*.spec')).map do |file|
24
+ [File.basename(file)[%r{\d+}].to_i, file]
25
+ end
26
+ versioned.select { |major, _| major <= simp_main_version }.max_by(&:first)&.last
27
+ else
28
+ File.join(TEMPLATE_DIR, 'simpdefault.spec')
29
+ end
30
+
31
+ raise "Error: Could not find template for SIMP version #{simp_version}" unless template_file && File.exist?(template_file)
24
32
 
25
33
  File.read(template_file)
26
34
  end
@@ -4,5 +4,5 @@ module Simp; end
4
4
  module Simp::Rake; end
5
5
 
6
6
  class Simp::Rake::Helpers
7
- VERSION = '7.0.0'
7
+ VERSION = '7.1.0'
8
8
  end
data/lib/simp/yum.rb CHANGED
@@ -26,10 +26,8 @@ module Simp
26
26
  tmp_dir = ENV['TMPDIR'] || '/tmp'
27
27
 
28
28
  # Ensure that yumdownloader uses a fresh cache directory for each run of a given platform
29
- @@yum_cache ||= File.join(tmp_dir, 'yum_cache-' +
30
- Facter.fact('operatingsystem').value + '-' +
31
- Facter.fact('operatingsystemmajrelease').value + '-' +
32
- Facter.fact('architecture').value)
29
+ os = Facter.value(:os)
30
+ @@yum_cache ||= File.join(tmp_dir, "yum_cache-#{os['name']}-#{os['release']['major']}-#{os['architecture']}")
33
31
 
34
32
  FileUtils.mkdir_p(@@yum_cache)
35
33
 
@@ -27,7 +27,7 @@ module Simp::BeakerHelpers::SimpRakeHelpers::BuildProjectHelpers
27
27
  #
28
28
  # @example The distribution directory format looks like:
29
29
  #
30
- # `build/distributions/CentOS/6/x86_64
30
+ # `build/distributions/RedHat/9/x86_64`
31
31
  #
32
32
  # @param [Host, String, Symbol] host Beaker host
33
33
  # @param [String] proj_dir Absolute path to the parent project directory
@@ -47,11 +47,11 @@ module Simp::BeakerHelpers::SimpRakeHelpers::BuildProjectHelpers
47
47
  # unrecognized opts (e.g. run_in_parallel) into the `puppet facts show`
48
48
  # command line, which puppet then rejects as an invalid option.
49
49
  os = fact_on(host, 'os')
50
- name = os['name']
50
+ family = os['family']
51
51
  maj_rel = os.dig('release', 'major')
52
52
  architecture = os['architecture']
53
53
 
54
- dir = "#{proj_dir}/build/distributions/#{name}/#{maj_rel}/#{architecture}"
54
+ dir = "#{proj_dir}/build/distributions/#{family}/#{maj_rel}/#{architecture}"
55
55
  @distribution_dirs[host.to_s] = dir
56
56
  end
57
57
 
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'simp/rake'
4
+ require 'simp/rpm'
5
+ require 'simp/rake/build/constants'
6
+ require 'spec_helper'
7
+
8
+ describe Simp::Rake::Build::Constants do
9
+ subject(:obj) do
10
+ Class.new { include Simp::Rake::Build::Constants }.new.tap do |o|
11
+ o.init_member_vars(File.expand_path('../../files/simp_build', __dir__))
12
+ end
13
+ end
14
+
15
+ around(:each) do |example|
16
+ saved = ENV.to_h.slice('SIMP_BUILD_distro', 'SIMP_RPM_dist')
17
+ ENV.delete('SIMP_BUILD_distro')
18
+ ENV['SIMP_RPM_dist'] = '.el9'
19
+ example.run
20
+ ensure
21
+ ENV.delete('SIMP_BUILD_distro')
22
+ ENV.delete('SIMP_RPM_dist')
23
+ ENV.update(saved)
24
+ end
25
+
26
+ it 'builds AlmaLinux from the RedHat tree, by OS family' do
27
+ allow(Facter).to receive(:value).and_call_original
28
+ allow(Facter).to receive(:value).with(:os).and_return(
29
+ 'name' => 'AlmaLinux', 'family' => 'RedHat', 'architecture' => 'x86_64', 'release' => { 'major' => '9' },
30
+ )
31
+
32
+ expect(obj.instance_variable_get(:@build_distro)).to eq 'RedHat'
33
+ expect(obj.instance_variable_get(:@build_version)).to eq '9'
34
+ expect(obj.instance_variable_get(:@build_arch)).to eq 'x86_64'
35
+ end
36
+
37
+ it 'still honors SIMP_BUILD_distro' do
38
+ ENV['SIMP_BUILD_distro'] = 'CentOS/8/x86_64'
39
+ expect(obj.instance_variable_get(:@build_distro)).to eq 'CentOS'
40
+ expect(obj.instance_variable_get(:@build_version)).to eq '8'
41
+ end
42
+ end
@@ -0,0 +1,63 @@
1
+ [checksums]
2
+ images/boot.iso = sha256:d842df0dca98a3bf79c84cfcce49505ba7a7f56f03dcb02639b8377410154f4d
3
+ images/eltorito.img = sha256:86ab1fb0659ae078f386c8f518596a41440d8540bde58b8873429779ddec8571
4
+ images/install.img = sha256:24e6e36fd21697dcc04f9a795c9fe3f616a6879c5f91001c273f2960a92d056a
5
+ images/pxeboot/initrd.img = sha256:0c3ce9606455cbabcece631322491da4640cb1b869e2fb2f0307365e7493bc26
6
+ images/pxeboot/vmlinuz = sha256:3cfeda58301d7094e9298844f8818d94bca67b661ed0e18438f5c21e73ab55d0
7
+
8
+ [general]
9
+ arch = x86_64
10
+ family = AlmaLinux
11
+ name = AlmaLinux 10
12
+ packagedir = Packages
13
+ platforms = x86_64,xen
14
+ repository = .
15
+ timestamp = 1794586561
16
+ variant = BaseOS
17
+ variants = AppStream,BaseOS
18
+ version = 10
19
+
20
+ [header]
21
+ type = productmd.treeinfo
22
+ version = 1.2
23
+
24
+ [images-x86_64]
25
+ boot.iso = images/boot.iso
26
+ eltorito.img = images/eltorito.img
27
+ initrd = images/pxeboot/initrd.img
28
+ kernel = images/pxeboot/vmlinuz
29
+
30
+ [images-xen]
31
+ initrd = images/pxeboot/initrd.img
32
+ kernel = images/pxeboot/vmlinuz
33
+
34
+ [release]
35
+ name = AlmaLinux
36
+ short = AlmaLinux
37
+ version = 10
38
+
39
+ [stage2]
40
+ mainimage = images/install.img
41
+
42
+ [tree]
43
+ arch = x86_64
44
+ build_timestamp = 1794586561
45
+ platforms = x86_64,xen
46
+ variants = AppStream,BaseOS
47
+
48
+ [variant-AppStream]
49
+ id = AppStream
50
+ name = AppStream
51
+ packages = ../../../AppStream/x86_64/os/Packages
52
+ repository = ../../../AppStream/x86_64/os
53
+ type = variant
54
+ uid = AppStream
55
+
56
+ [variant-BaseOS]
57
+ id = BaseOS
58
+ name = BaseOS
59
+ packages = Packages
60
+ repository = .
61
+ type = variant
62
+ uid = BaseOS
63
+
@@ -0,0 +1,59 @@
1
+ [checksums]
2
+ images/efiboot.img = sha256:c4953fb6c5ac8762006ece93971feed215d6a6b287c881fc96749d73f288d0c5
3
+ images/install.img = sha256:652046fde59e389e288aee31d5cd8463ccf36998711a9ce124bd4c3144b81602
4
+ images/pxeboot/initrd.img = sha256:0038aa8a9eed8f9d62da1a400ce448f207049f7096e2f556a472d97cde37eaa2
5
+ images/pxeboot/vmlinuz = sha256:f58fb65f5bd85aaf75995be3b2caadc929ad3ef746e4af8629afd82779740a80
6
+
7
+ [general]
8
+ ; WARNING.0 = This section provides compatibility with pre-productmd treeinfos.
9
+ ; WARNING.1 = Read productmd documentation for details about new format.
10
+ arch = x86_64
11
+ family = AlmaLinux
12
+ name = AlmaLinux 8
13
+ packagedir = Minimal/Packages
14
+ platforms = x86_64,xen
15
+ repository = Minimal
16
+ timestamp = 1716624055
17
+ variant = Minimal
18
+ variants = Minimal
19
+ version = 8
20
+
21
+ [header]
22
+ type = productmd.treeinfo
23
+ version = 1.2
24
+
25
+ [images-x86_64]
26
+ efiboot.img = images/efiboot.img
27
+ initrd = images/pxeboot/initrd.img
28
+ kernel = images/pxeboot/vmlinuz
29
+
30
+ [images-xen]
31
+ initrd = images/pxeboot/initrd.img
32
+ kernel = images/pxeboot/vmlinuz
33
+
34
+ [media]
35
+ discnum = 1
36
+ totaldiscs = 1
37
+
38
+ [release]
39
+ name = AlmaLinux
40
+ short = AlmaLinux
41
+ version = 8
42
+
43
+ [stage2]
44
+ mainimage = images/install.img
45
+
46
+ [tree]
47
+ arch = x86_64
48
+ build_timestamp = 1716624055
49
+ platforms = x86_64,xen
50
+ variants = Minimal
51
+
52
+ [variant-Minimal]
53
+ id = Minimal
54
+ name = Minimal
55
+ packages = Minimal/Packages
56
+ repository = Minimal
57
+ type = variant
58
+ uid = Minimal
59
+
@@ -0,0 +1,59 @@
1
+ [checksums]
2
+ images/efiboot.img = sha256:d1b35b4fb75ab53b7beaf0a0669d7570afeedc59df572adba6aea63f868e0f52
3
+ images/install.img = sha256:994bc444770aadfc0c5f7c4a9210f2ace24cce6691aa62f91a4a63cf1725bea5
4
+ images/pxeboot/initrd.img = sha256:0bdb97c249055d6b95d03b1fdd11d81852eef8b9675e390f0fae39b8f8a98dc1
5
+ images/pxeboot/vmlinuz = sha256:7af4a31b2a63411c95859a7b655cff3462d45a9cbcde537723ebcd4347b8d47a
6
+
7
+ [general]
8
+ ; WARNING.0 = This section provides compatibility with pre-productmd treeinfos.
9
+ ; WARNING.1 = Read productmd documentation for details about new format.
10
+ arch = x86_64
11
+ family = AlmaLinux
12
+ name = AlmaLinux 9
13
+ packagedir = Minimal/Packages
14
+ platforms = x86_64,xen
15
+ repository = Minimal
16
+ timestamp = 1794591760
17
+ variant = Minimal
18
+ variants = Minimal
19
+ version = 9
20
+
21
+ [header]
22
+ type = productmd.treeinfo
23
+ version = 1.2
24
+
25
+ [images-x86_64]
26
+ efiboot.img = images/efiboot.img
27
+ initrd = images/pxeboot/initrd.img
28
+ kernel = images/pxeboot/vmlinuz
29
+
30
+ [images-xen]
31
+ initrd = images/pxeboot/initrd.img
32
+ kernel = images/pxeboot/vmlinuz
33
+
34
+ [media]
35
+ discnum = 1
36
+ totaldiscs = 1
37
+
38
+ [release]
39
+ name = AlmaLinux
40
+ short = AlmaLinux
41
+ version = 9
42
+
43
+ [stage2]
44
+ mainimage = images/install.img
45
+
46
+ [tree]
47
+ arch = x86_64
48
+ build_timestamp = 1794591760
49
+ platforms = x86_64,xen
50
+ variants = Minimal
51
+
52
+ [variant-Minimal]
53
+ id = Minimal
54
+ name = Minimal
55
+ packages = Minimal/Packages
56
+ repository = Minimal
57
+ type = variant
58
+ uid = Minimal
59
+
@@ -0,0 +1,21 @@
1
+ [general]
2
+ name = CentOS-7
3
+ family = CentOS
4
+ timestamp = 1603729576.26
5
+ variant =
6
+ version = 7
7
+ packagedir =
8
+ arch = x86_64
9
+
10
+ [stage2]
11
+ mainimage = LiveOS/squashfs.img
12
+
13
+ [images-x86_64]
14
+ kernel = images/pxeboot/vmlinuz
15
+ initrd = images/pxeboot/initrd.img
16
+ boot.iso = images/boot.iso
17
+
18
+ [images-xen]
19
+ kernel = images/pxeboot/vmlinuz
20
+ initrd = images/pxeboot/initrd.img
21
+
@@ -0,0 +1,82 @@
1
+ [checksums]
2
+ images/boot.iso = sha256:2fda244142dcf746dcbfb476acd66f3ca757081edfa560f907c125142c47617c
3
+ images/efiboot.img = sha256:1ae51bd73c35ae5ef864004f592528845fc3f2fad347d468df7ac20a29742184
4
+ images/install.img = sha256:abdcc6a8ecf0a4d32f2500d17a41d4961980eb8e19027ee0fca599b8054c5771
5
+ images/pxeboot/initrd.img = sha256:6c20b39dc3815783bc348e6b756512fcffc096fb7b4d390aa4207cfdc32dbedc
6
+ images/pxeboot/vmlinuz = sha256:d527e7002f40dfcf56e5e87481e8bed3439343e74a509aa68e9e78c248665a9a
7
+ .discinfo = sha256:b7c5767f9f188a217872f12e3ce8d1604022e1c1e7fcfd2bad8fa087d9bee733
8
+ EFI/BOOT/BOOTX64.EFI = sha256:1ff3f223c2fcf5b11615d042fcb5674c4651bbbc8505b5b2987d60da0cb65d1a
9
+ EFI/BOOT/fonts/unicode.pf2 = sha256:d7d6e42700f0895de26d72f3036822e56708935542e60c8a7a108b45df9b0aad
10
+ EFI/BOOT/grub.cfg = sha256:72a6380a6170a187658d5b51f4ba0d48629df05b89a637344b8dffe3659066a2
11
+ EFI/BOOT/grubx64.efi = sha256:509b375e4977d4607445636d4fa8c0d9fdf6d386040a66f58b28f010253ea4bf
12
+ EFI/BOOT/mmx64.efi = sha256:1a3687f923d077080fe49feb470e3932c2b1d3fd4c6439123aa0226246a24522
13
+ isolinux/boot.msg = sha256:8630a42c892260c005a985c0f46b25c0200a5582463348c802b2965074b4ec99
14
+ isolinux/grub.conf = sha256:e086e462a55d0c0dc0a5acb98a23f34d8e622d1a70abb1ad59a12bafa98c3d94
15
+ isolinux/initrd.img = sha256:6c20b39dc3815783bc348e6b756512fcffc096fb7b4d390aa4207cfdc32dbedc
16
+ isolinux/isolinux.bin = sha256:43a3b790f38c045764334e25b741a38ee44ce57970f459ae421132ddd037c8d0
17
+ isolinux/isolinux.cfg = sha256:96818810dcf0032b1bc9b8b5f28ccb2919c3f820eeab7a4cbe1e64690b43cc8d
18
+ isolinux/ldlinux.c32 = sha256:ac01a1cc963e8736ba799e0eaa6bb98e86bced1e0614e2ffb91ae72079799ce9
19
+ isolinux/libcom32.c32 = sha256:8a5edec7c4b9b28c44806f5031caf4c7538a3223c1aea59e029968d257726b41
20
+ isolinux/libutil.c32 = sha256:7b07609f08b5fbd948a50e8dbda5c807768147e45d25819a752cd78ec0d2e69a
21
+ isolinux/memtest = sha256:c2b747a826a03082a13302cb119ddc51e6fb635090d1a3263d5671de813f0b5f
22
+ isolinux/splash.png = sha256:a1345321b1ffe751f13f7b6547e7ea5cde99a4e4dbe95db4b1a123caacfdcb39
23
+ isolinux/vesamenu.c32 = sha256:744f8d90b7a4848d2734344903787cd641bec3515b2f6f625ccd2608e189139b
24
+ isolinux/vmlinuz = sha256:d527e7002f40dfcf56e5e87481e8bed3439343e74a509aa68e9e78c248665a9a
25
+ media.repo = sha256:d9321bdf6952e89d466b3ac49a8110b7f9a6d5d00cc424423a17653b040859a0
26
+
27
+ [general]
28
+ arch = x86_64
29
+ family = Rocky Linux
30
+ name = Rocky Linux 9.9
31
+ packagedir = Packages
32
+ platforms = x86_64,xen
33
+ repository = .
34
+ timestamp = 1794528893
35
+ variant = BaseOS
36
+ variants = BaseOS
37
+ version = 9.9
38
+
39
+ [header]
40
+ type = productmd.treeinfo
41
+ version = 1.2
42
+
43
+ [release]
44
+ name = Rocky Linux
45
+ short = Rocky
46
+ version = 9.9
47
+
48
+ [tree]
49
+ arch = x86_64
50
+ build_timestamp = 1794528893
51
+ platforms = x86_64,xen
52
+ variants = BaseOS,AppStream
53
+
54
+ [variant-BaseOS]
55
+ id = BaseOS
56
+ name = BaseOS
57
+ packages = Packages
58
+ repository = .
59
+ type = variant
60
+ uid = BaseOS
61
+
62
+ [variant-AppStream]
63
+ id = AppStream
64
+ name = AppStream
65
+ type = variant
66
+ uid = AppStream
67
+ packages = ../../../AppStream/x86_64/os/Packages
68
+ repository = ../../../AppStream/x86_64/os/
69
+
70
+ [images-x86_64]
71
+ boot.iso = images/boot.iso
72
+ efiboot.img = images/efiboot.img
73
+ initrd = images/pxeboot/initrd.img
74
+ kernel = images/pxeboot/vmlinuz
75
+
76
+ [images-xen]
77
+ initrd = images/pxeboot/initrd.img
78
+ kernel = images/pxeboot/vmlinuz
79
+
80
+ [stage2]
81
+ mainimage = images/install.img
82
+
@@ -0,0 +1,63 @@
1
+ [checksums]
2
+ images/boot.iso = sha256:343ea124ce30d8211dc0a29413fbef6467458e526ae3a9686353a916b130c54a
3
+ images/efiboot.img = sha256:fd5bdc4bceb5c9ef0438d610998e0f3803090d44cf20c487ae26fb03bdb651d5
4
+ images/install.img = sha256:9179ca3b747bf6dc5e2ccb30850d36705dd9344820dd07b3b5431d45776bb7a5
5
+ images/pxeboot/initrd.img = sha256:db1e4fc4ddb60a6cd92850b6536a0d5df4d34813fb0d537b0a5a495fa4b74b44
6
+ images/pxeboot/vmlinuz = sha256:e86137e48b7de2bb72448502e992c2dadb3091e96ced07b33889d3749e92c2fb
7
+
8
+ [general]
9
+ arch = x86_64
10
+ family = CentOS Stream
11
+ name = CentOS Stream 9
12
+ packagedir = Packages
13
+ platforms = x86_64,xen
14
+ repository = .
15
+ timestamp = 1795492802
16
+ variant = BaseOS
17
+ variants = BaseOS
18
+ version = 9
19
+
20
+ [header]
21
+ type = productmd.treeinfo
22
+ version = 1.2
23
+
24
+ [images-x86_64]
25
+ boot.iso = images/boot.iso
26
+ efiboot.img = images/efiboot.img
27
+ initrd = images/pxeboot/initrd.img
28
+ kernel = images/pxeboot/vmlinuz
29
+
30
+ [images-xen]
31
+ initrd = images/pxeboot/initrd.img
32
+ kernel = images/pxeboot/vmlinuz
33
+
34
+ [release]
35
+ name = CentOS Stream
36
+ short = CentOS-Stream
37
+ version = 9
38
+
39
+ [stage2]
40
+ mainimage = images/install.img
41
+
42
+ [tree]
43
+ arch = x86_64
44
+ build_timestamp = 1795492802
45
+ platforms = x86_64,xen
46
+ variants = BaseOS,AppStream
47
+
48
+ [variant-BaseOS]
49
+ id = BaseOS
50
+ name = BaseOS
51
+ packages = Packages
52
+ repository = .
53
+ type = variant
54
+ uid = BaseOS
55
+
56
+ [variant-AppStream]
57
+ id = AppStream
58
+ name = AppStream
59
+ packages = ../../../AppStream/x86_64/os/Packages
60
+ repository = ../../../AppStream/x86_64/os/
61
+ type = variant
62
+ uid = AppStream
63
+
@@ -0,0 +1,80 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'simp/rake/build/media'
4
+ require 'spec_helper'
5
+ require 'tmpdir'
6
+
7
+ describe Simp::Rake::Build::Media do
8
+ let(:files) { File.expand_path('files/treeinfo', __dir__) }
9
+
10
+ describe '.read_treeinfo' do
11
+ {
12
+ 'alma8' => { 'family' => 'AlmaLinux', 'version' => '8', 'arch' => 'x86_64' },
13
+ 'alma9' => { 'family' => 'AlmaLinux', 'version' => '9', 'arch' => 'x86_64' },
14
+ 'alma10' => { 'family' => 'AlmaLinux', 'version' => '10', 'arch' => 'x86_64' },
15
+ 'rocky9' => { 'family' => 'Rocky Linux', 'version' => '9.9', 'arch' => 'x86_64' },
16
+ 'stream9' => { 'family' => 'CentOS Stream', 'version' => '9', 'arch' => 'x86_64' },
17
+ 'centos7' => { 'family' => 'CentOS', 'version' => '7', 'arch' => 'x86_64' }
18
+ }.each do |media, expected|
19
+ it "reads #{media} media" do
20
+ expect(described_class.read_treeinfo(File.join(files, media))).to eq expected
21
+ end
22
+ end
23
+
24
+ it 'returns nils without a [general] section' do
25
+ Dir.mktmpdir do |dir|
26
+ file = File.join(dir, 'treeinfo')
27
+ File.write(file, "[tree]\narch = x86_64\n")
28
+ expect(described_class.read_treeinfo(file)).to eq('family' => nil, 'version' => nil, 'arch' => nil)
29
+ end
30
+ end
31
+ end
32
+
33
+ describe '.baseos' do
34
+ ['Red Hat Enterprise Linux', 'AlmaLinux', 'Rocky Linux', 'CentOS', 'CentOS Stream', 'Oracle Linux Server'].each do |family|
35
+ it("maps #{family} to RedHat") { expect(described_class.baseos(family)).to eq 'RedHat' }
36
+ end
37
+
38
+ it('returns nil for Fedora') { expect(described_class.baseos('Fedora')).to be_nil }
39
+ it('returns nil for no family') { expect(described_class.baseos(nil)).to be_nil }
40
+ end
41
+
42
+ describe '.mkisofs_args' do
43
+ def tree(*boot_files)
44
+ Dir.mktmpdir do |dir|
45
+ boot_files.each do |f|
46
+ FileUtils.mkdir_p(File.join(dir, File.dirname(f)))
47
+ FileUtils.touch(File.join(dir, f))
48
+ end
49
+ yield dir
50
+ end
51
+ end
52
+
53
+ let(:bios) { ['-b', 'isolinux/isolinux.bin', '-boot-load-size', '4', '-boot-info-table', '-no-emul-boot'] }
54
+ let(:uefi) { ['-e', 'images/efiboot.img', '-no-emul-boot'] }
55
+
56
+ it 'boots BIOS and UEFI when both images exist (EL8/EL9 media)' do
57
+ tree('isolinux/isolinux.bin', 'images/efiboot.img') do |dir|
58
+ args = described_class.mkisofs_args(dir, 'SIMP-7.0.0', 'out.iso')
59
+ expect(args.each_cons(bios.size)).to include(bios)
60
+ expect(args.each_cons(uefi.size + 1)).to include(['-eltorito-alt-boot'] + uefi)
61
+ expect(args.each_cons(2)).to include(['-V', 'SIMP-7.0.0'], ['-m', File.join(dir, 'lost+found')], ['-o', 'out.iso'])
62
+ expect(args.last).to eq dir
63
+ end
64
+ end
65
+
66
+ it 'boots UEFI alone without an alternate boot entry' do
67
+ tree('images/efiboot.img') do |dir|
68
+ args = described_class.mkisofs_args(dir, 'SIMP-7.0.0', 'out.iso')
69
+ expect(args).not_to include('-b', '-eltorito-alt-boot')
70
+ expect(args.each_cons(uefi.size)).to include(uefi)
71
+ end
72
+ end
73
+
74
+ it 'fails clearly with neither boot image (EL10 media)' do
75
+ tree('images/eltorito.img') do |dir|
76
+ expect { described_class.mkisofs_args(dir, 'SIMP-7.0.0', 'out.iso') }.to raise_error(%r{neither isolinux/isolinux.bin})
77
+ end
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'simp/rake/helpers/rpm_spec'
4
+ require 'spec_helper'
5
+
6
+ describe Simp::Rake::Helpers::RPMSpec do
7
+ subject(:helper) { Class.new { include Simp::Rake::Helpers::RPMSpec }.new }
8
+
9
+ let(:template_dir) { Simp::Rake::Helpers::RPMSpec::TEMPLATE_DIR }
10
+ let(:simp6_template) { File.read(File.join(template_dir, 'simp6.spec')) }
11
+ let(:default_template) { File.read(File.join(template_dir, 'simpdefault.spec')) }
12
+
13
+ around(:each) do |example|
14
+ saved = ENV.delete('SIMP_BUILD_version')
15
+ example.run
16
+ ensure
17
+ saved.nil? ? ENV.delete('SIMP_BUILD_version') : ENV['SIMP_BUILD_version'] = saved
18
+ end
19
+
20
+ it 'uses the template for the exact SIMP major' do
21
+ expect(helper.rpm_template('6.6.0-2')).to eq(simp6_template)
22
+ end
23
+
24
+ it 'falls back to the newest older template for a newer SIMP major' do
25
+ expect(helper.rpm_template('7.0.0-Alpha.el8')).to eq(simp6_template)
26
+ end
27
+
28
+ it 'prefers SIMP_BUILD_version over the argument' do
29
+ ENV['SIMP_BUILD_version'] = '7.0.0-Alpha.el10'
30
+ expect(helper.rpm_template('5.0.0')).to eq(simp6_template)
31
+ end
32
+
33
+ it 'uses the default template without a SIMP version' do
34
+ expect(helper.rpm_template).to eq(default_template)
35
+ end
36
+
37
+ it 'fails for a SIMP major older than every template' do
38
+ expect { helper.rpm_template('5.4.0') }.to raise_error(%r{Could not find template for SIMP version 5\.4\.0})
39
+ end
40
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simp-rake-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.0
4
+ version: 7.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Tessmer
8
8
  - Trevor Vaughan
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-10-07 00:00:00.000000000 Z
11
+ date: 2026-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simp-beaker-helpers
@@ -410,6 +410,7 @@ files:
410
410
  - lib/simp/rake/build/deps.rb
411
411
  - lib/simp/rake/build/helpers.rb
412
412
  - lib/simp/rake/build/iso.rb
413
+ - lib/simp/rake/build/media.rb
413
414
  - lib/simp/rake/build/pkg.rb
414
415
  - lib/simp/rake/build/rpmdeps.rb
415
416
  - lib/simp/rake/build/spec.rb
@@ -591,17 +592,26 @@ files:
591
592
  - spec/lib/simp/files/testpackage.spec
592
593
  - spec/lib/simp/local_gpg_signing_key_spec.rb.beaker-only
593
594
  - spec/lib/simp/packer/iso_vars_json_spec.rb
595
+ - spec/lib/simp/rake/build/constants_spec.rb
594
596
  - spec/lib/simp/rake/build/files/changed_name_mod/metadata.json
595
597
  - spec/lib/simp/rake/build/files/dependencies.yaml
596
598
  - spec/lib/simp/rake/build/files/malformed_dep_meta_mod/metadata.json
597
599
  - spec/lib/simp/rake/build/files/managed_mod/metadata.json
598
600
  - spec/lib/simp/rake/build/files/obsoletes_too_new_mod/metadata.json
599
601
  - spec/lib/simp/rake/build/files/release_only_mod/metadata.json
602
+ - spec/lib/simp/rake/build/files/treeinfo/alma10
603
+ - spec/lib/simp/rake/build/files/treeinfo/alma8
604
+ - spec/lib/simp/rake/build/files/treeinfo/alma9
605
+ - spec/lib/simp/rake/build/files/treeinfo/centos7
606
+ - spec/lib/simp/rake/build/files/treeinfo/rocky9
607
+ - spec/lib/simp/rake/build/files/treeinfo/stream9
600
608
  - spec/lib/simp/rake/build/files/unknown_dep_mod/metadata.json
601
609
  - spec/lib/simp/rake/build/files/unmanaged_mod/build/rpm_metadata/requires
602
610
  - spec/lib/simp/rake/build/files/unmanaged_mod/metadata.json
603
611
  - spec/lib/simp/rake/build/helpers_spec.rb
612
+ - spec/lib/simp/rake/build/media_spec.rb
604
613
  - spec/lib/simp/rake/build/rpmdeps_spec.rb
614
+ - spec/lib/simp/rake/helpers/rpm_spec_spec.rb
605
615
  - spec/lib/simp/rake/helpers_spec.rb
606
616
  - spec/lib/simp/rake/pkg_spec.rb
607
617
  - spec/lib/simp/rake/pupmod/fixtures/othermod/Gemfile