blob: 4663c1b7c1871cb006ec7442abf5a1410318a33e (
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
#!/bin/sh
#
# helper script: generate the source release archive
#
# Copyright (C) 2014, 2015 Francis Rowe <info@gluglug.org.uk>
# Copyright (C) 2015 Patrick "P. J." McDermott <pj@pehjota.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e
printf 'Building the source release archive\n'
version="$(git describe --tags HEAD)"
distdir="libreboot_${version}_src"
printf 'Deleting old source release archives\n'
rm -f "release/${distdir}.tar.xz"
rm -Rf "release/${distdir}"
mkdir -p "release/${distdir}/"
printf 'Copying sources to %s/\n' "release/${distdir}"
for resource in *; do
case "${resource}" in
libreboot_* | release | tobuild* | docs);;
*) cp -R "${resource}" "release/${distdir}/";;
esac
done
printf '%s\n' "${version}" >"release/${distdir}/version"
printf 'Cleaning files in %s/\n' "release/${distdir}"
# Clean old builds.
(cd "release/${distdir}/" && ./build clean all)
printf '\n'
# Delete Git repositories and properties and Subversion administrative
# directories and properties.
rm -Rf "release/${distdir}/bucts/".git*
rm -Rf "release/${distdir}/flashrom/".svn*
rm -Rf "release/${distdir}/grub/".git*
# Delete useless files.
rm -Rf "release/${distdir}/TODO/"
rm -f "release/${distdir}/push"
# Delete the deblob scripts.
# Since the source archive doesn't distribute the download scripts and already
# comes with a deblobbed coreboot, the deblobbing scripts aren't needed at all.
rm -Rf "release/${distdir}/resources/utilities/coreboot-libre/"
# We don't want to encourage development to happen on the release archives.
# Development goes in Git. These scripts are not needed in the source archive,
# because the files that they download are already included and trimmed.
rm -Rf "release/${distdir}/resources/scripts/helpers/build/release/"
rm -f "release/${distdir}/download"
rm -Rf "release/${distdir}/resources/scripts/helpers/download/"
rm -Rf "release/${distdir}/resources/scripts/helpers/build/trim/"
# Patches are not needed, because they are already applied to coreboot sources.
rm -Rf "release/${distdir}/resources/libreboot/patch/"
# coreboot's crossgcc archives are distributed separately.
rm -Rf "release/${distdir}/coreboot/util/crossgcc/tarballs/"
# ich9deblob: There are certain files in there that the user most likely does
# not want to share.
rm -f "release/${distdir}/resources/utilities/ich9deblob/deblobbed_descriptor.bin"
rm -f "release/${distdir}/resources/utilities/ich9deblob/factory.rom"
rm -f "release/${distdir}/resources/utilities/ich9deblob/libreboot.rom"
rm -f "release/${distdir}/resources/utilities/ich9deblob/mkdescriptor.c"
rm -f "release/${distdir}/resources/utilities/ich9deblob/mkdescriptor.h"
rm -f "release/${distdir}/resources/utilities/ich9deblob/mkgbe.c"
rm -f "release/${distdir}/resources/utilities/ich9deblob/mkgbe.h"
rm -f "release/${distdir}/resources/utilities/ich9deblob/ich9fdgbe_4m.bin"
rm -f "release/${distdir}/resources/utilities/ich9deblob/ich9fdgbe_8m.bin"
rm -f "release/${distdir}/resources/utilities/ich9deblob/demefactory_4kdescriptor.bin"
rm -f "release/${distdir}/mkgbe.c"
rm -f "release/${distdir}/mkgbe.h"
rm -f "release/${distdir}/ich9fdgbe_8m.bin"
rm -f "release/${distdir}/ich9fdgbe_4m.bin"
printf 'Creating %s.tar.xz\n' "release/${distdir}"
(cd release/ && tar -c "${distdir}/" | xz -9e >"${distdir}.tar.xz")
rm -Rf "release/${distdir}/"
printf 'Source release archives are stored in release/\n'
|