#1254 PR closed: systemd-boot support added

Labels: enhancement, waiting for info, discuss / RFC

ProBackup-nl opened issue at 2017-03-20 01:34:

https://github.com/rear/rear/issues/1214

ProBackup-nl commented at 2017-03-20 19:27:

I have no experience with mkbackup. Should that do the mkrescue step again? Or not?

Yes it should, according to 540_choose_backup_archive mkbackup should make backup+recovery, where mkbackuponly should only make the backup.

When testing these 2 commands, they seem to run ok.

ProBackup-nl commented at 2017-03-20 22:54:

There is another potential recover issue

rear recover returns:

...
Running workflow recover...
...
/usr/share/rear/verify/NETFS/default/070_set_backup_archive.sh = ../prep/NETFS/default/070_set_backup_archive.sh
Using backup archive '/tmp/rear.xyz/outputfs/rear/<hostname>/20170320.2106/backup'
/usr/share/rear/verify/NETFS/default/090_set_readonly_options.sh
/usr/share/rear/verify/GNU/linux/230_storage_and_network_modules.sh = ../rescue/GNU/Linux/230_storage_and_network_modules.sh
/usr/share/rear/verify/GNU/linux/260_recovery_storage_drivers.sh
/usr/share/rear/verify/USB/NETFS/default/540_choose_backup_archive.sh
ERROR: No 'backup' detected in '/tmp/rear.xyz/outputfs/rear/localhost/*'
Aborting due to an error, ...

In 070 the archive path is build from: $BUILD_DIR/outputfs/$NETFS_PREFIX/$backup_file_name

In 540 the archive path is looking in: $BUILD_DIR/outputfs/rear/$HOSTNAME/* and build from $rear_run/${BACKUP_PROG_ARCHIVE}${BACKUP_PROG_SUFFIX}${BACKUP_PROG_COMPRESS_SUFFIX}
Where 540 error location is build from: $BUILD_DIR/outputfs/rear/$HOSTNAME/*

ProBackup-nl commented at 2017-03-21 14:46:

@jsmeix One unintended debug leftover is removed. The commenting of the debug section has now been uncommented.

This code not only introduces systemd-boot boot support. I needed to catch some situation to prevent execution from breaking, f.e. because of not existing commands, folders, etcetera.

Which code raises questions? I will then add some more comments to try to explain what and why.

ProBackup-nl commented at 2017-03-24 22:49:

@gdha I did try to exclude usr/share/rear/skel/default/etc/scripts/system-setup from the git commit, though that failed due to my inexperience with git.

gdha commented at 2017-03-30 13:22:

@ProBackup-nl any chance to rework the pull request?

ProBackup-nl commented at 2017-04-12 18:10:

@gdha Am I correctly understand that:

I think @schlomo is right that we first should detect where the ESP directory is located and use that in a variable, e.g. ESP_DIR

is referring to:
https://github.com/rear/rear/pull/1246#pullrequestreview-27076231
?

I do need a little more guidance into the desired direction for reworking ESP_DIR, as commented in pull request 1246.

ProBackup-nl commented at 2017-04-13 19:19:

@gdha I am stuck in reverting changed files in this branch that are not related to this pull request. Removing files from the pushed commit is a challenge.

Regression:
https://git-scm.com/book/en/v2/Git-Basics-Undoing-Things doesn't help.

Any changes that are not strictly related to systemd-boot support are now moved to separate pull requests: #1288, #1289, #1290, #1291, #1292, #1293, #1294.

The goal here is to only commit these changed files here:

usr/share/rear/layout/save/default/450_check_bootloader_files.sh 
usr/share/rear/output/USB/Linux-i386/100_create_efiboot.sh 
usr/share/rear/output/USB/Linux-i386/300_create_extlinux.sh 
usr/share/rear/output/USB/Linux-i386/830_copy_kernel_initrd.sh 
usr/share/rear/output/USB/Linux-i386/850_make_USB_bootable.sh 
usr/share/rear/prep/USB/Linux-i386/070_find_systemd-boot.sh 
usr/share/rear/prep/USB/Linux-i386/340_find_mbr_bin.sh 
usr/share/rear/prep/USB/Linux-i386/350_find_syslinux_modules.sh 
usr/share/rear/prep/USB/Linux-i386/400_check_extlinux.sh 
usr/share/rear/prep/default/500_guess_bootloader.sh 
usr/share/rear/rescue/default/850_save_sysfs_uefi_vars.sh

That leaves me with the question: How to fix this branch and/or pull request from undesired file changes?

My best guess is:

  1. git log --graph --decorate --oneline
* 0fd2f3b1 (HEAD -> rear/rear#1214, origin/rear/rear#1214, origin/master, origin/HEAD, master) ESP_DIR added, duplicate check for /boot/efi in both 310 and 320 removed in 320, explicitly error out in 310 when USING_UEFI_BOOTLOADER is set to 1 and there is no /boot/efi
* 7917a0be systemd-boot support added
* 97016d5a line 53: syntax error near unexpected token else fixed
* 8d03b0ce syntax error near /boot fixed
* 24f5b514 320_include_uefi_env made less case sensitive, and also allowing /boot to be completely VFAT file system
*   4fb1f98a (upstream/master) Merge pull request #1219 from jsmeix/small_coding_style_iprovements_regarding_pull_request_1217
  1. figure out a decent SHA historical version from before 7917a0b, my guess 97016d5
  2. # git checkout SHA -- path/to/filename

Maybe, I should revert this unmerged commit using: git revert SHA?

gdha commented at 2017-04-14 10:20:

@ProBackup-nl do a git pull first to fix the upstream modified files first. If that does not work I would discard this pull request and create a new one with an updated branch

ProBackup-nl commented at 2017-04-14 11:09:

Status update: Let me figure out how to merge the conflicts

# git pull upstream master
From github.com:rear/rear
 * branch              master     -> FETCH_HEAD
   4fb1f98a..363eba71  master     -> upstream/master
Auto-merging usr/share/rear/rescue/default/100_hostname.sh
CONFLICT (content): Merge conflict in usr/share/rear/rescue/default/100_hostname.sh
CONFLICT (modify/delete): usr/share/rear/prep/default/500_guess_bootloader.sh deleted in 363eba7108d183432c32a7277f19b1a1c4b9067f and modified in HEAD. Version HEAD of usr/share/rear/prep/default/500_guess_bootloader.sh left in tree.
Auto-merging usr/share/rear/prep/default/320_include_uefi_env.sh
CONFLICT (content): Merge conflict in usr/share/rear/prep/default/320_include_uefi_env.sh
Auto-merging usr/share/rear/prep/default/310_include_uefi_tools.sh
CONFLICT (content): Merge conflict in usr/share/rear/prep/default/310_include_uefi_tools.sh
Auto-merging usr/share/rear/layout/save/default/450_check_bootloader_files.sh
CONFLICT (content): Merge conflict in usr/share/rear/layout/save/default/450_check_bootloader_files.sh
Auto-merging usr/share/rear/format/USB/default/300_format_usb_disk.sh
CONFLICT (content): Merge conflict in usr/share/rear/format/USB/default/300_format_usb_disk.sh
Removing usr/share/rear/backup/NETFS/GNU/Linux/30_stop_selinux.onhold
Automatic merge failed; fix conflicts and then commit the result.

ProBackup-nl commented at 2017-04-14 13:22:

@gdha It seems I fixed the upstream modified files:

# git status
On branch rear/rear#1214
Your branch is up-to-date with 'origin/rear/rear#1214'.
nothing to commit, working tree clean
# git pull
Already up-to-date.

I was even able to revert 0fd2f3b1 and 7917a0b.

Now my limited knowledge makes me think that it is best to bring the rear/rear#1214 branch up to date with rear:master (instead of 87 commits behind rear:master) (How?). Then re-apply my changes, commit and push. Or do you have better suggestions?

gdha commented at 2017-04-18 12:44:

@ProBackup-nl based on feedback I saw I think we better drop this pull request and start from scratch with first finding the ESP partition

gdha commented at 2017-12-29 11:33:

As issue #1214 has been closed - we better close this PR request as well - until further notice.


[Export of Github issue for rear/rear.]