blob: 8153fc976010f6b6c657e258a183146c32369270 (
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
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
|
#tool/distro specific functions for fetching, building and installing dependencies
fetch_source () {
download_untar "$REQUIRED_URL" "src/"
download_untar "$REQUIRED_LIBKMOD_URL" "src/"
# Another nice hack for Scientific Linux - experimental.
if [ "$SYS_DISTRIBUTION" == "scientific" ]; then
download_untar "$REQUIRED_UTILLINUX_URL" "src/" || perror "Cannot download util-linux!"
download_untar "$REQUIRED_M4_URL" "src/" || perror "Cannot download m4 version $REQUIRED_AUTOMAKE_VERSION!"
download_untar "$REQUIRED_AUTOCONF_URL" "src/" || perror "Cannot download autoconf version $REQUIRED_AUTOCONF_VERSION!"
download_untar "$REQUIRED_AUTOMAKE_URL" "src/" || perror "Cannot download automake version $REQUIRED_AUTOMAKE_VERSION!"
fi
# Patch PATH environment
sed -s -i -r 's#"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin(:/sbin:/bin)?"#& ":/opt/openslx/usr/sbin:/opt/openslx/usr/bin:/opt/openslx/sbin:/opt/openslx/bin"#g' src/systemd-*/src/core/main.c
sed -s -i -r 's#"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"#& ":/opt/openslx/usr/sbin:/opt/openslx/usr/bin:/opt/openslx/sbin:/opt/openslx/bin"#g' src/systemd-*/src/nspawn/nspawn.c
}
build () {
#build libkmod
pinfo "Building libkmod"
cd "${MODULE_DIR}/src/$REQUIRED_LIBKMOD_VERSION"
./configure || perror "./configure kmod failed."
make || perror "kmod make failed."
make install || perror "kmod make install failed."
cd - &> /dev/null
# Scientific Linux specials
if [ "$SYS_DISTRIBUTION" == "scientific" ]; then
pinfo "Scientific Linux detected ..." # Freude, schöner Götterfunke!
# Some path mainpulations for followong utilities
OLDPATH=$PATH
PATH="${MODULE_BUILD_DIR}/usr/local/bin/:$PATH" # autoconf needs new m4
# Utillinux stuff
pinfo "Building util-linux"
cd "${MODULE_DIR}/src/util-linux-$REQUIRED_UTILLINUX_VERSION"
./configure --disable-libuuid --disable-libmount --without-ncurses \
--disable-mount --disable-losetup --disable-cytune --disable-fsck --disable-partx --disable-uuidd \
--disable-mountpoint --disable-fallocate --disable-unshare --disable-nsenter --disable-setpriv \
--disable-eject --disable-agetty --disable-cramfs --disable-bfs --disable-fdformat --disable-hwclock \
--disable-wdctl --disable-switch_root --disable-pivot_root --disable-kill --disable-utmpdump --disable-raw \
--disable-rename --disable-login --disable-sulogin --disable-su --disable-runuser --disable-ul --disable-more \
--disable-pg --disable-schedutils --disable-wall --disable-bash-completion \
|| perror "./configure util-linux failed."
make || perror "util-linux make failed."
DESTDIR="${MODULE_BUILD_DIR}" make install || perror "util-linux make install failed."
cd - &> /dev/null
# Let's have some starting fun with m4, as we want systemd, which wants automake 1.13, which wants autoconf,
# which wants m4 ...
pinfo "Building m4 Version $REQUIRED_M4_VERSION."
cd "${MODULE_DIR}/src/m4-$REQUIRED_M4_VERSION"
./configure || perror "./configure m4 failed."
make || perror "m4 make failed."
DESTDIR="${MODULE_BUILD_DIR}" make install || perror "m4 make install failed."
cd - &> /dev/null
# Let's have some starting fun with autoconf, as we want systemd, which wants automake 1.13, which wants
# autoconf 2.65 or better...
pinfo "Building autoconf Version $REQUIRED_AUTOCONF_VERSION."
cd "${MODULE_DIR}/src/autoconf-$REQUIRED_AUTOCONF_VERSION"
./configure || perror "./configure autoconf failed."
make || perror "autoconf make failed."
DESTDIR="${MODULE_BUILD_DIR}" make install || perror "autoconf make install failed."
cd - &> /dev/null
# Now let's have some fun with automake, as config.log/systemd will whine later about SL's automake 1.11:
# AUTOMAKE='${SHELL} /root/tm-scripts/remote/modules/systemd/src/systemd-206/build-aux/missing automake-1.13'
pinfo "Building automake Version $REQUIRED_AUTOMAKE_VERSION."
cd "${MODULE_DIR}/src/automake-$REQUIRED_AUTOMAKE_VERSION"
./configure || perror "./configure automake failed."
make || perror "automake make failed."
DESTDIR="${MODULE_BUILD_DIR}" make install || perror "automake make install failed."
cd - &> /dev/null
# patching configure for Scientific Linux - cave - ugly hack!
pinfo "Scientific Linux detected; patching systemd/configure..."
cd "${MODULE_DIR}/src/$REQUIRED_VERSION"
sed 's/dbus-1 >= 1.3.2/dbus-1 >= 1.2.24/g' configure > configure.patched
mv configure configure.orig
mv configure.patched configure
chmod +x configure
# For later compiling systemd
pinfo "-------------${MODULE_BUILD_DIR}--------------"
CPPFLAGS="-I${MODULE_BUILD_DIR}/usr/include/"
LDFLAGS="$LDFLAGS -L${MODULE_BUILD_DIR}/usr/lib/ -ldl"
# LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${MODULE_BUILD_DIR}/usr/lib/"
cd - &> /dev/null
PATH=$OLDPATH # re-set PATH
fi
#build systemd
pinfo "Building systemd"
cd "${MODULE_DIR}/src/$REQUIRED_VERSION"
pinfo "calling configure"
pinfo "-------$LDFLAGS------------$CPPFLAGS-----------------$LD_LIBRARY_PATH---------------------------------------------------"
./configure --disable-manpages --enable-split-usr --sysconfdir="/etc" --enable-gtk-doc-html=no --disable-nls \
--disable-microhttpd --disable-bootchart --disable-quotacheck --disable-hostnamed --disable-timedated \
--disable-localed --disable-coredump --disable-keymap --without-python --enable-blkid --enable-acl --enable-pam \
|| perror "configure failed."
pinfo "calling make"
make || perror "make failed."
pinfo "calling make install"
DESTDIR="${MODULE_BUILD_DIR}" make install || perror "make install failed."
cd - &> /dev/null
# Delete unneeded services
pinfo "Deleting unneeded services"
local SERVICE=
local OTHER=
for SERVICE in $REQUIRED_DISABLED_SERVICES; do
find "${MODULE_BUILD_DIR}" -name "$SERVICE" -exec rm -r {} \;
for OTHER in $(grep -l -r "$SERVICE" "$MODULE_BUILD_DIR/usr/lib/systemd/system"); do
sed -i -r "s#\s*$SERVICE\s*# #g" "$OTHER"
done
done
}
post_copy() {
# dont clear systemd log at startup
sed -i "s/TTYVTDisallocate=yes/TTYVTDisallocate=no/g" "${TARGET_BUILD_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" "${TARGET_BUILD_DIR}/usr/lib/systemd/system/getty@.service"
fi
# add nfs to modules-load list
echo "nfs" > "${TARGET_BUILD_DIR}/etc/modules-load.d/nfs.conf"
# add pam_systemd.so to pam modules directory
if [ -e "${MODULE_BUILD_DIR}/usr/lib/security/pam_systemd.so" ]; then
cp "${MODULE_BUILD_DIR}/usr/lib/security/pam_systemd.so" "${TARGET_BUILD_DIR}/lib/security/"
else
pdebug "No such file: ${MODULE_BUILD_DIR}/usr/lib/security/pam_systemd.so"
fi
}
|