|
53 | 53 | # * ENABLE_BOOTCHART: Enable SONiC bootchart
|
54 | 54 | # * Default: n
|
55 | 55 | # * Values: y,n
|
| 56 | +# * UNATTENDED: Don't wait for interactive input from terminal, setting this |
| 57 | +# * value to anything will enable it |
| 58 | +# * Default: unset |
| 59 | +# * Value: y |
56 | 60 | #
|
57 | 61 | ###############################################################################
|
58 | 62 |
|
@@ -585,23 +589,28 @@ init :
|
585 | 589 |
|
586 | 590 | .ONESHELL : reset
|
587 | 591 | reset :
|
588 |
| - $(Q)echo && echo -n "Warning! All local changes will be lost. Proceed? [y/N]: " |
589 |
| - $(Q)read ans && ( |
590 |
| - if [ $$ans == y ]; then |
591 |
| - echo "Resetting local repository. Please wait..."; |
592 |
| - sudo rm -rf fsroot*; |
593 |
| - if [ "$(MULTIARCH_QEMU_ENVIRON)" == y ] && [[ "$(CONFIGURED_ARCH)" == "armhf" || "$(CONFIGURED_ARCH)" == "arm64" ]]; then |
594 |
| - echo "Stopping march $(CONFIGURED_ARCH) docker" |
595 |
| - sudo kill -9 `sudo cat /var/run/march/docker.pid` || true |
596 |
| - sudo rm -f /var/run/march/docker.pid || true |
597 |
| - fi |
598 |
| - git clean -xfdf; |
599 |
| - git reset --hard; |
600 |
| - git submodule foreach --recursive 'git clean -xfdf || true'; |
601 |
| - git submodule foreach --recursive 'git reset --hard || true'; |
602 |
| - git submodule foreach --recursive 'git remote update || true'; |
603 |
| - git submodule update --init --recursive; |
604 |
| - echo "Reset complete!"; |
605 |
| - else |
606 |
| - echo "Reset aborted"; |
607 |
| - fi ) |
| 592 | + $(Q)echo && ( |
| 593 | + if [ -z "$(UNATTENDED)" ]; then |
| 594 | + echo -n "Warning! All local changes will be lost. Proceed? [y/N]: " |
| 595 | + @read ans |
| 596 | + else |
| 597 | + ans=y |
| 598 | + fi |
| 599 | + if [ $$ans == y ]; then |
| 600 | + echo "Resetting local repository. Please wait..."; |
| 601 | + sudo rm -rf fsroot*; |
| 602 | + if [ "$(MULTIARCH_QEMU_ENVIRON)" == y ] && [[ "$(CONFIGURED_ARCH)" == "armhf" || "$(CONFIGURED_ARCH)" == "arm64" ]]; then |
| 603 | + echo "Stopping march $(CONFIGURED_ARCH) docker" |
| 604 | + sudo kill -9 `sudo cat /var/run/march/docker.pid` || true |
| 605 | + sudo rm -f /var/run/march/docker.pid || true |
| 606 | + fi |
| 607 | + git clean -xfdf; |
| 608 | + git reset --hard; |
| 609 | + git submodule foreach --recursive 'git clean -xfdf || true'; |
| 610 | + git submodule foreach --recursive 'git reset --hard || true'; |
| 611 | + git submodule foreach --recursive 'git remote update || true'; |
| 612 | + git submodule update --init --recursive; |
| 613 | + echo "Reset complete!"; |
| 614 | + else |
| 615 | + echo "Reset aborted"; |
| 616 | + fi ) |
0 commit comments