mirror of
https://git.adityakumar.xyz/lfs-scripts.git
synced 2024-12-22 15:22:56 +00:00
move driver code for chapter 5 inside chapter 5 folder
This commit is contained in:
parent
dc3d878e75
commit
6e0ab27a7a
2 changed files with 83 additions and 51 deletions
81
scripts/chapter5/main.sh
Normal file
81
scripts/chapter5/main.sh
Normal file
|
@ -0,0 +1,81 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Exit on error
|
||||
# =============
|
||||
exit_status=0
|
||||
|
||||
function check_exit_code() {
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
exit_status=1
|
||||
else
|
||||
exit_status=0
|
||||
fi
|
||||
}
|
||||
|
||||
function stop_script() {
|
||||
echo "Script failed in $(pwd)/$1"
|
||||
exit 1
|
||||
}
|
||||
|
||||
PWD=$(pwd)
|
||||
|
||||
# Chapter 5.2
|
||||
# ===========
|
||||
echo "Building binutils"
|
||||
su - lfs -c "bash $PWD/5.2-binutils.sh"
|
||||
|
||||
# Exit on error
|
||||
check_exit_code
|
||||
if [ $exit_status -ne 0 ]
|
||||
then
|
||||
stop_script "chapter5/5.2-binutils.sh"
|
||||
fi
|
||||
|
||||
# Chapter 5.3
|
||||
# ===========
|
||||
echo "Building gcc"
|
||||
su - lfs -c "bash $PWD/5.3-gcc.sh"
|
||||
|
||||
# Exit on error
|
||||
check_exit_code
|
||||
if [ $exit_status -ne 0 ]
|
||||
then
|
||||
stop_script "chapter5/5.3-gcc.sh"
|
||||
fi
|
||||
|
||||
# Chapter 5.4
|
||||
# ===========
|
||||
echo "Building Linux API Headers"
|
||||
su - lfs -c "bash $PWD/5.4-linux-headers.sh"
|
||||
|
||||
# Exit on error
|
||||
check_exit_code
|
||||
if [ $exit_status -ne 0 ]
|
||||
then
|
||||
stop_script "chapter5/5.4-linux-headers.sh"
|
||||
fi
|
||||
|
||||
# Chapter 5.5
|
||||
# ===========
|
||||
echo "Building glibc"
|
||||
su - lfs -c "bash $PWD/5.5-glibc.sh"
|
||||
|
||||
# Exit on error
|
||||
check_exit_code
|
||||
if [ $exit_status -ne 0 ]
|
||||
then
|
||||
stop_script "chapter5/5.5-glibc.sh"
|
||||
fi
|
||||
|
||||
# Chapter 5.6
|
||||
# ===========
|
||||
echo "Building listdc++"
|
||||
su - lfs -c "bash $PWD/5.6-libstdc++.sh"
|
||||
|
||||
# Exit on error
|
||||
check_exit_code
|
||||
if [ $exit_status -ne 0 ]
|
||||
then
|
||||
stop_script "chapter5/5.6-libstdc++.sh"
|
||||
fi
|
|
@ -74,62 +74,13 @@ fi
|
|||
# Chapter 5.2
|
||||
# ===========
|
||||
echo "Chapter 5"
|
||||
echo "Building binutils"
|
||||
su - lfs -c "bash $PWD/chapter5/5.2-binutils.sh"
|
||||
bash ./chapter5/main.sh
|
||||
|
||||
# Exit on error
|
||||
check_exit_code
|
||||
if [ $exit_status -ne 0 ]
|
||||
then
|
||||
stop_script "chapter5/5.2-binutils.sh"
|
||||
fi
|
||||
|
||||
# Chapter 5.3
|
||||
# ===========
|
||||
echo "Building gcc"
|
||||
su - lfs -c "bash $PWD/chapter5/5.3-gcc.sh"
|
||||
|
||||
# Exit on error
|
||||
check_exit_code
|
||||
if [ $exit_status -ne 0 ]
|
||||
then
|
||||
stop_script "chapter5/5.3-gcc.sh"
|
||||
fi
|
||||
|
||||
# Chapter 5.4
|
||||
# ===========
|
||||
echo "Building Linux API Headers"
|
||||
su - lfs -c "bash $PWD/chapter5/5.4-linux-headers.sh"
|
||||
|
||||
# Exit on error
|
||||
check_exit_code
|
||||
if [ $exit_status -ne 0 ]
|
||||
then
|
||||
stop_script "chapter5/5.4-linux-headers.sh"
|
||||
fi
|
||||
|
||||
# Chapter 5.5
|
||||
# ===========
|
||||
echo "Building glibc"
|
||||
su - lfs -c "bash $PWD/chapter5/5.5-glibc.sh"
|
||||
|
||||
# Exit on error
|
||||
check_exit_code
|
||||
if [ $exit_status -ne 0 ]
|
||||
then
|
||||
stop_script "chapter5/5.5-glibc.sh"
|
||||
fi
|
||||
|
||||
# Chapter 5.6
|
||||
# ===========
|
||||
echo "Building listdc++"
|
||||
su - lfs -c "bash $PWD/chapter5/5.6-libstdc++.sh"
|
||||
|
||||
# Exit on error
|
||||
check_exit_code
|
||||
if [ $exit_status -ne 0 ]
|
||||
then
|
||||
stop_script "chapter5/5.6-libstdc++.sh"
|
||||
stop_script "Stopped in chapter 5"
|
||||
fi
|
||||
|
||||
# Chapter 6.2
|
||||
|
|
Loading…
Reference in a new issue