Configuration debian pour raspberry pi:
Création partition:
64M en fat16 pour la partition firmware
Le reste pour le system
mount /dev/{device}p2 /mnt
debootstrap –arch=armhf –include=sudo,ntp,flash-kernel,openssh-server,bind9-host,resolvconf,network-manager,locales,isc-dhcp-server,init,vim,man-db,wget,u-boot-rpi,u-boot-tools buster /mnt http://ftp.fr.debian.org/debian
mkdir /mnt/boot/firmware
mount /dev/{device}p1 /mnt
mount –bind /dev /mnt/dev && mount –bind /proc /mnt/proc && mount –bind /sys /mnt/sys
chroot /mnt
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
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=<p2 UUID> / ext4 errors=remount-ro 0 1
# /boot/uboot was on /dev/mmcblk0p1 during installation
UUID=<p1 UUID> /boot/firmware vfat utf8 0 0
tmpfs /tmp tmpfs defaults 0 0
tmpfs /var/tmp tmpfs defaults 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
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
adduser <user>
usermod -G sudo -a <user>
Instalation selon rapsberry pi:
apt update; apt install linux-image-<version>-<type> raspi-firmware
editer le fichier suivant:
/etc/default/raspi-firmware pour avoir ces valeurs pour un démarrage direct sur le kernel:
ROOTPART=/dev/mmcblk0p2
CONSOLES= »tty0 ttyAMA0,115200″
Puis:
update-initramfs -u
Pour démarrer sur u-boot, modifier aussi cette ligne:
KERNEL= »u-boot.bin »
Faire la copie de uboot selon rapsberry pi:
cp /usr/lib/u-boot/rpi/u-boot.bin /boot/firmware
cp /usr/lib/u-boot/rpi_2/u-boot.bin /boot/firmware
cp /usr/lib/u-boot/rpi_3_32b/u-boot.bin /boot/firmware
cp /usr/lib/u-boot/rpi_3/u-boot.bin /boot/firmware
Puis:
update-initramfs -u
Vous pouvez aussi ajouter des options dans le fichier /etc/default/raspi-firmware:
Exemple pour une raspberry pi 2, modification des fréquences par defaut:
arm_freq=1000
core_freq=500
sdram_freq=400
over_voltage=0
over_voltage_sdram_p=0
over_voltage_sdram_i=0
over_voltage_sdram_c=0
Exemple pour une raspberry pi 3,ajout 64 bits (pi3 non tester):
arm_control=0x200