avatar
mikhailnov has added c39dbb0e00
Refactor adding repositories
... ... --- a/MATRIX
... ... +++ b/MATRIX
... ... @@ -3,6 +3,8 @@
3 3
set -x #verbose output
4 4
set -e #fail in case of any error
5 5
6
. common-funcs.sh || exit 1
7
6 8
fail(){
7 9
	echo "Critical failure, terminating."
8 10
	exit 1
... ... @@ -18,10 +20,16 @@ umount_chroot_bind_nofail(){
20 20
git config --system http.postBuffer 52428800
21 21
PRODUCTNAME="ROSA.DESKTOP.$RELEASE"
22 22
ch="$PRODUCTNAME"
23
echo $PRODUCTNAME
24
echo $REPO
25
echo $TYPES
26
echo $DE
23
ROSA_PLATFORM="${ROSA_PLATFORM:-rosa2016.1}"
24
25
# This is bad, but for now building ISOs of multiple archs
26
# at one time is broken, so take the first arch in $TYPES.
27
type="$(echo "$TYPES" | awk '{print $1}')"
28
set_types
29
ARCH="$arch"
30
31
MIRROR="${MIRROR:-http://abf-downloads.rosalinux.ru}"
32
REPO="${REPO:-${MIRROR}/${ROSA_PLATFORM}/repository/${ARCH}/}"
27 33
28 34
umount_chroot_bind_nofail
29 35
... ... @@ -34,7 +42,8 @@ done
42 42
urpmq --list-url
43 43
urpmi.update -a
44 44
urpmi lsof #remove when basesystem is >= 2015-25 (https://bugzilla.rosalinux.ru/show_bug.cgi?id=9510)
45
urpmi.addmedia --urpmi-root $PRODUCTNAME --distrib $REPO 2>&1 > /home/vagrant/results/addrepo.log
45
46
urpmi.addmedia --distrib --mirrorlist "$REPO" --urpmi-root "$PRODUCTNAME" 2>&1 > /home/vagrant/results/addrepo.log
46 47
urpmi --urpmi-root $PRODUCTNAME --root $PRODUCTNAME basesystem-minimal basesystem urpmi rpm locales-en locales-ru rpm-build livecd-tools syslinux git --auto --noverify --download-all
47 48
48 49
for mount_point in proc 'dev/pts' dev sys
... ... @@ -71,10 +80,11 @@ done
80 80
chroot $ch git config --system http.postBuffer 52428800
81 81
ls -R > /home/vagrant/results/ls.log
82 82
83
echo 
83
echo
84 84
echo "----------> UR IN Z MATRIX <----------"
85 85
86
echo $BUILD_ID
86
# build script sources common-funcs.sh
87
cp common-funcs.sh "${ch}/opt/ISOBUILD/"
87 88
chroot "${ch}" /bin/sh -c "env BUILD_ID=${BUILD_ID} ${ch}/opt/ISOBUILD/build"
88 89
ret_code=$?
89 90
cp -rfT  $ch/$ch/opt/ISOBUILD/iso /home/vagrant/results
... ... --- a/build
... ... +++ b/build
... ... @@ -3,6 +3,8 @@
3 3
set -x #verbose output
4 4
#set -e #fail in case of any error (currently this code is not ready for this)
5 5
6
. common-funcs.sh || exit 1
7
6 8
losetup -a
7 9
losetup -D
8 10
... ... @@ -27,32 +29,7 @@ num_fail=0
29 29
30 30
# Possible ISO types: 32- or 64-bit with or without UEFI (32, 32u, 64, 64u)
31 31
for type in $TYPES; do
32
	# Translate ISO type into architecture + UEFI flag
33
	if [ "${type:0:2}" = "32" ]; then
34
		arch="i586"
35
		lib="lib"
36
		uefi="${type:2:1}"
37
	elif [ "${type:0:4}" = "i586" ]; then
38
		# Support architecture instead of bitness, but consider it deprecated
39
		arch="i586"
40
		lib="lib"
41
		uefi="${type:4:1}"
42
	elif [ "${type:0:2}" = "64" ]; then
43
		arch="x86_64"
44
		lib="lib64"
45
		uefi="${type:2:1}"
46
	elif [ "${type:0:6}" = "x86_64" ]; then
47
		# Support architecture instead of bitness, but consider it deprecated
48
		arch="x86_64"
49
		lib="lib64"
50
		uefi="${type:6:1}"
51
	else
52
		echo ""
53
		echo "!!!         INVALID ISO TYPE SPECIFIED ($type), SKIPPING         !!!"
54
		echo ""
55
		num_fail=$((num_fail + 1))
56
		continue
57
	fi
32
	set_types
58 33
	uefi="${uefi,,}"
59 34
60 35
	echo ""
view file @ c39dbb0e00
... ... --- /dev/null
... ... +++ b/common-funcs.sh
... ... @@ -0,0 +1,31 @@
1
#!/usr/bin/env bash
2
# Common functions for multople scripts
3
4
set_types(){
5
	# Translate ISO type into architecture + UEFI flag
6
	if [ "${type:0:2}" = "32" ]; then
7
		arch="i586"
8
		lib="lib"
9
		uefi="${type:2:1}"
10
	elif [ "${type:0:4}" = "i586" ]; then
11
		# Support architecture instead of bitness, but consider it deprecated
12
		arch="i586"
13
		lib="lib"
14
		uefi="${type:4:1}"
15
	elif [ "${type:0:2}" = "64" ]; then
16
		arch="x86_64"
17
		lib="lib64"
18
		uefi="${type:2:1}"
19
	elif [ "${type:0:6}" = "x86_64" ]; then
20
		# Support architecture instead of bitness, but consider it deprecated
21
		arch="x86_64"
22
		lib="lib64"
23
		uefi="${type:6:1}"
24
	else
25
		echo ""
26
		echo "!!!         INVALID ISO TYPE SPECIFIED ($type), SKIPPING         !!!"
27
		echo ""
28
		num_fail=$((num_fail + 1))
29
		continue
30
	fi 
31
}

Comments