summaryrefslogtreecommitdiffstats
path: root/make-fedora-ostree-tarball
blob: c41b8107a9351ace08b2959425ee0ccd4b31fd5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env bash

srcdir=$(dirname $0)
releasever=19
name=fedora-ostree-${releasever}
prefix=$(pwd)/${name}
root=${prefix}.tmp
output=${name}.tar.gz
yumcachedir=${root}/var/cache/yum
yumcache_lookaside=${prefix}-yum-cache

set -x
set -e

if test -d ${yumcachedir}; then
    mv ${yumcachedir} ${yumcache_lookaside}
fi
rm ${root} -rf
if test -d ${yumcache_lookaside}; then
    mkdir -p ${root}/var/cache/
    mv ${yumcache_lookaside} ${yumcachedir}
fi
yum -c ${srcdir}/fedora-ostree.repo -y --releasever=${releasever} --nogpg --installroot=${root} --disablerepo='*' --enablerepo=fedora --enablerepo=fedora-ostree install systemd passwd yum ostree fedora-release vim-minimal kernel dracut
if test "${mfotbreak}" = "post-yum"; then
    bash
fi
# To have OSTree work, directories need to be writable by the user.
# Also, there's no point in shipping private files; there's no
# security on OSTree repositories, so make everything at least
# readable.
chmod -R u+rw,go+r ${root}
rm ${root}/var/lib/yum/* -rf
rm ${root}/var/cache/yum/* -rf
rm ${root}/var/log/* -rf
tar -c -z -C ${root} -f ${output} .
echo "Generated ${output}"
rm ${root} -rf