summaryrefslogtreecommitdiffstats
path: root/remote/tools/systemd/systemd.build
blob: 7d9588c0dcf069a3fc4d399cf0e2ae8caace5ef9 (plain) (blame)
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
#tool/distro specific functions for fetching, building and installing dependencies

fetch_source () {
	[ ! -e .fetched_source ] && download_untar "$URL" "src/"
	touch .fetched_source
}	

install_dependencies() {
	# quick fix for missing libkmod repo...
	#libkmod=$(apt-cache search libkmod-dev)
	#if [[ -z $libkmod ]];
	#then
	#	echo "libkmod cannot be found. Adding ppa:pitti/systemd"
	#	add-apt-repository --yes ppa:pitti/systemd
	#	apt-get update --force-yes
	#fi
	# install libkmod from source
	# TODO: Use download_untar
	local libkmodversion=kmod-12
	if [ ! -d $libkmodversion ]; then
		wget http://www.kernel.org/pub/linux/utils/kernel/kmod/${libkmodversion}.tar.gz
		tar xf $libkmodversion.tar.gz
		rm ${libkmodversion}.tar.gz
		cd $libkmodversion
		./configure
		make -j5
		make install
		cd -
	fi
	
	apt-get install -y $DEPS
}

build () {
	if [ ! -e .built ]; then
		cd "src/$VERSION/"
		pinfo "calling configure"
		./configure --disable-manpages --enable-split-usr --sysconfdir="/etc" --enable-gtk-doc-html=no || perror "configure failed."
		pinfo "calling make"
		make -j5 || perror "make failed."
		mkdir -p $TOOL_DIR/$TOOL/build
		pinfo "calling make install"
		DESTDIR=$TOOL_DIR/$TOOL/build make install || perror "make install failed."
		cd -
		touch .built
	fi
}

post_copy() {
	# copy static data files
	cp -r $TOOL_DIR/$TOOL/data/* $INIT_DIR || perror "copying data files failed."
		
	# dont clear systemd log at startup
	sed -i.bak "s/TTYVTDisallocate=yes/TTYVTDisallocate=no/g" $INIT_DIR/usr/lib/systemd/system/getty@.service

	#old agetty version doesn't support --noclear option in getty service
	if [ "x$(dpkg -s util-linux | grep Version: | cut -d' ' -f2)" == "x2.19.1-2ubuntu3" ];
	then
		sed -i.bak "s/ExecStart=-\/sbin\/agetty --noclear %I 38400 linux/ExecStart=-\/sbin\/agetty %I 38400 linux/g" $INIT_DIR/usr/lib/systemd/system/getty@.service
	fi

	# add nfs to modules-load list
	echo "nfs" > "$INIT_DIR/etc/modules-load.d/nfs.conf"
}