From nobody Mon Apr 29 23:42:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+45176+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+45176+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1565268004; cv=none; d=zoho.com; s=zohoarc; b=GrZ/93pZxbY/2h21CrrfhJpX+/s/N/uHHs+K6qVE64THOBTIa2ihcRU8vIJrjX8A8+MZhwVdPRjAMZgqeFl/YjiulIZd8VVxd5SYntL8LHYBmiGADOYOCMAU+gDpJsWcask1Z0wkrIeK3iMpTBy1vJo+cAAebLSfDI4f/wdHpjM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565268004; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=eq5GMEquliHk6B22mUFCbcsNesLqtrst3bX/A0ikkQQ=; b=n2oKu/fg29YDzNSnpjpUe0UoLtnJSMSDlXFzrxpHbVjW23+bLAILQAuJm8OyYPr75uLiirWyXM9GHJRJwYYnNQgS2LN9lCxkLrMl2ZSRu6PUh5/6KyJeHXEx5sZElS5we8zfa39Qnmx6YxVrj0NSGrhC6zxFe3sLqvtRj6uhivg= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+45176+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1565268004479627.017032840057; Thu, 8 Aug 2019 05:40:04 -0700 (PDT) Return-Path: X-Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by groups.io with SMTP; Thu, 08 Aug 2019 05:40:03 -0700 X-Received: by mail-wm1-f46.google.com with SMTP id v19so2259719wmj.5 for ; Thu, 08 Aug 2019 05:40:02 -0700 (PDT) X-Gm-Message-State: APjAAAWmFGZfz8Zhv4booSOUsMQl49lCldclE36LE+p9V5BqzQXGzN69 FpXhUI0YH65/ujutLZHznfq46MoYMVg= X-Google-Smtp-Source: APXvYqx2e6US9J0Ds2FiqQET5DOzngPuKm97K09MHNNaAGYfIwE+Bg895gd1auGJkeFII7B5+zNF+A== X-Received: by 2002:a1c:c2d5:: with SMTP id s204mr4370398wmf.174.1565268000765; Thu, 08 Aug 2019 05:40:00 -0700 (PDT) X-Received: from localhost.localdomain ([84.203.61.230]) by smtp.gmail.com with ESMTPSA id x11sm1723212wmi.26.2019.08.08.05.39.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Aug 2019 05:40:00 -0700 (PDT) From: "Pete Batard" To: devel@edk2.groups.io Cc: ard.biesheuvel@linaro.org, leif.lindholm@linaro.org Subject: [edk2-devel] [edk2-platforms: PATCH v3 1/1] Platform/RPi3: Add Debian 10 installation in Systems.md Date: Thu, 8 Aug 2019 13:39:51 +0100 Message-Id: <20190808123951.11548-2-pete@akeo.ie> In-Reply-To: <20190808123951.11548-1-pete@akeo.ie> References: <20190808123951.11548-1-pete@akeo.ie> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pete@akeo.ie Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1565268004; bh=RRyyr/cC2whrqEAIUr/LGVMdmjzv6UounXt31fCc2WI=; h=Cc:Date:From:Reply-To:Subject:To; b=ANq6exljMmgtVpb9u1AKwjbRbcBTwKrCnyxb1VQfZ1m9UR9cf+lsSimaYz4Al94WlrV wrODafijjG3en20wMN2s7w6Z9NKqbEANJtLAh6NoHO00QD2nKvMtE2xCG46INgn66Ho9i 4O4R8NKp0BY831ZPUxvfgQNHbA4MTOn38rs= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" This documents the installation of vanilla Debian 10.0 ARM64 (netinst), which we validated for both Model B and Model B+. Also fix an erroneous reference in an RPi3.fdf comment. Signed-off-by: Pete Batard Reviewed-by: Leif Lindholm --- Platform/RaspberryPi/RPi3/RPi3.fdf | 2 +- Platform/RaspberryPi/RPi3/Readme.md | 4 +- Platform/RaspberryPi/RPi3/Systems.md | 127 +++++++++++++++++++- 3 files changed, 126 insertions(+), 7 deletions(-) diff --git a/Platform/RaspberryPi/RPi3/RPi3.fdf b/Platform/RaspberryPi/RPi3= /RPi3.fdf index c7c3f7a2ab8c..c62d649834c7 100644 --- a/Platform/RaspberryPi/RPi3/RPi3.fdf +++ b/Platform/RaspberryPi/RPi3/RPi3.fdf @@ -300,7 +300,7 @@ [FV.FvMain] INF Platform/RaspberryPi/$(PLATFORM_NAME)/Drivers/LogoDxe/LogoDxe.inf =20 # - # FDT (GUID matches mRaspberryPiFfsFileGuid in RaspberryPiPlatformDxe) + # FDT (GUID matches gRaspberryPiFdtFileGuid in FdtDxe) # FILE FREEFORM =3D DF5DA223-1D27-47C3-8D1B-9A41B55A18BC { SECTION RAW =3D Platform/RaspberryPi/$(PLATFORM_NAME)/DeviceTree/bcm27= 10-rpi-3-b.dtb diff --git a/Platform/RaspberryPi/RPi3/Readme.md b/Platform/RaspberryPi/RPi= 3/Readme.md index 624f3a8d287a..797da1bab4a9 100644 --- a/Platform/RaspberryPi/RPi3/Readme.md +++ b/Platform/RaspberryPi/RPi3/Readme.md @@ -18,8 +18,8 @@ Raspberry Pi is a trademark of the [Raspberry Pi Foundati= on](http://www.raspberr =20 This firmware, that has been validated to compile against the current [edk2](https://github.com/tianocore/edk2)/[edk2-platforms](https://github.= com/tianocore/edk2-platforms), -should be able to boot Linux (SUSE, Ubuntu), NetBSD, FreeBSD as well as Wi= ndows 10 ARM64 -(full GUI version). +should be able to boot Linux (Debian, Ubuntu, SUSE), NetBSD, FreeBSD as we= ll as Windows +10 ARM64 (full GUI version). =20 It also provides support for ATF ([Arm Trusted Platform](https://github.co= m/ARM-software/arm-trusted-firmware)). =20 diff --git a/Platform/RaspberryPi/RPi3/Systems.md b/Platform/RaspberryPi/RP= i3/Systems.md index f6410eb25f0d..3a313c29cbdc 100644 --- a/Platform/RaspberryPi/RPi3/Systems.md +++ b/Platform/RaspberryPi/RPi3/Systems.md @@ -1,5 +1,128 @@ # Tested Operating Systems =20 +## Debian + +[Debian 10](https://cdimage.debian.org/debian-cd/current/arm64/iso-cd/) ne= tinst has been +tested and confirmed to work, both on the Model B and Model B+, including = installation in +either wired or wireless mode. + +Below are steps you can follow to install Debian 10 onto an SD card: +* Partition the media as MBR and create a ~300 MB partition on it with MBR= type `0x0e`. + __Note:__ Make sure that the partition scheme is MBR (not GPT) and the t= ype `0x0e` (not + `0xef` for instance), as the on-CPU Broadcom bootloader supports neither= the GPT scheme + nor the ESP MBR type. +* Set the partition as active/bootable. This is needed as the Debian parti= tion manager can + not detect it as ESP otherwise, which we need for GRUB installation. If = using `fdisk` on + Linux, you can use the `a` command to set a partition as active. On Wind= ows, you can use + `diskpart` and then type `active` after selecting the relevant disk and = partition. +* Format the partition as FAT. Here you should make sure that you use FAT1= 6 over FAT32 else + the Debian partition manager may not automatically detect the partition = as ESP. If you + are using Windows `diskpart` then `format fs=3Dfat quick` will format a = drive to FAT16. On + Linux, the equivalent command would be `mkfs.vfat -F 16 /dev/`. As long as + the partition is smaller than 2 GB, the use of FAT16 over FAT32 should n= ot be a problem. + Note that it is also possible to use FAT32, but you will probably have t= o invoke `fdisk` + before rebooting, as shown in the _Additional Notes_ below, to reset the= partition type. +* Copy the UEFI firmware files (`RPI_EFI.fd`, `bootcode.bin`, `fixup.dat` = and `start.elf`) + as well as an appropriate `config.txt` onto the FAT partition. If needed= you can download + the non UEFI binary files from https://github.com/raspberrypi/firmware/t= ree/master/boot. +* (Optional) If you plan to install through WiFi, you will need to downloa= d relevant + non-free WLAN firmware binaries from your WLAN interface (`brcmfmac4343= 0-sdio.txt` and + `brcmfmac43430-sdio.bin` for a Raspberry Pi 3 Model B, `brcmfmac43455-sd= io.txt` and + `brcmfmac43455-sdio.bin` for a Raspberry Pi 3 Model B+). You may also wa= nt to obtain the + relevant `.clm_blob` (`brcmfmac43430-sdio.clm_blob` or `brcmfmac43455-sd= io.clm_blob`), + though wireless networking should work even if you do not provide these = files. Copy these + files either at the root of your FAT partition or into a `firmware/` dir= ectory there. +* Download the latest `debian-##.#.#-arm64-netinst.iso` from + https://cdimage.debian.org/debian-cd/current/arm64/iso-cd/ +* Extract the full content of the ISO onto the FAT partition you created. +* Insert the media and power up the Raspberry Pi device. +* On the GRUB menu select `Install` and let the Debian Installer process s= tart. + __Note:__ In case anything goes wrong during the install process, you ca= n use + Alt-F4 to check the installation log. +* Select your Language, Country and Keyboard and let the installer proceed= until it reports + that `No Common CD-ROM drive was detected.` +* On `Load CD-ROM drivers from removable media` select `No`. +* On `Manually select a CD-ROM module and device` select `Yes`. +* On `Module needed for accessing the CD-ROM` select `none`. +* On `Device file for accessing the CD-ROM` type the following exactly: + ``` + -t vfat -o rw /dev/mmcblk0p1 + ``` +* (Optional) If you have copied the non-free WLAN firmware binaries, and p= lan to install + through wireless, you can let the installer select the firmware files. P= lease be mindful + that you may be asked multiple times as there are multiple files to prov= ide. +* If requested by the installer, set up your network by choosing the netwo= rk interface you + want to use for installation and (optionally) your access point and cred= entials. +* Go through the hostname, user/password set up and customize those as you= see fit. +* Let the installer continue until you get to the `Partition disks` screen= . There, for + `Partitioning method` select `Manual`. You __should__ see something like= this: + ``` + MMC/SD card #1 (mmcblk0) - 16.0 GB SD 2WCGO + #1 primary 314.6 MB B K ESP + pri/log FREE SPACE + ``` + In other words, the partition manager should already detect your existin= g partition as + `ESP`, with the `B` (bootable) and `K` (keep data) flags. If that is not= the case, (e.g. + if it says `fat16` or `fat32` instead of `ESP`) then it probably means y= ou either didn't + format the partition to FAT16 or you forgot to set the bootable flag. In= that case, + please refer to the _Additional Notes_ below. +* Select `FREE SPACE` → `Create a new partition` and create a `1 GB` = primary `swap` + partition. +* Select `FREE SPACE` → `Create a new partition` and allocate the res= t to a primary + `ext4` root partition (mountpoint =3D `/`) +* After doing the above, your partition report should look like this: + ``` + MMC/SD card #1 (mmcblk0) - 16.0 GB SD 2WCGO + #1 primary 314.6 MB B K ESP + #2 primary 1.0 GB f swap swap + #3 primary 14.7 GB f ext4 / + ``` +* Select `Finish partitioning and write changes to disk` and then `Yes` an= d let the + installer continue with the base system installation. +* After a while, the installer should produce a message that states: + ``` + [!!] Configure the package manager + + apt-configuration problem + An attempt to configure apt to install additional packages from the CD f= ailed. + ``` + This is a __benign__ message that you can safely ignore by selecting `Co= ntinue` (The + reason it is benign is we are running a net install and won't need to ac= cess the "CD-ROM" + files post install). +* Once you have dimissed the message above, pick the mirror closest to you= r geographical + location and let the installer proceed with some more software installat= ion. +* Finally, at the `Software selection` screen, choose any additional softw= are package you + wish to install. `Debian desktop environment` should work out of the box= if you choose to + install it. +* Let the process finalize the software and GRUB bootloader installation a= nd, provided you + didn't run into the partition manager issue described above (installatio= n partition not + seen as `ESP`) you can reboot your machine when prompted, which, once co= mpleted, should + bring you to your newly installed Debian environment. + +### Additional Notes for Debian + +The reason we use `-t vfat -o rw /dev/mmcblk0p1` for the source media (i.e= . "CD-ROM" device) +is because, whereas the first partition on the SD card is indeed `/dev/mmc= blk0p1`, we also +need to provide additional parameters for the `mount` command that the ins= taller invokes +behind the scenes. For instance, if we don't use `-t vfat`, then ISO-9660 = is forced as the +file system, and if we don't use `-o rw` then the partition will be mounte= d as read-only +which then prevents the same partition from being remounted when locating = the non-free +firmware files or when setting up `/efi/boot`. + +With regards to fixing the partitioning if you don't see `B K ESP` when = entering the +partition manager, what you need to do is: +* Before you create the additional partitions, select the first partition = and change its + type to `ESP`. Note however that doing this changes the type of the part= ition to `0xef` + which is precisely what we're trying to avoid by having the partition ma= nager already + detect it as ESP, as type `0xef` is __unbootable__ by the Broadcom CPU. +* To fix this then, before you choose `Continue` on the `Installation comp= lete` prompt you + should open a new console with Alt-F2 and type: + ``` + chroot /target fdisk /dev/mmcblk0 + ``` + Then press t, 1, e w, to res= et the partition + to type `0x0e` (FAT16 LBA). + ## Ubuntu =20 [Ubuntu 18.04 LTS](http://releases.ubuntu.com/18.04/) has been tested and = confirmed to work, @@ -35,10 +158,6 @@ Then, to have your changes applied run `update-grub` an= d reboot. =20 ## Other Linux distributions =20 -* Debian ARM64 does not currently work, most likely due to missing require= d module support - in its kernel. However its installation process works, so it may be poss= ible to get it - running with a custom kernel. - * OpenSUSE Leap 42.3 has been reported to work on Raspberry 3 Model B. =20 * Other ARM64 Linux releases, that support UEFI boot and have the required= hardware support --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#45176): https://edk2.groups.io/g/devel/message/45176 Mute This Topic: https://groups.io/mt/32797836/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-