Hello community, here is the log from the commit of package rear for openSUSE:Factory checked in at 2015-07-12 22:52:50 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rear (Old) and /work/SRC/openSUSE:Factory/.rear.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rear" Changes: -------- --- /work/SRC/openSUSE:Factory/rear/rear.changes 2015-03-18 13:05:29.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.rear.new/rear.changes 2015-07-12 22:52:51.000000000 +0200 @@ -1,0 +2,66 @@ +Tue Jun 30 13:57:05 CEST 2015 - jsm...@suse.de + +- Update to version 1.17.1 + * Removed the plain password in the logs (and output) coming + from BACKUP_PROG_CRYPT_KEY to avoid crib (issue #568) + * Mount vfat file system without special mount options + seems to work much better then with these options in recovery + mode, therefore, we do not use these anymore (especially + for /boot/efi) (issue #576) + * Elilo support has been added for SLES + (not fully tested yet) - issue #583 + * Grub2 rescue menu has been added (enable this feature + with GRUB_RESCUE=y) - issue #589 + * splitted script 31_include_uefi_tools.sh in two pieces: + 31_include_uefi_tools.sh: to grab the UEFI tools (as long + as /boot/efi is mounted), and 32_include_uefi_env.sh: to dig + deeper into the configuration when UEFI is active + (related to issue #214). This is necessary to have to UEFI + tools on SLES 11/12 where we cannot create an UEFI bootable + ISO image. We must boot in BIOS mode, and need the UEFI tools + to make the system bootable over UEFI. + * It is now possible to format an USB disk with a vfat and ext3 + partition (for UEFI booting) - issue #593 + rear -v format -- --efi /dev/<usbdevice> + However, UEFI booting from an USB disk has not been + implemented yet (sponsoring?). + * Simplified the code for ext* fs and added StopIfError calls + to prevent divide by zero during recovery (issue #598) + * Syslinux version >6 requires some special handling due to + splitting up the package (Ubuntu 15.04) (issue #584) + * Debian 8 support added with ISO booting with latest syslinux + release as well (issues #596, #599 and #600) + * Changed the behavior of SSH_ROOT_PASSWORD - now saved as MD5 + hash password, but backwards compatibility is still respected + (issue #560) + * For EMC NetWorker server/client we added some exclude items + to COPY_AS_IS_EXCLUDE_NSR (issue #571) + * Removed the Warning message from main rear script as it was + misleading (issues #563 and #564) + * output/ISO/Linux-i386/80_create_isofs.sh: make sure + ISO_FILES[@] are copied to isofs directory (issue #569) +- SLE11-ext3-example.conf is an example for SLE11 + with default ext3 filesystem that gets installed as + /usr/share/rear/conf/SLE11-ext3-example.conf +- SLE12-btrfs-example.conf is an example for SLE12 + with default btrfs subvolumes that gets installed + as /usr/share/rear/conf/SLE12-btrfs-example.conf +- Have config(noreplace) also for all files in /usr/share/rear/ + to avoid that RPM package update overwrites user edited files + because Relax-and-Recover (rear) is meant to be adapted and + enhanced by the user according to his particular needs + (see http://en.opensuse.org/SDB:Disaster_Recovery). +- Added rear-rpmlintrc to filter the following false positives + rpmlint warning messages: + * non-etc-or-var-file-marked-as-conffile + because config(noreplace) is intentionally for all files + in /usr/share/rear/ (see above) + * systemd-service-without-service_del_preun + systemd-service-without-service_del_postun + systemd-service-without-service_add_pre + systemd-service-without-service_add_post + because the systemd unit files in /usr/share/rear/skel/ + are not meant to be used in the running system. + They are used to build the rear recovery system ISO image. + +------------------------------------------------------------------- @@ -5,5 +71,6 @@ - * a new stage directory (init) which is called before - any workflow. Can be used for extra initialization code, - custom configurations and other stuff that should happen - each time that ReaR is used (was added especially for DRLM - as plugin for their DRLM variables) (issue #557) + * rear 1.17 introduced a new stage directory (init) which + is called before any workflow. Can be used for extra + initialization code, custom configurations and other stuff + that should happen each time that ReaR is used (was added + especially for DRLM as plugin for their DRLM variables) + (issue #557) Old: ---- rear-1.17.0.tar.gz New: ---- SLE11-ext3-example.conf SLE12-btrfs-example.conf rear-1.17.1.tar.gz rear-rpmlintrc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rear.spec ++++++ --- /var/tmp/diff_new_pack.m4D77D/_old 2015-07-12 22:52:52.000000000 +0200 +++ /var/tmp/diff_new_pack.m4D77D/_new 2015-07-12 22:52:52.000000000 +0200 @@ -19,7 +19,7 @@ %bcond_without use_mkisofs Name: rear -Version: 1.17.0 +Version: 1.17.1 Release: 0 Summary: Relax-and-Recover (abbreviated rear) is a Linux Disaster Recovery framework License: GPL-2.0+ @@ -27,6 +27,15 @@ Url: http://relax-and-recover.org/ # as GitHub stopped with download section we need to go back to Sourceforge for downloads Source0: http://sourceforge.net/projects/rear/files/rear/1.17/%{version}/rear-%{version}.tar.gz +# Source11 SLE11-ext3-example.conf is a working example for SLE11 with default ext3 filesystem +# that gets installed as /usr/share/rear/conf/SLE11-ext3-example.conf +Source11: SLE11-ext3-example.conf +# Source12 SLE12-btrfs-example.conf is a working example for SLE12 with default btrfs subvolumes +# that gets installed as /usr/share/rear/conf/SLE12-btrfs-example.conf +Source12: SLE12-btrfs-example.conf +# Source99 rear-rpmlintrc filters false positives rpmlint warning messages, see +# https://en.opensuse.org/openSUSE:Packaging_checks#Building_Packages_despite_of_errors +Source99: rear-rpmlintrc BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build # LSB RPM Requires: @@ -230,23 +239,25 @@ echo -e "OS_VENDOR=SUSE_LINUX\nOS_VERSION=$OS_VERSION" >etc/rear/os.conf %build -# no code to compile - all bash scripts -# but at least test if the syntax is o.k. -# currently "make validate" does not work because '-n 1' is missing for xargs -# so that the commands from "make validate" are run here with 'xargs -n 1': -find etc/ usr/share/rear/conf/ -name '*.conf' | xargs -n 1 bash -n -bash -n usr/sbin/rear -find . -name '*.sh' | xargs -n 1 bash -n +# no code to compile - all bash scripts - but at least run "make validate" +# that runs "bash -n" for all bash files to test if the plain syntax is o.k. +make validate %install make install DESTDIR="%{buildroot}" +# Source11 SLE11-ext3-example.conf is a working example for SLE11 with default ext3 filesystem +# that gets installed as /usr/share/rear/conf/SLE11-ext3-example.conf +install -m 644 %{SOURCE11} %{buildroot}%{_datadir}/rear/conf/SLE11-ext3-example.conf +# Source12 SLE12-btrfs-example.conf is a working example for SLE12 with default btrfs subvolumes +# that gets installed as /usr/share/rear/conf/SLE12-btrfs-example.conf +install -m 644 %{SOURCE12} %{buildroot}%{_datadir}/rear/conf/SLE12-btrfs-example.conf %files %defattr(-,root,root,-) %doc AUTHORS COPYING README doc/*.txt doc/user-guide/ doc/mappings/ %{_mandir}/man8/rear.8* %config(noreplace) %{_sysconfdir}/rear/ -%{_datadir}/rear/ +%config(noreplace) %{_datadir}/rear/ %{_localstatedir}/lib/rear/ %{_sbindir}/rear ++++++ SLE11-ext3-example.conf ++++++ # Begin example setup for SLE11 with default ext3 filesystem. # You must adapt "your.NFS.server.IP/path/to/your/rear/backup" at BACKUP_URL. # You may activate SSH_ROOT_PASSWORD and adapt the "password_on_the_rear_recovery_system". # For basic information see the SLE11 manuals. # Also see the support database article "SDB:Disaster Recovery" # at http://en.opensuse.org/SDB:Disaster_Recovery # In particular note: # There is no such thing as a disaster recovery solution that "just works". # Create rear rescue media as ISO image: OUTPUT=ISO # Store the backup file via NFS on a NFS server: BACKUP=NETFS # BACKUP_OPTIONS variable contains the NFS mount options and # with 'mount -o nolock' no rpc.statd (plus rpcbind) are needed: BACKUP_OPTIONS="nfsvers=3,nolock" # If the NFS server is not an IP address but a hostname, # DNS must work in the rear recovery system when the backup is restored. BACKUP_URL=nfs://your.NFS.server.IP/path/to/your/rear/backup # Keep an older copy of the backup in a HOSTNAME.old directory # provided there is no '.lockfile' in the HOSTNAME directory: NETFS_KEEP_OLD_BACKUP_COPY=yes # This option defines a root password to allow SSH connection # whithout a public/private key pair #SSH_ROOT_PASSWORD="password_on_the_rear_recovery_system" # Let the rear recovery system run dhclient to get an IP address # instead of using the same IP address as the original system: #USE_DHCLIENT="yes" # End example setup for SLE11 with default ext3 filesystem. ++++++ SLE12-btrfs-example.conf ++++++ # Begin example setup for SLE12 with default btrfs subvolumes. # You must adapt "your.NFS.server.IP/path/to/your/rear/backup" at BACKUP_URL. # You must decide whether or not you want to have /home/* in the backup. # It depends on the size of your harddisk whether or not /home is by default # a btrfs subvolume or a separated xfs filesystem on a separated partition. # You may activate SSH_ROOT_PASSWORD and adapt the "password_on_the_rear_recovery_system". # For basic information see the SLE12 manuals. # Also see the support database article "SDB:Disaster Recovery" # at http://en.opensuse.org/SDB:Disaster_Recovery # In particular note: # There is no such thing as a disaster recovery solution that "just works". # Regarding btrfs snapshots: # Recovery of btrfs snapshot subvolumes is not possible. # Only recovery of "normal" btrfs subvolumes is possible. # Create rear rescue media as ISO image: OUTPUT=ISO # Store the backup file via NFS on a NFS server: BACKUP=NETFS # BACKUP_OPTIONS variable contains the NFS mount options and # with 'mount -o nolock' no rpc.statd (plus rpcbind) are needed: BACKUP_OPTIONS="nfsvers=3,nolock" # If the NFS server is not an IP address but a hostname, # DNS must work in the rear recovery system when the backup is restored. BACKUP_URL=nfs://your.NFS.server.IP/path/to/your/rear/backup # Keep an older copy of the backup in a HOSTNAME.old directory # provided there is no '.lockfile' in the HOSTNAME directory: NETFS_KEEP_OLD_BACKUP_COPY=yes # Files in btrfs subvolumes are excluded by 'tar --one-file-system' # so that such files must be explictly included to be in the backup. # Files in the following SLE12 default btrfs subvolumes are # in the below example not included to be in the backup # /.snapshots/* /var/crash/* # but files in /home/* are included to be in the backup. # Note that not having '/tmp/*' in BACKUP_PROG_INCLUDE when there are # matching entries in EXCLUDE_RECREATE like "fs:/tmp" would result # that during restore a /tmp/rear.*/tmp/restore-exclude-list.txt file # would contain the tar exclude patterns 'tmp' and 'tmp/*' so that # also other files and directories that match those tar exclude patterns # would not be restored (e.g. '/usr/tmp'): BACKUP_PROG_INCLUDE=( '/home/*' '/var/tmp/*' '/var/spool/*' '/var/opt/*' '/var/log/*' '/var/lib/pgsql/*' '/var/lib/mailman/*' '/var/lib/named/*' '/usr/local/*' '/tmp/*' '/srv/*' '/boot/grub2/x86_64-efi/*' '/opt/*' '/boot/grub2/i386-pc/*' ) # Avoid that "rear recover" is 'Creating btrfs-filesystem' by default # also for every mounted btrfs subvolume by excluding the mountpoints # of the mounted btrfs subvolumes from component recreation # see /usr/share/doc/packages/rear/user-guide/06-layout-configuration.txt # and /usr/share/rear/conf/default.conf # When /home is a separated filesystem remove "fs:/home" from the list below: EXCLUDE_RECREATE=( "${EXCLUDE_RECREATE[@]}" "fs:/home" "fs:/.snapshots" "fs:/var/tmp" "fs:/var/spool" "fs:/var/opt" "fs:/var/log" "fs:/var/lib/pgsql" "fs:/var/lib/mailman" "fs:/var/lib/named" "fs:/usr/local" "fs:/tmp" "fs:/srv" "fs:/var/crash" "fs:/boot/grub2/x86_64-efi" "fs:/opt" "fs:/boot/grub2/i386-pc" ) # This option defines a root password to allow SSH connection # whithout a public/private key pair #SSH_ROOT_PASSWORD="password_on_the_rear_recovery_system" # Let the rear recovery system run dhclient to get an IP address # instead of using the same IP address as the original system: #USE_DHCLIENT="yes" # End example setup for SLE12 with default btrfs subvolumes. ++++++ rear-1.17.0.tar.gz -> rear-1.17.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/doc/rear-release-notes.txt new/rear-1.17.1/doc/rear-release-notes.txt --- old/rear-1.17.0/doc/rear-release-notes.txt 2015-03-13 14:38:42.000000000 +0100 +++ new/rear-1.17.1/doc/rear-release-notes.txt 2015-06-25 09:31:28.000000000 +0200 @@ -10,7 +10,7 @@ Survey stock image Please take our online survey -Release Notes for Relax-and-Recover version 1.17.0 +Release Notes for Relax-and-Recover version 1.17.1 This document contains the release notes for the open source project Relax-and-Recover. @@ -169,6 +169,58 @@ The references pointing to fix #nr or issue #nr refer to our issues tracker +Version 1.17.1 (June 2015) + + • Removed the plain password in the logs (and output) coming from + BACKUP_PROG_CRYPT_KEY to avoid crib (issue #568) + + • Mount vfat file system without special mount options seems to work much + better then with these options in recovery mode, therefore, we do not use + these anymore (especially for /boot/efi) (issue #576) + + • Elilo support has been added for SLES (not fully tested yet) - issue #583 + + • Grub2 rescue menu has been added (enable this feature with GRUB_RESCUE=y) + - issue #589 + + • splitted script 31_include_uefi_tools.sh in two pieces: + 31_include_uefi_tools.sh: to grab the UEFI tools (as long as /boot/efi is + mounted), and 32_include_uefi_env.sh: to dig deeper into the + configuration when UEFI is active (related to issue #214) + + This is necessary to have to UEFI tools on SLES 11/12 where we cannot + create an UEFI bootable ISO image. We must boot in BIOS mode, and need + the UEFI tools to make the system bootable over UEFI. + + • It is now possible to format an USB disk with a vfat and ext3 partition + (for UEFI booting) - issue #593 + + rear -v format -- --efi /dev/<usbdevice> + + However, UEFI booting from an USB disk has not been implemented yet + (sponsoring?). + + • Simplified the code for ext* fs and added StopIfError calls to prevent + divide by zero during recovery (issue #598) + + • Syslinux version >6 requires some special handling due to splitting up + the package (Ubuntu 15.04) (issue #584) + + • Debian 8 support added with ISO booting with latest syslinux release as + well (issues #596, #599 and #600) + + • Changed the behavior of SSH_ROOT_PASSWORD - now saved as MD5 hash + password, but backwards compatibility is still respected (issue #560) + + • For EMC NetWorker server/client we added some exclude items to + COPY_AS_IS_EXCLUDE_NSR (issue #571) + + • Removed the Warning message from main rear script as it was misleading + (issues #563 and #564) + + • output/ISO/Linux-i386/80_create_isofs.sh: make sure ISO_FILES[@] are + copied to isofs directory (issue #569) + Version 1.17.0 (March 2015) • rear 1.17 introduced a new stage directory (init) which is called before @@ -898,14 +950,14 @@ Rear-1.17 is supported on the following Linux based operating systems: - • Fedora 20, 21 and 22(alpha) + • Fedora 20, 21 and 22 • RHEL 5, 6 and 7 • CentOS 5, 6 and 7 • ScientificLinux 6 and 7 • SLES 11 and 12 • OpenSuSe 11, 12 and 13 - • Debian 6 and 7 - • Ubuntu 12, 13 and 14 + • Debian 6, 7 and 8 + • Ubuntu 12, 13, 14 and 15 Rear-1.17 dropped officially support for the following Linux based operating systems: @@ -917,8 +969,11 @@ • Debian <6 • Ubuntu <12 -If you require support for unsupported Operating Systems you must acquire a -rear support contract (per system). +If you require support for unsupported Linux Operating System you must +acquire a rear support contract (per system). + +Requests to port rear to another Operating System (not Linux) can only be +achieved with serious sponsoring. Supported Architectures diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/doc/rear.8 new/rear-1.17.1/doc/rear.8 --- old/rear-1.17.0/doc/rear.8 2015-02-24 08:18:46.000000000 +0100 +++ new/rear-1.17.1/doc/rear.8 2015-06-25 09:44:08.000000000 +0200 @@ -2,12 +2,12 @@ .\" Title: rear .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> -.\" Date: 19 February 2015 +.\" Date: 25 June 2015 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" -.TH "REAR" "8" "19 February 2015" "\ \&" "\ \&" +.TH "REAR" "8" "25 June 2015" "\ \&" "\ \&" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/doc/rear.8.txt new/rear-1.17.1/doc/rear.8.txt --- old/rear-1.17.0/doc/rear.8.txt 2015-02-24 08:18:46.000000000 +0100 +++ new/rear-1.17.1/doc/rear.8.txt 2015-06-25 09:34:04.000000000 +0200 @@ -1,6 +1,6 @@ = rear(8) -:version: v1.17 -:date: 19 February 2015 +:version: v1.17.1 +:date: 25 June 2015 :data-uri: :doctype: manpage :lang: en diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/packaging/debian/changelog new/rear-1.17.1/packaging/debian/changelog --- old/rear-1.17.0/packaging/debian/changelog 2015-03-13 14:55:19.000000000 +0100 +++ new/rear-1.17.1/packaging/debian/changelog 2015-06-25 09:37:26.000000000 +0200 @@ -1,3 +1,11 @@ +rear (1.17.1-1) stable; urgency=low + + * added support for Debian 8 and Ubuntu 15 + * some security fixes + * minor bug fixes + + -- Gratien Dhaese <gratien.dha...@gmail.com> Thu, 25 Jun 2015 09:36:39 +0100 + rear (1.17.0-1) stable; urgency=high * new features diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/packaging/debian/rear.dsc new/rear-1.17.1/packaging/debian/rear.dsc --- old/rear-1.17.0/packaging/debian/rear.dsc 2015-03-13 14:47:10.000000000 +0100 +++ new/rear-1.17.1/packaging/debian/rear.dsc 2015-06-25 09:35:07.000000000 +0200 @@ -1,6 +1,6 @@ Format: 1.0 Source: rear -Version: 1.17.0 +Version: 1.17.1 Binary: rear Maintainer: Dag Wieers <d...@wieers.com> Architecture: all diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/packaging/rpm/rear.spec new/rear-1.17.1/packaging/rpm/rear.spec --- old/rear-1.17.0/packaging/rpm/rear.spec 2015-03-13 14:46:46.000000000 +0100 +++ new/rear-1.17.1/packaging/rpm/rear.spec 2015-06-25 09:34:50.000000000 +0200 @@ -7,7 +7,7 @@ Summary: Relax-and-Recover is a Linux disaster recovery and system migration tool Name: rear -Version: 1.17.0 +Version: 1.17.1 Release: 1%{?rpmrelease}%{?dist} License: GPLv3 Group: Applications/File diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/usr/sbin/rear new/rear-1.17.1/usr/sbin/rear --- old/rear-1.17.0/usr/sbin/rear 2015-03-13 14:46:03.000000000 +0100 +++ new/rear-1.17.1/usr/sbin/rear 2015-06-25 09:34:27.000000000 +0200 @@ -26,7 +26,7 @@ # Versioning PRODUCT="Relax-and-Recover" PROGRAM=${0##*/} -VERSION=1.17.0 +VERSION=1.17.1 RELEASE_DATE=Git STARTTIME=$SECONDS @@ -260,8 +260,6 @@ if [[ $EXIT_CODE -eq 0 ]]; then LogToSyslog "DONE: rc=$EXIT_CODE" -else - LogToSyslog "WARNING: rc=$EXIT_CODE (see $LOGFILE)" fi exit $EXIT_CODE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/usr/share/rear/backup/NETFS/default/50_make_backup.sh new/rear-1.17.1/usr/share/rear/backup/NETFS/default/50_make_backup.sh --- old/rear-1.17.0/usr/share/rear/backup/NETFS/default/50_make_backup.sh 2015-02-06 07:40:52.000000000 +0100 +++ new/rear-1.17.1/usr/share/rear/backup/NETFS/default/50_make_backup.sh 2015-06-25 09:07:56.000000000 +0200 @@ -40,7 +40,7 @@ # Disable BACKUP_PROG_CRYPT_OPTIONS by replacing the default value to cat in # case encryption is disabled if (( $BACKUP_PROG_CRYPT_ENABLED == 1 )); then - LogPrint "Encrypting archive with key: $BACKUP_PROG_CRYPT_KEY" + LogPrint "Encrypting archive with a key" else LogPrint "Encrypting disabled" BACKUP_PROG_CRYPT_OPTIONS="cat" @@ -78,7 +78,7 @@ $BACKUP_PROG_X_OPTIONS \ ${BACKUP_PROG_BLOCKS:+-b $BACKUP_PROG_BLOCKS} $BACKUP_PROG_COMPRESS_OPTIONS \ -X $TMP_DIR/backup-exclude.txt -C / -c -f - \ - $(cat $TMP_DIR/backup-include.txt) $LOGFILE \| $BACKUP_PROG_CRYPT_OPTIONS $BACKUP_PROG_CRYPT_KEY \| $SPLIT_COMMAND + $(cat $TMP_DIR/backup-include.txt) $LOGFILE \| $BACKUP_PROG_CRYPT_OPTIONS BACKUP_PROG_CRYPT_KEY \| $SPLIT_COMMAND $BACKUP_PROG $TAR_OPTIONS --sparse --block-number --totals --verbose \ --no-wildcards-match-slash --one-file-system \ --ignore-failed-read $BACKUP_PROG_OPTIONS \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/usr/share/rear/build/Debian/61_jessie_link_systemd_lib.sh new/rear-1.17.1/usr/share/rear/build/Debian/61_jessie_link_systemd_lib.sh --- old/rear-1.17.0/usr/share/rear/build/Debian/61_jessie_link_systemd_lib.sh 1970-01-01 01:00:00.000000000 +0100 +++ new/rear-1.17.1/usr/share/rear/build/Debian/61_jessie_link_systemd_lib.sh 2015-06-25 09:07:56.000000000 +0200 @@ -0,0 +1,18 @@ +Log "Fixup debian jessie systemd files" + +# on debian jessie systemd files are located in /lib/systemd not +# /usr/lib/systemd, as such symlink then within the $ROOTFS_DIR +# otherwise certain servises wont come up. + +if [ -e "$ROOTFS_DIR/lib/systemd/" ]; then + cd $ROOTFS_DIR/lib/systemd/ + my_systemd_files=( $( ls -1 systemd-* )) + if [ -e "$ROOTFS_DIR/usr/lib/systemd/" ]; then + cd $ROOTFS_DIR/usr/lib/systemd/ + for m in "${my_systemd_files[@]}" ; do + ln -sf ../../../lib/systemd/$m $m + done + else + Error "Missing usr/lib/systemd/system - too confused to continue" + fi +fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/usr/share/rear/build/GNU/Linux/16_adjust_sshd_config.sh new/rear-1.17.1/usr/share/rear/build/GNU/Linux/16_adjust_sshd_config.sh --- old/rear-1.17.0/usr/share/rear/build/GNU/Linux/16_adjust_sshd_config.sh 2014-01-28 08:22:28.000000000 +0100 +++ new/rear-1.17.1/usr/share/rear/build/GNU/Linux/16_adjust_sshd_config.sh 1970-01-01 01:00:00.000000000 +0100 @@ -1,26 +0,0 @@ -# 16_adjust_sshd_config.sh -# -# Edit the sshd_config for Relax and Recover to allow password login if set -# -# Relax-and-Recover is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. - -# Relax-and-Recover is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with Relax-and-Recover; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# -# -if has_binary sshd; then - if [[ $SSH_ROOT_PASSWORD ]] ; then - sed -i 's/.*PermitRootLogin.*/PermitRootLogin yes/g' $ROOTFS_DIR/etc/ssh/sshd_config - sed -i 's/.*PasswordAuthentication.*/PasswordAuthentication yes/g' $ROOTFS_DIR/etc/ssh/sshd_config - fi -fi - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/usr/share/rear/build/default/50_patch_sshd_config.sh new/rear-1.17.1/usr/share/rear/build/default/50_patch_sshd_config.sh --- old/rear-1.17.0/usr/share/rear/build/default/50_patch_sshd_config.sh 2014-03-31 09:43:35.000000000 +0200 +++ new/rear-1.17.1/usr/share/rear/build/default/50_patch_sshd_config.sh 2015-06-08 09:50:38.000000000 +0200 @@ -6,25 +6,28 @@ # - disable challange response (Kerberos, skey, ...) for same reason # - disable PAM # - disable motd printing, our /etc/profile does that +# - if SSH_ROOT_PASSWORD was defined allow root to login via ssh # The idea is to allow only ssh authorized_keys based access which HAS TO BE ENABLED # also in the original system to work here as we DO NOT ENABLE IT FOR YOU ! # important for the [n] hack below because we want non-existant patterns to simply disappear shopt -s nullglob -SSH_CONFIG_FILES=( $ROOTFS_DIR/etc/ssh/sshd_co[n]fig $ROOTFS_DIR/etc/sshd_co[n]fig $ROOTFS_DIR/etc/openssh/sshd_co[n]fig) +SSH_CONFIG_FILES=( $ROOTFS_DIR/etc/ssh/sshd_co[n]fig $ROOTFS_DIR/etc/sshd_co[n]fig $ROOTFS_DIR/etc/openssh/sshd_co[n]fig ) + if test "$SSH_CONFIG_FILES" ; then sed -i -e 's/ChallengeResponseAuthentication.*/ChallengeResponseAuthentication no/ig' \ - -e 's/UsePAM.*/UsePam no/ig' \ - -e 's/ListenAddress.*/ListenAddress 0.0.0.0/ig' \ - -e '1i PrintMotd no' \ - $ROOTFS_DIR/etc/sshd_co[n]fig $ROOTFS_DIR/etc/ssh/sshd_co[n]fig $ROOTFS_DIR/etc/openssh/sshd_co[n]fig - - if [ -n "$SSH_ROOT_PASSWORD" ] ; then - sed -i -e 's/PasswordAuthentication.*/PasswordAuthentication yes/ig' $ROOTFS_DIR/etc/sshd_co[n]fig $ROOTFS_DIR/etc/ssh/sshd_co[n]fig $ROOTFS_DIR/etc/openssh/sshd_co[n]fig - else - sed -i -e 's/PasswordAuthentication.*/PasswordAuthentication no/ig' $ROOTFS_DIR/etc/sshd_co[n]fig $ROOTFS_DIR/etc/ssh/sshd_co[n]fig $ROOTFS_DIR/etc/openssh/sshd_co[n]fig - fi + -e 's/UsePAM.*/UsePam no/ig' \ + -e 's/ListenAddress.*/ListenAddress 0.0.0.0/ig' \ + -e '$a PrintMotd no' \ + ${SSH_CONFIG_FILES[@]} + + if [ -n "$SSH_ROOT_PASSWORD" ] ; then + sed -i -e 's/PasswordAuthentication.*/PasswordAuthentication yes/ig' ${SSH_CONFIG_FILES[@]} + sed -i -e 's/PermitRootLogin.*/PermitRootLogin yes/ig' ${SSH_CONFIG_FILES[@]} + else + sed -i -e 's/PasswordAuthentication.*/PasswordAuthentication no/ig' ${SSH_CONFIG_FILES[@]} + fi else - Log "WARNING: ssh configuration files missing" + Log "WARNING: sshd configuration file missing" fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/usr/share/rear/build/default/99_update_os_conf.sh new/rear-1.17.1/usr/share/rear/build/default/99_update_os_conf.sh --- old/rear-1.17.0/usr/share/rear/build/default/99_update_os_conf.sh 2013-11-07 16:42:57.000000000 +0100 +++ new/rear-1.17.1/usr/share/rear/build/default/99_update_os_conf.sh 2015-06-08 09:50:38.000000000 +0200 @@ -1,6 +1,6 @@ # add os/version info to os.conf in the rescue system so that we don't need to pull lsb into the rescue system -echo -e "#\n# WARNING ! This information was added automatically by the $WORKFLOW workflow !!!" >> $ROOTFS_DIR/$CONFIG_DIR/os.conf +echo -e "#\n# WARNING ! This information was added automatically by the $WORKFLOW workflow !!!" >> $ROOTFS_DIR/etc/rear/os.conf for var in ARCH OS OS_VERSION OS_VENDOR OS_VENDOR_VERSION OS_VENDOR_ARCH ; do echo "$var='${!var}'" -done >> $ROOTFS_DIR/$CONFIG_DIR/os.conf +done >> $ROOTFS_DIR/etc/rear/os.conf diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/usr/share/rear/conf/default.conf new/rear-1.17.1/usr/share/rear/conf/default.conf --- old/rear-1.17.0/usr/share/rear/conf/default.conf 2015-03-12 15:49:33.000000000 +0100 +++ new/rear-1.17.1/usr/share/rear/conf/default.conf 2015-06-25 09:07:56.000000000 +0200 @@ -124,8 +124,10 @@ # empty means only keep current output KEEP_OLD_OUTPUT_COPY= -# The remote file system layout for OUTPUT=PXE can be modified to accomodate different TFTP server layouts (simply overwrite OUTPUT_PREFIX_PXE). -OUTPUT_PREFIX_PXE="$OUTPUT_PREFIX" +# The remote file system layout for OUTPUT=PXE can be modified to accomodate 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="" ## # OUTPUT=RAMDISK stuff @@ -270,6 +272,9 @@ BACKUP_INTEGRITY_CHECK= # define BACKUP_TYPE (default empty [full]) or incremental - only with BACKUP=NETFS and BACKUP_PROG=tar BACKUP_TYPE= +# Together with BACKUP_TYPE=incremental you could define on which day in the week a full backup must be run +# Therefore, use FULLBACKUPDAY=Mon (or whatever day you prefer - use the "date +%a" syntax) +FULLBACKUPDAY= # # program files (find them in the path). These progs are optional, @@ -300,6 +305,7 @@ file pidof sync +strings ) # library files @@ -324,8 +330,13 @@ # copy all available users and groups on the rescue system. # this variable overrides CLONE_USERS and CLONE_GROUPS CLONE_ALL_USERS_GROUPS=n -# This option defines a root password to allow SSH connection whithout a public/private key pair -# Be aware, the password is saved as clear text - DO NOT use the same password as on the live system! + +# SSH_ROOT_PASSWORD defines a root password to allow SSH connection whithout a public/private key pair +# Be aware, the password is saved in hashed MD5 format (do not forget the password after months:) +# Generate a hashed password with the following command: +# echo "my_rescue_root_password" | openssl passwd -1 -stdin +# and copy paste the output of openssl to variable SSH_ROOT_PASSWORD="..." +# into config file /etc/rear/local.conf SSH_ROOT_PASSWORD= # time synchronisation, could be NTP, RDATE or empty @@ -452,7 +463,7 @@ # NSR_ROOT_DIR is relocatable - default location is /nsr NSR_ROOT_DIR=/nsr COPY_AS_IS_NSR=( $NSR_ROOT_DIR /opt/nsr /usr/lib/nsr /usr/lib64/gconv ) -COPY_AS_IS_EXCLUDE_NSR=( "$NSR_ROOT_DIR/logs/*" ) +COPY_AS_IS_EXCLUDE_NSR=( "$NSR_ROOT_DIR/logs/*" "$NSR_ROOT_DIR/debug/*" "$NSR_ROOT_DIR/index/*" "$NSR_ROOT_DIR/lockbox/*" "$NSR_ROOT_DIR/mm/*" "$NSR_ROOT_DIR/repository/*" "$NSR_ROOT_DIR/scripts/*" "$NSR_ROOT_DIR/utils/*" ) PROGS_NSR=( nsrexec nsrexecd mminfo save savefs savepnpc recover nsrfsra nsrinfo nsrretrieve nsrwatch nsrports uasm ) # NSRSERVER is normally found automatically, but for the rare cases it is not found pls define it in local.conf NSRSERVER= @@ -801,6 +812,8 @@ GRUB_RESCUE=n # It is protected by a password, default "REAR" (uppercase), to prevent accidental recovery GRUB_RESCUE_PASSWORD="REAR" +# In GRUB2 you can specify which users can properly access rear - here we only want superusers +GRUB_SUPERUSER="rearadmin" # UEFI (Secure booting) support is partly available in rear (at least for Fedora, RHEL) # SLES, OpenSuSe do not work out of the box due to issues with making an ISO image UEFI aware diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/usr/share/rear/finalize/Linux-i386/21_install_grub.sh new/rear-1.17.1/usr/share/rear/finalize/Linux-i386/21_install_grub.sh --- old/rear-1.17.0/usr/share/rear/finalize/Linux-i386/21_install_grub.sh 2015-02-06 07:40:52.000000000 +0100 +++ new/rear-1.17.1/usr/share/rear/finalize/Linux-i386/21_install_grub.sh 2015-06-08 09:50:38.000000000 +0200 @@ -19,9 +19,11 @@ (( USING_UEFI_BOOTLOADER )) && return # set to 1 means UEFI booting # check the BOOTLOADER variable (read by 01_prepare_checks.sh script) -if [[ "$BOOTLOADER" = "GRUB2" ]]; then - # grub2 script should handle this instead - return +if [[ "$BOOTLOADER" = "GRUB" ]]; then + if [[ $(type -p grub-probe) || $(type -p grub2-probe) ]]; then + # grub2 script should handle this instead + return + fi fi # Only for GRUB Legacy - GRUB2 will be handled by its own script diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/usr/share/rear/finalize/Linux-i386/22_install_elilo.sh new/rear-1.17.1/usr/share/rear/finalize/Linux-i386/22_install_elilo.sh --- old/rear-1.17.0/usr/share/rear/finalize/Linux-i386/22_install_elilo.sh 1970-01-01 01:00:00.000000000 +0100 +++ new/rear-1.17.1/usr/share/rear/finalize/Linux-i386/22_install_elilo.sh 2015-06-25 09:07:56.000000000 +0200 @@ -0,0 +1,51 @@ +# This script is meant for UEFI based systems using ELILO (SLES) +# + +# skip if another bootloader was installed +if [[ -z "$NOBOOTLOADER" ]] ; then + return +fi + +# for UEFI systems we defined USING_UEFI_BOOTLOADER=1; BIOS based is 0 or "" +(( USING_UEFI_BOOTLOADER )) || return # when set to 0 + +# Only for elilo +[[ "$BOOTLOADER" == "ELILO" ]] || return # only continue when bootloader is elilo based + +[[ $(type -p elilo) ]] +StopIfError "Could not find elilo executable" + + +LogPrint "Installing ELILO boot loader" +mount -t proc none /mnt/local/proc +#for i in /dev /dev/pts /proc /sys; do mount -B $i /mnt/local${i} ; done + +if [[ -r "$LAYOUT_FILE" && -r "$LAYOUT_DEPS" ]]; then + + # Check if we find the vfat file system /boot/efi where we expect it + [[ -d "/mnt/local/boot/efi" ]] + StopIfError "Could not find directory /boot/efi" + + # the UEFI_BOOTLOADER was saved in /etc/rear/rescue.conf file by rear mkrescue/mkbackup + [[ ! -f "/mnt/local${UEFI_BOOTLOADER}" ]] + StopIfError "Could not find elilo.efi" + + [[ -r "/mnt/local/etc/elilo.conf" ]] + LogIfError "Unable to find /etc/elilo.conf" + + # Find the disks that need a new ELILO + disks=$(grep '^disk \|^multipath ' $LAYOUT_FILE | cut -d' ' -f2) + [[ "$disks" ]] + StopIfError "Unable to find any disks" + + + chroot /mnt/local elilo -v >&2 + + if (( $? == 0 )); then + NOBOOTLOADER= + fi +fi + + +#for i in /dev /dev/pts /proc /sys; do umount /mnt/local${i} ; done +umount /mnt/local/proc diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/usr/share/rear/format/USB/default/30_format_usb_disk.sh new/rear-1.17.1/usr/share/rear/format/USB/default/30_format_usb_disk.sh --- old/rear-1.17.0/usr/share/rear/format/USB/default/30_format_usb_disk.sh 2012-02-23 16:57:55.000000000 +0100 +++ new/rear-1.17.1/usr/share/rear/format/USB/default/30_format_usb_disk.sh 2015-06-08 09:50:38.000000000 +0200 @@ -7,23 +7,35 @@ echo "Yes" | parted -s $RAW_USB_DEVICE mklabel msdos >&2 StopIfError "Could not create msdos partitioning" - # FIXME: Parted shipping with RHEL4 does not support percentages ! - echo "Yes" | parted -s $RAW_USB_DEVICE mkpart primary 0 100% >&2 - StopIfError "Could not create a primary partition on '$REAL_USB_DEVICE'" - + if [[ "$EFI" == "y" ]]; then + LogPrint "The --efi toggle was used with format - make an EFI bootable USB disk" + echo "Yes" | parted -s $RAW_USB_DEVICE -- mklabel gpt mkpart primary 0 100Mib mkpart primary 100Mib 100% >&2 + StopIfError "Could not create primary partitions on '$REAL_USB_DEVICE'" + # partition 1 is the ESP (vfat partition) on which EFI/BOOT/BOOTX86.EFI resides + ParNr=2 + else + echo "Yes" | parted -s $RAW_USB_DEVICE mkpart primary 0 100% >&2 + StopIfError "Could not create a primary partition on '$REAL_USB_DEVICE'" + ParNr=1 + fi + echo "Yes" | parted -s $RAW_USB_DEVICE set 1 boot on >&2 StopIfError "Could not make primary partition boot-able on '$REAL_USB_DEVICE'" - + partprobe $RAW_USB_DEVICE # Wait until udev has had the time to kick in sleep 5 - LogPrint "Creating new filesystem on ${RAW_USB_DEVICE}1" - mkfs.ext3 -L REAR-000 ${RAW_USB_DEVICE}1 >&2 - StopIfError "Could not format '${RAW_USB_DEVICE}1' with ext3 layout" + if [[ "$EFI" == "y" ]]; then + LogPrint "Creating new vfat filesystem on ${RAW_USB_DEVICE}1" + mkfs.vfat $v -F 16 ${RAW_USB_DEVICE}1 >&2 + fi + LogPrint "Creating new ext3 filesystem on ${RAW_USB_DEVICE}${ParNr}" + mkfs.ext3 -L REAR-000 ${RAW_USB_DEVICE}${ParNr} >&2 + StopIfError "Could not format '${RAW_USB_DEVICE}${ParNr}' with ext3 layout" - tune2fs -c 0 -i 0 -o acl,journal_data,journal_data_ordered ${RAW_USB_DEVICE}1 >&2 - StopIfError "Failed to change filesystem characteristics on '${RAW_USB_DEVICE}1'" + tune2fs -c 0 -i 0 -o acl,journal_data,journal_data_ordered ${RAW_USB_DEVICE}${ParNr} >&2 + StopIfError "Failed to change filesystem characteristics on '${RAW_USB_DEVICE}${ParNr}'" fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/usr/share/rear/format/USB/default/35_label_usb_disk.sh new/rear-1.17.1/usr/share/rear/format/USB/default/35_label_usb_disk.sh --- old/rear-1.17.0/usr/share/rear/format/USB/default/35_label_usb_disk.sh 2012-11-07 12:35:32.000000000 +0100 +++ new/rear-1.17.1/usr/share/rear/format/USB/default/35_label_usb_disk.sh 2015-06-08 09:50:38.000000000 +0200 @@ -1,22 +1,28 @@ +if [[ "$EFI" == "Yes" ]]; then + ParNr=2 +else + ParNr=1 +fi + case "$ID_FS_TYPE" in ext*) - USB_LABEL="$(e2label ${RAW_USB_DEVICE}1)" + USB_LABEL="$(e2label ${RAW_USB_DEVICE}${ParNr})" if [[ "$USB_LABEL" != "REAR-000" ]]; then LogPrint "Setting filesystem label to REAR-000" - e2label ${RAW_USB_DEVICE}1 REAR-000 - StopIfError "Could not label '${RAW_USB_DEVICE}1' with REAR-000" - USB_LABEL="$(e2label ${RAW_USB_DEVICE}1)" + e2label ${RAW_USB_DEVICE}${ParNr} REAR-000 + StopIfError "Could not label '${RAW_USB_DEVICE}${ParNr}' with REAR-000" + USB_LABEL="$(e2label ${RAW_USB_DEVICE}${ParNr})" fi ;; btrfs) - USB_LABEL="$(btrfs filesystem label ${RAW_USB_DEVICE}1)" + USB_LABEL="$(btrfs filesystem label ${RAW_USB_DEVICE}${ParNr})" if [[ "$USB_LABEL" != "REAR-000" ]]; then LogPrint "Setting filesystem label to REAR-000" - btrfs filesystem label ${RAW_USB_DEVICE}1 REAR-000 - StopIfError "Could not label '${RAW_USB_DEVICE}1' with REAR-000" - USB_LABEL="$(btrfs filesystem label ${RAW_USB_DEVICE}1)" + btrfs filesystem label ${RAW_USB_DEVICE}${ParNr} REAR-000 + StopIfError "Could not label '${RAW_USB_DEVICE}${ParNr}' with REAR-000" + USB_LABEL="$(btrfs filesystem label ${RAW_USB_DEVICE}${ParNr})" fi ;; esac -Log "Device '${RAW_USB_DEVICE}1' has label $USB_LABEL" +Log "Device '${RAW_USB_DEVICE}${ParNr}' has label $USB_LABEL" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/usr/share/rear/layout/prepare/GNU/Linux/13_include_mount_filesystem_code.sh new/rear-1.17.1/usr/share/rear/layout/prepare/GNU/Linux/13_include_mount_filesystem_code.sh --- old/rear-1.17.0/usr/share/rear/layout/prepare/GNU/Linux/13_include_mount_filesystem_code.sh 2015-02-06 07:40:52.000000000 +0100 +++ new/rear-1.17.1/usr/share/rear/layout/prepare/GNU/Linux/13_include_mount_filesystem_code.sh 2015-06-25 09:07:56.000000000 +0200 @@ -54,6 +54,13 @@ # Call the btrfs_subvolumes_setup function for the btrfs filesystem that was mounted above: btrfs_subvolumes_setup $device $mp $mountopts ;; + (vfat) + # mounting vfat filesystem - avoid using mount options - issue #576 + ( + echo "mkdir -p /mnt/local$mp" + echo "mount $device /mnt/local$mp" + ) >> "$LAYOUT_CODE" + ;; (*) ( echo "mkdir -p /mnt/local$mp" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/usr/share/rear/layout/save/GNU/Linux/23_filesystem_layout.sh new/rear-1.17.1/usr/share/rear/layout/save/GNU/Linux/23_filesystem_layout.sh --- old/rear-1.17.0/usr/share/rear/layout/save/GNU/Linux/23_filesystem_layout.sh 2015-03-12 15:49:33.000000000 +0100 +++ new/rear-1.17.1/usr/share/rear/layout/save/GNU/Linux/23_filesystem_layout.sh 2015-06-25 09:07:56.000000000 +0200 @@ -92,26 +92,26 @@ label=$( e2label $device ) echo -n " label=$label" # options: blocks, fragments, max_mount, check_interval, reserved blocks, bytes_per_inode - blocksize=$( $tunefs -l $device | tr -d '[:blank:]' | grep -oi 'Blocksize:[0-9]*' | cut -d ':' -f 2 ) + blocksize=$( $tunefs -l $device | tr -d '[:blank:]' | grep -i 'Blocksize:[0-9]*' | cut -d ':' -f 2 ) echo -n " blocksize=$blocksize" # we agreed to comment fragmentsize due mkfs.ext* option -f not existing (man page says it is) - issue #558 #fragmentsize=$( $tunefs -l $device | tr -d '[:blank:]' | grep -oi 'Fragmentsize:[0-9]*' | cut -d ':' -f 2 ) #echo -n " fragmentsize=$fragmentsize" - nr_blocks=$( $tunefs -l $device | tr -d '[:blank:]' | grep -iv reserved | grep -oi 'Blockcount:[0-9]*' | cut -d ':' -f 2 ) - reserved_blocks=$( $tunefs -l $device | tr -d '[:blank:]' | grep -oi 'Reservedblockcount:[0-9]*' | cut -d ':' -f 2 ) + nr_blocks=$( $tunefs -l $device | tr -d '[:blank:]' | grep -iv reserved | grep -i 'Blockcount:[0-9]*' | cut -d ':' -f 2 ) + reserved_blocks=$( $tunefs -l $device | tr -d '[:blank:]' | grep -i 'Reservedblockcount:[0-9]*' | cut -d ':' -f 2 ) reserved_percentage=$(( reserved_blocks * 100 / nr_blocks )) + StopIfError "Divide by zero detected" echo -n " reserved_blocks=$reserved_percentage%" - # FIXME: I (jsm...@suse.de) have no idea what the reason for the following is: - # On Fedora | grep -oi 'Maximummountcount:[0-9]*' | does not work but | grep -i 'Maximummountcount:[0-9]*' | works. - # If someone knows the reason replace this comment with a description of the actual root cause. max_mounts=$( $tunefs -l $device | tr -d '[:blank:]' | grep -i 'Maximummountcount:[0-9]*' | cut -d ':' -f 2 ) echo -n " max_mounts=$max_mounts" - check_interval=$( $tunefs -l $device | tr -d '[:blank:]' | grep -oi 'Checkinterval:[0-9]*' | cut -d ':' -f 2 ) + check_interval=$( $tunefs -l $device | tr -d '[:blank:]' | grep -i 'Checkinterval:[0-9]*' | cut -d ':' -f 2 | cut -d '(' -f1 ) + check_interval=$( is_numeric $check_interval ) # if non-numeric 0 is returned # translate check_interval from seconds to days let check_interval=$check_interval/86400 echo -n " check_interval=${check_interval}d" - nr_inodes=$( $tunefs -l $device | tr -d '[:blank:]' | grep -oi 'Inodecount:[0-9]*' | cut -d ':' -f 2 ) + nr_inodes=$( $tunefs -l $device | tr -d '[:blank:]' | grep -i 'Inodecount:[0-9]*' | cut -d ':' -f 2 ) let "bytes_per_inode=$nr_blocks*$blocksize/$nr_inodes" + StopIfError "Divide by zero detected" echo -n " bytes_per_inode=$bytes_per_inode" default_mount_options=$( tune2fs -l $device | grep -i "Default mount options:" | cut -d ':' -f 2 | awk '{$1=$1};1' | tr ' ' ',' | grep -v none ) if [[ -n $default_mount_options ]]; then diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/usr/share/rear/layout/save/default/45_check_bootloader_files.sh new/rear-1.17.1/usr/share/rear/layout/save/default/45_check_bootloader_files.sh --- old/rear-1.17.0/usr/share/rear/layout/save/default/45_check_bootloader_files.sh 2014-02-14 16:21:37.000000000 +0100 +++ new/rear-1.17.1/usr/share/rear/layout/save/default/45_check_bootloader_files.sh 2015-06-25 09:07:56.000000000 +0200 @@ -12,4 +12,6 @@ ;; LILO) CHECK_CONFIG_FILES=( ${CHECK_CONFIG_FILES[@]} /etc/lilo.conf ) ;; + ELILO) CHECK_CONFIG_FILES=( ${CHECK_CONFIG_FILES[@]} /etc/elilo.conf ) + ;; esac diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/usr/share/rear/lib/bootloader-functions.sh new/rear-1.17.1/usr/share/rear/lib/bootloader-functions.sh --- old/rear-1.17.0/usr/share/rear/lib/bootloader-functions.sh 2015-03-12 15:49:33.000000000 +0100 +++ new/rear-1.17.1/usr/share/rear/lib/bootloader-functions.sh 2015-06-25 09:07:56.000000000 +0200 @@ -19,6 +19,20 @@ echo "$syslinux_version" } +function find_syslinux_file { + # input argument is usually isolinux.bin + # output argument is the full path of isolinux.bin + local syslinux_file="" + + for file in /usr/{share,lib,libexec}/*/"$1" ; do + if [[ -s "$file" ]]; then + syslinux_file="$file" + break # for loop + fi + done + echo "$syslinux_file" +} + function set_syslinux_features { # Test for features in syslinux # true if isolinux supports booting from /boot/syslinux, /boot or only from / of the ISO @@ -43,15 +57,15 @@ FEATURE_SYSLINUX_MENU_HIDDEN= # true if syslinux supports TEXT HELP directive FEATURE_SYSLINUX_TEXT_HELP= + # true if syslinux supports modules sub-dir (Version > 5.00) + FEATURE_SYSLINUX_MODULES= # Define the syslinux directory for later usage if [[ -z "$SYSLINUX_DIR" ]]; then - for file in /usr/{share,lib,libexec}/*/isolinux.bin ; do - if [[ -s "$file" ]]; then - SYSLINUX_DIR="$(dirname $file)" - break # for loop - fi - done + ISOLINUX_BIN=$(find_syslinux_file isolinux.bin) + if [[ -s "$ISOLINUX_BIN" ]]; then + SYSLINUX_DIR="$(dirname $ISOLINUX_BIN)" + fi fi [[ "$SYSLINUX_DIR" ]] StopIfError "Could not find a working syslinux path." @@ -90,6 +104,10 @@ FEATURE_SYSLINUX_EXTLINUX_INSTALL="y" fi + if version_newer "$syslinux_version" 5.00; then + FEATURE_SYSLINUX_MODULES=y + fi + if [[ "$FEATURE_SYSLINUX_BOOT_SYSLINUX" ]]; then SYSLINUX_PREFIX="boot/syslinux" else @@ -110,13 +128,25 @@ [[ -d "$1" ]] BugIfError "Required argument for BOOT_DIR is missing" [[ -d "$SYSLINUX_DIR" ]] - BugIfError "Required environment SYSLINUX_DIR ($SYSLINUX_DIR) is not set or not a d irectory" + BugIfError "Required environment SYSLINUX_DIR ($SYSLINUX_DIR) is not set or not a directory" [[ "$FEATURE_SYSLINUX_IS_SET" ]] BugIfError "You must call set_syslinux_features before" local BOOT_DIR="$1" ; shift local flavour="${1:-isolinux}" ; shift + if [[ "$FEATURE_SYSLINUX_MODULES" ]]; then + SYSLINUX_MODULES_DIR= + if [[ -d /usr/lib/syslinux/modules ]]; then + if (( USING_UEFI_BOOTLOADER )); then + SYSLINUX_MODULES_DIR=/usr/lib/syslinux/modules/efi64 + else + SYSLINUX_MODULES_DIR=/usr/lib/syslinux/modules/bios + fi + SYSLINUX_DIR="$SYSLINUX_MODULES_DIR" + fi + fi + # Enable serial console, unless explicitly disabled (only last entry is used :-/) if [[ "$USE_SERIAL_CONSOLE" =~ ^[yY1] ]]; then for devnode in $(ls /dev/ttyS[0-9]* | sort); do diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/usr/share/rear/lib/format-workflow.sh new/rear-1.17.1/usr/share/rear/lib/format-workflow.sh --- old/rear-1.17.0/usr/share/rear/lib/format-workflow.sh 2012-02-23 16:57:55.000000000 +0100 +++ new/rear-1.17.1/usr/share/rear/lib/format-workflow.sh 2015-06-08 09:50:38.000000000 +0200 @@ -1,6 +1,11 @@ # format-workflow.sh # +# Usage: rear -v format -- -h /dev/<usb-disk> +# By default 1 partition will be created with ext3 format and label REAR-000 +# With the --efi toggle you get 2 partitions (vfat and ext3) so we are able +# to make this USB UEFI bootable afterwards + WORKFLOW_format_DESCRIPTION="format and label media for use with rear" WORKFLOWS=( ${WORKFLOWS[@]} format ) WORKFLOW_format () { @@ -8,7 +13,7 @@ local DEVICE="" # Parse options - OPTS="$(getopt -n "$PROGRAM format" -o "fhy" -l "force,help,yes" -- "$@")" + OPTS="$(getopt -n "$PROGRAM format" -o "efhy" -l "efi,force,help,yes" -- "$@")" if (( $? != 0 )); then echo "Try \`$PROGRAM format -- --help' for more information." exit 1 @@ -17,8 +22,9 @@ eval set -- "$OPTS" while true; do case "$1" in + (-e|--efi) EFI=y;; (-f|--force) FORCE=y;; - (-h|--help) echo "Valid options are: -f/--force or -y/--yes"; exit 1;; + (-h|--help) echo "Valid options are: -e/--efi, -f/--force or -y/--yes"; exit 1;; (-y|--yes) YES=y;; (--) shift; continue;; ("") break;; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/usr/share/rear/lib/framework-functions.sh new/rear-1.17.1/usr/share/rear/lib/framework-functions.sh --- old/rear-1.17.0/usr/share/rear/lib/framework-functions.sh 2014-10-23 13:30:00.000000000 +0200 +++ new/rear-1.17.1/usr/share/rear/lib/framework-functions.sh 2015-06-08 09:50:38.000000000 +0200 @@ -87,7 +87,6 @@ rm -Rf $ROOTFS_DIR # line below put in comment due to issue #465 #rm -Rf $BUILD_DIR/outputfs - rmdir $v $BUILD_DIR/outputfs >&2 # in worst case it could not umount; so before remove the BUILD_DIR check if above outputfs is gone mount | grep -q "$BUILD_DIR/outputfs" if [[ $? -eq 0 ]]; then @@ -96,6 +95,9 @@ sleep 2 umount -f -l $BUILD_DIR/outputfs >&2 rmdir $v $BUILD_DIR/outputfs >&2 + else + # not mounted so we can safely delete $BUILD_DIR/outputfs + rm -Rf $BUILD_DIR/outputfs fi rmdir $v $BUILD_DIR >&2 fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/usr/share/rear/lib/uefi-functions.sh new/rear-1.17.1/usr/share/rear/lib/uefi-functions.sh --- old/rear-1.17.0/usr/share/rear/lib/uefi-functions.sh 2014-05-05 08:41:13.000000000 +0200 +++ new/rear-1.17.1/usr/share/rear/lib/uefi-functions.sh 2015-06-08 09:50:38.000000000 +0200 @@ -25,8 +25,8 @@ function uefi_extract_bootloader { # input arg path/data local dt - dt=$(cat "$1" | cut -c40- | tr -cd '[:print:]\n' | cut -d\\ -f2-) - echo "\\${dt}" + dt=$(cat "$1" | tail -1 | tr -cd '[:print:]\n' | cut -d\\ -f2-) + echo "\\$(trim ${dt})" } function trim { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/usr/share/rear/lib/validated/Fedora/21/i386.txt new/rear-1.17.1/usr/share/rear/lib/validated/Fedora/21/i386.txt --- old/rear-1.17.0/usr/share/rear/lib/validated/Fedora/21/i386.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/rear-1.17.1/usr/share/rear/lib/validated/Fedora/21/i386.txt 2015-06-08 09:50:38.000000000 +0200 @@ -0,0 +1,6 @@ +Version: Relax-and-Recover 1.17.0 / Git +Validation: Fedora/21/i386 +Submitted: Frank Crawford <fr...@crawford.emu.id.au>, Australia +Date: 2015-03-29 +Features: LVM, MD, REQUESTRESTORE, ISO, EMAIL +Comment: Works, with standard Fedora RPM installation. The documentation could be a little better. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/usr/share/rear/output/ISO/Linux-i386/80_create_isofs.sh new/rear-1.17.1/usr/share/rear/output/ISO/Linux-i386/80_create_isofs.sh --- old/rear-1.17.0/usr/share/rear/output/ISO/Linux-i386/80_create_isofs.sh 2013-05-27 17:11:21.000000000 +0200 +++ new/rear-1.17.1/usr/share/rear/output/ISO/Linux-i386/80_create_isofs.sh 2015-06-08 09:50:38.000000000 +0200 @@ -28,6 +28,11 @@ cp $v $TMP_DIR/initrd.cgz $TMP_DIR/isofs/isolinux/initrd.cgz >&2 #ISO_FILES=( ${ISO_FILES[@]} $TMP_DIR/kernel $TMP_DIR/initrd.cgz ) +# in case the user populates this array manually we must not forget to copy +# these files to our temporary isofs +if test "${#ISO_FILES[@]}" -gt 0 ; then + cp -pL $v ${ISO_FILES[@]} $TMP_DIR/isofs/isolinux/ >&2 +fi mkdir -p $v "$ISO_DIR" >&2 StopIfError "Could not create ISO ouput directory ($ISO_DIR)" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/usr/share/rear/output/USB/Linux-i386/85_make_USB_bootable.sh new/rear-1.17.1/usr/share/rear/output/USB/Linux-i386/85_make_USB_bootable.sh --- old/rear-1.17.0/usr/share/rear/output/USB/Linux-i386/85_make_USB_bootable.sh 2012-02-23 16:57:55.000000000 +0100 +++ new/rear-1.17.1/usr/share/rear/output/USB/Linux-i386/85_make_USB_bootable.sh 2015-06-08 09:50:38.000000000 +0200 @@ -48,9 +48,9 @@ # Write the USB boot sector if the filesystem is not the entire disk LogPrint "Writing MBR to $RAW_USB_DEVICE" if [[ "$FEATURE_DD_OFLAG" ]]; then - dd if=$(dirname $ISO_ISOLINUX_BIN)/mbr.bin of=$RAW_USB_DEVICE bs=440 count=1 oflag=sync + dd if=$SYSLINUX_MBR_BIN of=$RAW_USB_DEVICE bs=440 count=1 oflag=sync else - dd if=$(dirname $ISO_ISOLINUX_BIN)/mbr.bin of=$RAW_USB_DEVICE bs=440 count=1 + dd if=$SYSLINUX_MBR_BIN of=$RAW_USB_DEVICE bs=440 count=1 sync fi StopIfError "Problem with writing the mbr.bin to '$RAW_USB_DEVICE'" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/usr/share/rear/output/default/94_grub2_rescue.sh new/rear-1.17.1/usr/share/rear/output/default/94_grub2_rescue.sh --- old/rear-1.17.0/usr/share/rear/output/default/94_grub2_rescue.sh 1970-01-01 01:00:00.000000000 +0100 +++ new/rear-1.17.1/usr/share/rear/output/default/94_grub2_rescue.sh 2015-06-08 09:50:38.000000000 +0200 @@ -0,0 +1,162 @@ +# This file is part of Relax and Recover, licensed under the GNU General +# Public License. Refer to the included LICENSE for full text of license. + +### Add the rescue kernel and initrd to the local GRUB Legacy +### + +### Only do when explicitely enabled +if [[ ! "$GRUB_RESCUE" =~ ^[yY1] ]]; then + return +fi + +### Only do when system is not using GRUB Legacy +[[ $(type -p grub-probe) || $(type -p grub2-probe) ]] || return + +if [ -f /bin/grub-mkpasswd-pbkdf2 ]; then + grub_binary=$(get_path grub-mkpasswd-pbkdf2) +elif [ -f /usr/bin/grub2-mkpasswd-pbkdf2 ]; then + grub_binary=$(get_path grub2-mkpasswd-pbkdf2) +else + StopIfError "ERROR: no binary found for grub-mkpasswd-pbkdf2 or grub2-mkpasswd-pbkdf2" +fi + +if [[ -z "$grub_binary" ]]; then + Log "Could not find grub-mkpasswd-pbkdf2 or grub2-mkpasswd-pbkdf2 binary." + return +fi + +### Use strings as grub --version syncs all disks +#grub_version=$(get_version "grub --version") +grub_version=$(strings $grub_binary | sed -rn 's/^[^0-9\.]*([0-9]+\.[-0-9a-z\.]+).*$/\1/p' | tail -n 1) +if [[ ! "$grub_version" ]]; then + # only for grub-legacy we make special rear boot entry in menu.lst + return +fi + +[[ -r "$KERNEL_FILE" ]] +StopIfError "Failed to find kernel, updating GRUB2 failed." + +[[ -r "$TMP_DIR/initrd.cgz" ]] +StopIfError "Failed to find initrd.cgz, updating GRUB2 failed." + +function total_filesize { + stat --format '%s' $@ 2>&8 | awk 'BEGIN { t=0 } { t+=$1 } END { print t }' +} + +available_space=$(df -Pkl /boot | awk 'END { print $4 * 1024 }') +used_space=$(total_filesize /boot/rear-kernel /boot/rear-initrd.cgz) +required_space=$(total_filesize $KERNEL_FILE $TMP_DIR/initrd.cgz) + +if (( available_space + used_space < required_space )); then + LogPrint "WARNING: Not enough disk space available in /boot for GRUB2 rescue image" + LogPrint " Required: $(( required_space / 1024 / 1024 )) MiB /" \ + "Available: $(( ( available_space + used_space ) / 1024 / 1024 )) MiB" + return +fi + +if (( USING_UEFI_BOOTLOADER )) ; then + # set to 1 means using UEFI + grub_conf="`dirname $UEFI_BOOTLOADER`/grub.cfg" +elif [[ $(type -p grub2-probe) ]]; then + grub_conf=$(readlink -f /boot/grub2/grub.cfg) +else + grub_conf=$(readlink -f /boot/grub/grub.cfg) +fi + +[[ -w "$grub_conf" ]] +StopIfError "GRUB2 configuration cannot be modified." + +if [[ ! "${GRUB_RESCUE_PASSWORD:0:11}" == 'grub.pbkdf2' ]]; then + StopIfError "GRUB_RESCUE_PASSWORD needs to be set. Run grub2-mkpasswd-pbkdf2 to generate pbkdf2 hash" +fi + +if [[ ! -f /etc/grub.d/01_users ]]; then + echo "#!/bin/sh +cat << EOF +set superusers=\"$GRUB_SUPERUSER\" +password_pbkdf2 $GRUB_SUPERUSER $GRUB_RESCUE_PASSWORD +EOF" > /etc/grub.d/01_users +fi + +grub_pass_set=$(tail -n 4 /etc/grub.d/01_users | grep -E "cat|set superusers|password_pbkdf2|EOF" | wc -l) +if [[ $grub_pass_set < 4 ]]; then + echo "#!/bin/sh +cat << EOF +set superusers=\"$GRUB_SUPERUSER\" +password_pbkdf2 $GRUB_SUPERUSER $GRUB_RESCUE_PASSWORD +EOF" > /etc/grub.d/01_users +fi + +grub_super_set=$(grep 'set superusers' /etc/grub.d/01_users | cut -f2 -d '"') +if [[ ! $grub_super_set == $GRUB_SUPERUSER ]]; then + sed -i "s/set superusers=\"\S*\"/set superusers=\"$GRUB_SUPERUSER\"/" /etc/grub.d/01_users + sed -i "s/password_pbkdf2\s\S*\s\S*/password_pbkdf2 $GRUB_SUPERUSER $GRUB_RESCUE_PASSWORD/" /etc/grub.d/01_users +fi + +grub_enc_password=$(grep "password_pbkdf2" /etc/grub.d/01_users | awk '{print $3}') +if [[ ! $grub_enc_password == $GRUB_RESCUE_PASSWORD ]]; then + sed -i "s/password_pbkdf2\s\S*\s\S*/password_pbkdf2 $GRUB_SUPERUSER $GRUB_RESCUE_PASSWORD/" /etc/grub.d/01_users +fi + + +# Ensure 01_users is added to the /boot/grub.d/ +if [[ ! -x /etc/grub.d/01_users ]]; then + chmod 755 /etc/grub.d/01_users +fi + +if [[ $( type -f grub2-mkconfig ) ]]; then + grub2-mkconfig -o $grub_conf +else + grub-mkconfig -o $grub_conf +fi + +awk -f- $grub_conf >$TMP_DIR/grub.cfg <<EOF +/^menuentry \"Relax and Recover\" --class os --users \"\"/ { + ISREAR=1 + next +} + +/^menuentry / { + ISREAR=0 +} + +{ + if (ISREAR) { + next + } + print +} + +END { + print "menuentry \"Relax and Recover\" --class os --users \"\" {" + print "\tset root=\'hd0,msdos1\'" + print "\tlinux /rear-kernel $KERNEL_CMDLINE" + print "\tinitrd /rear-initrd.cgz" + print "\tpassword_pbkdf2 $GRUB_SUPERUSER $GRUB_RESCUE_PASSWORD" + print "}" +} +EOF + +[[ -s $grub_conf ]] +BugIfError "Modified GRUB2 is empty !" + +if ! diff -u $grub_conf $TMP_DIR/grub.cfg >&2; then + LogPrint "Modifying local GRUB configuration" + cp -af $v $grub_conf $grub_conf.old >&2 + cat $TMP_DIR/grub.cfg >$grub_conf +fi + +if [[ $(stat -L -c '%d' $KERNEL_FILE) == $(stat -L -c '%d' /boot/) ]]; then + # Hardlink file, if possible + cp -pLlf $v $KERNEL_FILE /boot/rear-kernel >&2 +elif [[ $(stat -L -c '%s %Y' $KERNEL_FILE) == $(stat -L -c '%s %Y' /boot/rear-kernel 2>&8) ]]; then + # If existing file has exact same size and modification time, assume the same + : +else + # In all other cases, replace + cp -pLf $v $KERNEL_FILE /boot/rear-kernel >&2 +fi +BugIfError "Unable to copy '$KERNEL_FILE' to /boot" + +cp -af $v $TMP_DIR/initrd.cgz /boot/rear-initrd.cgz >&2 +BugIfError "Unable to copy '$TMP_DIR/initrd.cgz' to /boot" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/usr/share/rear/output/default/94_grub_rescue.sh new/rear-1.17.1/usr/share/rear/output/default/94_grub_rescue.sh --- old/rear-1.17.0/usr/share/rear/output/default/94_grub_rescue.sh 2015-02-06 07:40:52.000000000 +0100 +++ new/rear-1.17.1/usr/share/rear/output/default/94_grub_rescue.sh 2015-06-08 09:50:38.000000000 +0200 @@ -49,6 +49,8 @@ if (( USING_UEFI_BOOTLOADER )) ; then # set to 1 means using UEFI + # SLES uses elilo instead of grub-efi; we will return if that is the case (and do not add a rear rescue entry) + [[ "${UEFI_BOOTLOADER##*/}" = "elilo.efi" ]] && return grub_conf="`dirname $UEFI_BOOTLOADER`/grub.conf" else grub_conf=$(readlink -f /boot/grub/menu.lst) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/usr/share/rear/prep/GNU/Linux/30_include_grub_tools.sh new/rear-1.17.1/usr/share/rear/prep/GNU/Linux/30_include_grub_tools.sh --- old/rear-1.17.0/usr/share/rear/prep/GNU/Linux/30_include_grub_tools.sh 2015-03-12 15:49:33.000000000 +0100 +++ new/rear-1.17.1/usr/share/rear/prep/GNU/Linux/30_include_grub_tools.sh 2015-06-08 09:50:38.000000000 +0200 @@ -12,8 +12,8 @@ fi PROGS=( "${PROGS[@]}" -grub-install grub-mkdevicemap grub-probe grub-set-default grub-mkconfig grub-reboot grub-setup grub-mkimage grub-mkrelpath -grub2-install grub2-mkdevicemap grub2-probe grub2-set-default grub2-mkconfig grub2-reboot grub2-setup grub2-mkimage grub2-mkrelpath +grub-install grub-mkdevicemap grub-probe grub-set-default grub-mkconfig grub-reboot grub-setup grub-mkimage grub-mkrelpath grub-mkpasswd-pbkdf2 +grub2-install grub2-mkdevicemap grub2-probe grub2-set-default grub2-mkconfig grub2-reboot grub2-setup grub2-mkimage grub2-mkrelpath grub2-mkpasswd-pbkdf2 grub-bios-setup grub2-bios-setup ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/usr/share/rear/prep/ISO/Linux-i386/33_find_isolinux.sh new/rear-1.17.1/usr/share/rear/prep/ISO/Linux-i386/33_find_isolinux.sh --- old/rear-1.17.0/usr/share/rear/prep/ISO/Linux-i386/33_find_isolinux.sh 2012-02-23 16:57:55.000000000 +0100 +++ new/rear-1.17.1/usr/share/rear/prep/ISO/Linux-i386/33_find_isolinux.sh 2015-06-08 09:50:38.000000000 +0200 @@ -2,13 +2,7 @@ # find isolinux.bin if [[ ! -s "$ISO_ISOLINUX_BIN" ]]; then - for file in /usr/{share,lib,libexec}/*/isolinux.bin ; do - if [[ -s "$file" ]]; then - ISO_ISOLINUX_BIN="$file" - break # for loop - fi - done - + ISO_ISOLINUX_BIN=$(find_syslinux_file isolinux.bin) fi [[ -s "$ISO_ISOLINUX_BIN" ]] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/usr/share/rear/prep/README new/rear-1.17.1/usr/share/rear/prep/README --- old/rear-1.17.0/usr/share/rear/prep/README 2012-02-23 16:57:55.000000000 +0100 +++ new/rear-1.17.1/usr/share/rear/prep/README 2015-06-25 09:07:56.000000000 +0200 @@ -1,11 +1,7 @@ This is the preparation part of rear before starting the rescue build phase. Please note that you should not put any scripts that reference -$ROOTFS_DIR or $CONFIG_DIR/recovery into this section. Scripts for $ROOTFS_DIR -go to rescue/ and for $CONFIG_DIR/recovery go to dr/ respectively +$ROOTFS_DIR or $VAR_DIR/recovery into this section. Scripts for $ROOTFS_DIR +go to rescue/ and for $VAR_DIR/recovery go to layout/ respectively -That way we keep only the real prep stuff here in the prep section. This is -important because some workflows (e.g. mkbackuponly) skip the dr and rescue -sections but include the prep section so that we shouldn't do stuff in the -prep section like creating the ROOTFS_DIR or wiping $CONFIG_DIR/recovery since -not ALL workflows require these things. +That way we keep only the real prep stuff here in the prep section. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/usr/share/rear/prep/USB/Linux-i386/34_find_mbr_bin.sh new/rear-1.17.1/usr/share/rear/prep/USB/Linux-i386/34_find_mbr_bin.sh --- old/rear-1.17.0/usr/share/rear/prep/USB/Linux-i386/34_find_mbr_bin.sh 2012-02-23 16:57:55.000000000 +0100 +++ new/rear-1.17.1/usr/share/rear/prep/USB/Linux-i386/34_find_mbr_bin.sh 2015-06-08 09:50:38.000000000 +0200 @@ -1,5 +1,6 @@ # The file mbr.bin is only added since syslinux 3.08 # The extlinux -i option is only added since syslinux 3.20 -[[ -s "$SYSLINUX_DIR/mbr.bin" ]] -StopIfError "Could not find 'mbr.bin' in $SYSLINUX_DIR. Syslinux version 3.08 or newer is required, 4.x prefered !" +SYSLINUX_MBR_BIN=$(find_syslinux_file mbr.bin) +[[ -s "$SYSLINUX_MBR_BIN" ]] +StopIfError "Could not find 'mbr.bin' in $(dirname $SYSLINUX_MBR_BIN). Syslinux version 3.08 or newer is required, 4.x prefered !" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/usr/share/rear/prep/default/31_include_uefi_tools.sh new/rear-1.17.1/usr/share/rear/prep/default/31_include_uefi_tools.sh --- old/rear-1.17.0/usr/share/rear/prep/default/31_include_uefi_tools.sh 2015-02-06 07:40:52.000000000 +0100 +++ new/rear-1.17.1/usr/share/rear/prep/default/31_include_uefi_tools.sh 2015-06-08 09:50:38.000000000 +0200 @@ -1,57 +1,15 @@ -# in conf/default.conf we defined an empty variable USING_UEFI_BOOTLOADER -# This script will try to guess if we're using UEFI or not, and if yes, -# then add all the required executables, kernel modules, etc... -# Most likely, only recent OSes will be UEFI capable, such as SLES11, RHEL6, Ubuntu 12.10, Fedora 18 +# When /boot/efi is mounted we copy the UEFI binaries we might need # If noefi is set, we can ignore UEFI altogether if grep -qw 'noefi' /proc/cmdline; then return fi -# by default the variable USING_UEFI_BOOTLOADER is empty which means rear will decide (this script) -if [[ "$USING_UEFI_BOOTLOADER" = "0" ]]; then - # we forced the variable to zero (in local.conf) so we do not want UEFI stuff - Log "We do not want UEFI capabilities in rear (USING_UEFI_BOOTLOADER=0)" - return -fi - -# Some distributions don't have a builtin efivars kernel module, so we need to load it. -# Be aware, efivars is not listed with 'lsmod' -modprobe -q efivars - -# next step, is checking the presence of UEFI variables directory -# However, we should first check kernel command line to see whether we hide on purpose the UEFI vars with 'noefi' -SYSFS_DIR_EFI_VARS= -if [[ -d /sys/firmware/efi/vars ]]; then - SYSFS_DIR_EFI_VARS=/sys/firmware/efi/vars -elif [[ -d /sys/firmware/efi/efivars ]]; then - SYSFS_DIR_EFI_VARS=/sys/firmware/efi/efivars -else - return # when UEFI is enabled the dir is there -fi - -# mount-point: efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime) -if grep -qw efivars /proc/mounts; then - SYSFS_DIR_EFI_VARS=/sys/firmware/efi/efivars -fi - # next step, is checking /boot/efi directory (we need it) if [[ ! -d /boot/efi ]]; then return # must be mounted fi -# next step, check filesystem partition type (vfat?) -UEFI_FS_TYPE=$(awk '/\/boot\/efi/ { print $3 }' /proc/mounts) - -# ESP must be type vfat (under Linux) -if [[ "$UEFI_FS_TYPE" != "vfat" ]]; then - return -fi - -# we are still here? Ok, now it is safe to turn on USING_UEFI_BOOTLOADER=1 -USING_UEFI_BOOTLOADER=1 -LogPrint "Using UEFI Boot Loader for Linux (USING_UEFI_BOOTLOADER=1)" - PROGS=( "${PROGS[@]}" dosfsck dosfslabel @@ -63,4 +21,9 @@ MODULES=( "${MODULES[@]}" efivars ) -awk '/\/boot\/efi/ { print $1 }' /proc/mounts >$VAR_DIR/recovery/bootdisk 2>/dev/null +if [[ -f /sbin/elilo ]]; then + # this is probably SLES + PROGS=( "${PROGS[@]}" elilo perl ) + COPY_AS_IS=( "${COPY_AS_IS[@]}" /etc/elilo.conf /usr/lib64/crt0-efi-x86_64.o /usr/lib64/elf_x86_64_efi.lds \ + /usr/lib64/libefi.a /usr/lib64/libgnuefi.a ) +fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/usr/share/rear/prep/default/32_include_uefi_env.sh new/rear-1.17.1/usr/share/rear/prep/default/32_include_uefi_env.sh --- old/rear-1.17.0/usr/share/rear/prep/default/32_include_uefi_env.sh 1970-01-01 01:00:00.000000000 +0100 +++ new/rear-1.17.1/usr/share/rear/prep/default/32_include_uefi_env.sh 2015-06-08 09:50:38.000000000 +0200 @@ -0,0 +1,55 @@ +# in conf/default.conf we defined an empty variable USING_UEFI_BOOTLOADER +# This script will try to guess if we're using UEFI or not, and if yes, +# then add all the required executables, kernel modules, etc... +# Most likely, only recent OSes will be UEFI capable, such as SLES11, RHEL6, Ubuntu 12.10, Fedora 18 + +# If noefi is set, we can ignore UEFI altogether +if grep -qw 'noefi' /proc/cmdline; then + return +fi + +# by default the variable USING_UEFI_BOOTLOADER is empty which means rear will decide (this script) +if [[ "$USING_UEFI_BOOTLOADER" = "0" ]]; then + # we forced the variable to zero (in local.conf) so we do not want UEFI stuff + Log "We do not want UEFI capabilities in rear (USING_UEFI_BOOTLOADER=0)" + return +fi + +# Some distributions don't have a builtin efivars kernel module, so we need to load it. +# Be aware, efivars is not listed with 'lsmod' +modprobe -q efivars + +# next step, is checking the presence of UEFI variables directory +# However, we should first check kernel command line to see whether we hide on purpose the UEFI vars with 'noefi' +SYSFS_DIR_EFI_VARS= +if [[ -d /sys/firmware/efi/vars ]]; then + SYSFS_DIR_EFI_VARS=/sys/firmware/efi/vars +elif [[ -d /sys/firmware/efi/efivars ]]; then + SYSFS_DIR_EFI_VARS=/sys/firmware/efi/efivars +else + return # when UEFI is enabled the dir is there +fi + +# mount-point: efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime) +if grep -qw efivars /proc/mounts; then + SYSFS_DIR_EFI_VARS=/sys/firmware/efi/efivars +fi + +# next step, is checking /boot/efi directory (we need it) +if [[ ! -d /boot/efi ]]; then + return # must be mounted +fi + +# next step, check filesystem partition type (vfat?) +UEFI_FS_TYPE=$(awk '/\/boot\/efi/ { print $3 }' /proc/mounts) + +# ESP must be type vfat (under Linux) +if [[ "$UEFI_FS_TYPE" != "vfat" ]]; then + return +fi + +# we are still here? Ok, now it is safe to turn on USING_UEFI_BOOTLOADER=1 +USING_UEFI_BOOTLOADER=1 +LogPrint "Using UEFI Boot Loader for Linux (USING_UEFI_BOOTLOADER=1)" + +awk '/\/boot\/efi/ { print $1 }' /proc/mounts >$VAR_DIR/recovery/bootdisk 2>/dev/null diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/usr/share/rear/rescue/default/50_ssh.sh new/rear-1.17.1/usr/share/rear/rescue/default/50_ssh.sh --- old/rear-1.17.0/usr/share/rear/rescue/default/50_ssh.sh 2014-03-31 09:43:35.000000000 +0200 +++ new/rear-1.17.1/usr/share/rear/rescue/default/50_ssh.sh 2015-06-08 09:50:38.000000000 +0200 @@ -19,38 +19,41 @@ # if has_binary sshd; then - # assume that we have openssh with configs in /etc/ssh + # assume that we have openssh with configs in /etc/ssh - COPY_AS_IS=( "${COPY_AS_IS[@]}" /etc/ssh* /root/.s[s]h /root/.shos[t]s ) - PROGS=( - ${PROGS[@]} - ssh sshd scp sftp - $( - read subsys sftp file junk < <( grep sftp /etc/sshd_co[n]fig /etc/ssh/sshd_co[n]fig /etc/openssh/sshd_co[n]fig 2>&8 ) - echo $file - ) - ) + COPY_AS_IS=( "${COPY_AS_IS[@]}" /etc/ssh* /root/.s[s]h /root/.shos[t]s ) + PROGS=( + ${PROGS[@]} + ssh sshd scp sftp + $( + read subsys sftp file junk < <( grep sftp /etc/sshd_co[n]fig /etc/ssh/sshd_co[n]fig /etc/openssh/sshd_co[n]fig 2>&8 ) + echo $file + ) + ) - # copy ssh user - if PASSWD_SSH=$(grep ssh /etc/passwd) ; then - # sshd:x:71:65:SSH daemon:/var/lib/sshd:/bin/false - echo "$PASSWD_SSH" >>$ROOTFS_DIR/etc/passwd - IFS=: read user ex uid gid gecos homedir junk <<<"$PASSWD_SSH" - # add ssh group to be collected later - CLONE_GROUPS=( "${CLONE_GROUPS[@]}" "$gid" ) - mkdir -p $v -m 0700 "$ROOTFS_DIR$homedir" >&2 - chown $v root.root "$ROOTFS_DIR$homedir" >&2 - fi + # copy ssh user + if PASSWD_SSH=$(grep ssh /etc/passwd) ; then + # sshd:x:71:65:SSH daemon:/var/lib/sshd:/bin/false + echo "$PASSWD_SSH" >>$ROOTFS_DIR/etc/passwd + IFS=: read user ex uid gid gecos homedir junk <<<"$PASSWD_SSH" + # add ssh group to be collected later + CLONE_GROUPS=( "${CLONE_GROUPS[@]}" "$gid" ) + mkdir -p $v -m 0700 "$ROOTFS_DIR$homedir" >&2 + chown $v root.root "$ROOTFS_DIR$homedir" >&2 + fi - echo "ssh:23:respawn:/bin/sshd -D" >>$ROOTFS_DIR/etc/inittab + echo "ssh:23:respawn:/bin/sshd -D" >>$ROOTFS_DIR/etc/inittab - # print a warning if there is no authorized_keys file for root - if test ! -f "/root/.ssh/authorized_keys" ; then - LogPrint "TIP: To login as root via ssh you need to set up /root/.ssh/authorized_keys or SSH_ROOT_PASSWORD in your configuration file" - fi - - # Set the SSH root password - if [[ $SSH_ROOT_PASSWORD ]] ; then - echo "root:$(echo $SSH_ROOT_PASSWORD | openssl passwd -1 -stdin):::::::" > $ROOTFS_DIR/etc/shadow - fi + # print a warning if there is no authorized_keys file for root + if test ! -f "/root/.ssh/authorized_keys" ; then + LogPrint "TIP: To login as root via ssh you need to set up /root/.ssh/authorized_keys or SSH_ROOT_PASSWORD in your configuration file" + fi + + # Set the SSH root password; if pw is hashed just copy it otherwise use openssl (for backward compatibility) + if [[ "$SSH_ROOT_PASSWORD" ]] ; then + case "$SSH_ROOT_PASSWORD" in + "$1$*") echo "root:$SSH_ROOT_PASSWORD:::::::" > $ROOTFS_DIR/etc/shadow ;; + * ) echo "root:$(echo $SSH_ROOT_PASSWORD | openssl passwd -1 -stdin):::::::" > $ROOTFS_DIR/etc/shadow ;; + esac + fi fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rear-1.17.0/usr/share/rear/rescue/default/85_save_sysfs_uefi_vars.sh new/rear-1.17.1/usr/share/rear/rescue/default/85_save_sysfs_uefi_vars.sh --- old/rear-1.17.0/usr/share/rear/rescue/default/85_save_sysfs_uefi_vars.sh 2015-02-06 07:40:52.000000000 +0100 +++ new/rear-1.17.1/usr/share/rear/rescue/default/85_save_sysfs_uefi_vars.sh 2015-06-25 09:07:56.000000000 +0200 @@ -56,11 +56,16 @@ fi fi -# double check it +# in case we have an elilo bootloader then we might be lucky with next statements +if [[ ! -f ${UEFI_BOOTLOADER} ]]; then + UEFI_BOOTLOADER=$(find /boot/efi -name "elilo.efi" | tail -1) +fi + +# triple check it if [[ ! -f ${UEFI_BOOTLOADER} ]]; then Error "Cannot find a proper UEFI_BOOTLOADER ($UEFI_BOOTLOADER). -Please define it in $CONFIG_DIR/local.conf (e.g. UEFI_BOOTLOADER=/boot/efi/EFI/fedora/shim.efi)" +Please define it in $CONFIG_DIR/local.conf (e.g. UEFI_BOOTLOADER=/boot/efi/EFI/fedora/bootx64.efi)" else ++++++ rear-rpmlintrc ++++++ # This rpmlintrc file filters false positives rpmlint warning messages # for Relax-and-Recover (rear). # rear contains systemd unit files in /usr/share/rear/skel/ # that are not meant to be used in the running system. # They are used to build the rear recovery system ISO image: addFilter("rear.* W: systemd-service-without-service_del_preun ") addFilter("rear.* W: systemd-service-without-service_del_postun ") addFilter("rear.* W: systemd-service-without-service_add_pre ") addFilter("rear.* W: systemd-service-without-service_add_post ") # There is config(noreplace) for all files in /usr/share/rear/ # to avoid that RPM package update overwrites user edited files # because rear is meant to be adapted and enhanced by the user # according to his particular disaster recovery needs # (see http://en.opensuse.org/SDB:Disaster_Recovery): addFilter("rear.* W: non-etc-or-var-file-marked-as-conffile /usr/share/rear/")