mirror of
https://git.adityakumar.xyz/lfs-scripts.git
synced 2024-12-22 15:22:56 +00:00
move driver code for chapter 2 inside chapter 2 folder
This commit is contained in:
parent
6e56b9c05c
commit
8fa5a3a782
2 changed files with 56 additions and 28 deletions
54
scripts/chapter2/main.sh
Normal file
54
scripts/chapter2/main.sh
Normal file
|
@ -0,0 +1,54 @@
|
|||
#!/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
|
||||
}
|
||||
|
||||
echo "Checking required packages"
|
||||
bash ./2.2-version-check.sh
|
||||
|
||||
# Exit on error
|
||||
check_exit_code
|
||||
if [ $exit_status -ne 0 ]
|
||||
then
|
||||
stop_script "chapter2/2.2-version-check.sh"
|
||||
fi
|
||||
|
||||
# Chapter 2.5
|
||||
# ===========
|
||||
echo "Creating filesystem"
|
||||
su -c "bash ./2.5-create-filesystem.sh"
|
||||
|
||||
# Exit on error
|
||||
check_exit_code
|
||||
if [ $exit_status -ne 0 ]
|
||||
then
|
||||
stop_script "chapter2/2.5-create-filesystem.sh"
|
||||
fi
|
||||
|
||||
|
||||
# Chapter 2.7
|
||||
# ===========
|
||||
echo "Mounting filesystem"
|
||||
su -c "bash ./2.7-mount.sh"
|
||||
|
||||
# Exit on error
|
||||
check_exit_code
|
||||
if [ $exit_status -ne 0 ]
|
||||
then
|
||||
stop_script "chapter2/2.7-mount.sh"
|
||||
fi
|
|
@ -32,46 +32,20 @@ function stop_script() {
|
|||
# Chapter 2
|
||||
# =========
|
||||
echo "Chapter 2"
|
||||
echo "Checking required packages"
|
||||
bash ./chapter2/2.2-version-check.sh
|
||||
bash ./chapter2/main.sh
|
||||
|
||||
# Exit on error
|
||||
check_exit_code
|
||||
if [ $exit_status -ne 0 ]
|
||||
then
|
||||
stop_script "chapter2/2.2-version-check.sh"
|
||||
stop_script "chapter3/3.1-sources.sh"
|
||||
fi
|
||||
|
||||
|
||||
# Set LFS variable
|
||||
# ================
|
||||
export LFS=/mnt/lfs
|
||||
echo "LFS is $LFS"
|
||||
|
||||
# Chapter 2.5
|
||||
# ===========
|
||||
echo "Creating filesystem"
|
||||
su -c "bash ./chapter2/2.5-create-filesystem.sh"
|
||||
|
||||
# Exit on error
|
||||
check_exit_code
|
||||
if [ $exit_status -ne 0 ]
|
||||
then
|
||||
stop_script "chapter2/2.5-create-filesystem.sh"
|
||||
fi
|
||||
|
||||
|
||||
# Chapter 2.7
|
||||
# ===========
|
||||
echo "Mounting filesystem"
|
||||
su -c "bash ./chapter2/2.7-mount.sh"
|
||||
|
||||
# Exit on error
|
||||
check_exit_code
|
||||
if [ $exit_status -ne 0 ]
|
||||
then
|
||||
stop_script "chapter2/2.7-mount.sh"
|
||||
fi
|
||||
|
||||
|
||||
# Chapter 3
|
||||
|
|
Loading…
Reference in a new issue