MaxVMH
Posts: 95
Joined: Mon Mar 19, 2018 1:26 pm

Debian on Pi 3B & 3B+

Sat Apr 07, 2018 12:19 pm

I want to install Debian Stretch (or Buster) on Raspberry Pi 3B & 3B+ for learning purposes. I know it will not work out of the box, trying to make it work will be the learning experience. I will try to gather my questions/remarks in this topic.

When I go to the Debian.org website, I see 3 options: arm64, armel, armhf. If I understand it correctly, Raspbian is a port of armhf with support added for older ARM processors used in other Raspberry Pi's.
  • arm64 supports the latest ARM processors
  • armel supports older ARM processors
  • armhf supports ARM v7 processors in 32-bit
I think I don't need armel. So that leaves armhf and arm64. I assume that armhf is the 32-bit version of arm64.

Are there other reasons to choose arm64 over armhf (or vice versa, armhf over arm64)?
Up-to-date tutorials on how to create a Raspberry Pi webserver (Raspbian/Apache/MySQL/PHP/SSL):
http://blog.mijnscore.be
It's linked to GitHub so anyone can improve them, make suggestions or add new tutorials:
https://github.com/MaxVMH/mywebdevresources

MaxVMH
Posts: 95
Joined: Mon Mar 19, 2018 1:26 pm

Re: Debian on Pi 3B & 3B+

Sat Apr 07, 2018 2:29 pm

When I compare images of Ubuntu MATE / Raspbian / Debian Buster (for RPi 3B) with 'vanilla' (standard) Debian ARM64, I notice that the images that are ready for the Raspberry Pi have a BOOT partition.

The 'vanilla' Debian ARM64 doesn't have a BOOT partition but a /BOOT folder.

Can I start copying the files from the Raspbian BOOT partition into the Debian /BOOT folder, or do I need a separate partition?
Up-to-date tutorials on how to create a Raspberry Pi webserver (Raspbian/Apache/MySQL/PHP/SSL):
http://blog.mijnscore.be
It's linked to GitHub so anyone can improve them, make suggestions or add new tutorials:
https://github.com/MaxVMH/mywebdevresources

User avatar
hansotten
Posts: 300
Joined: Fri Jul 13, 2012 6:01 am
Contact: Website

Re: Debian on Pi 3B & 3B+

Sat Apr 07, 2018 3:12 pm

A Raspberry boots from a SD FAT partition, this is where the software (KERNEL*.IMG) for the GPU is stored. The GPU takes care of the reading of these fles and loads this in memory. Only then the ARM processor is activated.

Quite a different approach than on PC's for example, where a BIOS for the CPU is present to boot the machine.

The baremetal forum will give you detailed info on the boot process.
http://duinorasp.hansotten.com for Raspberry Pi and Arduino and ESP8266
http://retro.hansotten.nl for retrocomputing with the 6502 cpu


MaxVMH
Posts: 95
Joined: Mon Mar 19, 2018 1:26 pm

Re: Debian on Pi 3B & 3B+

Sat Apr 07, 2018 3:55 pm

hansotten wrote:
Sat Apr 07, 2018 3:12 pm
A Raspberry boots from a SD FAT partition, this is where the software (KERNEL*.IMG) for the GPU is stored. The GPU takes care of the reading of these fles and loads this in memory. Only then the ARM processor is activated.

OK, I'll make a BOOT partition in FAT32 :)

That links to a pre-installed image for Debian Buster. With some modifications I got the image to work for USB-drives and for RPi 3B+ but I'd like to learn how to install it (not using a pre-installed image) - that way I could also have a go with Debian Stretch (instead of Buster).
Last edited by MaxVMH on Sat Apr 07, 2018 4:17 pm, edited 1 time in total.
Up-to-date tutorials on how to create a Raspberry Pi webserver (Raspbian/Apache/MySQL/PHP/SSL):
http://blog.mijnscore.be
It's linked to GitHub so anyone can improve them, make suggestions or add new tutorials:
https://github.com/MaxVMH/mywebdevresources

MaxVMH
Posts: 95
Joined: Mon Mar 19, 2018 1:26 pm

Re: Debian on Pi 3B & 3B+

Sat Apr 07, 2018 4:17 pm

At the moment I have the following on my USB drive:
  • First partition: FAT32, copied the BOOT partition from the Debian Buster RPi 3B image, altered cmdline.txt to boot from USB ('root=/dev/sda2' - because I'm on USB instead of SD)
  • Second partition: EXT4, copied the Debian ARM64 installer (contents of 'debian-9.4.0-arm64-xfce-CD-1.iso')
I get the following output before it stops booting. Anyone got a tip on how I can continue trying to make this work?
I was thinking of copying the /lib/modules folder like we got Ubuntu Mate to work for the RPi 3B+, but this folder is not present on the Debian ARM64 installer partition.

Image
Up-to-date tutorials on how to create a Raspberry Pi webserver (Raspbian/Apache/MySQL/PHP/SSL):
http://blog.mijnscore.be
It's linked to GitHub so anyone can improve them, make suggestions or add new tutorials:
https://github.com/MaxVMH/mywebdevresources

feelslikeautumn
Posts: 242
Joined: Wed Aug 09, 2017 9:51 pm

Re: Debian on Pi 3B & 3B+

Sat Apr 07, 2018 5:45 pm

They are Cd/DVD ISO debian-installer images so you don't set them up like a standard pi sd card image. Have a look at the mini ISO images I made for raspbian - viewtopic.php?t=195162 , or you could boot the iso using uboot/grub (like I showed in the Ubuntu thread). Debian's generic arm64 kernel can be booted by the pi firmware, which makes things easier than Ubuntu's generic arm64 kernel (which needs uboot as far as I can tell).

The debian wiki seems out of date. A custom armhf kernel should not be necessary as pi support was added to the debian kernel in Dec 2015. So the armhf debian installer should work on the pi 3.

You might also like to read a bug I created which discusses the debian-installer on the pi - https://bugs.launchpad.net/raspbian/+bug/1723203

If you want to make an sd card image (like the Ubuntu server image), then the livecd-rootfs package is what is used in Ubuntu to build it. Ubuntu-mate uses the raspberry pi flavour maker to create their images. They use the same kernel as raspbian, so you could do the same in debian armhf. Raspbian build scripts are here https://github.com/RPi-Distro/pi-gen . Doing it manually in debian is described here - https://www.debian.org/releases/stable/ ... 03.html.en .

Lots of other build scripts kicking about the internet, but the standard armhf/arm64 debian-installer should be usable and I think are the best choice.
Last edited by feelslikeautumn on Sun Apr 08, 2018 5:38 pm, edited 1 time in total.

feelslikeautumn
Posts: 242
Joined: Wed Aug 09, 2017 9:51 pm

Re: Debian on Pi 3B & 3B+

Sun Apr 08, 2018 10:50 am

MaxVMH wrote: I was thinking of copying the /lib/modules folder like we got Ubuntu Mate to work for the RPi 3B+
In the debian-installer the filesystem is compressed into the initrd. So you have to unpack it, copy across, then repack the initrd. Using this technique you should be able to use the downstream raspberrypi foundation kernel with debian's armhf debian-installer files - https://www.debian.org/releases/stable/ ... 02.html.en

Return to “Debian”

Who is online

Users browsing this forum: No registered users and 1 guest