diff --git a/packages/base/all/initrds/loader-initrd-files/src/bin/switchroot b/packages/base/all/initrds/loader-initrd-files/src/bin/switchroot index 91d08334..2eb8ead6 100644 --- a/packages/base/all/initrds/loader-initrd-files/src/bin/switchroot +++ b/packages/base/all/initrds/loader-initrd-files/src/bin/switchroot @@ -49,7 +49,13 @@ done <${mtab} rm -f ${mtab} mount --move /proc /newroot/proc +if [ -d /sys/firmware/efi/efivars ]; then + umount /sys/firmware/efi/efivars || : +fi mount --move /sys /newroot/sys +if [ -d /newroot/sys/firmware/efi/efivars ]; then + mount -t efivarfs efivarfs /newroot/sys/firmware/efi/efivars +fi mount --move /dev /newroot/dev # Switch to /newroot if possible, else re-execute /init @@ -58,3 +64,8 @@ if [ -x /newroot/sbin/init ]; then else exec /init fi + +# Local variables: +# sh-indentation: 4 +# sh-basic-offset: 4 +# End: diff --git a/packages/base/all/initrds/loader-initrd-files/src/bin/sysinit b/packages/base/all/initrds/loader-initrd-files/src/bin/sysinit index b80f85fb..910b3fcf 100755 --- a/packages/base/all/initrds/loader-initrd-files/src/bin/sysinit +++ b/packages/base/all/initrds/loader-initrd-files/src/bin/sysinit @@ -35,6 +35,9 @@ trap "restoreconsole; reboot -f" EXIT # Mount special filesystems mount -t proc proc /proc mount -t sysfs sysfs /sys +if [ -d /sys/firmware/efi/efivars ]; then + mount -t efivarfs efivarfs /sys/firmware/efi/efivars +fi mount -o remount,size=1M /dev case "$(stat -f -c "%T" /tmp)" in tmpfs|ramfs) ;; @@ -144,4 +147,5 @@ trap - EXIT # Local variables: # sh-basic-offset: 4 +# sh-indentation: 4 # End: diff --git a/packages/base/all/vendor-config-onl/src/lib/install/lib.sh b/packages/base/all/vendor-config-onl/src/lib/install/lib.sh index 74dd273f..311bd5d5 100644 --- a/packages/base/all/vendor-config-onl/src/lib/install/lib.sh +++ b/packages/base/all/vendor-config-onl/src/lib/install/lib.sh @@ -113,6 +113,9 @@ installer_mkchroot() { mkdir -p ${rootdir}/dev/pts fi mount -t devpts devpts "${rootdir}/dev/pts" + if test -d "${rootdir}/sys/firmware/efi/efivars"; then + mount -t efivarfs efivarfs "${rootdir}/sys/firmware/efi/efivars" + fi if test ${TMPDIR+set}; then # make the tempdir available to the chroot diff --git a/packages/base/all/vendor-config-onl/src/python/onl/install/InstallUtils.py b/packages/base/all/vendor-config-onl/src/python/onl/install/InstallUtils.py index 1cc40e4c..9e64bc54 100644 --- a/packages/base/all/vendor-config-onl/src/python/onl/install/InstallUtils.py +++ b/packages/base/all/vendor-config-onl/src/python/onl/install/InstallUtils.py @@ -821,6 +821,11 @@ class InitrdContext(SubprocessMixin): cmd = ('mount', '-t', 'sysfs', 'sysfs', dst,) self.check_call(cmd, vmode=self.V1) + dst = os.path.join(self.dir, "sys/firmware/efi/efivars") + if os.path.exists(dst): + cmd = ('mount', '-t', 'efivarfs', 'efivarfs', dst,) + self.check_call(cmd, vmode=self.V1) + # maybe mount devtmpfs if self._hasDevTmpfs: dst = os.path.join(self.dir, "dev")