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

fetch_source () {
	if [ ! -e .fetched_source ]; then
 		[ ! -d src ] && mkdir src
		wget $URL
		tar xJf $VERSION.tar.xz -C src/
		rm $VERSION.tar.xz
		touch .fetched_source
	fi
}	

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
	apt-get install -y $DEPS &>/dev/null
}

build () {
	if [ ! -e .built ]; then
		cd src/$VERSION
		./configure --disable-manpages --enable-split-usr --sysconfdir="/etc"
		make -j5
		[ ! -d $TOOL_DIR/$TOOL/build ] && mkdir -p $TOOL_DIR/$TOOL/build
		DESTDIR=$TOOL_DIR/$TOOL/build make install
		cd -
	touch .built
	fi
}

post_copy() {
	# copy static data files
	cp -r $TOOL_DIR/$TOOL/data/* $INIT_DIR
		
	# 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
}