diff --git a/usr/share/rear/conf/default.conf b/usr/share/rear/conf/default.conf index cf68bce6d5..3efb630b71 100644 --- a/usr/share/rear/conf/default.conf +++ b/usr/share/rear/conf/default.conf @@ -626,8 +626,7 @@ BEXTRACT_DEVICE= ## # TODO # Copy Borg stuff 1:1 -# Investigate propper locales setup in ReaR recovery media -COPY_AS_IS_BORG=( /usr/lib/locale/en_US.utf8 /usr/share/locale/en_US ) +COPY_AS_IS_BORG=( ) # Binaries Borg needs to operate correctly PROGS_BORG=( borg locale ) # Borg server name @@ -641,7 +640,7 @@ BORG_REPO= BORG_ARCHIVE_PREFIX="rear" # Compression used by Borg # Syntax: -# compression_type: lz4, zlib, lzma +# compression_type: none, lz4, zlib, lzma # level: 0-9 BORG_COMPRESSION="zlib,9" # TODO diff --git a/usr/share/rear/prep/BORG/default/10_prep_borg.sh b/usr/share/rear/prep/BORG/default/10_prep_borg.sh index 3819c9ac92..c781e1e492 100644 --- a/usr/share/rear/prep/BORG/default/10_prep_borg.sh +++ b/usr/share/rear/prep/BORG/default/10_prep_borg.sh @@ -3,5 +3,10 @@ # # 10_prep_borg.sh +# Create our own locales, used only for Borg restore +mkdir -p $ROOTFS_DIR/usr/lib/locale +localedef -f UTF-8 -i en_US $ROOTFS_DIR/usr/lib/locale/rear.UTF-8 +StopIfError "Could not create locales" + COPY_AS_IS=( "${COPY_AS_IS[@]}" "${COPY_AS_IS_BORG[@]}" ) PROGS=( "${PROGS[@]}" "${PROGS_BORG[@]}" ) diff --git a/usr/share/rear/restore/BORG/default/20_restore_borg.sh b/usr/share/rear/restore/BORG/default/20_restore_borg.sh index 4ed8d90dc7..8c2d392225 100644 --- a/usr/share/rear/restore/BORG/default/20_restore_borg.sh +++ b/usr/share/rear/restore/BORG/default/20_restore_borg.sh @@ -8,15 +8,12 @@ cd /mnt/local StopIfError "Could not change directory to /mnt/local" -# This will need some more work... -# It looks like Borg, needs working locales in order to behave correctly. -# Locale handling is curently very primitive and tested only on SLES11 SP3. -# Copy of locales is handled by COPY_AS_IS_BORG in default.conf. -# For the future, we will need to find some way how to make locale setup in -# ReaR recovery medium more bullet proof -LC_ALL=en_US.UTF-8 - # Start actual restore +# Scope of LC_ALL is only within run of `borg extract'. +# This avoids Borg problems with restoring UTF-8 encoded files names in archive +# and should not interfere with remaining stages of rear recover. +# This is still not the ideal sollution, but best I can think of so far :-/ LogPrint "Recovering from archive: $ARCHIVE" +LC_ALL=rear.UTF-8 \ borg extract --sparse $BORG_USERNAME@$BORG_HOST:$BORG_REPO::$ARCHIVE StopIfError "Could not successfully finish Borg restore"