顯示具有 UEFI 標籤的文章。 顯示所有文章
顯示具有 UEFI 標籤的文章。 顯示所有文章

2016年7月25日 星期一

Disable Secure Boot in shim-signed

The latest Ubuntu kernel updates bring some Secure Boot enhancement for the kernel modules when the Secure Boot is enabled in BIOS settings. However there is no easy way to sign those kernel modules in DKMS packages automatically so far. If we want to use those DKMS packages, we need to disable Secure Boot in BIOS settings temporarily or we can also disable Secure Boot in shim-signed temporarily. The following steps introduced how to disable Secure Boot in shim-signed.

  1. Open a terminal by Ctrl + Alt + T, execute `sudo update-secureboot-policy` and then select ‘Yes’.
  2. Enter a temporary password between 8 to 16 digits. (For example, 12345678, we will use this password later.)
  3. Enter the same password again to confirm.
  4. Reboot the system and press any key when you see the blue screen (MOK management).
  5. Select “Change Secure Boot state”.
  6. Press the corresponding password character and press Enter. Repeat this step several times to confirm previous temporary password like ‘12345678’ in step 2&3. For exmaple, '2' for this screen.
  7. Select ‘Yes’ to disable Secure Boot in shim-signed.
  8. Press Enter key to finish the whole procedure.

We can still enable Secure Boot in shim-signed again. Just execute `sudo update-secureboot-policy --enable` and then follow the similar steps above.

2016年5月6日 星期五

在搭配 32-bit UEFI BIOS 的電腦上面安裝 Ubuntu 16.04 amd64

最近剛好拿到一台硬體上面的 BIOS 只有支援 32-bit UEFI,但是 Ubuntu 16.04 以前的版本包含 Ubuntu 16.04 本身的標準安裝媒體都沒有支援。

不過還好找到 http://askubuntu.com/questions/392719/32-bit-uefi-boot-support 提到了可以借用 Debian multi-arch 的 netboot ISO 裡面的 GRUB 檔案來繞過啟動的問題。

首先是要將 UEFI BIOS 當中的 Secure Boot 關掉,然後將 http://releases.ubuntu.com/16.04/ 上面的 ubuntu-16.04-desktop-amd64.iso 下載回來解開到 USB 隨身碟上面。

$ sudo apt install p7zip-full
$ cd /media/user/USBStick
$ 7z x ~/ubuntu-16.04-desktop-amd64.iso

然後是到 http://cdimage.debian.org/debian-cd/current/multi-arch/iso-cd/ 上面將 debian-8.4.0-amd64-i386-netinst.iso 下載回來,然後掛載起來將當中的 GRUB 檔案複製到 USB 隨身碟上面。

$ sudo mount ~/debian-8.4.0-amd64-i386-netinst.iso /mnt
$ cp -rv /mnt/boot/grub/i386-efi /media/user/USBStick/boot/grub/
$ cp -v /mnt/efi/boot/bootia32.efi /media/user/USBStick/EFI/BOOT/

最後將 /mnt 跟 USB 隨身碟都卸載就可以拿去安裝 Ubuntu 16.04 amd64 了。

$ cd
$ sudo umount /mnt
$ umount /media/user/USBStick

安裝過程中我有接著有線網路,並且提供 DHCP 給它取得 IP,所以它會自己連上網路去下載 grub-efi-ia32 及 grub-efi-ia32-bin 回來安裝使用,這是 Ubuntu 16.04 amd64 之所以能夠正常安裝使用的重要步驟。

另外一個重點是 Debian multi-arch 的 netboot ISO 裡面的 GRUB 檔案可能沒有支援 Secure Boot,還有 Ubuntu 16.04 也沒有提供 grub-efi-ia32-signed 這樣的套件,所以遇上了無法關閉 Secure Boot 的 UEFI BIOS 就無法使用這個方法來安裝了。

補充:只要再使用「自製 Ubuntu 13.04/12.10/12.04.2 與 Debian 7.0 測試硬體安裝使用的 USB 隨身碟」裡面提到的指令,就可以製作出同時可以使用於 Legacy BIOS、32-bit UEFI BIOS 與 64-bit UEFI BIOS 的 Ubuntu 16.04 amd64 安裝 USB 隨身碟

$ sudo apt install grub-pc-bin
$ sudo grub-install --removable --target=i386-pc --root-directory=/media/user/USBStick/ /dev/sdb

不過後來又發現,其實只要使用 Ubuntu 16.04 裡面的工具就不需要使用 Debian multi-arch 的 netboot ISO 裡面的 GRUB 檔案了。 Orz...

$ sudo apt install grub-efi-ia32-bin
$ sudo grub-install --removable --target=i386-efi --root-directory=/media/user/USBStick/ /dev/sdb

當然 grub-pc-bin 跟 grub-efi-ia32-bin 都是從 Debian 而來的,只是使用上最好都維持同樣的版本,比較不會遇到奇怪的問題。