-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path54-util-linux-e2fsprogs.sh
executable file
·109 lines (98 loc) · 3.74 KB
/
54-util-linux-e2fsprogs.sh
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
#!/bin/bash
# QQ群:111601117、钉钉群:35948877
# 避免chroot后执行
id lfs >/dev/null 2>&1
if [ $? = 0 ]; then
source `dirname ${BASH_SOURCE[0]}`/lfs.sh
cp -v ${BASH_SOURCE[0]} $LFS/task.sh
sed "s/_LFS_VERSION/$(getConf LFS_VERSION)/g" -i $LFS/task.sh
sed "s/_LFS_BUILD_PROC/$LFS_BUILD_PROC/g" -i $LFS/task.sh
source `dirname ${BASH_SOURCE[0]}`/chroot.sh
rm -fv $LFS/task.sh
exit
fi
# 来自chroot之后的调用
pushd /sources/_LFS_VERSION
PKG_NAME=util-linux
PKG_PATH=$(find stage4 -maxdepth 1 -type d -name "$PKG_NAME-*")
if [ -z $PKG_PATH ]; then
tar -xpvf $(find . -maxdepth 1 -type f -name "$PKG_NAME-*.tar.*") --directory stage4
PKG_PATH=$(find stage4 -maxdepth 1 -type d -name "$PKG_NAME-*")
fi
if [ ! -f $PKG_PATH/_BUILD_DONE ]; then
pushd $PKG_PATH
./configure ADJTIME_PATH=/var/lib/hwclock/adjtime \
--bindir=/usr/bin \
--libdir=/usr/lib \
--sbindir=/usr/sbin \
--docdir=/usr/share/doc/util-linux-2.38.1 \
--disable-chfn-chsh \
--disable-login \
--disable-nologin \
--disable-su \
--disable-setpriv \
--disable-runuser \
--disable-pylibmount \
--disable-static \
--without-python
[ $? = 0 ] && make -j_LFS_BUILD_PROC
if [ $? = 0 ]; then
chown -Rv tester .
su tester -c "make -k check"
read -p "$PKG_NAME CHECK DONE..."
fi
[ $? = 0 ] && make install
if [ $? = 0 ]; then
read -p "$PKG_NAME ALL DONE..."
touch _BUILD_DONE
else
pwd
exit 1
fi
popd
fi
popd
pushd /sources/_LFS_VERSION
PKG_NAME=e2fsprogs
PKG_PATH=$(find stage4 -maxdepth 1 -type d -name "$PKG_NAME-*")
if [ -z $PKG_PATH ]; then
tar -xpvf $(find . -maxdepth 1 -type f -name "$PKG_NAME-*.tar.*") --directory stage4
PKG_PATH=$(find stage4 -maxdepth 1 -type d -name "$PKG_NAME-*")
fi
if [ ! -f $PKG_PATH/build/_BUILD_DONE ]; then
mkdir -pv $PKG_PATH/build
pushd $PKG_PATH/build
../configure --prefix=/usr \
--sysconfdir=/etc \
--enable-elf-shlibs \
--disable-libblkid \
--disable-libuuid \
--disable-uuidd \
--disable-fsck
[ $? = 0 ] && make -j_LFS_BUILD_PROC
if [ $? = 0 ]; then
# 已知一项名为 u_direct_io 的测试可能在一些系统上失败
# 370 tests succeeded 1 tests failed
make -j_LFS_BUILD_PROC -k check
read -p "$PKG_NAME CHECK DONE..."
fi
[ $? = 0 ] && make install
if [ $? = 0 ]; then
# 删除无用的静态库
rm -fv /usr/lib/{libcom_err,libe2p,libext2fs,libss}.a
# 解压并更新系统 dir 文件
gunzip -v /usr/share/info/libext2fs.info.gz
install-info --dir-file=/usr/share/info/dir /usr/share/info/libext2fs.info
# 创建并安装一些额外的文档
makeinfo -o doc/com_err.info ../lib/et/com_err.texinfo
install -v -m644 doc/com_err.info /usr/share/info
install-info --dir-file=/usr/share/info/dir /usr/share/info/com_err.info
read -p "$PKG_NAME ALL DONE..."
touch _BUILD_DONE
else
pwd
exit 1
fi
popd
fi
popd