summaryrefslogtreecommitdiffstats
path: root/make-fedora-ostree-tarball
blob: 2d09e32d1ca62bce5b884575ddf88e64b43fbf08 (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
38
39
40
41
42
#!/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}

# These two bits are expected to be visible at the OS/ by OSTree.
mkdir -p ${root}/sysroot
ln -s sysroot/ostree ${root}/ostree

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