Linux on ARM-based IGEPv2
Jun. 14th, 2012 02:23 pmНекоторое время назад довольно много времени потратил на установку Linux и его последующую настройку на плате IGEP v2

Поскольку я Linux знаю довольно слабо (и более того, не особо горю желанием его осваивать сверх необходимого минимума - ну не интересно это мне), то изрядно потоптался по граблям. Судя по Гуглу, не я один такой (причем большинство из найденных ссылок не помогает), так что решил описать все, что делал. Чтобы не писать два раза, дальше будет на английском.
What is the goal? To get platform with Linux, OpenCV, QT and drivers to PTGrey Camera.
00)This board has Poky Linux in internal memory but I don`t like it. That is why I decided to install Linaro distributive.
0)For the beginning I suppose that you connected board with monitor via HDMI, and keyboard/mouse via USB. And you have ethernet cable with internet also connetcted to IGEPv2.
1)Instead of HDD IGEPv2 uses microSD cards. I used good step-by-step tutorial http://labs.isee.biz/index.php/How_to_boot_from_MicroSD_Card
It is better than Linaro tutorial http://labs.isee.biz/index.php/How_to_get_the_Linaro_distribution, because
No password is bad (for example if you will work via ssh) that is why you have to set one.
Type "passwd", press Enter, and then 2 times new password.
!!!)Type "sudo apt-get update" to get package lists from server.
3)type "sudo apt-get install nano" to install text-editor nano that uses no GUI, widows or mouse. That is why you can use it in console and ssh, for example. Linaro already have vim but it is too complicated for me.
To open file with nano, type in console "nano file_name". To save file, press Ctrl+O, to quit Ctrl+X.
4)If you haven`t another monitor and use one from your home computer, it is very useful to communicate with a board via ssh from your home computer.
If you type "ssh localhost" you`ll have error message:
>ssh: connect to host localhost port 22: Connection refused
That is because Linaro-nano has ssh-client tools, but haven`t server ones. That is why type
"sudo apt-get install openssh-server"
After installation, open ssh-server-config file with command "sudo nano /etc/ssh/sshd_config"
search for this lines:
upd. My friend wrote how to complile another Linux distributive there.
Поскольку я Linux знаю довольно слабо (и более того, не особо горю желанием его осваивать сверх необходимого минимума - ну не интересно это мне), то изрядно потоптался по граблям. Судя по Гуглу, не я один такой (причем большинство из найденных ссылок не помогает), так что решил описать все, что делал. Чтобы не писать два раза, дальше будет на английском.
What is the goal? To get platform with Linux, OpenCV, QT and drivers to PTGrey Camera.
00)This board has Poky Linux in internal memory but I don`t like it. That is why I decided to install Linaro distributive.
0)For the beginning I suppose that you connected board with monitor via HDMI, and keyboard/mouse via USB. And you have ethernet cable with internet also connetcted to IGEPv2.
1)Instead of HDD IGEPv2 uses microSD cards. I used good step-by-step tutorial http://labs.isee.biz/index.php/How_to_boot_from_MicroSD_Card
It is better than Linaro tutorial http://labs.isee.biz/index.php/How_to_get_the_Linaro_distribution, because
- you will know how your board boot works;
- you can use larger SD (8-16-32 Gb);
- it is almost as fast as getting ready image.
No password is bad (for example if you will work via ssh) that is why you have to set one.
Type "passwd", press Enter, and then 2 times new password.
!!!)Type "sudo apt-get update" to get package lists from server.
3)type "sudo apt-get install nano" to install text-editor nano that uses no GUI, widows or mouse. That is why you can use it in console and ssh, for example. Linaro already have vim but it is too complicated for me.
To open file with nano, type in console "nano file_name". To save file, press Ctrl+O, to quit Ctrl+X.
4)If you haven`t another monitor and use one from your home computer, it is very useful to communicate with a board via ssh from your home computer.
If you type "ssh localhost" you`ll have error message:
>ssh: connect to host localhost port 22: Connection refused
That is because Linaro-nano has ssh-client tools, but haven`t server ones. That is why type
"sudo apt-get install openssh-server"
After installation, open ssh-server-config file with command "sudo nano /etc/ssh/sshd_config"
search for this lines:
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
If they are commented (like #X11Forwarding yes, erase "#"). That save file and restart server with "sudo /etc/init.d/ssh restart".
5)Than, if you want to use sometimes GUI-based apps (or you want write them yourself), type
"sudo apt-get install xorg" that will install X11 tools.
After installation type "startx".
If all is OK, you`ll see black screen with command line typed by other font (or Gnome-session desktop)
You can open this screnn by pressing Ctrl+Alt+F7 or see console output by pressing Ctrl+Alt+F2.
If you see just black screen in 7-th screen and error "no protocol specified" in 2-nd screen, then open other console (Ctrl+Alt+F3), type "rm ~/.Xauthority" and then "xhost +", "xauth $DISPLAY". (Ctrl+C for exit)
Then type "xcalc". It has to be ok and you`ll see calculator window.
If you see error "Failed to initialize for relative axes", but X11 works, it is OK.
6)Type "ifconfig" to get information about your IP-adress (connection eth0, my IP was 192.168.1.4).
7)Type "sudo poweroff" for shutdown board ("sudo reboot" for restart)
8)Disconnect board monitor/mouse/keyboard (but RJ45 remains) and connect them back to your home computer. If you use Windows, start putty and connect via ssh port 22) using board IP-adress (i.e. 192.168.1.4). If all is OK, you can use board in console mode this way.
If you use Linux, type "ssh -X linaro@192.168.1.4" (use board IP-adress instead 192.168.1.4) and type password.
If all is OK, then you can use not only command line interface, but GUI-based apps too. To test it, type "xcalc". You`ll see calculator window on your desktop. If no, in your home computer type "sudo nano /etc/ssh/ssh_config" and find lines like
"ForwardX11 yes
If they are commented (like #X11Forwarding yes, erase "#"). That save file and restart server with "sudo /etc/init.d/ssh restart".
5)Than, if you want to use sometimes GUI-based apps (or you want write them yourself), type
"sudo apt-get install xorg" that will install X11 tools.
After installation type "startx".
If all is OK, you`ll see black screen with command line typed by other font (or Gnome-session desktop)
You can open this screnn by pressing Ctrl+Alt+F7 or see console output by pressing Ctrl+Alt+F2.
If you see just black screen in 7-th screen and error "no protocol specified" in 2-nd screen, then open other console (Ctrl+Alt+F3), type "rm ~/.Xauthority" and then "xhost +", "xauth $DISPLAY". (Ctrl+C for exit)
Then type "xcalc". It has to be ok and you`ll see calculator window.
If you see error "Failed to initialize for relative axes", but X11 works, it is OK.
6)Type "ifconfig" to get information about your IP-adress (connection eth0, my IP was 192.168.1.4).
7)Type "sudo poweroff" for shutdown board ("sudo reboot" for restart)
8)Disconnect board monitor/mouse/keyboard (but RJ45 remains) and connect them back to your home computer. If you use Windows, start putty and connect via ssh port 22) using board IP-adress (i.e. 192.168.1.4). If all is OK, you can use board in console mode this way.
If you use Linux, type "ssh -X linaro@192.168.1.4" (use board IP-adress instead 192.168.1.4) and type password.
If all is OK, then you can use not only command line interface, but GUI-based apps too. To test it, type "xcalc". You`ll see calculator window on your desktop. If no, in your home computer type "sudo nano /etc/ssh/ssh_config" and find lines like
"ForwardX11 yes
ForwardX11Trusted yes".
If 'no' or commented - correct.
Next time I`ll write about installing OpenCV libraries and Qt.
If 'no' or commented - correct.
Next time I`ll write about installing OpenCV libraries and Qt.
upd. My friend wrote how to complile another Linux distributive there.
no subject
Date: 2012-06-14 04:19 pm (UTC)Обожаю!
Ничегошеньки не понятно было сразу, но я все-таки зашла под кат, усугубить, так сказать)))
no subject
Date: 2012-06-14 04:30 pm (UTC)no subject
Date: 2012-06-16 09:22 am (UTC)no subject
Date: 2012-06-14 08:43 pm (UTC)no subject
Date: 2012-06-14 08:52 pm (UTC)no subject
Date: 2012-06-16 06:35 pm (UTC)Я бы посоветовал вместо описания чего делаем+команда отдельно описание, а с новой строчки команда, с описанием пользователя и/или права доступа, к примеру:
linaro@названиемашины:~$
а если root:
root@названиемашины:~#
таким образом лучше написать вот так:
Shutdown board:
$ sudo poweroff
or restart it:
$ sudo reboot
под рутом:
# poweroff
# reboot
Так пишут инструкции практически ко всем *nix системам и заинтересованным людям будет проще понять чего ты делаешь.
https://wiki.archlinux.org/index.php/Disable_root_password_and_gain_su_sudo_with_no_password#Disable_root_login - так тут к примеру пишется
for log-in screen via tty - наверное, имел ввиду putty? Или а то tty есть команда, но о ней далее ни слова. Или ты как всё семейство телетайпов имеешь ввиду?
В целом, мне понравилось описание. Я все понял чего делаешь и для чего. И X11 через ssh - это круто. Я еще не пробовал)
А какая файловая система используется на sd-карточках? Чем тебя не устроил Poky? Для чего вообще будет плата? Для чего Qt используется? Она же тяжеловесна для ARM вроде бы.
no subject
Date: 2012-06-16 07:07 pm (UTC)Но большую часть я таки отклоню, ибо писал для таких же чайников как я был недавно. Но все равно большое спасибо, если буду писать для другой аудитории - обязательно учту.
Линукс вместо линаро линукс - ибо про линаро я узнал только потом. Ну а если человек будет пользоваться моим мануалом - то он будет ставить именно линаро, где apt-get есть, а уж никак не генту :)
Про $ и #: я специально их не пишу :) Ибо опять же, писал для чайников, а я в первые разы копировал команды с долларом или решеткой, а потом долго удивлялся, почему же они не работают. Т.е. "так пишут все, кто хоть чуть-чуть разбирается", а я пишу не для них :)
tty - да, имелось в виду все семейство. Файловая система - да какую сделаешь, обычно ext4.
Poky не устроил минимализмом и тем, что многого из того, к чему я привык, там нет.
Qt нужен затем, что в моей программе надо отображать окошки с видеопотоком и распознанными объектами - раз. Два - потому что надо проверять разные настройки алгоритма, а мне привычней делать это через GUI, а не командную строку.
Когда будет, так сказать, релизная версия, я все уберу и никакого Qt и X11 мне не будет нужно. А тяжеловесна для ARM скорее не Qt, а сама задача обработки изображения и распознавания. Но я надеюсь сделать все на целочисленных операциях и задействовать встроенный DSP.
no subject
Date: 2012-06-16 07:46 pm (UTC)окошки с видеопотоком и распознанными объектами - а это наверняка OpenCV. Круто)
Да, в таком случаи мой комментарий на счет Qt полный бред) Я тут как раз решил восполнить свой пробел в знаниях *nix OS, поэтому с большим интересом прочитал)
Я только что еще раз по спецификации пробежал - на плате три процессора? DM3730, ARM Cortex A8 и C64+ DSP? Я пока вообще непредставляю, как это все добро тогда вместе работает) Главный А8?
Я во время учебы DSP так и не пощупал) Успехов, успехов и еще раз успехов!
no subject
Date: 2012-06-16 08:37 pm (UTC)ARM Cortex A8 - это только архитектура, сама фирма не производит процессоров, а только разрабатывает их и продает лицензии. DM3730 - собственно и есть реализация от TI. Ну а DSP, он и в Африке DSP, просто не отдельным блоком, а сразу на плате стоит.
За пожелание удачи спасибо :) Ну а про Qt и OpenCV скоро еще один пост будет.