Arch linux arm установка raspberry pi

Содержание
  1. Как установить Arch Linux на Raspberry Pi
  2. Скачивание Arch Linux
  3. Подготовка SD-карты
  4. Копирование файлов ОС
  5. Загрузка Pi
  6. Выводы
  7. Arch Linux на Raspberry Pi
  8. Запуск getty на ttyAMA0 (необязательно)
  9. Настройка беспроводной сети (необязательно)
  10. Аппаратный генератор случайных чисел
  11. Часовой пояс и синхронизация времени
  12. Обновление системы
  13. Расширение корневого раздела
  14. Добавление непривилегированного пользователя
  15. Установка и настройка sudo
  16. Настройка ssh
  17. Заключение
  18. theramiyer / arch-arm-rpi3-b-plus.md
  19. This comment has been minimized.
  20. Maik93 commented Sep 5, 2019
  21. This comment has been minimized.
  22. theramiyer commented Sep 6, 2019
  23. This comment has been minimized.
  24. 0pcom commented Oct 8, 2019
  25. This comment has been minimized.
  26. OfficialMuffin commented Oct 9, 2019
  27. This comment has been minimized.
  28. theramiyer commented Oct 14, 2019
  29. This comment has been minimized.
  30. theramiyer commented Oct 14, 2019
  31. This comment has been minimized.
  32. blaggacao commented Oct 28, 2019
  33. This comment has been minimized.
  34. theramiyer commented Nov 10, 2019
  35. This comment has been minimized.
  36. SleepingNewton commented Jan 13, 2020 •
  37. This comment has been minimized.
  38. open-antux commented Jan 19, 2020 •
  39. This comment has been minimized.
  40. theramiyer commented Jan 23, 2020
  41. This comment has been minimized.
  42. open-antux commented Jan 23, 2020 •
  43. This comment has been minimized.
  44. luckily82 commented Feb 6, 2020 •
  45. timedatectl set-time «2012-10-30 18:17:16»
  46. timedatectl set-timezone Zone/SubZone
  47. timedatectl set-timezone Europe/Moscow
  48. This comment has been minimized.
  49. mb720 commented Feb 13, 2020
  50. This comment has been minimized.
  51. niktob560 commented Apr 11, 2020
  52. This comment has been minimized.
  53. xetta-byte commented Apr 15, 2020
  54. This comment has been minimized.
  55. gaetanpierrard commented Jan 6, 2021
  56. This comment has been minimized.
  57. niktob560 commented Jan 6, 2021
  58. This comment has been minimized.
  59. iiwwnnaa commented Apr 27, 2021

Как установить Arch Linux на Raspberry Pi

Raspberry Pi — самый популярный одноплатный компьютер всех времен. Его можно использовать для различных целей, таких как настольный ПК, домашний медиацентр, интеллектуальный WiFi-маршрутизатор, система автоматизации и игровой сервер. Варианты использования бесконечны.

На Raspberry Pi можно запускать несколько различных операционных систем, включая различные дистрибутивы Linux, такие как Raspbian , Windows 10 IoT и FreeBSD.

В этом руководстве мы покажем вам, как настроить Arch Linux ARM на Raspberry Pi 3 и 4. Установить Arch Linux так же просто, как создать два раздела и скопировать файлы ОС на SD-карту.

Arch Linux — это непрерывный выпуск GNU / Linux, что означает, что вам нужно установить его только один раз и часто обновлять.

Скачивание Arch Linux

Посетите страницу загрузок Arch Linux ARM и загрузите последний файл ARM Arch Linux для своей версии Raspberry Pi.

Если вы предпочитаете командную строку, используйте следующую команду wget для загрузки пакета:

Подготовка SD-карты

Вставьте SD-карту в привод SD-карты и найдите имя карты с помощью команды lsblk :

Команда распечатает список всех доступных блочных устройств:

В приведенном выше примере имя SD-устройства — /dev/sdb , но это может отличаться в вашей системе. Лучший способ узнать имя — это проверить размер устройства.

Вы можете использовать графический инструмент, например GParted, или инструменты командной строки, такие как fdisk или parted для форматирования диска и создания необходимого раздела. Мы будем использовать parted утилиту.

Обратите внимание, что форматирование и создание новых разделов — это деструктивный процесс, и он стирает все существующие данные. Если у вас есть данные на SD-карте, сначала создайте их резервную копию.

Сначала создайте таблицу разделов, выполнив следующую команду:

Создайте две перегородки. Загрузочный раздел Fat32 объемом 128 МБ и корневой раздел ext4, который занимает остальное пространство SD:

Добавьте загрузочный флаг в загрузочный раздел:

После этого используйте команду ниже, чтобы распечатать таблицу разделов и убедиться, что все настроено правильно:

Результат должен выглядеть примерно так:

Отформатируйте загрузочный раздел в FAT32:

Отформатируйте корневой раздел в ext4:

Копирование файлов ОС

Теперь, когда SD-карта разбита на разделы, мы смонтируем разделы и скопируем данные из загруженного tar-файла.

Перед монтированием разделов SD создайте каталоги, которые будут служить точками монтирования:

Смонтируйте оба раздела, используя следующие команды:

Если вы загрузили файл с помощью веб-браузера, он должен храниться в папке «Загрузки» в вашей учетной записи. В противном случае, если вы использовали команду wget , файл находится в вашем текущем рабочем каталоге .

Используйте команду tar для извлечения содержимого файла tar.gz Arch Linux в /mnt/arch/root каталог /mnt/arch/root :

Затем переместите загрузочные файлы в смонтированный загрузочный раздел:

После этого размонтируйте оба раздела:

Это все! У вас есть загрузочная ОС Arch Linux на SD-карте.

Загрузка Pi

Вставьте SD-карту в плату Raspberry Pi, подключите монитор, клавиатуру и источник питания, и вы готовы к работе.

Читайте также:  Как сделать простой linux

Имя пользователя по умолчанию — alarm , а пароль — alarm . У этого пользователя есть права sudo .

Вы также можете войти в систему как root с паролем root .

После входа в систему инициализируйте связку ключей pacman и заполните ключи подписи пакета:

Отсюда вы можете изменить пароль пользователя, настроить Wi-Fi и настроить новую установку Arch Linux.

Выводы

Установка Arch Linux на Raspberry Pi 3 / 34bis довольно простой процесс. Все, что вам нужно сделать, это подготовить SD-карту, скопировать файлы и загрузить Raspberry Pi.

Если вы столкнулись с проблемой или хотите оставить отзыв, оставьте комментарий ниже.

Источник

Arch Linux на Raspberry Pi

После довольно продолжительно использования Raspberry Pi совместно с Raspbian решил попробовать установить Arch Linux ARM. Что из этого получилось рассмотрено в статье.

Так как в месте установки RPi подключать что-либо к разъемам HDMI или RCA Video и LAN мне неудобно, я использую WiFi-подключение к сети и USB-UART для терминального доступа. Поэтому некоторые описанные шаги я отметил как необязательные.

Использованное оборудование: ноутбук с Windows, Raspberry Pi Model B, SD-карта объемом 4GB, WiFi-адаптер, UART-адаптер.

Загружаем и записываем на SD-карту образ операционной системы. В моем случае это был ArchLinuxARM-2014.01-rpi.img, запись выполнялась при помощи Win32DiskImager 0.9.5.

После установки войти в систему можно как root, пароль root. Это можно сделать как через локальный терминал так и через LAN, используя SSH.

Запуск getty на ttyAMA0 (необязательно)

Для вывода на последовательный порт загрузочных сообщений необходимо добавить в файл /boot/cmdline.txt параметр loglevel=5.

Разрешаем работу getty на последовательном порту командой:

Сигналы UART выведены на GPIO разъем Raspberry Pi:

Нужно подключить к ним USB-UART конвертер и указать в терминальной программе следующие параметры подключения: скорость 115200, 8 бит данных, 1 стоп бит, без проверки четности, без управления потоком. Подробнее как использовать PuTTY для работы через последовательный порт здесь.

Настройка беспроводной сети (необязательно)

Копируем и редактируем нужный профиль, указав в нем имя сети и пароль:

Активируем созданный профиль и разрешаем его запуск при включении:

Аппаратный генератор случайных чисел

В ArchLinux для Raspberry Pi есть поддержка аппаратного генератора случайных чисел, но демону rngd нужно указать, как его найти. Для это необходимо отредактировать файл /etc/conf.d/rngd следующим образом:

И перезапустить rngd:

Часовой пояс и синхронизация времени

Удаляем часовой пояс, назначенный по умолчанию и устанавливаем нужный:

Запускаем ntpd и разрешаем его работу при включении:

Обновление системы

Просто запускаем команду:

Расширение корневого раздела

Запускаем fdisk и выводим существующую таблицу разделов:

На SD-карте, как видно, есть основной (mmcblk0p1) и дополнительный (mmcblk0p2) разделы. Дополнительный, в свою очередь, содержит один логический (mmcblk0p5) раздел. Раздел mmcblk0p1 имеет небольшой размер, монтируется как /boot и используется при загрузке. Его модифицировать не нужно. Расширить нужно раздел mmcblk0p5, который монтируется как /.

Удаляем раздел mmcblk0p2 (при этом раздел mmcblk0p5 также удалится):

Теперь нужно создать новый дополнительный раздел, занимающий все доступное свободное пространство:

После этого внутри дополнительного, нужно создать логический раздел, так же занимающий все доступное пространство:

Проверяем, что разделы созданы правильно:

Стартовые блоки созданных разделов должны быть такими же как до внесения изменений, а общее количество блоков увеличиться.

Сохраняем изменения и выполняем перезагрузку:

После перезагрузки нужно увеличить размер файловой системы на созданном логического разделе. Текущий размер:

Имеет смысл для уменьшения количества операций записи на SD-карту установить в файле /etc/fstab параметр noatime для корневого раздела:

Добавление непривилегированного пользователя

Добавляем пользователя и устанавливаем пароль:

Установка и настройка sudo

Открыв с помощью команды visudo конфигурацию раскомментируем следующую строку:

Добавляем созданного ранее пользователя pi в группу wheel:

Это позволит пользователю pi использовать sudo для выполнения команд, требующих повышенных полномочий.

Настройка ssh

Так как SSH-ключи у меня уже были, останавливаться на их создании я не буду. Как их создать можно прочитать здесь.

Копируем публичный ключ на RPi:

Открываем файл конфигурации sshd:

Устанавливаем в нем запрет входить по ssh пользователю root и отключаем аутентификацию по паролю:

Заключение

В результате выполнения перечисленных шагов получаем RPi подключенный к WiFi сети, синхронизирующий время через интернет. На RPi можно зайти через SSH как непривилегированный пользователь имея при этом возможность вызова системных команд через sudo.

Источник

theramiyer / arch-arm-rpi3-b-plus.md

Install Arch Linux (ARM) on Raspberry Pi B+

Created 17 Aug 2018

This is a simple installation that I did on my Raspberry Pi. Of course, this is only one of the many reasons to do it.

Here are my requirements:

First, insert the memory card into your laptop. I use a memory card slot, so my device name would differ from yours if you use a USB memory card reader.

Читайте также:  Windows драйвер для оптического привода

Setup the SD card

Format the SD card with fdisk

  1. List out all the drives and partitions using lsblk . Note down the name of the SD card. In my case, it is mmcblk0 .
  2. Start fdisk using sudo fdisk /dev/mmcblk0 .
  3. Delete the existing partitions by entering o at the prompt. This clears out all partitions on the card.
  4. Type p to list the partitions; there should be none.
  5. Create a new partition with n , make it primary by entering p , set it as the first partition using 1 .
  6. Press Enter to accept the default first sector. At the prompt, enter +110M to make it a 100 MB partition.
  7. Type t and then c to set the partition type to W95 FAT32 (LBA) .
  8. Now, to create the second partition, type n , then p , make it the second partition by typing 2 , and then, press Enter twice to accept the default first and the last sectors.
  9. Enter w to write this configuration to the card.
  10. Next, format the first partition as VFAT , and the second as EXT4 .

Transfer Arch Linux ARM to the card

The next step is to transfer the OS files onto the partitions.

Insert the SD card into the Pi. Now, connect a keyboard and a mouse. Connect the Pi to a display using the HDMI port. Next, connect the ethernet cable. Finally, plug in the power supply.

As soon as the login prompt arrives, enter root as the username and root as the password. You are now logged into the device.

Connect to WiFi (in case you don’t use Ethernet)

If you would rather connect the device to WiFi:

  1. Navigate to /etc/wpa_supplicant .
  2. Create a new file called anything of your choice.

Arch Linux allows SSH by default. If you would like to connect to the Pi using SSH from your personal computer instead of attaching a keyboard and a mouse and HDMI and everything, by all means, please do.

This setup may be optional. I prefer doing this because I’m used to swap.

    Setup the swapfile.

pacman is the package manager for Arch Linux.

    Add colour to pacman .

Right out of the box, Arch Linux ARM comes with two users: root and alarm . The first thing we would want to do is reset the password for root , and then, either create a new user to replace alarm , or reset the password for alarm . I go with the former approach.

    Change the password for root .

Now that we have most things set up, we will now proceed and install the necessary packages.

  1. First, install a bunch of necessary software.
  1. Install pi-bluetooth from the AUR. You should already have the packages necessary to build packages from the AUR. The package, pi-bluetooth , needs hciattach-rpi3 installed. Run the following.

Update: Looks like hciattach-rpi3 is no more available. Use bluez-utils-compat instead. Thanks to @SleepingNewton.

  1. Enable Bluetooth using sudo systemctl enable bluetooth.service .
  2. Start the Bluetooth service using sudo systemctl start bluetooth.service .
  3. Now, let us install packages necessary for audio.
  1. Enable audio at boot by adding the following line to sudo vim /boot/config.txt .

Increase the life of your SD card.

  1. Add the following line to the file.

That should get you going with Arch Linux on Raspberry Pi 3 B+.

This comment has been minimized.

Copy link Quote reply

Maik93 commented Sep 5, 2019

Hi, cool guide!
One question: when, at the beginning, you download the ArchLinux ARM image, you use the command:
wget http://archlinuxarm.org/os/ArchLinuxARM-rpi-2-latest.tar.gz
I’ve checked the official site too, and it’s the same, but we are using a Pi3, so doesn’t we have to change rpi-2 in rpi-3 ? I’ve tried and it resolves in an existing package.

My main concern is that the Pi3 is 64-bit, while the Pi2 is not, so I suppose that anything should not work if exchanged.

This comment has been minimized.

Copy link Quote reply

theramiyer commented Sep 6, 2019

Hey! Thank you! I wrote this guide quite long ago. I think I copied links off of my notes, rather than from the terminal, at the time of writing the guide. Sorry about the glitch; I’ve changed that. Thank you for pointing it out. 👍 🙂

This comment has been minimized.

Copy link Quote reply

0pcom commented Oct 8, 2019

Awesome and very helpful guide!

This comment has been minimized.

Copy link Quote reply

OfficialMuffin commented Oct 9, 2019

I get a few errors when using the command sudo tar -xpf ArchLinuxARM-rpi-latest.tar.gz -C /mnt/root/
I used sudo tar -zxvf ArchLinuxARM-rpi-latest.tar.gz -C /mnt/root/ instead and it unpacks perfeclty without error.

This comment has been minimized.

Copy link Quote reply

theramiyer commented Oct 14, 2019

Oh okay, could you please tell me what error you got if you have the logs? I could add it to the documentation.

This comment has been minimized.

Copy link Quote reply

theramiyer commented Oct 14, 2019

This comment has been minimized.

Copy link Quote reply

blaggacao commented Oct 28, 2019

Little glitch:
change

archlinux-keyring might already have a newer release, so update pacman first.

This comment has been minimized.

Copy link Quote reply

theramiyer commented Nov 10, 2019

Hey, thank you! Changed it.

This comment has been minimized.

Copy link Quote reply

SleepingNewton commented Jan 13, 2020 •

I couldn’t set up Bluetooth with these instructions; the hciattach-rpi3 package is not available anymore.

I installed bluez-utils-compat instead.

This comment has been minimized.

Copy link Quote reply

open-antux commented Jan 19, 2020 •

I have two issue:

  1. sync command stuck, I don’t know why but when I do sync it take very long long time to be executed and I think that it crashes instead.
  2. Ok I avoid sync command, continue with the guide and when I boot Archlinux it stuck at: fb0 switching to vc4drmfb from simple .

How can I solve these problems?

Edit: I solved the problem with sync

This comment has been minimized.

Copy link Quote reply

theramiyer commented Jan 23, 2020

Hey, @SleepingNewton and @Superjolly002, thank you for adding your solutions. I’ll update the article. Unfortunately, I don’t have the device with me anymore, so I can’t test anything just yet. Will probably buy a 4 soon. 🙂

This comment has been minimized.

Copy link Quote reply

open-antux commented Jan 23, 2020 •

@theramiyer the bluez-firmware package doesn’t exist anymore
EDIT: I’ve notice you wrong to mention, change «Thanks to @Superjolly002» with «Thanks to @SleepingNewton»

This comment has been minimized.

Copy link Quote reply

luckily82 commented Feb 6, 2020 •

Author, You did not note about setup and sync time and select timezone:

In case if you have not file rc.conf
Для того, чтобы сравнить системное время и UTC:

$ timedatectl status
Для установки системных часов:

timedatectl set-time «2012-10-30 18:17:16»

Изменить Вашу зону и субзону:

timedatectl set-timezone Zone/SubZone

Лист доступных зон:

$ timedatectl list-timezones
Пример установки зон:

timedatectl set-timezone Europe/Moscow

This comment has been minimized.

Copy link Quote reply

mb720 commented Feb 13, 2020

Thanks for your instructions!

The image at http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-3-latest.tar.gz did not work for me. When plugging in USB power, after a short while the green ACT LED started blinking rhythmically: two short blinks separated by a longer pause. I’m not sure what it means, also after reading the flash codes.

I figured out that it works fine with a different image:

It might seem counter-intuitive to use the rpi-2 image, but it worked on my Raspberry Pi 3 B+ as opposed to the rpi-3 image.

The instructions here also use the rpi-2 image.

This comment has been minimized.

Copy link Quote reply

niktob560 commented Apr 11, 2020

wpa_supplicant requires «-c» key before the config file path

This comment has been minimized.

Copy link Quote reply

xetta-byte commented Apr 15, 2020

Can it monitor 5 ghz wifi

This comment has been minimized.

Copy link Quote reply

gaetanpierrard commented Jan 6, 2021

wpa_supplicant . & dhcpcd . works well to connect the wifi. But I have to run it every time I start the computer. What would be the elegant way to make it happen at boot automatically?

This comment has been minimized.

Copy link Quote reply

niktob560 commented Jan 6, 2021

wpa_supplicant . & dhcpcd . works well to connect the wifi. But I have to run it every time I start the computer. What would be the elegant way to make it happen at boot automatically?

We call it networkd (or netctl)

This comment has been minimized.

Copy link Quote reply

iiwwnnaa commented Apr 27, 2021

Thanks.
I installed ArchLinuxARM-rpi-2-latest.tar.gz on my raspberry pi 3B+

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

Читайте также:  Как windows создает окно
Оцените статью