/
default.conf
3704 lines (3604 loc) · 196 KB
/
default.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# conf/default.conf
# Relax-and-Recover default configuration.
# This file is part of Relax-and-Recover, licensed under the GNU General
# Public License. Refer to the included COPYING for full text of license.
#
# Here we define and describe all configuration variables and set them to a default.
#
# Do not change them here. Set them in your site.conf or local.conf file as needed.
#
# Many variables are bash arrays that should be set carefully.
# Use VAR=() to set an empty array.
# Use VAR+=( 'value' ) to append a fixed value to an array.
# Use VAR+=( "$var" ) to append a variable value to an array.
# Whether or not the latter case works as intended depends on when and
# how "$var" is set and evaluated by the Relax-and-Recover scripts.
# Be careful with values that are globbing patterns (cf. COPY_AS_IS below).
# Globbing patterns should not be quoted like VAR+=( /directory/* )
# when for globbing patterns bash pathname expansion is intended
# in contrast to quoted globbing patterns like VAR+=( '/directory/*' )
# where bash pathname expansion would usually not happen.
# In general using ${VAR[*]} is problematic and
# using ${VAR[@]} without double-quotes is also problematic
# so to prepend to an array use VAR=( 'prepend_value' "${VAR[@]}" )
# see 'Arrays' in "man bash" and for some examples see
# https://github.com/rear/rear/issues/1068
#
# Most variables can be set to an empty value VAR= which means that this
# setting is off or set to some automatic mode.
#
# Boolean variables can be set to anything as we only check whether the variable
# is not empty so that both VAR=yes and VAR=no evaluate to boolean 'true'.
# To set a boolean variable to 'false' set it to an empty value.
#
# Some variables have ternary semantics:
# - explicit true value like True T true t Yes Y yes y 1
# - explicit false value like False F false f No N no n 0
# - unset or empty or a value that is neither a true value nor a false value
# (see the is_true and is_false functions in lib/global-functions.sh).
#
# In case of doubt inspect the scripts how exactly a particular variable works.
####
# TMPDIR
#
# Relax-and-Recover needs a (temporary) working area where it builds in particular
# the rescue/recovery system ISO image (and perhaps even stores the backup archive).
# The directory name of the working area is created in /usr/sbin/rear by calling
# mktemp -d -t rear.XXXXXXXXXXXXXXX
# which usually results /tmp/rear.XXXXXXXXXXXXXXX or $TMPDIR/rear.XXXXXXXXXXXXXXX
# the latter when the canonical Linux/Unix environment variable TMPDIR
# is set in the environment where /usr/sbin/rear is called.
# To have a specific working area directory prefix for Relax-and-Recover call
# export TMPDIR="/prefix/for/rear/working/directory"
# before calling 'rear' (/prefix/for/rear/working/directory must already exist).
# This is useful for example when there is not sufficient free space
# in /var/tmp or $TMPDIR for the ISO image or even the backup archive.
# TMPDIR cannot be set to a default value here unconditionally but only
# if it is not set before calling the program, otherwise /usr/sbin/rear
# would not work in compliance with the Linux/Unix standards regarding TMPDIR
# see https://github.com/rear/rear/issues/968
# The default is /var/tmp instead of the more usual /tmp (the system default),
# because /tmp is not intended for such large amounts of data that ReaR usually
# produces when creating the image (see file-hierarchy(7)). In particular,
# /tmp can be a tmpfs, and thus restricted by the available RAM/swap.
export TMPDIR="${TMPDIR-/var/tmp}"
####
####
# ROOT_HOME_DIR
#
# According to the Filesystem Hierarchy Standard
# the home directory for the root user has to be '/root'
# cf. https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard
# but you may set it as needed like ROOT_HOME_DIR=~root
# ~root is not included into double (or single) quotes so it can be
# later expanded to actual root home directory.
ROOT_HOME_DIR=~root
####
####
# You can override autodetection and specify the kernel for the rescue/recovery system:
KERNEL_FILE=""
# The kernel configuration is used to collect the kernel binary and modules.
# It can be set to a different version (e.g. to create a UP rescue media on a SMP system):
KERNEL_VERSION="${KERNEL_VERSION:-$( uname -r )}"
# You can add arbitrary kernel command line parameters when booting the rescue/recovery system
# as you need it (e.g. things like 'console=...' see USE_SERIAL_CONSOLE below).
# Additionally Relax-and-Recover supports some special kernel command line parameters like
# - 'debug'
# Starts all init-scripts (in /etc/scripts/system-setup.d/ in the rescue/recovery system)
# in debug mode (via 'set -x') and asks for confirmation before it runs each init-script.
# - 'auto_recover' or 'automatic'
# Launch rear recover automatically (without automated reboot).
# Together with debug it runs rear recover in debug mode.
# - 'unattended'
# Launch rear recover automatically as with auto_recover
# plus automated reboot after successful rear recover.
# - 'ip=...' 'nm=...' 'netdev=...' 'gw=...'
# If IP address plus optionally netmask (default 255.255.255.0),
# network device (default eth0), and a default gateway are specified
# only that single network device is set up.
# Example: ip=192.168.100.2 nm=255.255.255.0 netdev=eth0 gw=192.168.100.1
# - 'noip'
# Prevents initialization of the networking configuration which is useful when
# you want to do the networking configuration manually in the rescue/recovery system
# e.g. to prevent the rescue/recovery system to use same IP address as the original system
# but for the latter using USE_DHCLIENT="yes" (see below) is probably easier.
# See also the 'RESCUE IMAGE KERNEL COMMAND LINE OPTIONS' section in the ReaR man page ("man rear"):
KERNEL_CMDLINE=""
# The COPY_KERNEL_PARAMETERS array lists kernel parameters that should be part
# of the KERNEL_CMDLINE (in rescue image) if present on the current system (/proc/cmdline).
# COPY_KERNEL_PARAMETERS specifies kernel parameter keys without value (e.g. net.ifnames but not net.ifnames=0).
# If such a kernel parameter key is already specified in the KERNEL_CMDLINE variable
# the already specified setting supersedes the one detected on the current system (if any).
# - Check net.ifnames and biosdevname kernel parameter as it may impact
# the network interface name during recovery/migration.
COPY_KERNEL_PARAMETERS=( 'net.ifnames' 'biosdevname' )
####
####
# These variables are used to include arch/os/version specific stuff:
# machine architecture, OS independent
REAL_MACHINE="$( uname -m )"
case "$REAL_MACHINE" in
(x86_64|i686|i586)
# all these behave exactly like i386. For 64bit we took care to handle the
# special cases within the 32bit scripts to prevent code duplication
MACHINE=i386
;;
(arm*|aarch*)
MACHINE=arm
;;
(s390*)
MACHINE=s390
;;
(*)
MACHINE=$REAL_MACHINE
esac
# Architecture, e.g. Linux-i386
ARCH="$( uname -s )-$MACHINE" 2>>/dev/null
REAL_ARCH="$( uname -s )-$REAL_MACHINE" 2>>/dev/null
####
# Short hostname
HOSTNAME="$( hostname -s 2>/dev/null || uname -n | cut -d. -f1 )"
# Logfile name
# NOTE: This may not be dynamic, else deal with .bash_history in rescue system
LOGFILE="$LOG_DIR/rear-$HOSTNAME.log"
####
# Operating System, e.g. GNU/Linux
OS="$( uname -o )"
# Vendors are SUSE, Red Hat, Debian, Ubuntu, etc.
# as returned by lsb_release -i -s
OS_VENDOR=generic
# Versions are 9.0, 10, 12.2, etc.
# as returned by lsb_release -r -s
OS_VERSION=none
# Only with OS_VENDOR=generic and OS_VERSION=none
# the OS_VENDOR and OS_VERSION variables are automatically
# determined and set (via the above lsb_release calls).
# Setting OS_VENDOR or OS_VERSION to invalid or unsupported values
# results undefined behaviour for things that depend on those variables.
# If on your system the above lsb_release calls result values
# that are not yet supported by ReaR you may specify appropriate
# supported values that could make it work even for your system.
# See the SetOSVendorAndVersion function in the config-functions.sh script.
####
# Keep the build area after we are done (ternary).
# Useful to inspect the ReaR recovery system content in $TMPDIR/rear.XXXXXXXXXXXXXXX/rootfs/
# directly without the need to extract it from the initramfs/initrd in the ISO image.
# Set to "y", "Yes", etc. to always keep the build area, to "n", "No", etc. to never keep it.
# KEEP_BUILD_DIR is automatically set to true in debug mode (-d) and in debugscript mode (-D).
# In addition to true (or any value that is recognized as 'yes' by the is_true function)
# and false (or any value that is recognized as 'no' by the is_false function)
# it can be set to several special values:
# - 'errors' to obtain the old behaviour where KEEP_BUILD_DIR was always set to true
# to keep the build area when errors in the ReaR recovery system were detected.
# - empty (KEEP_BUILD_DIR="") which means that the build area will be kept on errors
# if running interactively (in a terminal) but not otherwise to avoid cluttering
# TMPDIR (see above) by cron or other automated jobs in case of errors.
KEEP_BUILD_DIR=""
####
# No default workflows. This variable is filled in where the workflows are defined
# without the empty string as initial value WORKFLOWS and LOCKLESS_WORKFLOWS would
# be unbound variables that would result an error exit if 'set -eu' is used:
WORKFLOWS=("")
# Allow some workflows to not lock and use a separate logfile named 'LOGFILE.lockless'.
# The LOCKLESS_WORKFLOWS array gets filled during runtime as needed by the various
# usr/share/rear/lib/WORKFLOW-workflow.sh scripts. Currently the following workflows
# add themselves to the LOCKLESS_WORKFLOWS array: checklayout dump help
# To make setting the right logfile name working in usr/sbin/rear
# the lockless workflows must also be predefined here (cf. usr/sbin/rear):
LOCKLESS_WORKFLOWS=( 'checklayout' 'dump' 'help' )
# SIMULTANEOUS_RUNNABLE_WORKFLOWS are also allowed to run simultaneously
# but cannot use LOGFILE.lockless as the LOCKLESS_WORKFLOWS.
# Instead the SIMULTANEOUS_RUNNABLE_WORKFLOWS get a LOGFILE with PID
# because simultaneously runnable workflows require unique logfile names
# so that the PID is interposed in the LOGFILE value from default.conf above,
# i.e. by default SIMULTANEOUS_RUNNABLE_WORKFLOWS use during runtime
# a logfile named /var/log/rear/rear-$HOSTNAME.$$.log that gets
# at the end copied to a final possibly used-defined LOGFILE,
# see /usr/sbin/rear and https://github.com/rear/rear/issues/1102
SIMULTANEOUS_RUNNABLE_WORKFLOWS=( 'mkbackuponly' 'restoreonly' )
####
# MESSAGE_PREFIX
# Get messages of Relax-and-Recover output functions prefixed with ${MESSAGE_PREFIX}.
# Other output (e.g. from programs that are called) is not prefixed.
# By default MESSAGE_PREFIX is empty but the user can set it e.g. to MESSAGE_PREFIX="$$: "
# to get ReaR messages prefixed with the PID of the running 'rear' main program which is
# basically a requirement when workflows are run simultaneously to get distinguishable
# messages (cf. SIMULTANEOUS_RUNNABLE_WORKFLOWS)
MESSAGE_PREFIX=""
####
# PROGRESS_MODE
# How progress messages are shown (cf. lib/progresssubsystem.nosh).
# PROGRESS_MODE can be "ANSI" (default/fallback) or "plain".
# When there is a tty on stdout messages via the progress subsystem
# are by default shown with ANSI escape sequences so that all
# subsequent progress messages appear on one same line.
# With PROGRESS_MODE="plain" the progress subsystem outputs the same
# messages as in "ANSI" mode but without ANSI escape sequences.
# PROGRESS_MODE="plain" is basically a requirement when workflows
# are run simultaneously (cf. SIMULTANEOUS_RUNNABLE_WORKFLOWS) because
# otherwise the progress messages from simultaneously running workflows
# would mix up on one same line which results illegible and meaningless
# output on the terminal
PROGRESS_MODE="ANSI"
#
# PROGRESS_WAIT_SECONDS
# The number of seconds between subsequent progress messages that are output
# via the progress subsystem while a longer task (usually backup or restore) runs.
# The default/fallback is 1 second. Setting e.g. PROGRESS_WAIT_SECONDS="5" can be
# used to get less progress messages on the terminal but at the same time it delays
# continuing after the task (e.g. backup or restore) had finished by half that time
# on average up to at most the whole amount of PROGRESS_WAIT_SECONDS
PROGRESS_WAIT_SECONDS="1"
####
####
# Relax-and-Recover UserInput function default behaviour
#
# see the UserInput function decription in
# usr/share/rear/lib/_input-output-functions.sh
#
# USER_INPUT_TIMEOUT
# USER_INPUT_INTERRUPT_TIMEOUT
# USER_INPUT_PROMPT
# USER_INPUT_MAX_CHARS
# USER_INPUT_user_input_ID
#
# USER_INPUT_TIMEOUT specifies the default timeout in seconds
# after that UserInput() automatically proceeds with a default value.
# That timeout interrupts a possibly ongoing user input
# (same as the timeout of the 'read' bash builtin).
# The UserInput timeout must be sufficiently long for the user
# to read and understand the possibly unexpected UserInput() message
# and then some more time to make a decision whether or not
# the default action ("just proceed") is actually the right one
# in his particular case and finally even more time to enter
# his particular input when the default is not the right one.
# USER_INPUT_TIMEOUT is set to a default value here only
# if not already set so that the user can set it also like
# export USER_INPUT_TIMEOUT=30
# directly before he calls "rear ...":
test "$USER_INPUT_TIMEOUT" || USER_INPUT_TIMEOUT=300
#
# USER_INPUT_INTERRUPT_TIMEOUT specifies the default timeout in seconds
# for how long UserInput() waits for the user to interrupt an automated input
# when a predefined input value is specified for a particular UserInput() call
# via a matching USER_INPUT_user_input_ID variable (see below).
# The minimum waiting time to interrupt an automated input is one second.
# The default is 10 seconds to give the user a better chance to recognize
# an automated input and be able to actually hit a key to interrupt.
# USER_INPUT_INTERRUPT_TIMEOUT is set to a default value here only
# if not already set so that the user can set it also like
# export USER_INPUT_INTERRUPT_TIMEOUT=5
# directly before he calls "rear ...":
test "$USER_INPUT_INTERRUPT_TIMEOUT" || USER_INPUT_INTERRUPT_TIMEOUT=10
#
# USER_INPUT_PROMPT specifies the default prompt text that is shown
# if no prompt was specified for a particular UserInput() call.
# USER_INPUT_PROMPT is set to a default value here only
# if not already set so that the user can set it also like
# export USER_INPUT_PROMPT="$HOSTNAME input"
# directly before he calls "rear ...":
test "$USER_INPUT_PROMPT" || USER_INPUT_PROMPT='enter your input'
#
# USER_INPUT_MAX_CHARS specifies the default maximum characters until
# the UserInput function truncates further input and returns.
# With the default USER_INPUT_MAX_CHARS=0 input is not truncated and it
# also makes correcting the input possible (before [Enter] is pressed)
# cf. https://github.com/rear/rear/issues/2622
# USER_INPUT_MAX_CHARS is set to a default value here only
# if not already set so that the user can set it also like
# export USER_INPUT_MAX_CHARS=200
# directly before he calls "rear ...":
test "$USER_INPUT_MAX_CHARS" || USER_INPUT_MAX_CHARS=0
#
# USER_INPUT_user_input_ID variables can be used to predefine automated
# input for UserInput() calls with the matching user_input_ID value.
# Each UserInput() call has a specific user_input_ID that is shown
# when ReaR is run in debug mode (via the '-d' command line option).
# For example "rear -d recover" may show something like:
# UserInput -I LAYOUT_MIGRATION_CONFIRM_MAPPINGS needed ...
# Confirm or edit the disk mapping
# 1) Confirm disk mapping and continue 'rear recover'
# 2) Edit disk mapping (/var/lib/rear/layout/disk_mappings)
# 3) Use Relax-and-Recover shell and return back to here
# 4) Abort 'rear recover'
# (default '1' timeout 300 seconds)
# In this case one can specify a predefined input in local.conf like
# USER_INPUT_LAYOUT_MIGRATION_CONFIRM_MAPPINGS=2
# or directly on command line before running "rear recover" like
# export USER_INPUT_LAYOUT_MIGRATION_CONFIRM_MAPPINGS=2
# The user_input_ID that is shown 'LAYOUT_MIGRATION_CONFIRM_MAPPINGS'
# must be appended to a USER_INPUT_ variable prefix to get the right
# USER_INPUT_LAYOUT_MIGRATION_CONFIRM_MAPPINGS variable name.
# Then the "Edit disk mapping" choice will be selected automatically.
# In this case the USER_INPUT_INTERRUPT_TIMEOUT is crucial because
# otherwise one would be caught in an endless "Edit disk mapping" loop.
####
# Default backup and output targets:
BACKUP=REQUESTRESTORE
OUTPUT=ISO
# Default cdrom size in MB (probably it is actually MiB?):
CDROM_SIZE=20
####
# The CHECK_CONFIG_FILES array lists files where changes
# require the ReaR rescue/recovery system to be recreated.
# Testing whether or not those files changed is implemented in the checklayout workflow
# which exits with non-zero exit code when the disk layout or those files changed
# (cf. https://github.com/rear/rear/issues/1134) but the checklayout workflow
# does not automatically recreate the rescue/recovery system.
# Files matching FILES_TO_PATCH_PATTERNS are added to this list automatically.
CHECK_CONFIG_FILES=( '/etc/drbd/' '/etc/drbd.conf' '/etc/lvm/lvm.conf' '/etc/multipath.conf' '/etc/rear/' '/etc/udev/udev.conf' )
#
# FILES_TO_PATCH_PATTERNS is a space-separated list of shell glob patterns.
# Files that match are eligible for a final migration of UUIDs and other
# identifiers after recovery (if the layout recreation process has led
# to a change of an UUID or a device name and a corresponding change needs
# to be performed on restored configuration files ).
# See finalize/GNU/Linux/280_migrate_uuid_tags.sh
# The [] around the first letter make sure that
# 'shopt -s nullglob' removes this file from the list if it does not exist:
FILES_TO_PATCH_PATTERNS="[b]oot/{grub.conf,menu.lst,device.map} [e]tc/grub.* \
[b]oot/grub/{grub.conf,grub.cfg,menu.lst,device.map} \
[b]oot/grub2/{grub.conf,grub.cfg,menu.lst,device.map} \
[e]tc/sysconfig/grub [e]tc/sysconfig/bootloader \
[e]tc/lilo.conf [e]tc/elilo.conf \
[e]tc/yaboot.conf \
[e]tc/mtab [e]tc/fstab [e]tc/crypttab \
[e]tc/mtools.conf \
[e]tc/smartd.conf [e]tc/sysconfig/smartmontools \
[e]tc/sysconfig/rawdevices \
[e]tc/security/pam_mount.conf.xml \
[b]oot/efi/*/*/grub.cfg"
####
####
# Relax-and-Recover recovery system update during "rear recover"
#
# see https://github.com/rear/rear/issues/841
# and https://hackweek.suse.com/14/projects/1508
#
# The by default empty RECOVERY_UPDATE_URL means this functionality is not used so that
# "rear recover" runs as usual without updating any files in the ReaR recovery system
# (i.e. with the recovery system as "rear mkbackup" or "rear mkrescue" had made it).
#
# If RECOVERY_UPDATE_URL is non-empty it points to a download location
# wherefrom "rear recover" will first of all download a tar.gz archive and
# extract that at the root directory '/' in the ReaR recovery system.
#
# The intended purpose is to download and replace in the recovery system ReaR config files
# (usually the content of /etc/rear/ and /var/lib/rear/recovery/ and /var/lib/rear/layout/)
# with updated ReaR config files.
#
# But it is not limited to replace only ReaR config files in the recovery system.
# Anything in the tar.gz archive will be extracted at '/' in the recovery system
# (even if it destroys the recovery system) so that it can also be used to update
# anything in the recovery system - provided one does the update carefully.
# For example one should not replace currently running ReaR scripts.
#
# Currently only a HTTP download location is supported like
# RECOVERY_UPDATE_URL="http://my_internal_server/$HOSTNAME.rear_config.tgz"
# so that "curl -o recovery-update.tar.gz $RECOVERY_UPDATE_URL" will work.
# Accordingly when using RECOVERY_UPDATE_URL="http://..."
# curl should be added to the REQUIRED_PROGS array like
# REQUIRED_PROGS+=( curl )
#
# RECOVERY_UPDATE_URL is set to a default value here only
# if not already set so that the user can set it also via
# export RECOVERY_UPDATE_URL="http://my_internal_server/host123_rear_config.tgz"
# directly before he calls "rear recover":
test "$RECOVERY_UPDATE_URL" || RECOVERY_UPDATE_URL=""
####
####
# MIGRATION_MODE recovery during "rear recover"
#
# There is some basic autodetection during "rear recover" when
# disks on the replacement hardware seem to not match compared to
# what there was stored in disklayout.conf on the original system.
# If a mismatch is autodetected then ReaR goes into its
# MIGRATION_MODE where manual disk layout configuration happens.
# In this case ReaR asks the user via several user dialogs what to do.
# Only the disk size is used to determine whether or not
# disks on the replacement hardware match the disks on the original system.
# Problems only appear when more than one disk with same size is used.
# Examples:
# When on the original system and on the replacement hardware two disks
# with same size are used the disk devices may get interchanged
# so that what there was on /dev/sda on the original system may get
# recreated on /dev/sdb on the replacement hardware and vice versa.
# When on the original system one disk is used for the system and
# another disk with same size for the ReaR recovery system and backup
# the disk devices may get interchanged on the replacement hardware
# so that "rear recover" could result an ultimate disaster
# (instead of a recovery from a disaster) if it recreated the system
# on the disk where the ReaR recovery system and backup is
# which would overwrite/destroy the backup via parted and mkfs
# (cf. https://github.com/rear/rear/issues/1271).
# Therefore to be on the safe side and to avoid such problems
# ReaR goes by default automatically into its MIGRATION_MODE
# when more than one disk with same size is used on the original system
# or when for one of the used disk sizes on the original system
# more than one disk with same size is found on the replacement hardware
# i.e. when there is more than one possible target disk.
# Accordingly ReaR goes by default not into its MIGRATION_MODE
# only if for each used disk size on the original system eaxctly one
# possible target disk with same size is found on the replacement hardware.
# By setting MIGRATION_MODE='true' one can enfore MIGRATION_MODE.
# The by-default empty MIGRATION_MODE results that MIGRATION_MODE
# is set via the above described autodetection during "rear recover".
# MIGRATION_MODE is set to a default value here only
# if not already set so that the user can set it also via
# export MIGRATION_MODE='true'
# directly before he calls "rear recover":
test "$MIGRATION_MODE" || MIGRATION_MODE=''
####
####
# Wiping disks during "rear recover" before recreating the disk layout:
#
# The intent is that disks where the disk layout will be recreated
# get completely wiped as far as possible with reasonable effort,
# see usr/share/rear/layout/recreate/default/README.wipe_disks
# so that the disk layout recreation code (diskrestore.sh)
# can run on clean disks that behave like pristine new disks,
# see https://github.com/rear/rear/issues/799
# This is currently new and experimental functionality,
# see https://github.com/rear/rear/pull/2514
#
# An empty DISKS_TO_BE_WIPED="" means that disks will be automatically wiped.
# The disks that will be automatically wiped are those disks
# where in diskrestore.sh the create_disk_label function is called
# i.e. disks where the whole partitioning will be recreated from scratch.
# This automatism cannot work when the create_disk_label function is called
# for higher level block devices like RAID devices that do not exist as disks
# on the bare replacement hardware or on a bare replacement virtual machine.
# When disk devices are specified like DISKS_TO_BE_WIPED="/dev/sda /dev/sdb"
# all those that actually exist as block devices in the recovery system
# (i.e. on the replacement hardware or on the replacement virtual machine)
# will be wiped without any safety condition (except WRITE_PROTECTED_IDS)
# and regardless if those disks are actually needed to recreate the system.
# So e.g. DISKS_TO_BE_WIPED="/dev/sd[a-z]" will wipe all /dev/sda ... /dev/sdz that exist
# except when for a disk in the recovery system its ID is listed in WRITE_PROTECTED_IDS
# (listing disk IDs of the original system in WRITE_PROTECTED_IDS does not help).
# When the ReaR recovery system was booted from a (USB) disk that is /dev/sda on the
# replacement hardware then DISKS_TO_BE_WIPED="/dev/sda ..." may destroy the ReaR disk
# unless that disk is (by default automatically) listed in WRITE_PROTECTED_IDS
# (here it works because the ReaR disk ID is same on the replacement hardware).
# In any case there is a user confirmation dialog before disks will be wiped.
# With DISKS_TO_BE_WIPED="false" no disk will be wiped.
# DISKS_TO_BE_WIPED has no influence what disks will get completely overwritten
# by the actual disk layout recreation code (e.g. the diskrestore.sh script).
DISKS_TO_BE_WIPED=""
####
####
# Resizing partitions in MIGRATION_MODE during "rear recover"
#
# AUTORESIZE_PARTITIONS
# AUTORESIZE_EXCLUDE_PARTITIONS
# AUTOSHRINK_DISK_SIZE_LIMIT_PERCENTAGE
# AUTOINCREASE_DISK_SIZE_THRESHOLD_PERCENTAGE
#
# For details see the scripts
# usr/share/rear/layout/prepare/default/420_autoresize_last_partitions.sh
# and
# usr/share/rear/layout/prepare/default/430_autoresize_all_partitions.sh
#
# When AUTORESIZE_PARTITIONS is false, no partition is resized.
#
# When AUTORESIZE_PARTITIONS is true, all active partitions on all active disks
# get resized by the 430_autoresize_all_partitions.sh script
# (except boot and swap partitions via some special hardcoded rules in that script)
# if the disk size had changed (i.e. only in migration mode).
# This does not resize volumes on top of the affected partitions.
# Using AUTORESIZE_PARTITIONS='true' with 430_autoresize_all_partitions.sh
# may result badly aligned partitions in particular possibly harmful aligned
# according to what flash memory based disks (i.e. SSDs) actually need
# which is usually 4MiB or 8MiB alignment where a too small value
# will result lower speed and less lifetime of flash memory devices
# (cf. the below comment at USB_PARTITION_ALIGN_BLOCK_SIZE).
#
# A true or false value must be the first one in the AUTORESIZE_PARTITIONS array.
#
# When the first value in AUTORESIZE_PARTITIONS is neither true nor false
# only the last active partition on each active disk gets resized
# by the 420_autoresize_last_partitions.sh script.
#
# The following applies only when the last active partition on each active disk
# gets resized by the 420_autoresize_last_partitions.sh script:
#
# In particular this does not resize volumes on top of the affected partitions.
# To migrate volumes on a disk where the disk size had changed the user must in advance
# manually adapt his disklayout.conf file before he runs "rear recover".
#
# All other values in the AUTORESIZE_PARTITIONS array specify partition device nodes
# e.g. as in AUTORESIZE_PARTITIONS=( /dev/sda2 /dev/sdb3 )
# where last partitions with those partition device nodes should be resized
# (i.e. this way only last partitions can be specified to be resized)
# regardless of what is specified in the AUTORESIZE_EXCLUDE_PARTITIONS array.
#
# The values in the AUTORESIZE_EXCLUDE_PARTITIONS array specify partition device nodes
# where partitions with those partition device nodes are excluded from being resized.
# The special values 'boot', 'swap', and 'efi' specify that
# - partitions where its filesystem mountpoint contains 'boot' or 'bios' or 'grub'
# or where its GPT name or flags contain 'boot' or 'bios' or 'grub' (anywhere case insensitive)
# - partitions for which an active 'swap' entry exists in disklayout.conf
# or where its GPT name or flags contain 'swap' (anywhere case insensitive)
# - partitions where its filesystem mountpoint contains 'efi' or 'esp'
# or where its GPT name or flags contains 'efi' or 'esp' (anywhere case insensitive)
# are excluded from being resized e.g. as in
# AUTORESIZE_EXCLUDE_PARTITIONS=( boot swap efi /dev/sdb3 /dev/sdc4 )
#
# In general ReaR is not meant to somehow "optimize" a system during "rear recover".
# ReaR is meant to recreate a system as much as possible exactly as it was before.
# Accordingly the automated resizing by the 420_autoresize_last_partitions.sh script
# implements a "minimal changes" approach:
#
# When the new disk is a bit smaller (at most AUTOSHRINK_DISK_SIZE_LIMIT_PERCENTAGE percent),
# only the last (active) partition gets shrinked but all other partitions are not changed.
# When the new disk is smaller than AUTOSHRINK_DISK_SIZE_LIMIT_PERCENTAGE percent it errors out.
# To migrate onto a substantially smaller new disk the user must in advance
# manually adapt his disklayout.conf file before he runs "rear recover".
#
# When the new disk is not much bigger (less than AUTOINCREASE_DISK_SIZE_THRESHOLD_PERCENTAGE percent),
# no partition gets increased (which leaves the bigger disk space at the end of the disk unused).
# When the new disk is substantially bigger (at least AUTOINCREASE_DISK_SIZE_THRESHOLD_PERCENTAGE percent),
# only the last (active) partition gets increased but all other partitions are not changed.
# To migrate various partitions onto a substantially bigger new disk the user must in advance
# manually adapt his disklayout.conf file before he runs "rear recover".
#
# Because only the end value of the last partition may get changed, the partitioning alignment
# of the original system is not changed, cf. https://github.com/rear/rear/issues/102
#
# Because only the last active (i.e. not commented in disklayout.conf) partition on a disk
# may get changed, things go wrong if another partition is actually the last one on the disk
# but that other partition is commented in disklayout.conf (e.g. because that partition
# is a partition of another operating system that is not mounted during "rear mkrescue").
# To migrate a system with a non-active last partition onto a bigger or smaller new disk
# the user must in advance manually adapt his disklayout.conf file before he runs "rear recover".
#
AUTORESIZE_PARTITIONS=''
AUTORESIZE_EXCLUDE_PARTITIONS=( boot swap efi )
AUTOSHRINK_DISK_SIZE_LIMIT_PERCENTAGE=2
AUTOINCREASE_DISK_SIZE_THRESHOLD_PERCENTAGE=10
####
####
# Write-protection during "rear recover"
# for OUTPUT=USB and OUTPUT=RAWDISK
#
# Designate disks via disk specific IDs or file system labels as write-protected
# to avoid that those disks could get used as target disk during "rear recover"
# via WRITE_PROTECTED_IDS and WRITE_PROTECTED_FS_LABEL_PATTERNS
# in etc/rear/rescue.conf in the ReaR rescue/recovery system.
#
# WRITE_PROTECTED_ID_TYPES is a string of the 'lsblk' output columns where
# their values are stored in WRITE_PROTECTED_IDS during "rear mkrescue/mkbackup".
# During "rear recover" a disk is write-protected when one of the values
# of this 'lsblk' output columns for the disk also exists in WRITE_PROTECTED_IDS.
# The default 'lsblk' output columns for write-protection via disk specific IDs are
# UUID filesystem UUID
# PTUUID partition table identifier (usually UUID)
# PARTUUID partition UUID
# WWN unique storage identifier
WRITE_PROTECTED_ID_TYPES="UUID PTUUID PARTUUID WWN"
#
# For OUTPUT=USB the values of the 'lsblk' output columns in WRITE_PROTECTED_ID_TYPES
# of the ReaR recovery system disk (i.e. USB_DEVICE) are automatically added
# to the WRITE_PROTECTED_IDS array during "rear mkrescue/mkbackup".
# For OUTPUT=RAWDISK a partition table UUID is generated (provided 'uuidgen' is there)
# that is added to the WRITE_PROTECTED_IDS array.
# For the IDs in WRITE_PROTECTED_IDS their matching 'lsblk' output columns
# must exist in WRITE_PROTECTED_ID_TYPES because only this ID types are used
# to test if a disk is write-protected (see WRITE_PROTECTED_ID_TYPES above).
# E.g. if you like to use additionally the 'lsblk' output column MODEL as ID
# in WRITE_PROTECTED_IDS like WRITE_PROTECTED_IDS+=( "ACME_USB_DISK_XL" )
# you must also append that 'lsblk' output column as separated additional word
# to the WRITE_PROTECTED_ID_TYPES string like WRITE_PROTECTED_ID_TYPES+=" MODEL"
WRITE_PROTECTED_IDS=()
#
# WRITE_PROTECTED_FS_LABEL_PATTERNS is an array of (shell glob) patterns which designate
# matching file system labels as write-protected partitions to write-protect their disk.
# Entries may be quoted and contain blanks, but they may not contain single quotes themselves.
# Example: WRITE_PROTECTED_FS_LABEL_PATTERNS+=( "Backup *" )
# For OUTPUT=USB the file system label of the ReaR data partition on the ReaR recovery system disk
# is automatically added to WRITE_PROTECTED_FS_LABEL_PATTERNS during "rear mkrescue/mkbackup".
WRITE_PROTECTED_FS_LABEL_PATTERNS=()
####
####
# Creating XFS filesystems during "rear recover"
#
# MKFS_XFS_OPTIONS
# MKFS_XFS_OPTIONS_...
#
# For details see the script
# usr/share/rear/layout/prepare/GNU/Linux/130_include_filesystem_code.sh
# and for some reasoning behind you may have a look at
# https://github.com/rear/rear/pull/2005
#
# During "rear mkrescue/mkbackup" the script layout/save/GNU/Linux/230_filesystem_layout.sh
# calls 'xfs_info' and stores its output in var/lib/rear/layout/xfs/XFS_DEVICE.xfs files
# where XFS_DEVICE is the basename of the device where the XFS filesystem is (e.g. sda2).
# By default during "rear recover" the XFS filesystem on that device gets recreated
# with matching mkfs.xfs options according to the stored 'xfs_info' output so that
# XFS filesystems should get recreated with same XFS filesystem options as before.
#
# In particular in MIGRATION_MODE when disk devices had changed it could be needed
# to recreate XFS filesystems with different XFS filesystem options as before.
# MKFS_XFS_OPTIONS specifies global mkfs.xfs options for recreating all XFS filesystems.
# Device specific mkfs.xfs options can be specified for each XFS device via
# MKFS_XFS_OPTIONS_XFS_DEVICE where XFS_DEVICE is the basename of the device
# but only uppercase letters and digits to ensure a valid bash variable name.
# For example for /dev/sda2 it would be MKFS_XFS_OPTIONS_SDA2 and
# for /dev/mapper/ACME_1000-part3 it would be MKFS_XFS_OPTIONS_ACME1000PART3
# Common global options can be specified first like MKFS_XFS_OPTIONS="global options"
# and used via MKFS_XFS_OPTIONS_SDA2="$MKFS_XFS_OPTIONS additional options for sda2"
# versus separated options as in MKFS_XFS_OPTIONS_SDB3="all options for sdb3".
# To recreate XFS filesystems with the mkfs.xfs defaults (i.e. without mkfs.xfs options)
# specify a space MKFS_XFS_OPTIONS=' ' or MKFS_XFS_OPTIONS_SDA2=' ' only for sda2.
#
# The by-default empty MKFS_XFS_OPTIONS results that the mkfs.xfs options are set
# via the above described default according to the stored 'xfs_info' output.
# MKFS_XFS_OPTIONS is set to a default value here only
# if not already set so that the user can set it also via
# export MKFS_XFS_OPTIONS="..."
# directly before he calls "rear recover":
test "$MKFS_XFS_OPTIONS" || MKFS_XFS_OPTIONS=''
####
####
# Support for TCG Opal 2-compliant Self-Encrypting Disks
# (see doc/user-guide/13-tcg-opal-support.adoc)
#
# Output location for the Pre-Boot Authentication (PBA) System (empty for not using a PBA).
# (For URL syntax, see "Using OUTPUT_URL..." in doc/user-guide/03-configuration.adoc.)
# This URL specifies
# - where PBA output shall be stored by "rear mkopalpba", and
# - where to find a local PBA image file during "rear mkrescue" and "rear opaladmin" (but can
# be overridden by OPAL_PBA_IMAGE_FILE).
# The actual PBA image file resides below the OPAL_PBA_OUTPUT_URL directory at
# "$HOSTNAME/TCG-Opal-PBA-$HOSTNAME.raw".
# NOTE: If a local directory is specified, Relax-and-Recover will automatically pick
# up the PBA image when installing it to local disks or when building a rescue system.
OPAL_PBA_OUTPUT_URL="file://$VAR_DIR/TCG-Opal-PBA"
#
# Full path of a local PBA image file.
# This local path specifies the PBA image to be used by "rear mkrescue" and "rear opaladmin".
# If not set (the default) and OPAL_PBA_OUTPUT_URL points to a local directory, the location is
# determined by OPAL_PBA_OUTPUT_URL.
OPAL_PBA_IMAGE_FILE=""
#
# These variables extend their non-prefixed counterparts (PROGS, COPY_AS_IS, etc.) for the PBA system only.
# Their main purpose is to include the necessary files for a Plymouth graphical boot animation, which
# provides a nice looking user interface to enter the disk password.
OPAL_PBA_PROGS=()
OPAL_PBA_COPY_AS_IS=()
OPAL_PBA_LIBS=()
OPAL_PBA_KERNEL_CMDLINE=""
# The following variable, if non-empty, overrides FIRMWARE_FILES for the PBA system.
OPAL_PBA_FIRMWARE_FILES=()
# The following variable sets USE_SERIAL_CONSOLE for the PBA system.
OPAL_PBA_USE_SERIAL_CONSOLE=""
#
# OPAL_PBA_UNLOCK_MODE determines the PBA's disk unlock mode, either "transient" (the default) or "permanent".
# * "transient" mode unlocks devices until they are powered off. This is the normal behavior.
# * "permanent" mode unlocks devices and deactivates locking until a reactivation command is issued. This mode exists
# as a workaround for systems which are unable to reboot after transient unlocking. Example configuration in
# 'local.conf' or 'site.conf':
# if dmidecode | grep --quiet 'Product Name: ML10Gen9$'; then
# # An HPE ML10Gen9 Server does not start reliably after disk unlocking unless the reboot method includes a
# # power cycle. In the latter case, disks will only remain unlocked if "permanent" unlock mode is used.
# # Seen on: HPE ML10Gen9, BIOS Version: 1.13, BIOS Release Date: 12/05/2019
# OPAL_PBA_KERNEL_CMDLINE+=" reboot=efi" # reboot with a power cycle
# OPAL_PBA_UNLOCK_MODE="permanent" # keep disks unlocked after power cycling
# fi
# WARNING: If this mode is used, it is recommended to run 'rear opaladmin reactivate' each time the regular
# operating system has booted (e.g. via a systemd unit). Even then, a protection gap exists between deactivating
# locking by the PBA and reactivating locking by the reagular OS. If the regular boot fails or the reactivation
# command is not issued for some reason, devices will remain unlocked permanently.
OPAL_PBA_UNLOCK_MODE="transient"
#
# PBA debug password as a salted hash (empty for not using the debug shell facility).
# If the debug password is entered when the PBA asks for a password to unlock disks,
# an interactive emergency shell will be started, which can be used to debug the PBA system.
# To generate a password hash,
# 1. run
# - 'openssl passwd -6', if openssl 1.1.1 or newer is available, or
# - 'openssl passwd -1', otherwise (see https://github.com/rear/rear/pull/2455#discussion_r453613086 for information
# on the implications of its cryptographic weakness),
# 2. copy its entire output line between single quotes and assign it to this variable.
OPAL_PBA_DEBUG_PASSWORD=''
#
# When not empty, OPAL_PBA_DEBUG_DEVICE_COUNT overrides the number of TCG Opal 2-compliant self-encrypting disks
# installed. To test the PBA system on a machine without any Opal 2-compliant disk, set OPAL_PBA_DEBUG_DEVICE_COUNT=1.
# Used to debug the PBA system.
OPAL_PBA_DEBUG_DEVICE_COUNT=""
####
####
# Output/backup locations
##
#
# The URL defines the remote share as <scheme>://<host>/<share> like these examples:
# nfs://host.domain/path/path/path
# cifs://server.domain/share
# usb:///dev/sdb1
# others might also work, if they can be mounted with mount <host>:/<path>
# there is special support for tape:///dev/nst0
# Additional options to the mount command are given using *_OPTIONS
# Alternatively, you can provide your own mount/unmount commands, in that case
# Relax-and-Recover will append its mountpoint to the command.
#
# Specify the location of the backup (see text above):
BACKUP_URL=
# BACKUP_OPTIONS variable contains the mount options, do not confuse with BACKUP_PROG_OPTIONS
BACKUP_OPTIONS=
BACKUP_MOUNTCMD=
BACKUP_UMOUNTCMD=
##
# Specify the location of the output:
# When OUTPUT_URL is not specified it inherits the BACKUP_URL value
# and then also OUTPUT_OPTIONS inherits the BACKUP_OPTIONS value
# via the code in usr/share/rear/prep/default/020_translate_url.sh
# but when OUTPUT_URL is set then OUTPUT_OPTIONS may have to be
# explicitly set too in particular when BACKUP_OPTIONS are specified
# because when OUTPUT_URL is set OUTPUT_OPTIONS does not inherit the BACKUP_OPTIONS value
# cf. https://github.com/rear/rear/issues/2753
OUTPUT_URL=
OUTPUT_OPTIONS=
OUTPUT_MOUNTCMD=
OUTPUT_UMOUNTCMD=
OUTPUT_PREFIX="$HOSTNAME"
####
# Keep an older copy of the output (mv $OUTPUT_PREFIX $OUTPUT_PREFIX.old before we copy the new version)
# empty means only keep current output:
KEEP_OLD_OUTPUT_COPY=
# The remote file system layout for OUTPUT=PXE can be modified to accommodate different TFTP server layouts
# (simply overwrite OUTPUT_PREFIX_PXE).
#OUTPUT_PREFIX_PXE="$OUTPUT_PREFIX" # make it empty - see issue #570 (DRLM will fill it up)
OUTPUT_PREFIX_PXE=""
# When using fish, ftp, ftps, hftp, http, https or sftp in OUTPUT_URL, you can set OUTPUT_LFTP_OPTIONS to pass additional
# parameters to LFTP (https://lftp.yar.ru/lftp-man.html).
# Example: OUTPUT_LFTP_OPTIONS="set ftp:ssl-force true; set ftp:ssl-protect-data true;"
OUTPUT_LFTP_OPTIONS=""
####
# OUTPUT=RAMDISK
##
# With OUTPUT=RAMDISK the ReaR rescue/recovery system initramfs/initrd
# is created but nothing additional is done to make it bootable.
#
# The script output/RAMDISK/default/900_copy_ramdisk.sh adds the initramfs
# plus the kernel to the RESULT_FILES array so that the subsequent
# script output/default/950_copy_result_files.sh will copy them
# to the output location specified via OUTPUT_URL (or inherited from BACKUP_URL).
#
# With non-empty RAMDISK_SUFFIX
# the kernel at the output location will be kernel-$RAMDISK_SUFFIX
# the initramfs at the output location will be initramfs-$RAMDISK_SUFFIX.img
RAMDISK_SUFFIX="$HOSTNAME"
####
####
# OUTPUT=ISO
##
# OUTPUT=ISO produces files suitable for booting with SYSLINUX/ISOLINUX and assumes that the result
# will be written sequentially to a read-only medium with limited size (e.g. optical medium like CD-ROM).
#
# Default "local" ISO directory (usually /var/lib/rear/output). However, to avoid duplicate ISO images when
# also using the OUTPUT_URL variable with a file syntax, it is then better only to use ISO_DIR.
# Keep in mind that ISO_DIR works only with an absolute directory path and does not replace OUTPUT_URL
# which supports the NETFS syntax (to copy the ISO image across the network).
ISO_DIR=$VAR_DIR/output
#
# Default ISO label:
# When the backup is split on multiple ISOs (cf. ISO_MAX_SIZE below)
# the first ISO 'rear-HOSTNAME.iso' has the label $ISO_VOLID
# and subsequent ISOs 'rear-HOSTNAME_01.iso' 'rear-HOSTNAME_02.iso' ...
# get the labels ${ISO_VOLID}_01 ${ISO_VOLID}_02 ... respectively.
# The ISO_VOLID default value REAR-ISO has 8 characters so that
# the first ISO 'rear-HOSTNAME.iso' has the label REAR-ISO
# and subsequent ISOs 'rear-HOSTNAME_01.iso' 'rear-HOSTNAME_02.iso' ...
# get the labels REAR-ISO_01 REAR-ISO_02 ... respectively
# that have 11 characters which is the maximum length for FAT volume names
# ("man mkfs.fat" tells that a "volume name can be up to 11 characters long")
# so things work when the ISO image is used to create a FAT bootable USB stick
# cf. https://github.com/rear/rear/issues/1565
# and https://github.com/rear/rear/issues/2456
# In case of special filesystems that only support labels with even less than 11 characters
# ("man mkfs.xfs" tells "XFS filesystem labels can be at most 12 characters long" so it's ok)
# the ISO_VOLID value would have to be appropriately specified in /etc/rear/local.conf
# so that $ISO_VOLID plus the trailing '_NN' does not exceed the maximum label length.
ISO_VOLID="REAR-ISO"
#
# How to find isolinux.bin.
# Possible values are "" (meaning search for it) or "/path/to/isolinux.bin"
ISO_ISOLINUX_BIN=""
#
# ISO_MAX_SIZE is a rough way to specify the maximum size of generated ISO images.
# The ISO_MAX_SIZE value is specified in MiB.
# Actually ISO_MAX_SIZE does not implement the maximum size of the ISO.
# Instead it is used to calculate the size of the chunks when a backup.tar.gz is split
# that is used in a "split ... -b ${BACKUP_SPLIT_CHUNK_SIZE}m ..." SPLIT_COMMAND
# in the usr/share/rear/backup/NETFS/default/500_make_backup.sh script.
# Splitting a backup via ISO_MAX_SIZE is only supported for the 'tar' backup program.
# Multiple ISO images are generated when the backup.tar.gz size exceeds
# the BACKUP_SPLIT_CHUNK_SIZE that is derived from the ISO_MAX_SIZE value.
# It is useful when the backup.tar.gz is included within the ISO image
# (i.e. together with things like 'BACKUP_URL=iso:///backup').
# ISO_MAX_SIZE cannot be less than what the ReaR rescue/recovery system needs
# because the recovery system must fit onto one (bootable) recovery medium
# so that the whole recovery system must be on a single (bootable) ISO.
# Therefore ISO_MAX_SIZE should be normally not less than about 600 MiB.
# Because the ReaR recovery system and its bootloader must be on the first ISO
# the actually used size of the chunks when a backup.tar.gz is split is the
# ISO_MAX_SIZE value minus the size of the recovery system kernel and initrd
# and minus 15 MiB for the bootloader for booting the ISO and
# additionally minus 30 MiB for UEFI files when booting in UEFI mode
# so that the recovery system plus the first chunk of the backup.tar.gz
# should not exceed the specified ISO_MAX_SIZE value for the first ISO.
# On the other hand the actual size of subsequent ISO images
# is normally less than the specified ISO_MAX_SIZE value.
# When the backup is split on multiple ISOs, then "rear mkrescue" would destroy
# the backup because after "rear mkbackup" the first ISO 'rear-HOSTNAME.iso'
# contains the recovery system plus the first part of the splitted backup
# but "rear mkrescue" overwrites that first ISO with one that contains only
# a new recovery system but no longer the first part of the splitted backup
# so that then "rear recover" fails with "ERROR: Backup archive ... not found"
# cf. https://github.com/rear/rear/issues/1545
# Even with a sufficiently big maximum ISO size so that all is in one ISO
# "rear mkrescue" would overwrite an ISO that already contains a backup.
# Accordingly when ISO_MAX_SIZE is set the mkrescue workflow is forbidden
# to be on the safe side to not possibly destroy an existing backup.
ISO_MAX_SIZE=
#
# Error out when files greater or equal ISO_FILE_SIZE_LIMIT should be included in the ISO.
# There is a limit of the ISO 9660 file system that is 2GiB or 4GiB according to
# https://en.wikipedia.org/wiki/ISO_9660#The_2/4_GiB_file_size_limit
# Usually 'mkisofs' is called with '-iso-level 3'
# cf. usr/share/rear/prep/ISO/GNU/Linux/320_verify_mkisofs.sh
# but there are cases where ISO 9660 level 1 or 2 is used that has a 2GiB file size limit.
# For example when 'ebiso' is used there is a 2GiB file size limit
# cf. https://github.com/gozora/ebiso/issues/12
# but also other tools that are specified by ISO_MKISOFS_BIN could have that limit.
# Accordingly to be by default on the safe side we use by default a 2GiB limit
# cf. https://github.com/rear/rear/pull/2525
# Under normal circumstances files greater or equal 2GiB should not appear in the ISO.
# An exception is when the backup is included in the ISO with BACKUP_URL=iso://
# where the backup archive file (e.g. backup.tar.gz) could be greater or equal 2GiB.
# The user might adapt ISO_FILE_SIZE_LIMIT provided he verified that "rear recover"
# actually works in his particular environment even when there are files in his ISO
# (in particular backup.tar.gz) that are actually greater than the default 2GiB limit.
# When there is a 2GiB file size limit a backup.tar.gz that is greater than 2GiB
# will get corrupted in the ISO so backup restore via "rear recover" would fail
# which is a dead end because the backup in the ISO got corrupted which is a severe error.
# Also the ReaR recovery system initrd could become greater or equal 2GiB
# (e.g. because of accidentally too much in COPY_AS_IS) which is likely an error
# that could let booting or running the recovery system fail because
# a recovery system in a 2GiB or bigger compressed initrd will need
# more memory space when uncompressed and running in the ramdisk.
# By default we error out when files greater or equal ISO_FILE_SIZE_LIMIT should be
# included in the ISO but if really needed this ISO_FILE_SIZE_LIMIT test
# can be skipped with ISO_FILE_SIZE_LIMIT=0 in etc/rear/local.conf
# (2 GiB = 2 * 1024 * 1024 * 1024 bytes = 2147483648 bytes):
ISO_FILE_SIZE_LIMIT=2147483648
#
# How to find mkisofs:
# Guess the common names mkisofs or genisoimage
# script in prep stage will verify this and complain if not found
# ebiso (https://github.com/gozora/ebiso/) can be used as alternative
# for mkisofs/genisoimage on UEFI bootable systems
# to use ebiso, specify ISO_MKISOFS_BIN=<full_path_to_ebiso>/ebiso
# in /etc/rear/local.conf or /etc/rear/site.conf
# xorrisofs is now used as the preferred method for generating the iso image
# with mkisofs and genisoimage as second and third option
ISO_MKISOFS_BIN="$( type -p xorrisofs || type -p mkisofs || type -p genisoimage )"
#
# Additional options passed to the $ISO_MKISOFS_BIN binary
ISO_MKISOFS_OPTS=""
#
# Which files to include in the ISO image:
ISO_FILES=()
#
# Prefix name for ISO images without the .iso suffix.
# This might get a number appended (for splitting data onto multiple CDs).
ISO_PREFIX="rear-$HOSTNAME"
#
# Default boot option (i.e. what gets booted automatically after some timeout)
# when SYSLINUX boots the ISO image on BIOS systems.
# This variable ISO_DEFAULT should be better named ISO_BIOS_BOOT_DEFAULT
# (cf. USB_BIOS_BOOT_DEFAULT below) but we won't rename existing config variables
# to avoid regressions for users who use existing config variable names
# cf. https://github.com/rear/rear/pull/2293#issuecomment-564439509
# If ISO_DEFAULT is unset or empty or only blanks "boothd" is used by default.
# ISO_DEFAULT="boothd" is an automatism that intends to boot from the original first disk.
# In case of ISOLINUX "boothd" means to boot from the first disk 'boothd0' because
# usually ISOLINUX is used for booting from CD-ROM which is usually not the first disk
# so that the original first disk still is the first disk when booting the ISO from CD-ROM.
# In case of EXTLINUX "boothd" would mean to boot from the second disk 'boothd1' because
# usually when EXTLINUX is used the device with the ISO would be the first disk
# and the original first disk would become the second disk (cf. USB_BIOS_BOOT_DEFAULT below).
# ISO_DEFAULT="boothd0" boots from the first disk.
# ISO_DEFAULT="boothd1" boots from the second disk.
# The ISO_DEFAULT values 'boothd' 'boothd0' 'boothd1' are only supported
# when the SYSLINUX module 'chain.c32' for chain booting is available.
# ISO_DEFAULT="manual" boots the ReaR recovery system in normal mode
# where one must manually log in as 'root', manually type "rear recover", and manually reboot.
# ISO_DEFAULT="automatic" boots the ReaR recovery system with the 'auto_recover' kernel command line option
# that runs "rear recover" automatically without automated reboot (see "man rear").
# For details see the make_syslinux_config function in lib/bootloader-functions.sh
ISO_DEFAULT="boothd"
#
# ISO_RECOVER_MODE="unattended" boots the ReaR recovery system with the 'unattended' kernel command line option
# that runs "rear recover" automatically plus automated reboot after successful rear recover (see "man rear").
# Together with ISO_DEFAULT="automatic" full-automated recovery happens when the ISO image is booted
# which could result an endless full-automated recovery cycle when the ISO is booted by default
# (e.g. when the device with the ISO is the first one in the BIOS boot order list).
# The default ISO_RECOVER_MODE="" results the normal behaviour:
ISO_RECOVER_MODE=""
####
####
# OUTPUT=USB
##
#
# OUTPUT=USB is only supported on PC-compatible (Linux-i386/x86/x86_64) architecture
# see https://github.com/rear/rear/issues/2348
# Accordingly in case of false usage of OUTPUT=USB on non-PC-compatible architectures
# (i.e. the POWER architectures ppc64/ppc64le, IBM Z s390/s390x, and ARM)
# "rear mkrescue/mkbackup" errors out because on those architectures the USB medium cannot be booted
# because for non-PC-compatible architectures there are no scripts that install a USB bootloader.
# On non-PC-compatible architectures a possible alternative could be OUTPUT=RAMDISK (see above)
# that results only the plain ReaR rescue/recovery system initramfs/initrd plus the kernel
# (which is basically what OUTPUT=USB on non-PC-compatible architectures would result)
# where one must then manually create a bootable medium for non-PC-compatible architectures
# or load and boot the recovery system initrd plus kernel via 'kexec' from an already running system.
# A workaround to get a bootable USB device on POWER architecture for Power BareMetal is described
# in the usr/share/rear/prep/USB/Linux-ppc64/350_safeguard_error_out.sh script.
#
# OUTPUT=USB produces files suitable for booting with SYSLINUX/EXTLINUX from a disk device.
# USB sticks and USB disks are the main use case for this.
# "USB" also means any local block-storage device and includes eSATA and other external disks.
# The device is also made bootable and a boot loader gets installed.
# The device should be partitioned and formatted with an ext* file system.
# The recommended way to do that is to use the "rear format" workflow.
# Call "rear format -- --help" (the '--' is mandatory) to see format workflow options.
#
# The partition device to use (e.g. the exact partition like /dev/sdb1).
# Normally USB_DEVICE gets set automatically for BACKUP=NETFS
# via a specific BACKUP_URL like BACKUP_URL=usb:///dev/sdb1
# or via the generic BACKUP_URL=usb:///dev/disk/by-label/REAR-000
# (see also USB_DEVICE_FILESYSTEM_LABEL below):
USB_DEVICE=
#
# USB_DEVICE_PARTED_LABEL is the partition type (i.e. what is used for 'parted mklabel')
# that is used when formatting a medium for use with ReaR via the format workflow and
# when SYSLINUX/EXTLINUX is used as booloader used for the USB medium (see USB_BOOTLOADER below).
# It can be 'msdos' to create a MBR partition table or 'gpt' to create a GUID partition table (GPT).
# It is set depending on the format workflow option -b/--bios or -e/--efi as follows:
# When a format workflow option -b/--bios or -e/--efi was specified
# USB_DEVICE_PARTED_LABEL is set to 'msdos' or 'gpt' accordingly.
# When no format workflow option -b/--bios or -e/--efi was specified