From 2bef753269e1f756da6a6735d62e304316fc968d Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Sun, 5 Jan 2020 16:32:04 -0500 Subject: [PATCH 1/2] Install distribution-gpg-keys if it is not already installed We need distribution-gpg-keys to provide us the Mageia GPG key file in the distribution-agnostic location. As this package is available on virtually every distribution that also has DNF, it's easily relied upon. --- create_arm_image.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/create_arm_image.sh b/create_arm_image.sh index 2479390..7b8e941 100755 --- a/create_arm_image.sh +++ b/create_arm_image.sh @@ -85,6 +85,15 @@ function verify_disk_space() function createchroot() { title "Making chroot" + if ! [ -f /usr/share/distribution-gpg-keys/mageia/RPM-GPG-KEY-Mageia ]; then + title "distribution-gpg-keys package not present : installing distribution-gpg-keys" + /usr/bin/dnf --assumeyes --setopt=install_weak_deps=False install distribution-gpg-keys + if [ ${?} -ne 0 ]; then + error "line ${LINENO} can't install distribution-gpg-keys : exiting" + exit ${ERR_1} + fi + fi + if ! [ -f /bin/qemu-arm-static ]; then title "Qemu package not present : installing qemu packages" /usr/bin/dnf --assumeyes --setopt=install_weak_deps=False install qemu-user-static From 036dc79d99227674ec9e586d7eba75bb8376d5c8 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Sun, 5 Jan 2020 19:31:58 -0500 Subject: [PATCH 2/2] Small fixes to get basesystem chroot working --- create_arm_image.sh | 4 ++-- mageia4arm-dnf.conf | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/create_arm_image.sh b/create_arm_image.sh index 7b8e941..34549a1 100755 --- a/create_arm_image.sh +++ b/create_arm_image.sh @@ -118,10 +118,10 @@ function createchroot() # enabling extra Mageia repositories function genusemirroroptions() { - DNF_CONFIGPATH="$(dirname $(realpath "$0"))/mageia4arm-dnf.conf" + DNF_CONFIGPATH="$(dirname $(realpath "$0"))/../mageia4arm-dnf.conf" DNF_MIRROROPTS="--config=${DNF_CONFIGPATH} --forcearch=${ARM_VERSION} --nogpgcheck --releasever=${MAGEIA_VERSION}" if [ ! -z "${MIRROR}" ]; then - DNF_MIRROROPTS="${DNF_MIRROROPTS} --disablerepo=\* --repofrompath=mgarel,${MIRROR}/media/core/release/ --repofrompath=mgaup,${MIRROR}/media/core/updates/ --enablerepo=mgarel --enablerepo=mgaup" + DNF_MIRROROPTS="${DNF_MIRROROPTS} --disablerepo=* --repofrompath=mgarel,${MIRROR}/media/core/release/ --repofrompath=mgaup,${MIRROR}/media/core/updates/ --enablerepo=mgarel --enablerepo=mgaup" if [ ${NONFREE} -eq 1 ]; then DNF_MIRROROPTS="${DNF_MIRROROPTS} --repofrompath=mgarel-nonfree,${MIRROR}/media/nonfree/release/ --repofrompath=mgaup-nonfree,${MIRROR}/media/nonfree/updates/ --enablerepo=mgarel-nonfree --enablerepo=mgaup-nonfree" fi diff --git a/mageia4arm-dnf.conf b/mageia4arm-dnf.conf index d7a0450..c696539 100644 --- a/mageia4arm-dnf.conf +++ b/mageia4arm-dnf.conf @@ -11,10 +11,11 @@ syslog_device= metadata_expire=0 best=1 protected_packages= +install_weak_deps=0 # repos -[mageia-$arch] +[mageia] name=Mageia $releasever - $arch #baseurl=http://mirrors.kernel.org/mageia/distrib/$releasever/$arch/media/core/release/ #metalink=https://mirrors.mageia.org/metalink?distrib=mageia-$releasever&arch=$arch§ion=core&repo=release @@ -25,7 +26,7 @@ gpgkey=file:///usr/share/distribution-gpg-keys/mageia/RPM-GPG-KEY-Mageia enabled=1 skip_if_unavailable=False -[updates-$arch] +[updates] name=Mageia $releasever - $arch - Updates #baseurl=http://mirrors.kernel.org/mageia/distrib/$releasever/$arch/media/core/updates/ #metalink=https://mirrors.mageia.org/metalink?distrib=mageia-$releasever&arch=$arch§ion=core&repo=updates