Debian sur raspberry pi (non rasbian)

Configuration debian pour raspberry pi:

Installation des outils selon rapsberry pi:

crossbuild-essential-armel
crossbuild-essential-armhf
crossbuild-essential-arm64

creation partition:

16M en fat16 pour uboot
Le reste pour le systeme

Mount /dev/{device}p2 /mnt

Creation filesystems selon rapsberry pi:

qemu-debootstrap –variant=minbase –arch=armel buster /mnt/ http://ftp.fr.debian.org/debian/
qemu-debootstrap –variant=minbase –arch=armhf buster /mnt/ http://ftp.fr.debian.org/debian/
qemu-debootstrap –variant=minbase –arch=arm64 buster /mnt/ http://ftp.fr.debian.org/debian/

mount –bind /dev /mnt/dev
mount –bind /proc /mnt/proc
mount –bind /sys /mnt/sys

mkdir boot/uboot

chroot /mnt

Instalation selon rapsberry pi:

apt update; apt install linux-image-4.19.0-5-rpi sudo bind9-host resolvconf ntp network-manager flash-kernel locales openssh-server isc-dhcp-server init vim man wget u-boot-rpi
apt update; apt install linux-image-4.19.0-5-armmp sudo bind9-host resolvconf ntp network-manager flash-kernel locales openssh-server isc-dhcp-server init vim man wget u-boot-rpi
apt update; apt install linux-image-4.19.0-5-arm64 sudo bind9-host resolvconf ntp network-manager flash-kernel locales openssh-server isc-dhcp-server init vim man wget u-boot-rpi

mount /dev/sdd1 boot/uboot/
cd boot/uboot/

Copie des fichiers du firmware du GPU:

wget https://github.com/raspberrypi/firmware/raw/master/boot/bootcode.bin
wget https://github.com/raspberrypi/firmware/raw/master/boot/fixup_x.dat
wget https://github.com/raspberrypi/firmware/raw/master/boot/fixup_db.dat
wget https://github.com/raspberrypi/firmware/raw/master/boot/fixup.dat
wget https://github.com/raspberrypi/firmware/raw/master/boot/fixup_cd.dat
wget https://github.com/raspberrypi/firmware/raw/master/boot/start_x.elf
wget https://github.com/raspberrypi/firmware/raw/master/boot/start.elf
wget https://github.com/raspberrypi/firmware/raw/master/boot/start_db.elf
wget https://github.com/raspberrypi/firmware/raw/master/boot/start_cd.elf

Copie uboot selon rapsberry pi:
cp /usr/lib/u-boot/rpi/u-boot.bin .
cp /usr/lib/u-boot/rpi_2/u-boot.bin .
cp /usr/lib/u-boot/rpi_3_32b/u-boot.bin .
cp /usr/lib/u-boot/rpi_3/u-boot.bin .

Configuration flash-kernel selon rapsberry pi:
echo “Raspberry Pi 1 Model A” > /etc/flash-kernel/machine
echo “Raspberry Pi 1 Model A+” > /etc/flash-kernel/machine
echo “Raspberry Pi 1 Model B” > /etc/flash-kernel/machine
echo “Raspberry Pi 1 Model B+” > /etc/flash-kernel/machine
echo “Raspberry Pi 1 Model B Rev2” > /etc/flash-kernel/machine
echo “Raspberry Pi 1 Compute Module” > /etc/flash-kernel/machine
echo “Raspberry Pi Model B V2” > /etc/flash-kernel/machine
echo “Raspberry Pi Model Zero” > /etc/flash-kernel/machine
echo “Raspberry Pi Model Zero W” > /etc/flash-kernel/machine
echo “Raspberry Pi 2 Model B” > /etc/flash-kernel/machine
echo “Raspberry Pi 3 Model B” > /etc/flash-kernel/machine
echo “Raspberry Pi 3 Model B+” > /etc/flash-kernel/machine

Relance de flash-kernel apres configuration:
flash-kernel

Modification de fichier:
cat << EOF > /etc/fstab
# /etc/fstab: static file system information.
#
# Use ‘blkid’ to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# # / was on /dev/mmcblk0p2 during installation
UUID= / ext4 errors=remount-ro 0 1
# /boot/uboot was on /dev/mmcblk0p1 during installation
UUID= /boot/uboot vfat utf8 0 0
tmpfs /tmp tmpfs defaults,size=200M 0 0
tmpfs /var/tmp tmpfs defaults,size=200M 0 0
EOF

echo “raspberrypi” > /etc/hostname

cat << EOF > /etc/hosts
127.0.0.1 localhost raspberrypi

# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
EOF

cat << EOF > /etc/network/interface
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp
iface eth0 inet6 dhcp
EOF

cat << EOF > /etc/default/locale
# File generated by update-locale
LANG=fr_FR.UTF-8
EOF

cat << EOF > /etc/apt/sources.list
deb http://ftp.fr.debian.org/debian/ buster main contrib non-free
deb-src http://ftp.fr.debian.org/debian/ buster main contrib non-free

deb http://security.debian.org/ buster/updates main contrib non-free
deb-src http://security.debian.org/ buster/updates main contrib non-free

# stretch-updates, previously known as ‘volatile’
deb http://ftp.fr.debian.org/debian/ buster-updates main contrib non-free
deb-src http://ftp.fr.debian.org/debian/ buster-updates main contrib non-free

deb http://ftp.fr.debian.org/debian buster-backports main contrib non-free
deb-src http://ftp.fr.debian.org/debian buster-backports main contrib non-free
EOF

adduser
usermod -G sudo -a

cat << EOF >/etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# # program, run by the persistent-net-generator.rules rules file.
# #
# # You can modify it, as long as you keep each rule on a single
# # line, and change only the value of the NAME= key.

SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”, ATTR{address}==”“, ATTR{dev_id}==”0x0″, ATTR{type}==”1″, KERNEL==”eth*”, NAME=”eth0″
EOF

update-initramfs -u

ajout 64 bits (pi3 non tester):

arm_control=0x200

Leave a comment