ready to begin chapter 9
parent
89a7e712ae
commit
1f5d82d752
|
@ -0,0 +1,46 @@
|
|||
#!/bin/bash
|
||||
# desc:
|
||||
# stages, builds, installs
|
||||
|
||||
# make variables persist in subprocesses for logging function
|
||||
set -a
|
||||
|
||||
APPNAME="post-stage4-cleanup"
|
||||
|
||||
|
||||
# the file to log to
|
||||
LOGFILE="${APPNAME}.log"
|
||||
|
||||
# ISO 8601 variation
|
||||
TIMESTAMP="$(date +%Y-%m-%d_%H:%M:%S)"
|
||||
|
||||
# the path where logs are written to
|
||||
# note: LOGS_ROOT is sourced from environment
|
||||
LOG_DIR="${LOGS_ROOT}/${APPNAME}-${TIMESTAMP}"
|
||||
|
||||
|
||||
# print to stdout, print to log
|
||||
logprint() {
|
||||
mkdir -p "${LOG_DIR}"
|
||||
echo "[$(date +%Y-%m-%d_%H:%M:%S)] [${APPNAME}] $1" \
|
||||
| tee -a "${LOG_DIR}/${LOGFILE}"
|
||||
}
|
||||
|
||||
# Tell the user we're alive...
|
||||
logprint "Initializing the ${APPNAME} utility..."
|
||||
|
||||
logprint "Cleanup of /tmp"
|
||||
rm -rf /tmp/*
|
||||
assert_zero $?
|
||||
|
||||
logprint "Erasing libtool archive files"
|
||||
find /usr/lib /usr/libexec -name \*.la -delete
|
||||
assert_zero $?
|
||||
|
||||
logprint "Deleting temporary toolchain..."
|
||||
find /usr -depth -name ${T_TRIPLET}\* | xargs rm -vrf
|
||||
assert_zero $?
|
||||
|
||||
# TODO better integrate test user lifecycle
|
||||
|
||||
logprint "Execution of ${APPNAME} completed."
|
|
@ -5,6 +5,7 @@
|
|||
"name": "welcome master",
|
||||
"dependencies": [ null ],
|
||||
"comment": "greet the user"
|
||||
}
|
||||
},
|
||||
|
||||
]
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
"comment": "LFS 11.3-systemd-rc1 Ch. 7.6"
|
||||
},
|
||||
{
|
||||
"name": "util-linux",
|
||||
"name": "util-linux pass 1",
|
||||
"dependencies": [ null ],
|
||||
"comment": "LFS 11.3-systemd-rc1 Ch. 7.12"
|
||||
},
|
||||
|
|
|
@ -377,7 +377,7 @@
|
|||
"comment": "LFS 11.3-systemd-rc1 Ch. 8.75"
|
||||
},
|
||||
{
|
||||
"name": "util-linux",
|
||||
"name": "util-linux pass 2",
|
||||
"dependencies": [ null ],
|
||||
"comment": "LFS 11.3-systemd-rc1 Ch. 8.76"
|
||||
},
|
||||
|
@ -385,6 +385,11 @@
|
|||
"name": "e2fsprogs",
|
||||
"dependencies": [ null ],
|
||||
"comment": "LFS 11.3-systemd-rc1 Ch. 8.77"
|
||||
},
|
||||
{
|
||||
"name": "stage4 cleanup",
|
||||
"dependencies": [ null ],
|
||||
"comment": "8.80"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -17,6 +17,24 @@
|
|||
"group": "root",
|
||||
"supply_environment": true,
|
||||
"environment": "environments/stage4.env.bash"
|
||||
},
|
||||
{
|
||||
"name": "stage4 cleanup",
|
||||
"target": "components/stage4/cleanup.bash",
|
||||
"is_shell_command": true,
|
||||
"shell_definition": "bash",
|
||||
"force_pty": true,
|
||||
"set_working_directory": false,
|
||||
"working_directory": "",
|
||||
"rectify": false,
|
||||
"rectifier": "",
|
||||
"active": true,
|
||||
"required": true,
|
||||
"set_user_context": true,
|
||||
"user": "root",
|
||||
"group": "root",
|
||||
"supply_environment": true,
|
||||
"environment": "environments/stage4.env.bash"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -145,7 +145,7 @@
|
|||
"environment": "environments/stage3.env.bash"
|
||||
},
|
||||
{
|
||||
"name": "util-linux",
|
||||
"name": "util-linux pass 1",
|
||||
"target": "components/stage3/util-linux.bash --all",
|
||||
"is_shell_command": true,
|
||||
"shell_definition": "bash",
|
||||
|
|
|
@ -1351,7 +1351,7 @@
|
|||
"environment": "environments/stage4.env.bash"
|
||||
},
|
||||
{
|
||||
"name": "util-linux",
|
||||
"name": "util-linux pass 2",
|
||||
"target": "components/stage4/util-linux.bash --all",
|
||||
"is_shell_command": true,
|
||||
"shell_definition": "bash",
|
||||
|
@ -1385,6 +1385,24 @@
|
|||
"group": "root",
|
||||
"supply_environment": true,
|
||||
"environment": "environments/stage4.env.bash"
|
||||
},
|
||||
{
|
||||
"name": "stage4 cleanup",
|
||||
"target": "components/stage4/cleanup.bash",
|
||||
"is_shell_command": true,
|
||||
"shell_definition": "bash",
|
||||
"force_pty": true,
|
||||
"set_working_directory": false,
|
||||
"working_directory": "",
|
||||
"rectify": false,
|
||||
"rectifier": "",
|
||||
"active": true,
|
||||
"required": true,
|
||||
"set_user_context": true,
|
||||
"user": "root",
|
||||
"group": "root",
|
||||
"supply_environment": true,
|
||||
"environment": "environments/stage4.env.bash"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue