Skip to content

Commit

Permalink
Raspberry Pi OS 12 support (uyuni-project#7852)
Browse files Browse the repository at this point in the history
* Add Raspbian OS 12
Co-authored-by: Julio González Gil <juliogonzalez@users.noreply.github.com>
  • Loading branch information
raulillo82 authored Nov 30, 2023
1 parent 9e1ee26 commit a04d914
Show file tree
Hide file tree
Showing 13 changed files with 395 additions and 4 deletions.
3 changes: 3 additions & 0 deletions schema/spacewalk/common/data/rhnChannelArch.sql
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,8 @@ insert into rhnChannelArch (id, label, name, arch_type_id) values
insert into rhnChannelArch (id, label, name, arch_type_id) values
(sequence_nextval('rhn_channel_arch_id_seq'), 'channel-arm64-deb', 'ARM64 Debian', lookup_arch_type('deb'));

insert into rhnChannelArch (id, label, name, arch_type_id) values
(sequence_nextval('rhn_channel_arch_id_seq'), 'channel-armhf-deb', 'ARMHF Debian', lookup_arch_type('deb'));

commit;

1 change: 1 addition & 0 deletions schema/spacewalk/susemanager-schema.changes.raul.raspbian
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Add schema definition and migration for armhf
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
insert into rhnCpuArch (id, label, name) select
sequence_nextval('rhn_cpu_arch_id_seq'), 'armhf', 'ARMHF' from dual
where not exists (select 1 from rhnCpuArch where label = 'armhf');


insert into rhnPackageArch (id, label, name, arch_type_id) select
sequence_nextval('rhn_package_arch_id_seq'), 'armhf-deb', 'ARMHF-deb', lookup_arch_type('deb') from dual
where not exists (select 1 from rhnPackageArch where label = 'armhf-deb');


insert into rhnServerArch (id, label, name, arch_type_id) select
sequence_nextval('rhn_server_arch_id_seq'), 'armhf-debian-linux', 'ARMHF Debian', lookup_arch_type('deb') from dual
where not exists (select 1 from rhnServerArch where label = 'armhf-debian-linux');


insert into rhnChannelArch (id, label, name, arch_type_id) select
sequence_nextval('rhn_channel_arch_id_seq'), 'channel-armhf-deb', 'ARMHF Debian', lookup_arch_type('deb') from dual
where not exists (select 1 from rhnChannelArch where label = 'channel-armhf-deb');


insert into rhnPackageUpgradeArchCompat (package_arch_id, package_upgrade_arch_id, created, modified) select
LOOKUP_PACKAGE_ARCH('armhf-deb'), LOOKUP_PACKAGE_ARCH('all-deb'), current_timestamp, current_timestamp from dual
where not exists (select 1 from rhnPackageUpgradeArchCompat where package_arch_id = LOOKUP_PACKAGE_ARCH('armhf-deb') and package_upgrade_arch_id = LOOKUP_PACKAGE_ARCH('all-deb'));

insert into rhnPackageUpgradeArchCompat (package_arch_id, package_upgrade_arch_id, created, modified) select
LOOKUP_PACKAGE_ARCH('armhf-deb'), LOOKUP_PACKAGE_ARCH('armhf-deb'), current_timestamp, current_timestamp from dual
where not exists (select 1 from rhnPackageUpgradeArchCompat where package_arch_id = LOOKUP_PACKAGE_ARCH('armhf-deb') and package_upgrade_arch_id = LOOKUP_PACKAGE_ARCH('armhf-deb'));

insert into rhnPackageUpgradeArchCompat (package_arch_id, package_upgrade_arch_id, created, modified) select
LOOKUP_PACKAGE_ARCH('all-deb'), LOOKUP_PACKAGE_ARCH('armhf-deb'), current_timestamp, current_timestamp from dual
where not exists (select 1 from rhnPackageUpgradeArchCompat where package_arch_id = LOOKUP_PACKAGE_ARCH('all-deb') and package_upgrade_arch_id = LOOKUP_PACKAGE_ARCH('armhf-deb'));


insert into rhnChannelPackageArchCompat (channel_arch_id, package_arch_id) select
LOOKUP_CHANNEL_ARCH('channel-armhf-deb'), LOOKUP_PACKAGE_ARCH('armhf-deb') from dual
where not exists (select 1 from rhnChannelPackageArchCompat where channel_arch_id = LOOKUP_CHANNEL_ARCH('channel-armhf-deb') and package_arch_id = LOOKUP_PACKAGE_ARCH('armhf-deb'));

insert into rhnChannelPackageArchCompat (channel_arch_id, package_arch_id) select
LOOKUP_CHANNEL_ARCH('channel-armhf-deb'), LOOKUP_PACKAGE_ARCH('all-deb') from dual
where not exists (select 1 from rhnChannelPackageArchCompat where channel_arch_id = LOOKUP_CHANNEL_ARCH('channel-armhf-deb') and package_arch_id = LOOKUP_PACKAGE_ARCH('all-deb'));

insert into rhnChannelPackageArchCompat (channel_arch_id, package_arch_id) select
LOOKUP_CHANNEL_ARCH('channel-armhf-deb'), LOOKUP_PACKAGE_ARCH('src-deb') from dual
where not exists (select 1 from rhnChannelPackageArchCompat where channel_arch_id = LOOKUP_CHANNEL_ARCH('channel-armhf-deb') and package_arch_id = LOOKUP_PACKAGE_ARCH('src-deb'));


insert into rhnServerChannelArchCompat (server_arch_id, channel_arch_id) select
LOOKUP_SERVER_ARCH('armhf-debian-linux'), LOOKUP_CHANNEL_ARCH('channel-armhf-deb') from dual
where not exists (select 1 from rhnServerChannelArchCompat where server_arch_id = LOOKUP_SERVER_ARCH('armhf-debian-linux') and channel_arch_id = LOOKUP_CHANNEL_ARCH('channel-armhf-deb'));


insert into rhnServerPackageArchCompat (server_arch_id, package_arch_id, preference) select
LOOKUP_SERVER_ARCH('armhf-debian-linux'), LOOKUP_PACKAGE_ARCH('armhf-deb'), 0 from dual
where not exists (select 1 from rhnServerPackageArchCompat where server_arch_id = LOOKUP_SERVER_ARCH('armhf-debian-linux') and package_arch_id = LOOKUP_PACKAGE_ARCH('armhf-deb'));

insert into rhnServerPackageArchCompat (server_arch_id, package_arch_id, preference) select
LOOKUP_SERVER_ARCH('armhf-debian-linux'), LOOKUP_PACKAGE_ARCH('all-deb'), 1000 from dual
where not exists (select 1 from rhnServerPackageArchCompat where server_arch_id = LOOKUP_SERVER_ARCH('armhf-debian-linux') and package_arch_id = LOOKUP_PACKAGE_ARCH('all-deb'));



insert into rhnServerServerGroupArchCompat ( server_arch_id, server_group_type) select
lookup_server_arch('armhf-debian-linux'), lookup_sg_type('enterprise_entitled') from dual
where not exists (select 1 from rhnServerServerGroupArchCompat where server_arch_id = lookup_server_arch('armhf-debian-linux') and server_group_type = lookup_sg_type('enterprise_entitled'));

insert into rhnServerServerGroupArchCompat ( server_arch_id, server_group_type) select
lookup_server_arch('armhf-debian-linux'), lookup_sg_type('virtualization_host') from dual
where not exists (select 1 from rhnServerServerGroupArchCompat where server_arch_id = lookup_server_arch('armhf-debian-linux') and server_group_type = lookup_sg_type('virtualization_host'));

insert into rhnServerServerGroupArchCompat ( server_arch_id, server_group_type) select
lookup_server_arch('armhf-debian-linux'), lookup_sg_type('bootstrap_entitled') from dual
where not exists (select 1 from rhnServerServerGroupArchCompat where server_arch_id = lookup_server_arch('armhf-debian-linux') and server_group_type = lookup_sg_type('bootstrap_entitled'));

insert into rhnServerServerGroupArchCompat ( server_arch_id, server_group_type) select
lookup_server_arch('armhf-debian-linux'), lookup_sg_type('salt_entitled') from dual
where not exists (select 1 from rhnServerServerGroupArchCompat where server_arch_id = lookup_server_arch('armhf-debian-linux') and server_group_type = lookup_sg_type('salt_entitled'));

insert into rhnServerServerGroupArchCompat ( server_arch_id, server_group_type) select
lookup_server_arch('armhf-debian-linux'), lookup_sg_type('foreign_entitled') from dual
where not exists (select 1 from rhnServerServerGroupArchCompat where server_arch_id = lookup_server_arch('armhf-debian-linux') and server_group_type = lookup_sg_type('foreign_entitled'));

insert into rhnServerServerGroupArchCompat ( server_arch_id, server_group_type) select
lookup_server_arch('armhf-debian-linux'), lookup_sg_type('container_build_host') from dual
where not exists (select 1 from rhnServerServerGroupArchCompat where server_arch_id = lookup_server_arch('armhf-debian-linux') and server_group_type = lookup_sg_type('container_build_host'));

insert into rhnServerServerGroupArchCompat ( server_arch_id, server_group_type) select
lookup_server_arch('armhf-debian-linux'), lookup_sg_type('monitoring_entitled') from dual
where not exists (select 1 from rhnServerServerGroupArchCompat where server_arch_id = lookup_server_arch('armhf-debian-linux') and server_group_type = lookup_sg_type('monitoring_entitled'));


insert into rhnChildChannelArchCompat (parent_arch_id, child_arch_id) select
LOOKUP_CHANNEL_ARCH('channel-armhf-deb'), LOOKUP_CHANNEL_ARCH('channel-armhf-deb') from dual
where not exists (select 1 from rhnChildChannelArchCompat where parent_arch_id = LOOKUP_CHANNEL_ARCH('channel-armhf-deb') and child_arch_id = LOOKUP_CHANNEL_ARCH('channel-armhf-deb'));

commit;

6 changes: 3 additions & 3 deletions spacewalk/certs-tools/rhn_bootstrap_strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ def getRegistrationStackSh():
elif [ -f /etc/redhat-release ]; then
grep -v '^#' /etc/redhat-release | grep -q '\(Red Hat\)' && BASE="res"
VERSION=`grep -v '^#' /etc/redhat-release | grep -Po '(?<=release )\d+'`
elif [ -f /etc/openEuler-release ]; then
elif [ -f /etc/openEuler-release ]; then
grep -v '^#' /etc/openEuler-release | grep -q '\(openEuler\)' && BASE="openEuler"
VERSION=`grep -v '^#' /etc/openEuler-release | grep -Po '(?<=release )(\d+\.)+\d+'`
elif [ -f /etc/os-release ]; then
Expand Down Expand Up @@ -868,10 +868,10 @@ def getCorpCACertSh():
# we need to copy certificate to the trustroot outside of transaction for zypper
cp "$ORG_CA_CERT" /etc/pki/trust/anchors/
call_tukit "test -d '$CERT_DIR' || mkdir -p '$CERT_DIR'"
call_tukit "cp '/etc/pki/trust/anchors/$ORG_CA_CERT' '${CERT_DIR}/${ORG_CERT_FILE}'"
call_tukit "cp '/etc/pki/trust/anchors/$ORG_CA_CERT' '${CERT_DIR}/${CERT_FILE}'"
else
test -d "$CERT_DIR" || mkdir -p "$CERT_DIR"
mv "$ORG_CA_CERT" "${CERT_DIR}/${ORG_CERT_FILE}"
mv "$ORG_CA_CERT" "${CERT_DIR}/${CERT_FILE}"
fi
echo "* update certificates"
updateCertificates
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Change wrong name in unexisting variable ORG_CERT_FILE to CERT_FILE for rhn_bootstrap_strings.py
2 changes: 2 additions & 0 deletions susemanager-utils/susemanager-sls/salt/bootstrap/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ no_ssh_push_key_authorized:
{%- elif grains['os'] == 'Ubuntu' %}
{%- set os_base = grains['os']|lower %}
{% set osrelease = grains['osrelease_info'][0]|string + '/' + grains['osrelease_info'][1]|string %}
{%- elif grains['os'] == 'Raspbian' %}
{%- set os_base = grains['os']|lower %}
{%- endif %}
#end of expections
{%- endif %}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Add Raspberry Pi OS 12 support
2 changes: 1 addition & 1 deletion susemanager/src/mgr-create-bootstrap-repo
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ def create_repo(label, options, mgr_bootstrap_data, additional=[]):
"Description: $desc\n")
codename="bootstrap"
reprepro_conf = reprepro_conf_tmpl.substitute(origin="mgr",
label="mgr", codename=codename, arches="amd64 i386 armhf", comps="main", desc="Bootstrap repo")
label="mgr", codename=codename, arches="amd64 i386 armhf arm64", comps="main", desc="Bootstrap repo")
reprepro_conf_dir = os.path.join(destdirtmp, "conf")
if not os.path.exists(reprepro_conf_dir):
os.makedirs(reprepro_conf_dir)
Expand Down
35 changes: 35 additions & 0 deletions susemanager/src/mgr_bootstrap_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,31 @@
"venv-salt-minion"
]

PKGLISTRASPBERRYPIOS12 = [
# gnupg dependencies
"dirmngr",
"gnupg",
"gnupg-l10n",
"gnupg-utils",
"gpg",
"gpg-agent",
"gpg-wks-client",
"gpg-wks-server",
"gpgconf",
"gpgsm",
"libassuan0",
"libksba8",
"libldap-2.5-0",
"libnpth0",
"libsasl2-2",
"libsasl2-modules-db",
"libsqlite3-0",
"pinentry-curses",
"readline-common",
# end of gnupg dependencies
"venv-salt-minion"
]

PKGLISTASTRALINUXOREL = [
"dctrl-tools",
"dirmngr",
Expand Down Expand Up @@ -1558,6 +1583,16 @@
'DEST' : DOCUMENT_ROOT + '/pub/repositories/debian/12/bootstrap/',
'TYPE' : 'deb'
},
'raspberrypios-12-arm64-uyuni' : {
'BASECHANNEL' : 'raspberrypios-12-pool-arm64-uyuni', 'PKGLIST' : PKGLISTRASPBERRYPIOS12,
'DEST' : DOCUMENT_ROOT + '/pub/repositories/debian/12/bootstrap/',
'TYPE' : 'deb'
},
'raspberrypios-12-armhf-uyuni' : {
'BASECHANNEL' : 'raspberrypios-12-pool-armhf-uyuni', 'PKGLIST' : PKGLISTRASPBERRYPIOS12,
'DEST' : DOCUMENT_ROOT + '/pub/repositories/raspbian/12/bootstrap/',
'TYPE' : 'deb'
},
'astralinux-orel-amd64': {
'BASECHANNEL' : 'astralinux-orel-pool-amd64', 'PKGLIST' : PKGLISTASTRALINUXOREL,
'DEST' : DOCUMENT_ROOT + '/pub/repositories/astra/orel/bootstrap/',
Expand Down
1 change: 1 addition & 0 deletions susemanager/susemanager.changes.raul.raspbian
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Add bootstrap repository definitions for Raspberry Pi OS 12
3 changes: 3 additions & 0 deletions utils/spacewalk-common-channels
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ CHANNEL_ARCH = {
'ppc64': 'channel-ppc64',
'ppc64le': 'channel-ppc64le',
'amd64-deb': 'channel-amd64-deb',
'arm64-deb': 'channel-arm64-deb',
'armhf-deb': 'channel-armhf-deb',
'ia32-deb': 'channel-ia32-deb',
'ia64-deb': 'channel-ia64-deb',
'sparc-deb': 'channel-sparc-deb',
Expand All @@ -69,6 +71,7 @@ CHANNEL_NAME_TO_ARCH = {
'Alpha Debian': 'alpha-deb',
'AMD64 Debian': 'amd64-deb',
'ARM64 Debian': 'arm64-deb',
'ARM HF Debian': 'armhf',
'arm Debian': 'arm-deb',
'ARM hard. FP': 'armhfp',
'ARM soft. FP': 'arm',
Expand Down
Loading

0 comments on commit a04d914

Please sign in to comment.