X96 mini linux install

X96 mini linux install

Copy raw contents

Installing Linux on X96 Mini

Goal is to install a Linux on a X96 Mini that I did not use anymore as a TV box and wanted to recycle as a DNS server for ads-blocking (https://pi-hole.net/) and other experiments.

Important: I will not give any support or answer questions related to issues happening with your own X96

Instructions are covering steps on a Windows machine. Should be similar for Linux. Based upon (messy) instructions found at https://forum.armbian.com/topic/12162-single-armbian-image-for-rk-aml-aw-aarch64-armv8/

  • X96 Mini 2GB CPU is S905X. Label behind say «X96 mini RAM 2GB, ROM 16 GB».
  • SD card, 16 GB. Smaller will be ok too (needs at least 8GB)
  • Toothpick or small stick (reset button inside AV jack)
  • Download https://users.armbian.com/balbes150/arm-64/Armbian_20.10_Arm-64_focal_current_5.9.0.img.xz
  • Unzip this file to get Armbian_20.10_Arm-64_focal_current_5.9.0.img
  • Launch Rufus, select the img. Click on ‘Start’. SD card will be formatted and content will be written.

Configuration of u-boot

  • In Windows Explorer, navigate to your SD card. You should see a structure a ‘extlinux’ folder, ‘dtb’, etc.
  • Rename the file ‘u-boot-s905x-s912’ to ‘u-boot.ext’

Configuration of device tree block

  • A Device Tree Block (DTB) is a file that contains important information about the target hardware (more info http://junyelee.blogspot.com/2015/07/a-tutorial-on-device-tree.html). So it is necessary to use the proper one. This is a tricky part and if an improper DTB is used, your target system will fail loading or the kernel will panic.
  • Edit the file /extlinux/extlinux.conf
  • Comment out all lines starting with FDT and APPEND (we don’t want RK or AW configuration, we are only interested in AML s9xxx section).
  • Uncomment ‘FDT /dtb/amlogic/meson-gxl-s905x-p212.dtb’ and ‘APPEND . ‘. See example below
  • Unplug the X96 Mini
  • Insert the SD card
  • Using a toothpick, small stick or whatever suitable, press on the ‘reset’ switch which is located inside the AV jack. You don’t need to press too hard.
  • While the reset switch is maintained pressed, plug the power. The X96 Mini screen will appear and normally after a few seconds, it should switch to the Linux boot.
  • You can release the reset switch. Linux should run if everything is properly configured.
  • I access it through SSH on port 22. It is of course recommended to change the default root password (root / 1234)

Installing Pi-Hole on the X96

First upgrade your system.

About 50 packages or so are upgraded.

It may fail by saying that your OS is not supported, just follow the instructions they provide in the error message in this case. I will not detail the complete installation, I used the default configuration step without doing any tweaking except giving the target IP address of my X96 on my network.

Configuration of router

  • Assign a static IP to the MAC address of your X96. This must match what you defined in the PI-hole configuration.
  • Switch the router to your new DNS server (as the primary). I left the secondary DNS server to my ISP default, just in case the X96 crashes or fails for whatever reason.
  • Disable ad-blocking in your browser and navigate to some heavy websites

Adding some lists

Additional lists may be useful for Youtube adblocking, here is my configuration.

Источник

Linux на X96 или какой же этот ваш ARM овно

Подогрел мне кум неудачно прошитую андроид-приставку X96-mini. Он вообще любитель «обновляться» без нужды, вот и этот девайс окирпичил.

Беззащитная машинка умещается на ладошке, и содержит в себе с понтом четырехядерный Amlogic S905w, два гига ОЗУ, и 16 Г флешку.

Что вам сказать, мужчины и женщины. Во время раскирпичивания девайса, я познал всю боль устройств на базе ARM и на меня снизошло просветление, почему ARM никогда не будет на десктопах, по крайней мере в том исполнении, котором он теперь.

Итак, начнем с того, что готового образа НЭД (уже молчу о том, что его сперва нужно создать). Нет, образы конечно есть. Только вот они под другие модификации. Образ под устройство с 1Гб отличается от образа под устройство с 2Гб. Они все отличаются от образа сделанного под устройство на базе памяти Samsung, а этот образ отличается от образа сделанного на базе памяти Hynix.

Читайте также:  Можно ли отказаться от предустановленной windows

Визуально это видно как либо ОС не запускается вовсе, либо ядро падает в overflow и kernel panic, потому что не совпадают пару байтов откуда это ядро читать.

Ладно, готового образа нет, попробуем сделать свой. Но не тут-то было. Сначала нужно записать загрузчик. Но это загрузчик НЕ ПОД ARM, и даже не загрузчик под этот процессор. Это загрузчик под конкретное устройство.

Вот нагуглился аналогичный по процессору девайс Khadas VIM1. Вроде все красиво, u-boot стянулся, флешка стартонула. Но нет, это еще не все. Нужен DTB-файл. Это описание дерева устройств. У нас в X86 вроде такое тоже есть, но оно вшито производителем. Ладно, с горем пополам накопали в базе CoreElec такой вот DTB, переименовали в dtb.img, поскольку это имя файла захардкожено. И ничего. Потому что нужен еще файл с командами сраному u-boot’у. Мы не можем просто передать управление ядру под данную архитектуру (или хотя бы загрузчику который загрузит ядро), нет. Мы должны сначала определить откуда идет запуск, скопировать оттуда ядро в память по определенному адресу, а уже потом передать управление в начало этого адреса. Ладно. Так я и сделал.

Kernel panic, stack overflow. Сцука. И тут я присмотрелся: оказывается эта система считает себя Khadas VIM1 с одним гигом ОЗУ. Ну да, на месте ядра я бы тоже зафейлился, но на месте гребанной архитектуры, я бы разрешил ядру самому определить сколько в компьютере ОЗУ, а не основываться на каком-то левом файле.

Разумеется готовых u-boot в сети я не нашел, хотя нашел маны как конпельнуть. Жаль только в этом мане нету defconfig’а под это устройство, посему конпеляция увенчалась неуспехом. Более того, под Дебианом компилятор выдал какую-то ошибку шото типа duplicate или already defined, не помню. Поставил Арч. Скомпильнулось нормально, но не запустилось. Предсказуемо.

Нашел прошивку Андроида мало-мальски предназначенную под похожее устройство. Конечно же она тоже не завелась, но благодаря полутора утилитам, удалось с нее вытащить u-boot.

Но этот u-boot грузит по умолчанию recovery.img — андроидный рекавери. Окай, в порядке эксперимента качаю TWRP, переименовываю его в recovery.img, перезагружаюсь — вуаля, работает. При чем даже радиоклава с радиомышкой и видит подключенную USB-флешку. Хотя и изображение на мониторе раздваивается. Ну да ладно, напуркуа мне эти рекавери. Записываю файл с командами u-boot’а, который собственно копирует ядро в память и его оттуда запускает, записываю ядро (у меня их два, с armbian и с manjaro) — болт тебе. booti: command not found. И таки да, через UART удалось вызвать консоль сраного u-boot’a (чем-то напоминает наш grub, лал), там такой команды нет. Пояндексив, нагуглил что команда booti загружает линуксовое ядро, команда bootm андроидное, и эта команда у меня есть. Окей, поменял. Но нет, не тот формат ядра. Конечно нет, ведь Андроид это ж не Линукс.

Подменив ядра на CoreElec (видимо с андроидной базой) — CoreElec таки запустился. Ура.

Я бы оторвал руки изобретателям подобной архитектуры. Или производителю железки. Или хоть кому-нибудь.

Если уж хочется дроч с загрузчиками — почему не выделить в процессоре область ? Это ж гребанный SoC. Этот загрузчик занимает полмегабайта. И может быть readonly. Ну как на один и тот же процессор могут использоваться разные загрузчики, в зависимости от которых у вас либо стартонет система либо нет ? Вы хоть представляете себе установочный образ Винды заточенный на работу под 8Гб ОЗУ и вылетающий если стоит 16Гб ? Вот и я нет. А представляете чтобы вы в grub прописали шота типа «RAM=2G» и ваш Линукс думал что у вас 2 Гб ? Более того, стал вылетать если вы его запустили на 4 Гб ?

Читайте также:  Utorrent автозагрузка отключить windows 10

Повторюсь, сей звиздец с прошивками и Линуксами творится в пределах нескольких девайсов с идентичным именем, на идентичной архитектуре, а зачастую даже на совершенно идентичных процессорах.

Короче ARM не светит на десктоп. И как мне кажется именно по причине прибитости гвоздями загрузчика к железу, железа к реализации в загрузчике. Если ваш девайс по каким-то причинам теряет свою ОС — он превращается в кирпич, по крайней мере пока вы не вкатите туда ОС с точно такого же девайса.

И да, если у кого-то есть дельные предложения по запуску Linux на этом девайсе — буду премного благодарен, пушо пока на нем работает только две ОС — CoreElec (андроид) и Khadas recovery (который хоть и Linux, но покоцанный дюже), впрочем видящий только гиг ОЗУ. X96 2G на Amlogic S905W.

Источник

X96 mini linux install

Installing Linux on X96 Mini

Goal is to install a Linux on a X96 Mini that I did not use anymore as a TV box and wanted to recycle as a DNS server for ads-blocking (https://pi-hole.net/) and other experiments.

Important: I will not give any support or answer questions related to issues happening with your own X96

Instructions are covering steps on a Windows machine. Should be similar for Linux. Based upon (messy) instructions found at https://forum.armbian.com/topic/12162-single-armbian-image-for-rk-aml-aw-aarch64-armv8/

  • X96 Mini 2GB CPU is S905X. Label behind say «X96 mini RAM 2GB, ROM 16 GB».
  • SD card, 16 GB. Smaller will be ok too (needs at least 8GB)
  • Toothpick or small stick (reset button inside AV jack)
  • Download https://users.armbian.com/balbes150/arm-64/Armbian_20.10_Arm-64_focal_current_5.9.0.img.xz
  • Unzip this file to get Armbian_20.10_Arm-64_focal_current_5.9.0.img
  • Launch Rufus, select the img. Click on ‘Start’. SD card will be formatted and content will be written.

Configuration of u-boot

  • In Windows Explorer, navigate to your SD card. You should see a structure a ‘extlinux’ folder, ‘dtb’, etc.
  • Rename the file ‘u-boot-s905x-s912’ to ‘u-boot.ext’

Configuration of device tree block

  • A Device Tree Block (DTB) is a file that contains important information about the target hardware (more info http://junyelee.blogspot.com/2015/07/a-tutorial-on-device-tree.html). So it is necessary to use the proper one. This is a tricky part and if an improper DTB is used, your target system will fail loading or the kernel will panic.
  • Edit the file /extlinux/extlinux.conf
  • Comment out all lines starting with FDT and APPEND (we don’t want RK or AW configuration, we are only interested in AML s9xxx section).
  • Uncomment ‘FDT /dtb/amlogic/meson-gxl-s905x-p212.dtb’ and ‘APPEND . ‘. See example below
  • Unplug the X96 Mini
  • Insert the SD card
  • Using a toothpick, small stick or whatever suitable, press on the ‘reset’ switch which is located inside the AV jack. You don’t need to press too hard.
  • While the reset switch is maintained pressed, plug the power. The X96 Mini screen will appear and normally after a few seconds, it should switch to the Linux boot.
  • You can release the reset switch. Linux should run if everything is properly configured.
  • I access it through SSH on port 22. It is of course recommended to change the default root password (root / 1234)

Installing Pi-Hole on the X96

First upgrade your system.

About 50 packages or so are upgraded.

It may fail by saying that your OS is not supported, just follow the instructions they provide in the error message in this case. I will not detail the complete installation, I used the default configuration step without doing any tweaking except giving the target IP address of my X96 on my network.

Configuration of router

  • Assign a static IP to the MAC address of your X96. This must match what you defined in the PI-hole configuration.
  • Switch the router to your new DNS server (as the primary). I left the secondary DNS server to my ISP default, just in case the X96 crashes or fails for whatever reason.
  • Disable ad-blocking in your browser and navigate to some heavy websites
Читайте также:  About windows 10 cortana

Adding some lists

Additional lists may be useful for Youtube adblocking, here is my configuration.

  • Wifi is not working. I did not investigate more as I don’t need it right now. Probably some (proprietary) Realtek drivers are needed from what I have read on the web.
  • You can attach a keyboard and mouse to the USB ports. The Logitech receiver is also working such that I could use my keyboard.

About

How to install a Linux (Armbian) on a cheap X96 Mini TV box. This can be used as an alternative to a Raspberry PI

Источник

probonopd / x96.md

Linux on x96 2GB/16GB TV box

CAUTION: When powering it via the VCC line on the internal serial connector, it probably needs 3.3V rather than 5V!

  • Khadas VIM — my device can run http://releases.libreelec.tv/LibreELEC-LePotato.arm-8.90.006.img.gz but only one USB port is working
  • Le Potato AML-S905X-CC — my device can run http://releases.libreelec.tv/LibreELEC-LePotato.arm-8.90.006.img.gz without even fiddling with dtb.img; both USB ports working
  • NanoPi K2
  • Build an image with https://github.com/khadas/fenix
  • Get WLAN running, e.g., using sudo insmod 8189es — works out of the box in CoreELEC-S905.arm-8.99.07.img.gz
  • OctoPrint using https://www.cnx-software.com/2017/07/11/how-to-use-octoprint-on-orange-pi-lite-board-amlogic-s905x-and-s912-tv-boxes/ — WLAN works there.
  • Webcam streaming using amvenc_avc

The bootloader (u-boot) is always started from EMMC /bootloader partition. If that one is non functional (empty), then it tries to load the bootloader from SD card, which needs to be prepared in a special way.

WARNING: This will render the device unbootable from the built-in memory! To empty the bootloader, dd if=/dev/zero of=/dev/bootloader or do it from u-boot via the serial console as described at https://docs.khadas.com/vim1/HowtoEraseEMMC.html#Serial-Mode-For-developers

BUT it seems that there is even a way to load u-boot from SD if there is already another u-boot installed on the machine. This is of course way safer to test things out. http://www.stane1983.com/index.php/2015/05/05/burning-img-file-to-amlogic-m8-devices-using-sdcard/ — TO BE TRIED. Basically you need to add a aml_sdc_burn.ini file in addition to the above. If it is there, then it should boot u-boot from SD!

Amlogic USB update tool using WorldCup Device protocol

Amlogic USB update tool is a command line program, with Windows version and Linux version. The usage of this tool is like fastboot , which can upgrade partition mirrors in PC command line. In addition, command sets of this tools is more rich than fastboot protocol. Update tool use protocol called WorldCup Device to talk with Amlogic board. Lite version WorldCup device protocol is built in Amlogic SOC, so you can boot Amlogic SOC from USB cable using Update tool.

Wayland Mali OpenGL acceleration

Will this help only for 3D graphics or also for video playback, e.g., in Chomium and GNOME Videos?

Kernel and U-boot source are available from the official Amlogic website :

Heavily changed 3.10/3.14 kernel for Android is available for up to GXM SoCs.

But since early 2017, a 4.9 port is also available for GXL and newer SoCs. New 4.9 kernel is used for «Linux» products, has support for Wayland Mali OpenGL acceleration.

(NOTE: Please support the OSMC project by buying an officially supported box from them.)

The OSMC project has Vero 2 (S805) and Vero 3 = Vero 4K (S905x) boxes which are similar to other Amlogic based designs.

We can compare the dts of the OSMC boxes with the dts of stock boxes to find possible differences. FOr example, by comparing https://github.com/osmc/vero3-linux/blob/master/arch/arm64/boot/dts/amlogic/gxl_p212_2g.dts to https://github.com/osmc/vero3-linux/blob/master/arch/arm64/boot/dts/amlogic/vero3_2g_16g.dts we can see that the partitioning scheme is the same.

The diff is minimal:

However, trying to flash a Vero 4K / 4K + image from https://osmc.tv/download/ boots but says it cannot install. Most likely it checks for the v4kflash=verify bootenv variable, according to https://github.com/osmc/osmc/blob/7d616de2e4609a7fb51b1dbc51825f62558d2549/installer/target/qt_target/qt_target_installer/utils.cpp#L185-L188

NOTE: The OSMC developer states that by renaming boot.img to recovery.img you can force it to boot from SD.

The following has been tested as root in LibreELEC.

I have also sucessfully done this in Golang.

Источник

Оцените статью