ARM for ubuntu.docx
《ARM for ubuntu.docx》由会员分享,可在线阅读,更多相关《ARM for ubuntu.docx(14页珍藏版)》请在冰点文库上搜索。
ARMforubuntu
So,thiswasquiteabitmorelengthythanIhoped.Nevertheless,Ithinkthisisworthsharing.ImadeallthiswithmyoldtrustynetbookandtheBBBconnectedviaHDMItoanexternalmonitor(theoretically,youcouldcreateascripttosetupeverythingforyou,butIdon'tknowhowtodothat...yet),andcoupledwithitsownkeyboardandmousethefirsttime,thenIrealizedIcouldhaveusedSSHfromtheverybeginning(howdullofme)controllingtheBBBwithmycomputer.Youwillalsoneedafastmicrosdcard,4GBattheveryleast(and32GBatmost,Istronglyrecommendatleast8gb,class10)tosetupUbuntuARM.Toinstallthings,aninternetconnectionisrequired.YoucoulduseanEthernetcable,butpersonallyIhadaccesstoaUSB-StickWirelessNetworkAdapterbyCISCO/Linksysthatworkedrightaway.
Inshort,makesureyouhavethefollowing:
IfyouaregoingtouseSSH:
4GB(ormore,Irecommend8gbclass10)SDcard(andthesdcardreaderfortheimaginginyourPCwithUbuntu)
EthernetCable(orWifiUSBadapter)andinternetconnection
Plentyoftimeandpatience(timebeingthemostimportant,Iwarnyou)
IfyouwantgraphicaloutputfromtheBBB,tocontrolit"directly",add:
MicroHDMIcable(andtheHDMIMonitororTV,ofcourse)
USBHub(connectedtotheBBB)
Keyboard(inthehub)
Mouse(Ifyouwishtousethegraphicalenvironmentrightaway.Iusedawirelessonewithoutproblem,connectittothehub)
So,letsbeginwiththis.ThereisanalternativewaytoinstallROS,usingAngstrom,coveredbyVictorMayoralVilches(don'tknowhim),onhisblog:
.Ihavenottriedit,butwilldosometime.
1.-Preparethesdcardforimaging
Modifiedfromhttp:
//elinux.org/BeagleBoardUbuntu
Using:
"Method1:
DownloadaCompletePre-ConfiguredImage",downloadapremadeimageofQuantal12.10armhf.12.10beingimportant,asitisthelatestUbuntuversionsupportedbyROS.
Inmycase,Iextractedthefilesforubuntu-12.10-console-armhf-2013-07-22.Becarefulwhenimagingthecard,youmustbeabsolutelysurethatthesdXyouareusingistheRIGHTone(orrisktrashingyourcomputerdata).Positionyourselfviatheterminalinsidethefolderoftheextractedpremadeimageandenter:
sudo./setup_sdcard.sh--probe-mmc
Thisshowedmethatmysdcardwasinsdb,then,Iused:
sudo./setup_sdcard.sh--mmc/dev/sdb--ubootbone_dtb
Whenfinished,justputtheSDcardintheslotoftheBBB,andpoweritonwiththeUSBCableandyourPC.Thedefaultuserisubuntuandthepassistemppwd
2.-ConfigureSSH
Ifforsomereasonyouneedspecialconfiguration,do:
OntheBBB,enterintheterminalorcommandline:
sudonano/etc/ssh/sshd_config
AndfollowtheinstructionsoftheConfigurationsectionofbutLEAVEtheportas22.Thendo:
sudo/etc/init.d/sshrestart
Ifyoudonotneedspecialconfiguration,justdo:
OnyourPC,gotohttp:
//beagleboard.org/Getting%20Startedandlookformkudevrule.sh.Downloadit,makethefileexecutableandrunitwithsudo.Seeifneeded,andthenreboot.
MakesureyouareconnectedtothenetworkcreatedbytheBBBviatheUSBcable,inmycase,it'snamed"Wiredconnection2"andappearsasanEthernetNetwork(CircuitcoBeagleBoneBlack).Youcouldsetupthenetworkmanuallyifneeded,likeinbutIfounditunnecessary(also,don'tfollowtheinstructionsinthatlink,it'sfortheRaspberryPiandFedora).
Ifsuccesful,youshouldbeabletodo:
ping192.168.7.1
ping192.168.7.2
AndgetaresponsefromtheBBB.OnyourPC,updatethe/etc/hosts(sudonanoblablabla)file,addingtheline:
192.168.7.2arm
tothelistofknownhosts.YoushouldhavetheSSHserverandclientinstalledalready,ifindoubt,see.Thus,youcouldnowdo:
pingarm
OnyourPC(youmayneedtorebootitagain,Idon'treallyremember),enterinaterminal:
sudoufwallow22
sshubuntu@arm
I'mnotsureifthefirstlineisreallyneccesary,seenin.
Thenenterthepasstemppwd,andyouwillbeconnectedviaSSHtotheBBB,viatheUSBcable.Ifworriedaboutsecurity,see.
3.-Configurethewifiadapter(ifnotusingethernet)
Ifyoudon'tmind,youcanconnecttotheBBBviaSSHrightaway,anddoeverythingonyourcomputer,seestep1ifyouneedtoconfiguretheSSHconnectionfromtheBBBitself.IsuggestusingSSHsoyoudon'thavetobotherwithHDMI,keyboard,etc.YouneedtosetupthehostsfileonyourcomputersoitincludestheBBBipandnamekey-valuepair,and"install"thedriverscriptfromtheBBBwebpage.
TheBBBwillaskyouforalogin,enterubuntu(theuser)andthethepasswordtemppwd.Youarenowatubuntu@arm.Inthesectionnamed"UbuntuSoftware"athttp:
//elinux.org/BeagleBoardUbuntuthereisanexampleoftheinterfaceconfigurationfile(seehttp:
//ubuntuforums.org/showthread.php?
t=202834formoredetail).Iused:
sudonano/etc/network/interfaces
Inmycase,IhadaWPA-2publicssidAESencryptedpersonalDHCPnetwork,thusaftertheWifiExamplecommentsIentered:
autowlan0
ifacewlan0inetdhcp
wpa-driverwext
wpa-ssidINFINITUM1234
wpa-ap-scan1
wpa-protoRSN
wpa-pairwiseCCMP
wpa-groupCCMP
wpa-key-mgmtWPA-PSK
wpa-psk...
Again,seehttp:
//ubuntuforums.org/showthread.php?
t=202834formoredetails.INFINITUM1234beingthenameofmywirelessnetwork.Togetthepassphrase,exitnano(savingchanges)andenterintheterminal:
wpa_passphraseyour_essidyour_ascii_key
Letssay(asanexample)thatIused:
wpa_passphraseINFINITUM12341234567890
Writedown(ifnotusingSSH,sorryforthat...butyoucouldjustuseSSH,orEthernetyouknow,orfinishthislaterwithaGUI)thelongstringoflettersandnumbersgeneratedafterpsk,andupdatethewpa-psklinein/etc/network/interfaceswiththestring.Finally,reboot:
sudoreboot
4.-Configurethekeyboardlayout(ifyoursisnotUSstandardandyouareusingtheBBB"directly")
IusedaSpanish(Spain)keyboard.Toconfigureit,followtheinstructionsat
sudoapt-getupdate
sudoapt-getinstallconsole-data
Hitenterwhenshowed"Configuringconsole-data",andthenuse:
sudodpkg-reconfigurekeyboard-configuration
Selectanappropriatekeyboardandthedesiredlanguage.Leaveotheroptionsunchanged.
5.-StarttheGraphicalEnvironment(ifsoyouwish)
Sameuserasubuntuandpassastemppwd.Refertohttp:
//elinux.org/BeagleBoardUbuntuunderthesubsection"Raring13.04armhf".Positionyourselfinside/boot/uboot/tools/ubuntu/(notreallyreallyneeded)andrunthescriptsmall-lxde-desktop.shwithsudo:
cd/boot/uboot/tools/ubuntu/
sudo./small-lxde-desktop.sh
Willtakeawhile,around30minutesforme.Thenreboot.Useagainubuntuasuserandtemppwdaspassword.Forsomereasonthemousewillbe"hidden"eventhoughtit'sstillthere.YoucanaccessaterminalinStart/System_Tools/XTerm
IfyouwantLubuntu(thecorepart,installappslater),youwillneedan8gbcardorbigger,use:
sudoapt-getupdate
sudoapt-getinstalllubuntu-core
Thiswilltake1-2hourstofinish.
6.-ConfigureTightVNC
IusedVinagre(RemoteDesktopViewer)onmylaptopwithUbuntu13.04.Iinstalleditviathesoftwarecenter.
Wewilluseavariationof.OntheBBB(eitherdirectlyonitorviaSSH,IpreferSSH),enterinaterminalorcommandline:
sudoapt-getupdate
sudoapt-getinstallaptitude
sudoaptitudeinstalltightvncserver
tightvncserver:
1
I(maybefoolishly,butwhatever)puttemppwdasthepasswordforVNCtoo.Donotcreateaview-onlypassword.Then,ontheBBB:
tightvncserver-kill:
1
nano~/.vnc/xstartup
AndaddthislineattheendofthefileifusingsmallLXDE:
lxterminal&/usr/bin/lxsession-sLXDE&
IfusingLubuntu,erasetheline/etc/X11/Xsession,andadd:
/usr/bin/startlubuntu&
Again,ontheBBB:
tightvncserver:
1
Starttheremotedesktopviewer,andconnectviaVNCto192.168.7.2:
1,enterthepasstemppwd,andyouwillgettheremotedesktop.Youcanchangetheresolution,ontheBBB:
tightvncserver-kill:
1
tightvncserver:
1-geometry800x600-depth16-pixelformatrgb565:
AndconnectagainwithRemoteDesktopViewer.That'sallforthebasics.Asyoumaysee,thethemedoesnotbehaveswellrightnow,don'tknowhowtofixit,butitseemsperfectlyusable,ifbarebones.Personally,IthinkthatyoushouldusetheVNCasalastresort,asit'sheavyandresourceconsuming.Killtheserverwhenfinished:
tightvncserver-kill:
1
ToruntheVNCattheBBBstartupwithsmallLXDE,doontheBBB:
sudonano/etc/init.d/tightvncserver
Andcopyandpaste(takenfrom):
#!
/bin/sh
###BEGININITINFO
#Provides:
tightvncserver
#Required-Start:
$local_fs
#Required-Stop:
$local_fs
#Default-Start:
2345
#Default-Stop:
016
#Short-Description:
Start/stoptightvncserver
###ENDINITINFO#Moredetailssee:
#Customizethisentry
#SettheUSERvariabletothenameoftheusertostarttightvncserverunder