From Mageia wiki
Jump to: navigation, search


Drakconf multiflag.png
Other languages
English ;
this page is a draft.
It requires improvements. If you want to improve it, simply log in and click on the Edit tab.

Please remove this {{Draft}}template, when you're sure the page is complete and correct.


View the other draft pages, or other pages to improve and maintain.

How to install and configure Mageia 8 on your Raspberry Pi board

Raspberry Pi 4 aka RPi4 board

Wiki3.png

This instructions are tested on RPi4 board and might be adjusted for other Raspberry Pi boards like RPi3.

  1. First you should choose your image for your Desktop Environment which you can change/install later if needed. Note that there are only 64 bit images currently available but you can build your own with our scripts.
  2. Then you can use IsoDumper or any other tool for writing the image on your SD card. Note that you need to extract it first if your tool doesn't support compressed images.
  3. After successful write you just boot your RPi4 board from SD card. It's very easy if you connect the board to the monitor or TV and keyboard especially if already installed Mageia on a regular computer. Headless install is also possible but it's not covered here.
  4. The Mageia install should boot to the Desktop Environment of your chosen image or command line interface aka CLI if that was your choice.
  5. Before you install or update any packages make sure that the repositories are for Mageia 8 (note bug 28818) and those that you prefer (mandatory is core repositories one, others are of course optional: nonfree repositories, tainted repositories and backports).

It's very easy with MCC (see documentation and in CLI too (see below).


Please be aware that although this can work great and looks stable, there are currently some missing functionalities like missing sound, gpio export not possible (no bug report yet as more tests are needed) and possibly some other bugs too (like no working keyboard in some cases, initrd symlink not updated with kernel upgrade).

Information:
Some hardware features are not yet tested. Like Bluetooth, Wi-Fi, most of the GPIO connector functions.

Install and tests were started with Mageia-8-rpi-aarch64-noDE.img.gz image. Be brave and contribute your helpful experience.

CEC status

Supposedly, there is hardware support for CEC on the HDMI. Needs some experimentation to see if this works.

To be completed...

Raspberry Pi 3 aka RPi3 board

Mageia works stable on RPi3 too. The instructions should work the same as on RPi4. Note that there are only 64 bit images currently available but you can build your own with our scripts.

Workaround

After trying Mageia 8 and Cauldron image, i have facing of the following bug :

https://bugs.mageia.org/show_bug.cgi?id=26277

Last answer say image work for PI4.

My workaround isn't complete clean, but work.

Download an official image, let's say http://mageia.ip-connect.info/distrib/8/aarch64/install/images/Mageia-8-rpi-aarch64-gnome.img.gz

use your file explorer to uncompress the file, then double click on the image should mount /boot partition and rootfs on /dev/loop

But first we just need to adjust /boot, so sudo unmount /dev/mmcblk0p2

now we need official raspberry pi /boot, two options, you have a running RPI or you download and mount the official image of raspian.

If double click don't work, use : sudo mkdir -p /mnt/chroot/mageia/boot sudo mount -o rw /dev/mmcblk0p1 /mnt/chroot/mageia/boot

then copy /mountpoint/boot to ~/tmp/

then update mageia/boot with the raspian/boot For example : cp -fr /boot/* /mnt/chroot/mageia/boot/*

Erase back with the previous backup cp -fr ~/tmp/boot/* /mnt/chroot/mageia/boot/*

now we need rootfs, either double click on the download MGA image or : sudo mount -o rw /dev/mmcblk0p2 /mnt/chroot/mageia

With root privileges, edit /mountpoint/boot/grub2/grub.cfg find the entry and edit the linux= command line to add : audit=0 nokmsboot=1 noiswmd=1 rd.debug rd.retry=5 vga=788

sudo umount -R /your/mount/point

Plug the SD card into the PI3 and power on.

Raspberry Pi 400

Mageia should work on Raspberry Pi 400 too. The instructions should work the same as on RPi4. Note that there are only 64 bit images currently available but you can build your own with our scripts.

Older Raspberry boards

Boards as Raspberry Pi Zero, and 1 are currently unsupported due to older (ARMv6) architecture. But our scripts can build image for Raspberry Pi 2 (32 bit), Raspberry Pi 3 (32 bit or 64 bit) and even Compute Module other than 1.

using PXE

Some boards (RPI > 3 ?), support some form of PXE, however, they need to be booted on microSD first to enable PXE; it would be great if we had some kind of repos for images per board that turn on PXE and reboot, so if you have multiple RPI's, you can just use the same microSD.

RPI 4

Intro

Normally, I would make a manual install using urpmi-root on the pxe/nfs host directly, then fix the initrd and boot into it. However, the rpms have trigger scripts which need to execute in aarch64, so I need a aarch64 system to do this (and also making the initrd image).

So, the plan was to use the rpi mga image on the microSD, boot into that, then make the urpmi-root on the nfs path directly, then remove microSD and reboot.

However, the mga8 (and cauldron) image did not boot for this rpi4 8GB, some kind of u-boot issue about memory not allocated.

This left me with the only system being the raspian lite that i used to turn on PXE booting, but that does not have urpmi.

So, I thought, I'll boot into the raspian chroot into a rw copy of the mga8 image, and use that to prepare the nfs root.

That did not work, at first i figured it was the chrooting with urpmi --urpmi-root, but it appears you just cannot urpmi stuff on a nfs mount directly? there's some kind of weird locking issue with the nfs mount. Later, it seemed like this was a nfs version 4 issue, nfs version 3 did not have this problem, maybe user/group mapping issue

So then, I chrooted into the mga8 and did the urpmi setup on a dir of the physical microSD, then rsynced it later to the nfs mount.

because the u-boot didn't work, i also used the raspian upstream firmware to boot the mga kernel on the tftp server.

steps
  1. download raspian lite ( https://www.raspberrypi.com/software/operating-systems/#raspberry-pi-os-64-bit don't download the desktop one, it's a whole hassle ) and mga8 rpi image ( /mageia/distrib/cauldron/aarch64/install/images/Mageia-cauldron-rpi-aarch64-noDE.img.gz on your favorite mirror)
  2. xz -k -d *-arm64-lite.img.xz # unzip the img for dd
  3. gunzip -k Mageia-cauldron-rpi-aarch64-noDE.img.gz # unzip for losetup
  4. dd if=*-arm64-lite.img.xz of=/dev/sdX bs=64k oflag=direct # copy the image onto the microSD
  5. nfs server: make a dir "mga-img" and "src"
  6. nfs server: losetup -f Mageia-cauldron-rpi-aarch64-noDE.img
  7. nfs server: losetup -a # check which loop device is used
  8. nfs server: partx -a /dev/loopX
  9. nfs server: mount the correct /dev/loopXpY partition to the src folder (only the / is important, we don't care about the /boot or other)
  10. nfs server: rsync -aH src/. mga-img/
  11. boot rpi4 with the microSD
  12. rpi4: raspi-config # go into advanced, into boot order, and choose the PXE one
  13. rpi4: mount the nfs folder "mga-img" from your nfs server
  14. rpi4: mkdir /dst
  15. rpi4: mkdir mga-img/dst
  16. rpi4: mount --bind /dev mga-img/dev
  17. rpi4: mount --bind /sys mga-img/sys
  18. rpi4: mount --bind /dst mga-img/dst # empty dir to install into
  19. rpi4: chroot mga-img
  20. rpi4: mount /proc
  21. rpi4: urpmi.addmedia --urpmi-root /dst --distrib '<fav mirror>/mageia/distrib/8/aarch64'
  22. rpi4: urpmi.update --urpmi-root /dst --no-ignore "Nonfree Release" "Nonfree Updates" "Tainted Release" "Tainted Updates"
  23. rpi4: urpmi.update --urpmi-root /dst -a
  24. rpi4: urpmi --urpmi-root /dst --no-recommends locales-XX urpmi basesystem-minimal nfs-utils vim-enhanced bash-completion openssh-server kernel-desktop-latest man dhcp-client ntp curl console-setup usermode-consoleonly ...
  25. rpi4: umount /proc
  26. rpi4: exit # out of chroot
  27. rpi4: umount mga-img/dst
  28. rpi4: umount mga-img/dev
  29. rpi4: umount mga-img/sys
  30. rpi4: mount --bind /dev /dst/dev
  31. rpi4: mount --bind /sys /dst/sys
  32. rpi4: chroot /dst
  33. rpi4: mount /proc
  34. rpi4: echo "NETWORKING=yes" > /etc/sysconfig/network
  35. rpi4: mkdir /root/.ssh
  36. rpi4: chmod 700 /root/.ssh
  37. rpi4: vim /root/.ssh/authorized_keys # paste your ssh pub keys in here so you can ssh into it
  38. rpi4: vim /etc/systemd/journald.conf # change Storage into Volatile and set RunTimeLimit to 8MB or something
  39. rpi4: vim /etc/fstab # put "none /proc proc defaults 0 0" into it with the nfs mount and maybe other nfs mounts
  40. rpi4: vim /etc/dracut.conf # remove network from omit modules
  41. rpi4: dracut -N --add "nfs network" /boot/initrd-kernelversion.img kernelversion
  42. rpi4: chmod +r /boot/vmlinuz # this is so the vmlinuz will be available with tftp
  43. rpi4: umount /proc
  44. rpi4: exit # chroot
  45. rpi4: umount /dst/sys
  46. rpi4: umount /dst/dev
  47. rpi4: mkdir /nfs
  48. rpi4: mount nfs-server:/nfs /nfs
  49. rpi4: mkdir /nfs/path/to/rpi-img
  50. rpi4: rsync -aH /dst/. /nfs/aarch64/rpi-img/
  51. rpi4: rsync -aH /boot/. pxe-server:/boot-rpi/
  52. rpi4: poweroff
  53. unplug rpi and microSD
  54. pxe server: mkdir /var/lib/tftpboot/aarch64
  55. pxe server: mv /boot-rpi /var/lib/tftpboot/aarch64/linux
  56. pxe server: cd /var/lib/tftpboot/aarch64/linux
  57. pxe server: mkdir raspian
  58. pxe server: mv kernel* raspian/
  59. pxe server: mkdir nfs
  60. pxe server: mount nfs-server:/nfs/aarch64 nfs
  61. pxe server: ln -s nfs/rpi-img/boot/vmlinuz vmlinuz
  62. pxe server: ln -s nfs/rpi-img/boot/initrd.img initrd.img
  63. pxe server: vim config.txt # add 4 lines: "dtoverlay=upstream-pi4" "cmdline=cmdline.txt" "kernel=vmlinuz" "initramfs initrd.img followkernel"
  64. pxe server: vim cmdline.txt # change root to /dev/nfs and add "nfsroot=nfsserver:/nfs/aarch64/rpi-img,nfsvers=3,tcp,rw ip=dhcp rootfstype=nfs" after it
  65. pxe server: cd /var/lib/tftpboot
  66. pxe server: tcpdump udp port 69
  67. boot up the rpi and look at tcpdump, one of the first file requests will be some 8 char hex string as a dir, with config.txt after it
  68. pxe server: ln -s aarch64/linux 8-char-hexstring
  69. the rpi should boot up and you should be able to ssh to it with your pub key


To be completed...

How to install and configure Mageia 8 on your Banana Pi board

Mageia 8 can be also installed on Banana Pi board. You can find 32 bit images here and even build your own with our scripts.

To be completed...

Other ARM boards

More experienced can use our scripts to build generic aarch64 image.

To be completed...

First boot

Image without Desktop Environment aka command line interface

  • login name for first boot is root, new password is required
  • Workaround for changing the repositories in CLI (to be done before any urpmi command):
  • to check to which version URL points
# cat /etc/urpmi/urpmi.cfg
  • copy, to be on the safe side
# cp /etc/urpmi/urpmi.cfg /etc/urpmi/urpmi_original.cfg
  • the magic command to change
# sed -i 's/cauldron/8/g' /etc/urpmi/urpmi.cfg
  • to check the result
# cat /etc/urpmi/urpmi.cfg
  • refresh or even better
# urpmi.update -a
  • refresh and update
# urpmi.update -a && urpmi --auto-select
  • add important parts of mcc
# urpmi drakconf draklocale
  • add your locale if non English, note that Slovenian one is just an example. use <Tab> autocompletion if you don't remember exactly (not strange as there are more than 180).
# urpmi locales-sl
  • setup your language
# urpmi locales-sl
  • and tune your keyboard layout and add a nonroot user
# drakconf
  • change default hostname rpi-aarch64 if you wish or need
# hostnamectl set-hostname your_desired_hostname
  • You can install Desktop Environment (GUI aplication can come handy even in headless configuration)
  • for example or slightly thinner task-xfce-minimal
# urpmi task-xfce
# startx
  • or startxfce4

Image with Desktop Environment

If you use your ARM board with monitor or TV, everything should work the same as in your ordinary computer. There's also nice documentation available.

To be completed...

People Interested in Mageia on ARM

People Interested + some older history questions