User:Sakaki/Sakaki's EFI Install Guide/Creating and Booting the Minimal-Install Image on USB

We can now proceed to download, verify and use the Gentoo minimal install image. This is a bootable, self-contained Linux system ISO disk image, updated regularly by Gentoo Release Engineering. As the name suggests, you can boot your target PC with it and, assuming you have internet access, parlay from there to a full Gentoo installation.

This section shadows Chapter 2 of the Gentoo handbook.

Downloading and Verifying the ISO Image
Firstly, identify the name of the current release of the minimal install ISO (we'll refer to it using the generic form install-amd64-minimal-YYYYMMDD.iso below). New versions come out multiple times per year. Open the link http://distfiles.gentoo.org/releases/amd64/autobuilds/current-iso/ in a browser to determine the current name.

Open a terminal window on the helper PC, and download the necessary files (the ISO, a contents list for that ISO, and a signed digest list):

This may take a little time to complete, depending on the speed of your Internet link.

We next need to check the integrity of the ISO, before using it. The install-amd64-minimal-YYYYMMDD.iso.DIGESTS.asc file contains cryptographically signed digests (using various hash algorithms) for two other files you have downloaded.

As such, to verify the ISO we must:
 * 1) download the public key used for Gentoo automated weekly releases (if you don't already have this on your helper PC);
 * 2) check the signature of the install-amd64-minimal-YYYYMMDD.iso.DIGESTS.asc file using this key; and then
 * 3) check that the hashes (digests) contained in that file agree with values that we compute independently.

The fingerprint of the automated weekly release public key may be found on the Gentoo Release Engineering page. When requesting the key from a keyserver, you don't need to cite the whole fingerprint, just enough of it to be unambiguous. For example, at the time of writing, the automated release key fingerprint was 13EB BDBE DE7A 1277 5DFD B1BA BB57 2E0E 2D18 2910, so to download it (step 1 in the above list), issue:

With that done, use the gpg program to verify the digest file (step 2):

Assuming that worked (the output reports 'Good signature'), next check the digests themselves (step 3); we'll use the SHA512 variants here:

If this outputs:

then continue, all is well.

Copying the ISO Image to USB
Next, we need to copy the ISO onto a USB key (the image is already hybrid ).

Just before inserting the USB key (the larger one) into the helper pc, issue:

Note the output, then insert the USB key, and issue:

again. The change in output will show you the key's device path (note that the initial prefix is not shown in the lsblk output). We will refer to this path in these instructions as , but in reality on your system it will be something like, etc.

Next, we will write the ISO image to the USB key. This will require root access, so issue:

Now you can write the ISO image to the USB key (note, we use a larger than default block size here, for efficiency). Issue:

Wait for the process to complete before continuing.

Booting the ISO Image
Although the minimal install image does include an EFI directory, the .efi</tt> images within it are unusable for booting. As such, we'll proceed by first booting the USB key we just created using the UEFI's 'legacy' / CSM mode. (Of course, the kernel we'll ultimately create will (secure) boot under EFI.)

So, to proceed, take the USB key from the helper PC (where we just dd</tt>'d it) and insert it into the target PC. The latter is still running Windows-8, and you need to reboot it into the BIOS setup GUI. There are two ways to do this; choose the one that suits you:
 * Either: Use Windows boot options menu.
 * This is the easier method (particularly if your <span id="fast_boot_to_BIOS">target machine is using the 'fast boot' option with Windows). In Windows 8, hit, then click on the power icon at the bottom right of the screen, and then while holding down , click 'Restart' from the pop-up menu. This will pass you into the Windows boot options menu. Once this comes up (and asks you to 'Choose an option'), click on the 'Troubleshoot' tile, which brings up the 'Advanced options' panel: from this, click on 'UEFI Firmware Settings', and confirm if prompted. Your machine will then restart into the BIOS GUI directly (no hotkeys required) and you can proceed.


 * Or: Use the BIOS hotkey.
 * This is a less reliable method, since you are racing the OS loading process. To use it, hit from within Windows 8, then click on the power icon at the bottom right of the screen, and choose 'Restart' from the pop-up menu to perform a regular restart. Then, immediately the target PC starts to come back up, press the appropriate hotkey to enter the BIOS setup GUI. Unfortunately, the required hotkey varies greatly from machine to machine (as does the BIOS user interface itself). On the Panasonic CF-AX3, press  during startup (you may need to press it repeatedly).

Once you have the BIOS configuration GUI up, you need to <span id="set_csm_boot">perform the following steps :
 * 1) disable EFI boot mode;
 * 2) enable legacy / CSM boot mode;
 * 3) set the machine to look first at any inserted USB keys, when searching for a bootloader.

The precise steps to achieve this will depend on your BIOS. On the CF-AX3, <span id="bios_navigation">use the arrow keys to move to the 'Boot' tab, then, as shown below, navigate down to the 'UEFI Boot' item, and press. In the popup that appears, select 'Disabled' using the arrow keys, and press. This switches the system out of UEFI mode and into legacy / CSM boot (steps 1 and 2 in the list above).

Next, move down using the arrow keys to the 'Boot Option #1' item (as shown below). Press and select 'USB KEY' from the pop-up menu that appears, then press. This ensures that any inserted USB key will be searched for a bootable system before the internal hard drive (step 3). (If you don't do this, you'll simply be dumped back into Windows when you restart.)

Finally, instruct the BIOS to save these changes and restart (with the USB key still inserted). Again, the method varies from machine to machine; on the Panasonic CF-AX3, hit, and confirm when prompted.

Hopefully, you'll now see <span id="boot_beep">ISOLINUX boot prompt (and the machine will beep at you). Unless you want to enter custom boot options, simply press to proceed. After a few seconds (and before you are provided with a command prompt), you'll be asked to choose a keymap. It's important, particularly on a machine with non-standard keyboard layout such as the CF-AX3, to get this right, otherwise you may have problems with passwords and so forth. Again, the correct map to choose will obviously depend on your machine but, on the Panasonic CF-AX3, press to select the Japanese keymap.

A few seconds later, you should have a Gentoo Linux root command prompt. Now, we'll <span id="first_root_pw_setup">set-up a root password (this is only for use during the install, it will not persist across into the final system).

Make a note of the password, as you will require it shortly.

<span id="next_steps">Next Steps
Next, we'll setup the network and get an SSH daemon running. Click here to go to the next chapter, "Setting Up Networking and Connecting via ssh</tt>".

Acknowledgements
We would like to thank the following authors and editors for their contributions to this guide: