prepare-root.sh: move /efi to /usr/efi

if /efi is non-empty, gpt auto mounter does not mount it
but we still want the efi, in case you have to repair the system
This commit is contained in:
Harald Hoyer 2018-11-02 18:18:45 +01:00
parent 0777074a22
commit ba2650d106

View file

@ -797,6 +797,8 @@ echo 'C /var/mail - - - - -' >> "$sysroot"/usr/lib/tmpfiles.d/var-quirk.conf
mv "$sysroot"/lib/tmpfiles.d-var.conf "$sysroot"/lib/tmpfiles.d/var.conf mv "$sysroot"/lib/tmpfiles.d-var.conf "$sysroot"/lib/tmpfiles.d/var.conf
#---------------
# EFI
if [[ -d "$sysroot"/boot/efi/EFI/fedora ]]; then if [[ -d "$sysroot"/boot/efi/EFI/fedora ]]; then
mkdir -p "$sysroot"/efi/EFI mkdir -p "$sysroot"/efi/EFI
mv "$sysroot"/boot/efi/EFI/fedora "$sysroot"/efi/EFI mv "$sysroot"/boot/efi/EFI/fedora "$sysroot"/efi/EFI
@ -810,13 +812,16 @@ done
find "$sysroot"/efi -xdev -newermt "@${SOURCE_DATE_EPOCH}" -print0 \ find "$sysroot"/efi -xdev -newermt "@${SOURCE_DATE_EPOCH}" -print0 \
| xargs --verbose -0 touch -h --date "@${SOURCE_DATE_EPOCH}" | xargs --verbose -0 touch -h --date "@${SOURCE_DATE_EPOCH}"
mv "$sysroot"/efi "$sysroot"/usr/efi
#---------------
# cleanup
rm -fr "$sysroot"/{boot,root} rm -fr "$sysroot"/{boot,root}
ln -sfnr "$sysroot"/var/roothome "$sysroot"/root ln -sfnr "$sysroot"/var/roothome "$sysroot"/root
rm -fr "$sysroot"/var rm -fr "$sysroot"/var
rm -fr "$sysroot"/home rm -fr "$sysroot"/home
rm -f "$sysroot"/etc/yum.repos.d/* rm -f "$sysroot"/etc/yum.repos.d/*
mkdir -p "$sysroot"/{var,home,cfg,net} mkdir -p "$sysroot"/{var,home,cfg,net,efi}
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# SELinux relabel all the files # SELinux relabel all the files
@ -891,7 +896,7 @@ fi
mkdir -p "$OUTDIR" mkdir -p "$OUTDIR"
mv "$MY_TMPDIR"/root.img \ mv "$MY_TMPDIR"/root.img \
"$sysroot"/efi \ "$sysroot"/usr/efi \
"$OUTDIR"/ "$OUTDIR"/