Add instructions to re-run setup.sh
This commit is contained in:
committed by
Julien Cretin
parent
796261d538
commit
53b46ce6d5
27
setup.sh
27
setup.sh
@@ -31,13 +31,31 @@ git submodule update --init
|
||||
|
||||
done_text="$(tput bold)DONE.$(tput sgr0)"
|
||||
|
||||
patch_conflict_detected () {
|
||||
cat <<EOF
|
||||
|
||||
This script cannot be run twice without reverting the patches.
|
||||
|
||||
To do so, follow these instructions:
|
||||
1. Commit any changes you want to save.
|
||||
2. Run the ./reset.sh script to revert all uncommitted changes.
|
||||
3. Run the ./setup.sh script again.
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Apply patches to kernel. Do that in a sub-shell
|
||||
(
|
||||
cd third_party/tock/ && \
|
||||
for p in ../../patches/tock/[0-9][0-9]-*.patch
|
||||
do
|
||||
echo -n '[-] Applying patch "'$(basename $p)'"... '
|
||||
git apply "$p" && echo $done_text
|
||||
if git apply "$p"
|
||||
then
|
||||
echo $done_text
|
||||
else
|
||||
patch_conflict_detected
|
||||
fi
|
||||
done
|
||||
)
|
||||
|
||||
@@ -47,7 +65,12 @@ done_text="$(tput bold)DONE.$(tput sgr0)"
|
||||
for p in ../../patches/libtock-rs/[0-9][0-9]-*.patch
|
||||
do
|
||||
echo -n '[-] Applying patch "'$(basename $p)'"... '
|
||||
git apply "$p" && echo $done_text
|
||||
if git apply "$p"
|
||||
then
|
||||
echo $done_text
|
||||
else
|
||||
patch_conflict_detected
|
||||
fi
|
||||
done
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user