From 9fe671fe49123a2592bcd86e61a3ae5df9f875eb Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Tue, 20 Oct 2015 08:41:12 -0500 Subject: [PATCH 1/5] kde: Plasma session notifies for available updates See also http://bugzilla.redhat.com/1262600 --- fedora-live-kde-base.ks | 1 + 1 file changed, 1 insertion(+) diff --git a/fedora-live-kde-base.ks b/fedora-live-kde-base.ks index 611b2e0..4819a2f 100644 --- a/fedora-live-kde-base.ks +++ b/fedora-live-kde-base.ks @@ -58,6 +58,7 @@ AKONADI_EOF # Disable plasma-pk-updates sed -i \ -e "s|^X-KDE-PluginInfo-EnabledByDefault=true|X-KDE-PluginInfo-EnabledByDefault=false|g" \ + /usr/share/plasma/plasmoids/org.kde.plasma.pkupdates/metadata.desktop \ /usr/share/kservices5/plasma-applet-org.kde.plasma.pkupdates.desktop # Disable baloo From 6817b9661fff75dfa915a3842ce1b2a5da8dc935 Mon Sep 17 00:00:00 2001 From: Rex Dieter Date: Mon, 19 Oct 2015 14:56:27 -0500 Subject: [PATCH 2/5] split pk cached metadata hack into include'able snippet and add to -kde-base --- fedora-live-kde-base.ks | 2 ++ fedora-live-workstation.ks | 30 +--------------------------- fedora-packagekit-cached-metadata.ks | 30 ++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 29 deletions(-) create mode 100644 fedora-packagekit-cached-metadata.ks diff --git a/fedora-live-kde-base.ks b/fedora-live-kde-base.ks index 4819a2f..1d5ed5c 100644 --- a/fedora-live-kde-base.ks +++ b/fedora-live-kde-base.ks @@ -19,6 +19,8 @@ cat > /root/.config/gtk-3.0/settings.ini << EOF gtk-theme-name = Adwaita EOF +%include fedora-packagekit-cached-metadata.ks + # add initscript cat >> /etc/rc.d/init.d/livesys << EOF diff --git a/fedora-live-workstation.ks b/fedora-live-workstation.ks index 6857b86..cc8ef57 100644 --- a/fedora-live-workstation.ks +++ b/fedora-live-workstation.ks @@ -12,35 +12,7 @@ part / --size 6144 # This is a huge file and things work ok without it rm -f /usr/share/icons/HighContrast/icon-theme.cache -# Copy initial metadata for PackageKit -PK_PREFIX=`mktemp -d` -mkdir -p $PK_PREFIX/etc/yum.repos.d -if [ -f /etc/yum.repos.d/fedora.repo ] ; then - cp /etc/yum.repos.d/fedora.repo $PK_PREFIX/etc/yum.repos.d/ - sed -i -e 's|^metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch|baseurl=https://kojipkgs.fedoraproject.org/mash/branched/$basearch/os/|' \ - $PK_PREFIX/etc/yum.repos.d/fedora.repo -fi -if [ -f /etc/yum.repos.d/fedora-updates.repo ] ; then - cp /etc/yum.repos.d/fedora-updates.repo $PK_PREFIX/etc/yum.repos.d/ - sed -i -e 's|^metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f$releasever&arch=$basearch|baseurl=https://kojipkgs.fedoraproject.org/mash/updates/f$releasever-updates/$basearch/|' \ - $PK_PREFIX/etc/yum.repos.d/fedora-updates.repo -fi -if [ -f /etc/yum.repos.d/fedora-updates-testing.repo ] ; then - cp /etc/yum.repos.d/fedora-updates-testing.repo $PK_PREFIX/etc/yum.repos.d/ - sed -i -e 's|^metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-testing-f$releasever&arch=$basearch|baseurl=https://kojipkgs.fedoraproject.org/mash/updates/f$releasever-updates-testing/$basearch/|' \ - $PK_PREFIX/etc/yum.repos.d/fedora-updates-testing.repo -fi -if [ -f /etc/yum.repos.d/fedora-rawhide.repo ] ; then - cp /etc/yum.repos.d/fedora-rawhide.repo $PK_PREFIX/etc/yum.repos.d/ - sed -i -e 's|^metalink=https://mirrors.fedoraproject.org/metalink?repo=rawhide&arch=$basearch|baseurl=https://kojipkgs.fedoraproject.org/mash/rawhide/$basearch/os/|' \ - $PK_PREFIX/etc/yum.repos.d/fedora-rawhide.repo -fi -rpm --root=$PK_PREFIX --initdb -DESTDIR=$PK_PREFIX /usr/libexec/packagekit-direct refresh -if [ -d /var/cache/PackageKit ] ; then - mv $PK_PREFIX/var/cache/PackageKit/* /var/cache/PackageKit/ -fi -rm -rf $PK_PREFIX +%include fedora-packagekit-cached-metadata.ks cat >> /etc/rc.d/init.d/livesys << EOF diff --git a/fedora-packagekit-cached-metadata.ks b/fedora-packagekit-cached-metadata.ks new file mode 100644 index 0000000..d2ef0f1 --- /dev/null +++ b/fedora-packagekit-cached-metadata.ks @@ -0,0 +1,30 @@ +# Copy initial metadata for PackageKit +PK_PREFIX=`mktemp -d` +mkdir -p $PK_PREFIX/etc/yum.repos.d +if [ -f /etc/yum.repos.d/fedora.repo ] ; then + cp /etc/yum.repos.d/fedora.repo $PK_PREFIX/etc/yum.repos.d/ + sed -i -e 's|^metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch|baseurl=https://kojipkgs.fedoraproject.org/mash/branched/$basearch/os/|' \ + $PK_PREFIX/etc/yum.repos.d/fedora.repo +fi +if [ -f /etc/yum.repos.d/fedora-updates.repo ] ; then + cp /etc/yum.repos.d/fedora-updates.repo $PK_PREFIX/etc/yum.repos.d/ + sed -i -e 's|^metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f$releasever&arch=$basearch|baseurl=https://kojipkgs.fedoraproject.org/mash/updates/f$releasever-updates/$basearch/|' \ + $PK_PREFIX/etc/yum.repos.d/fedora-updates.repo +fi +if [ -f /etc/yum.repos.d/fedora-updates-testing.repo ] ; then + cp /etc/yum.repos.d/fedora-updates-testing.repo $PK_PREFIX/etc/yum.repos.d/ + sed -i -e 's|^metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-testing-f$releasever&arch=$basearch|baseurl=https://kojipkgs.fedoraproject.org/mash/updates/f$releasever-updates-testing/$basearch/|' \ + $PK_PREFIX/etc/yum.repos.d/fedora-updates-testing.repo +fi +if [ -f /etc/yum.repos.d/fedora-rawhide.repo ] ; then + cp /etc/yum.repos.d/fedora-rawhide.repo $PK_PREFIX/etc/yum.repos.d/ + sed -i -e 's|^metalink=https://mirrors.fedoraproject.org/metalink?repo=rawhide&arch=$basearch|baseurl=https://kojipkgs.fedoraproject.org/mash/rawhide/$basearch/os/|' \ + $PK_PREFIX/etc/yum.repos.d/fedora-rawhide.repo +fi +rpm --root=$PK_PREFIX --initdb +DESTDIR=$PK_PREFIX /usr/libexec/packagekit-direct refresh +if [ -d /var/cache/PackageKit ] ; then + mv $PK_PREFIX/var/cache/PackageKit/* /var/cache/PackageKit/ +fi +rm -rf $PK_PREFIX + From 2459d8254be561f0167398e5d1e10ccb8a3f0cb8 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Tue, 20 Oct 2015 20:17:29 +0200 Subject: [PATCH 3/5] Move packagekit-cached-metadata.ks to snippets/ ... and make it a top-level script wrapped in %post ... %end. --- fedora-live-kde-base.ks | 3 +-- fedora-live-workstation.ks | 3 +-- .../packagekit-cached-metadata.ks | 6 +++++- 3 files changed, 7 insertions(+), 5 deletions(-) rename fedora-packagekit-cached-metadata.ks => snippets/packagekit-cached-metadata.ks (96%) diff --git a/fedora-live-kde-base.ks b/fedora-live-kde-base.ks index 1d5ed5c..3e1d26a 100644 --- a/fedora-live-kde-base.ks +++ b/fedora-live-kde-base.ks @@ -4,6 +4,7 @@ %include fedora-live-base.ks %include fedora-kde-packages.ks +%include snippets/packagekit-cached-metadata.ks %post @@ -19,8 +20,6 @@ cat > /root/.config/gtk-3.0/settings.ini << EOF gtk-theme-name = Adwaita EOF -%include fedora-packagekit-cached-metadata.ks - # add initscript cat >> /etc/rc.d/init.d/livesys << EOF diff --git a/fedora-live-workstation.ks b/fedora-live-workstation.ks index cc8ef57..376ee72 100644 --- a/fedora-live-workstation.ks +++ b/fedora-live-workstation.ks @@ -4,6 +4,7 @@ %include fedora-live-base.ks %include fedora-workstation-packages.ks +%include snippets/packagekit-cached-metadata.ks part / --size 6144 @@ -12,8 +13,6 @@ part / --size 6144 # This is a huge file and things work ok without it rm -f /usr/share/icons/HighContrast/icon-theme.cache -%include fedora-packagekit-cached-metadata.ks - cat >> /etc/rc.d/init.d/livesys << EOF diff --git a/fedora-packagekit-cached-metadata.ks b/snippets/packagekit-cached-metadata.ks similarity index 96% rename from fedora-packagekit-cached-metadata.ks rename to snippets/packagekit-cached-metadata.ks index d2ef0f1..140d5e5 100644 --- a/fedora-packagekit-cached-metadata.ks +++ b/snippets/packagekit-cached-metadata.ks @@ -1,4 +1,7 @@ -# Copy initial metadata for PackageKit +# %post script to include initial metadata for PackageKit + +%post + PK_PREFIX=`mktemp -d` mkdir -p $PK_PREFIX/etc/yum.repos.d if [ -f /etc/yum.repos.d/fedora.repo ] ; then @@ -28,3 +31,4 @@ if [ -d /var/cache/PackageKit ] ; then fi rm -rf $PK_PREFIX +%end From d293e561f4fda68698fc5537789d9f4ae31dbedc Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Tue, 20 Oct 2015 20:18:58 +0200 Subject: [PATCH 4/5] packagekit-cached-metadata.ks: Use http for kojipkgs.fedoraproject.org It turns out that koji builders can't access kojipkgs.fedoraproject.org over https, but plain http works just fine. --- snippets/packagekit-cached-metadata.ks | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/snippets/packagekit-cached-metadata.ks b/snippets/packagekit-cached-metadata.ks index 140d5e5..163f2cb 100644 --- a/snippets/packagekit-cached-metadata.ks +++ b/snippets/packagekit-cached-metadata.ks @@ -6,22 +6,22 @@ PK_PREFIX=`mktemp -d` mkdir -p $PK_PREFIX/etc/yum.repos.d if [ -f /etc/yum.repos.d/fedora.repo ] ; then cp /etc/yum.repos.d/fedora.repo $PK_PREFIX/etc/yum.repos.d/ - sed -i -e 's|^metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch|baseurl=https://kojipkgs.fedoraproject.org/mash/branched/$basearch/os/|' \ + sed -i -e 's|^metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch|baseurl=http://kojipkgs.fedoraproject.org/mash/branched/$basearch/os/|' \ $PK_PREFIX/etc/yum.repos.d/fedora.repo fi if [ -f /etc/yum.repos.d/fedora-updates.repo ] ; then cp /etc/yum.repos.d/fedora-updates.repo $PK_PREFIX/etc/yum.repos.d/ - sed -i -e 's|^metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f$releasever&arch=$basearch|baseurl=https://kojipkgs.fedoraproject.org/mash/updates/f$releasever-updates/$basearch/|' \ + sed -i -e 's|^metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f$releasever&arch=$basearch|baseurl=http://kojipkgs.fedoraproject.org/mash/updates/f$releasever-updates/$basearch/|' \ $PK_PREFIX/etc/yum.repos.d/fedora-updates.repo fi if [ -f /etc/yum.repos.d/fedora-updates-testing.repo ] ; then cp /etc/yum.repos.d/fedora-updates-testing.repo $PK_PREFIX/etc/yum.repos.d/ - sed -i -e 's|^metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-testing-f$releasever&arch=$basearch|baseurl=https://kojipkgs.fedoraproject.org/mash/updates/f$releasever-updates-testing/$basearch/|' \ + sed -i -e 's|^metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-testing-f$releasever&arch=$basearch|baseurl=http://kojipkgs.fedoraproject.org/mash/updates/f$releasever-updates-testing/$basearch/|' \ $PK_PREFIX/etc/yum.repos.d/fedora-updates-testing.repo fi if [ -f /etc/yum.repos.d/fedora-rawhide.repo ] ; then cp /etc/yum.repos.d/fedora-rawhide.repo $PK_PREFIX/etc/yum.repos.d/ - sed -i -e 's|^metalink=https://mirrors.fedoraproject.org/metalink?repo=rawhide&arch=$basearch|baseurl=https://kojipkgs.fedoraproject.org/mash/rawhide/$basearch/os/|' \ + sed -i -e 's|^metalink=https://mirrors.fedoraproject.org/metalink?repo=rawhide&arch=$basearch|baseurl=http://kojipkgs.fedoraproject.org/mash/rawhide/$basearch/os/|' \ $PK_PREFIX/etc/yum.repos.d/fedora-rawhide.repo fi rpm --root=$PK_PREFIX --initdb From a6d3b1c4561db37fc209fa1fc0ce45cb3935c107 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Tue, 20 Oct 2015 20:23:23 +0200 Subject: [PATCH 5/5] packagekit-cached-metadata.ks: Set up resolv.conf and hosts files Copy over host system's /etc/resolv.conf and /etc/hosts to make it possible to resolve kojipkgs.fedoraproject.org inside the chroot. --- snippets/packagekit-cached-metadata.ks | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/snippets/packagekit-cached-metadata.ks b/snippets/packagekit-cached-metadata.ks index 163f2cb..af206b0 100644 --- a/snippets/packagekit-cached-metadata.ks +++ b/snippets/packagekit-cached-metadata.ks @@ -1,7 +1,20 @@ # %post script to include initial metadata for PackageKit +%post --nochroot +# Copy over files needed for networking inside the chroot +for f in /etc/resolv.conf /etc/hosts ; do + test -f $f && cp -a $f ${INSTALL_ROOT}${f}.kickstart +done +%end + %post +# Use host machine's resolv.conf and hosts files +for f in /etc/resolv.conf /etc/hosts ; do + test -f $f && mv $f $f.orig + test -f $f.kickstart && mv -f $f.kickstart $f +done + PK_PREFIX=`mktemp -d` mkdir -p $PK_PREFIX/etc/yum.repos.d if [ -f /etc/yum.repos.d/fedora.repo ] ; then @@ -31,4 +44,10 @@ if [ -d /var/cache/PackageKit ] ; then fi rm -rf $PK_PREFIX +# Restore original resolv.conf and hosts files +for f in /etc/resolv.conf /etc/hosts ; do + rm -f $f + test -f $f.orig && mv $f.orig $f +done + %end