-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path07-linux-api.sh
executable file
·37 lines (34 loc) · 1.22 KB
/
07-linux-api.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
#!/bin/bash
# QQ群:111601117、钉钉群:35948877
source `dirname ${BASH_SOURCE[0]}`/lfs.sh
# 配置LFS用户编译任务
if [ "$USER" != "lfs" ]; then
cp "$LFS_PROJECT/`basename ${BASH_SOURCE[0]}`" /home/lfs/build.sh
cp "$LFS_PROJECT/lfs.sh" /home/lfs/
cp "$LFS_PROJECT/lfs.conf" /home/lfs/
chown lfs:lfs /home/lfs/build.sh
chown lfs:lfs /home/lfs/lfs.sh
chown lfs:lfs /home/lfs/lfs.conf
[ ! -e /etc/bash.bashrc ] || mv -v /etc/bash.bashrc /etc/bash.bashrc.NOUSE
su - lfs
[ ! -e /etc/bash.bashrc.NOUSE ] || mv -v /etc/bash.bashrc.NOUSE /etc/bash.bashrc
rm -f /home/lfs/build.sh
rm -f /home/lfs/lfs.sh
rm -f /home/lfs/lfs.conf
exit
fi
# 来自lfs用户的调用
pushd $LFS/sources/$(getConf LFS_VERSION)
PKG_NAME=linux
PKG_PATH=$(find stage1 -maxdepth 1 -type d -name "$PKG_NAME-*")
if [ -z $PKG_PATH ]; then
tar -xpvf $(find . -maxdepth 1 -type f -name "$PKG_NAME-*.tar.*") --directory stage1
PKG_PATH=$(find stage1 -maxdepth 1 -type d -name "$PKG_NAME-*")
pushd $PKG_PATH
make mrproper
make headers
find usr/include -type f ! -name '*.h' -delete
cp -rv usr/include $LFS/usr
popd
fi
popd