mirror of
https://github.com/erenfro/gen2stage4.git
synced 2024-12-22 08:41:06 -05:00
Enabled code to actually run and be testable
This commit is contained in:
parent
e309ffafc0
commit
02d34478d8
3 changed files with 23 additions and 23 deletions
12
cpstage4.sh
12
cpstage4.sh
|
@ -82,10 +82,10 @@ done
|
|||
|
||||
|
||||
# checks if run as root:
|
||||
#if [[ "$(id -u)" -ne 0 ]]; then
|
||||
# echo "$(basename "$0"): must run as root"
|
||||
# exit 250
|
||||
#fi
|
||||
if [[ "$(id -u)" -ne 0 ]]; then
|
||||
echo "$(basename "$0"): must run as root"
|
||||
exit 250
|
||||
fi
|
||||
|
||||
if [[ -z "$sourcePath" ]]; then
|
||||
echo "$(basename "$0"): no source path specified"
|
||||
|
@ -213,6 +213,6 @@ fi
|
|||
|
||||
# start stage4 creation:
|
||||
if $optQuiet; then
|
||||
echo "Would've worked"
|
||||
#rsync "${rsyncOptions[@]}" "${syncExcludes[@]/#/--exclude=}" "$sourcePath" "$targetPath"
|
||||
#echo "Would've worked"
|
||||
rsync "${rsyncOptions[@]}" "${syncExcludes[@]/#/--exclude=}" "$sourcePath" "$targetPath"
|
||||
fi
|
||||
|
|
12
exstage4.sh
12
exstage4.sh
|
@ -85,10 +85,10 @@ while [[ $# -gt 0 ]]; do
|
|||
done
|
||||
|
||||
# checks if run as root:
|
||||
#if [[ "$(id -u)" -ne 0 ]]; then
|
||||
# echo "$(basename "$0"): must run as root"
|
||||
# exit 250
|
||||
#fi
|
||||
if [[ "$(id -u)" -ne 0 ]]; then
|
||||
echo "$(basename "$0"): must run as root"
|
||||
exit 250
|
||||
fi
|
||||
|
||||
if [[ ! -r "$archiveFile" ]]; then
|
||||
echo "ERROR: archive file (\`$archiveFile\`) does not exist"
|
||||
|
@ -158,6 +158,6 @@ fi
|
|||
|
||||
# start stage4 creation:
|
||||
if $optQuiet; then
|
||||
echo "Would've worked"
|
||||
#tar "${tarOptions[@]}" -f "$archiveFile" -C "$targetPath"
|
||||
#echo "Would've worked"
|
||||
tar "${tarOptions[@]}" -f "$archiveFile" -C "$targetPath"
|
||||
fi
|
||||
|
|
22
mkstage4.sh
22
mkstage4.sh
|
@ -112,10 +112,10 @@ done
|
|||
|
||||
|
||||
# checks if run as root:
|
||||
#if [[ "$(id -u)" -ne 0 ]]; then
|
||||
# echo "$(basename "$0"): must run as root"
|
||||
# exit 250
|
||||
#fi
|
||||
if [[ "$(id -u)" -ne 0 ]]; then
|
||||
echo "$(basename "$0"): must run as root"
|
||||
exit 250
|
||||
fi
|
||||
|
||||
if [[ -z "$targetPath" ]]; then
|
||||
echo "$(basename "$0"): no system path specified"
|
||||
|
@ -287,11 +287,11 @@ fi
|
|||
|
||||
# start stage4 creation:
|
||||
if $optQuiet; then
|
||||
echo "Would've worked"
|
||||
#tar "${tarOptions[@]}" "${tarIncludes[@]/#/--include=}" "${tarExcludes[@]/#/--exclude=}" -f "${stage4Filename}.${stage4Ext}" "${targetPath}"
|
||||
#if [[ "$optSeperateKernel" ]]
|
||||
#then
|
||||
# tar "${tarOptions[@]}" -f "${stage4Filename}.ksrc.${stage4Ext}" "${targetPath}usr/src/linux-$(uname -r)"
|
||||
# tar "${tarOptions[@]}" -f "${stage4Filename}.kmod.${stage4Ext}" "${targetPath}lib"*"/modules/$(uname -r)"
|
||||
#fi
|
||||
#echo "Would've worked"
|
||||
tar "${tarOptions[@]}" "${tarIncludes[@]/#/--include=}" "${tarExcludes[@]/#/--exclude=}" -f "${stage4Filename}.${stage4Ext}" "${targetPath}"
|
||||
if [[ "$optSeperateKernel" ]]
|
||||
then
|
||||
tar "${tarOptions[@]}" -f "${stage4Filename}.ksrc.${stage4Ext}" "${targetPath}usr/src/linux-$(uname -r)"
|
||||
tar "${tarOptions[@]}" -f "${stage4Filename}.kmod.${stage4Ext}" "${targetPath}lib"*"/modules/$(uname -r)"
|
||||
fi
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue