-
Notifications
You must be signed in to change notification settings - Fork 16
/
5.6-lfs_linux-4.2-api-headers.sh
85 lines (70 loc) · 2.01 KB
/
5.6-lfs_linux-4.2-api-headers.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
#!/bin/bash
CHAPTER_SECTION=6
INSTALL_NAME=linux
echo ""
echo "### ---------------------------"
echo "### Linux API HEADERS ###"
echo "### CHAPTER 5.$CHAPTER_SECTION ###"
echo "### Linux-4.2 API Headers"
echo "### Must be run as \"lfs\" user"
echo ""
echo "### Time estimate:"
echo "### real 0m12.862s"
echo "### user 0m2.440s"
echo "### sys 0m1.356s"
echo "### ---------------------------"
echo ""
echo "... Loading commun functions and variables"
if [ ! -f ./script-all_commun-functions.sh ]
then
echo "!! Fatal Error 1: './script-all_commun-functions.sh' not found."
exit 1
fi
source ./script-all_commun-functions.sh
if [ ! -f ./script-all_commun-variables.sh ]
then
echo "!! Fatal Error 1: './script-all_commun-variables.sh' not found."
exit 1
fi
source ./script-all_commun-variables.sh
echo ""
echo "... Validating the environment"
check_partitions
is_user lfs
check_tools
echo ""
echo "... Setup building environment"
BUILD_DIRECTORY=$INSTALL_NAME-build
LOG_FILE=$LFS_BUILD_LOGS_5$CHAPTER_SECTION-$INSTALL_NAME
cd $LFS_MOUNT_SOURCES
check_tarball_uniqueness
init_tarball $LFS_MOUNT_SOURCES
cd $(ls -d $LFS_MOUNT_SOURCES/$INSTALL_NAME*/)
echo ""
echo "... Installation starts now"
time {
echo ".... Making $SOURCE_FILE_NAME"
make mrproper $PROCESSOR_CORES &> $LOG_FILE-make-mrproper.log
echo ".... Installing $SOURCE_FILE_NAME"
make INSTALL_HDR_PATH=dest headers_install $PROCESSOR_CORES &> $LOG_FILE-make-install.log
echo ".... Post-Installing $SOURCE_FILE_NAME"
cp -rv dest/include/* /tools/include &> $LOG_FILE-postinstall-cp-devinclude.log
}
echo ""
echo "... Cleaning up $SOURCE_FILE_NAME"
cd $LFS_MOUNT_SOURCES
[ ! $SHOULD_NOT_CLEAN ] && rm -rf $(ls -d $LFS_MOUNT_SOURCES/$INSTALL_NAME*/)
rm -rf $BUILD_DIRECTORY
get_build_errors_5
echo ""
echo "######### END OF CHAPTER 5.$CHAPTER_SECTION ########"
echo "///// HUMAN REQUIRED \\\\\\\\\\\\\\\\\\\\"
echo "### Please run the next step:"
echo "### ./5.7-lfs_glibc-2.22.sh"
echo ""
if [ $ERRORS_COUNTER -ne 0 ]
then
exit 6
else
exit 0
fi