mirror of
https://pagure.io/fedora-kickstarts.git
synced 2024-12-22 05:35:26 +00:00
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.
This commit is contained in:
parent
d293e561f4
commit
a6d3b1c456
@ -1,7 +1,20 @@
|
|||||||
# %post script to include initial metadata for PackageKit
|
# %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
|
%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`
|
PK_PREFIX=`mktemp -d`
|
||||||
mkdir -p $PK_PREFIX/etc/yum.repos.d
|
mkdir -p $PK_PREFIX/etc/yum.repos.d
|
||||||
if [ -f /etc/yum.repos.d/fedora.repo ] ; then
|
if [ -f /etc/yum.repos.d/fedora.repo ] ; then
|
||||||
@ -31,4 +44,10 @@ if [ -d /var/cache/PackageKit ] ; then
|
|||||||
fi
|
fi
|
||||||
rm -rf $PK_PREFIX
|
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
|
%end
|
||||||
|
Loading…
Reference in New Issue
Block a user