Commit b8d843d
committed
cli: support the stateroot option also on
# Background
<hash> added the `stateroot` option to the `install` subcommand
# Issue
The `stateroot` option is not available on the `switch` subcommand
# Solution
Add the `stateroot` option to the `switch` subcommand
# Implementation
* If the stateroot is different than the current, we should allow using
the same image as the currently booted one
* Stateroot has to be explicitly created (`init_osname` binding) if it
doesn't exist. If it does, we still call `init_osname` and simply
ignore the error (TODO: only ignore non-already-exists errors)
* Copy `/var` from the old stateroot to the new one. I'm doing `--reflink`
but it's still very slow
* Must use the old stateroot to find the `merge_deployment` because
otherwise we boot without the required kargs (it manifested as a
missing `root=UUID=...` which caused the dracut rootfs-generator to
silently fail to create `sysroot.mount` and so `ostree-prepare-root`
failed due to empty `/sysroot`)
Signed-off-by: Omer Tuchfeld <[email protected]>switch
1 parent 1fd6c69 commit b8d843d
2 files changed
+49
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
102 | 108 | | |
103 | 109 | | |
104 | 110 | | |
| |||
628 | 634 | | |
629 | 635 | | |
630 | 636 | | |
631 | | - | |
| 637 | + | |
632 | 638 | | |
633 | 639 | | |
634 | 640 | | |
| |||
664 | 670 | | |
665 | 671 | | |
666 | 672 | | |
| 673 | + | |
667 | 674 | | |
668 | 675 | | |
669 | 676 | | |
670 | 677 | | |
671 | 678 | | |
672 | 679 | | |
673 | | - | |
674 | 680 | | |
675 | 681 | | |
676 | 682 | | |
| |||
687 | 693 | | |
688 | 694 | | |
689 | 695 | | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
690 | 706 | | |
691 | 707 | | |
692 | 708 | | |
693 | 709 | | |
694 | 710 | | |
695 | 711 | | |
696 | | - | |
697 | | - | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
698 | 717 | | |
699 | 718 | | |
700 | 719 | | |
701 | 720 | | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
702 | 742 | | |
703 | 743 | | |
704 | 744 | | |
| |||
712 | 752 | | |
713 | 753 | | |
714 | 754 | | |
715 | | - | |
716 | | - | |
| 755 | + | |
717 | 756 | | |
718 | 757 | | |
719 | 758 | | |
| |||
766 | 805 | | |
767 | 806 | | |
768 | 807 | | |
769 | | - | |
| 808 | + | |
770 | 809 | | |
771 | 810 | | |
772 | 811 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
376 | | - | |
377 | 376 | | |
378 | 377 | | |
379 | 378 | | |
| |||
396 | 395 | | |
397 | 396 | | |
398 | 397 | | |
399 | | - | |
| 398 | + | |
400 | 399 | | |
401 | 400 | | |
402 | 401 | | |
| |||
422 | 421 | | |
423 | 422 | | |
424 | 423 | | |
| 424 | + | |
425 | 425 | | |
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
429 | | - | |
| 429 | + | |
430 | 430 | | |
431 | 431 | | |
432 | 432 | | |
| |||
0 commit comments