scripts now generate

This commit is contained in:
Louis Abel 2022-06-23 15:29:22 -07:00
parent 2e5c4778f4
commit b75fe62899
Signed by: label
GPG Key ID: B37E62D143879B36
8 changed files with 88 additions and 19 deletions

View File

@ -69,6 +69,8 @@
packages: 'os/Packages' packages: 'os/Packages'
repodata: 'os/repodata' repodata: 'os/repodata'
iso_map: iso_map:
xorrisofs: False
iso_level: False
hosts: hosts:
x86_64: '' x86_64: ''
aarch64: '' aarch64: ''

View File

@ -51,6 +51,8 @@
packages: 'os/Packages' packages: 'os/Packages'
repodata: 'os/repodata' repodata: 'os/repodata'
iso_map: iso_map:
xorrisofs: False
iso_level: False
hosts: hosts:
x86_64: '' x86_64: ''
aarch64: '' aarch64: ''
@ -58,6 +60,7 @@
s390x: '' s390x: ''
images: images:
dvd: dvd:
discnum: '1'
repos: repos:
- 'BaseOS' - 'BaseOS'
- 'AppStream' - 'AppStream'

View File

@ -51,6 +51,8 @@
packages: 'os/Packages' packages: 'os/Packages'
repodata: 'os/repodata' repodata: 'os/repodata'
iso_map: iso_map:
xorrisofs: False
iso_level: False
hosts: hosts:
x86_64: '' x86_64: ''
aarch64: '' aarch64: ''
@ -58,6 +60,7 @@
s390x: '' s390x: ''
images: images:
dvd: dvd:
discnum: '1'
repos: repos:
- 'BaseOS' - 'BaseOS'
- 'AppStream' - 'AppStream'

View File

@ -51,6 +51,8 @@
packages: 'os/Packages' packages: 'os/Packages'
repodata: 'os/repodata' repodata: 'os/repodata'
iso_map: iso_map:
xorrisofs: False
iso_level: False
hosts: hosts:
x86_64: '' x86_64: ''
aarch64: '' aarch64: ''
@ -58,6 +60,7 @@
s390x: '' s390x: ''
images: images:
dvd: dvd:
discnum: '1'
repos: repos:
- 'BaseOS' - 'BaseOS'
- 'AppStream' - 'AppStream'

View File

@ -15,7 +15,7 @@ parser.add_argument('--isolation', type=str, help="Mock Isolation")
parser.add_argument('--local-compose', action='store_true', help="Compose Directory is Here") parser.add_argument('--local-compose', action='store_true', help="Compose Directory is Here")
parser.add_argument('--logger', type=str) parser.add_argument('--logger', type=str)
parser.add_argument('--extra-iso', type=str, help="Granular choice in which iso is built") parser.add_argument('--extra-iso', type=str, help="Granular choice in which iso is built")
parser.add_argument('--extra-iso-mode', type=str) parser.add_argument('--extra-iso-mode', type=str, default='local')
results = parser.parse_args() results = parser.parse_args()
rlvars = rldict[results.release] rlvars = rldict[results.release]
major = rlvars['major'] major = rlvars['major']

View File

@ -23,4 +23,5 @@ fi
mkdir -p {{ compose_work_iso_dir }}/{{ arch }} mkdir -p {{ compose_work_iso_dir }}/{{ arch }}
cp /builddir/*.iso {{ compose_work_iso_dir }}/{{ arch }} cp /builddir/*.iso {{ compose_work_iso_dir }}/{{ arch }}
cp /builddir/*.iso.manifest {{ compose_work_iso_dir }}/{{ arch }} cp /builddir/*.iso.manifest {{ compose_work_iso_dir }}/{{ arch }}
cp /builddir/*.log {{ compose_work_iso_dir }}/{{ arch }}
{% endif %} {% endif %}

View File

@ -10,7 +10,7 @@ MOCK_RESL="${MOCK_ROOT}/result"
MOCK_CHRO="${MOCK_ROOT}/root" MOCK_CHRO="${MOCK_ROOT}/root"
MOCK_LOG="${MOCK_RESL}/mock-output.log" MOCK_LOG="${MOCK_RESL}/mock-output.log"
IMAGE_SCR="/var/tmp/buildExtraImage.sh" IMAGE_SCR="/var/tmp/buildExtraImage.sh"
IMAGE_ISO="{{ shortname }}-{{ major }}.{{ minor }}{{ rc }}-{{ arch }}-dvd{{ discnum|default('1') }}.iso" IMAGE_ISO="{{ isoname }}"
ISOLATION="{{ isolation }}" ISOLATION="{{ isolation }}"
BUILDDIR="{{ builddir }}" BUILDDIR="{{ builddir }}"

View File

@ -140,11 +140,10 @@ class IsoBuild:
"work/logs" "work/logs"
) )
#self.iso_work_dir = os.path.join( self.iso_work_dir = os.path.join(
# self.compose_latest_dir, self.compose_latest_dir,
# "work/iso", "work/iso"
# config['arch'] )
#)
self.lorax_work_dir = os.path.join( self.lorax_work_dir = os.path.join(
self.compose_latest_dir, self.compose_latest_dir,
@ -708,7 +707,7 @@ class IsoBuild:
if self.extra_iso_mode == 'local': if self.extra_iso_mode == 'local':
self._extra_iso_local_config(a, y, grafts) self._extra_iso_local_config(a, y, grafts)
self._extra_iso_local_run() #self._extra_iso_local_run()
elif self.extra_iso_mode == 'podman': elif self.extra_iso_mode == 'podman':
continue continue
else: else:
@ -738,6 +737,27 @@ class IsoBuild:
if self.release_candidate: if self.release_candidate:
rclevel = '-' + self.rclvl rclevel = '-' + self.rclvl
discnum = ''
if self.iso_map['images'][image]['discnum']:
discnum = self.iso_map['images'][image]['discnum']
volid = '{}-{}-{}-{}-{}'.format(
self.shortname,
self.major_version,
self.minor_version,
arch,
image
)
isoname = '{}-{}.{}-{}-{}{}.iso'.format(
self.shortname,
self.major_version,
self.minor_version,
arch,
image,
discnum
)
mock_iso_template_output = mock_iso_template.render( mock_iso_template_output = mock_iso_template.render(
arch=self.current_arch, arch=self.current_arch,
major=self.major_version, major=self.major_version,
@ -755,8 +775,48 @@ class IsoBuild:
isolation=self.mock_isolation, isolation=self.mock_isolation,
builddir=self.mock_work_root, builddir=self.mock_work_root,
shortname=self.shortname, shortname=self.shortname,
isoname=isoname,
) )
opts = {
'arch': arch,
'iso_name': isoname,
'volid': volid,
'graft_points': grafts,
'use_xorrisofs': self.iso_map['xorrisofs'],
'iso_level': self.iso_map['iso_level'],
}
make_image = self._get_make_image_cmd(opts)
isohybrid = self._get_isohybrid_cmd(opts)
implantmd5 = self._get_implantisomd5_cmd(opts)
make_manifest = self._get_manifest_cmd(opts)
iso_template_output = iso_template.render(
inside_podman=False,
arch=arch,
compose_work_iso_dir=self.iso_work_dir,
make_image=make_image,
isohybrid=isohybrid,
implantmd5=implantmd5,
make_manifest=make_manifest,
)
mock_iso_entry = open(mock_iso_path, "w+")
mock_iso_entry.write(mock_iso_template_output)
mock_iso_entry.close()
mock_sh_entry = open(mock_sh_path, "w+")
mock_sh_entry.write(mock_sh_template_output)
mock_sh_entry.close()
iso_template_entry = open(iso_template_path, "w+")
iso_template_entry.write(iso_template_output)
iso_template_entry.close()
os.chmod(mock_sh_path, 0o755)
os.chmod(iso_template_path, 0o755)
def _extra_iso_local_run(self): def _extra_iso_local_run(self):
""" """
@ -1072,7 +1132,6 @@ class IsoBuild:
def _get_mkisofs_cmd( def _get_mkisofs_cmd(
self, self,
iso, iso,
paths,
appid=None, appid=None,
volid=None, volid=None,
volset=None, volset=None,
@ -1147,8 +1206,9 @@ class IsoBuild:
""" """
Implants md5 into iso Implants md5 into iso
""" """
cmd = ["/usr/bin/implantisomd5", "--supported-iso", opts['iso_path']] cmd = ["/usr/bin/implantisomd5", "--supported-iso", opts['iso_name']]
return cmd returned_cmd = ' '.join(cmd)
return returned_cmd
def _get_manifest_cmd(self, opts): def _get_manifest_cmd(self, opts):
""" """
@ -1164,8 +1224,9 @@ class IsoBuild:
if opts['arch'] == "x86_64": if opts['arch'] == "x86_64":
cmd = ["/usr/bin/isohybrid"] cmd = ["/usr/bin/isohybrid"]
cmd.append("--uefi") cmd.append("--uefi")
cmd.append(opts['iso_path']) cmd.append(opts['iso_name'])
return cmd returned_cmd = ' '.join(cmd)
return returned_cmd
def _get_make_image_cmd(self, opts): def _get_make_image_cmd(self, opts):
""" """
@ -1190,14 +1251,10 @@ class IsoBuild:
iso_level=opts['iso_level'], iso_level=opts['iso_level'],
**isokwargs **isokwargs
) )
return cmd returned_cmd = ' '.join(cmd)
return returned_cmd
def _write_script(self, opts):
"""
Writes out the script to make the DVD
"""
class LiveBuild: class LiveBuild:
""" """
This helps us build the live images for Rocky Linux. This helps us build the live images for Rocky Linux.