Difference between revisions of "EBC Exercise 04 Setup Scripts"

From eLinux.org
Jump to: navigation, search
m (Do only once per Linux host install)
m
 
(7 intermediate revisions by the same user not shown)
Line 5: Line 5:
  
 
Some of the things listed here have to be done only once, others are done every time you reboot, or more often.
 
Some of the things listed here have to be done only once, others are done every time you reboot, or more often.
 
== Do only once per Linux host install ==
 
The first time you set up a new Linux install on your host computer, edit the file '''/etc/hosts''' and add this at the end:
 
 
host$ '''sudo vi /etc/hosts'''
 
'''192.168.7.2 bone'''
 
 
Now rather than typing '''ssh debian@192.168.7.2''' you can just enter '''ssh debian@bone'''.  It saves lots of typing.
 
  
 
== Do when the bone is running a new image ==
 
== Do when the bone is running a new image ==
If you are running an SD card that's bigger than 4G, run:
 
host$ '''cd BeagleBoard/exercises/setup'''
 
host$ '''./grow_partition.sh'''
 
This will make the partition as large as possible, and then reboots.
 
  
There are a number of files I like to have on the Bone.  Rather than remember what they all are, I just put them in a script and run it on the host. Take a look at my '''install.sh''' script.
+
There are a number of files I like to have on the Bone.  Rather than remember what they all are, I just put them in a script and run it on the host. Take a look at my '''installStudent.sh''' script.
  
  host$ '''vi install.sh'''
+
  host$ '''cd exerciese/setup
 +
host$ '''nano installStudent.sh'''
  
 
You'll see things like
 
You'll see things like
 
* Setting the Bone's date to the host's date
 
* Setting the Bone's date to the host's date
* Copying the exercises to the bone rather than using git clone (much faster on a slow link).
+
* Turning off login messages
  
 
There is a line that starts with '''ssh root@$BONE "''' that runs all the following commands, up to the closing '''"''' on the bone.  These commands
 
There is a line that starts with '''ssh root@$BONE "''' that runs all the following commands, up to the closing '''"''' on the bone.  These commands
Line 35: Line 24:
 
and so on.
 
and so on.
  
Edit '''install.sh''' to install what you want.
+
Edit '''installStudent.sh''' to install what you want.  Then run it.
 
+
host$ '''./installStudent.sh'''
== Every time you boot the host ==
 
Every time I boot up the host I run:
 
  
host$ '''cd BeagleBoard/exercises/setup'''
+
== Proxy (Not needed at Rose) ==
host$ '''./ipMasquerade.sh ''eth0'' '''
 
 
 
Where ''eth0'' is the network interface you are using.  If you are wireless you may use '''wlan0''' instead.  This sets up you host to take internet requests from the Bone and send them to the internet.  That is, your Bone is masquerading as your host.
 
 
 
== Do this once after the Bone boots up ==
 
The install.sh script above does many things that only have to be done once after installing an image.  Here is what has to be done every time the Bone is booted up.
 
 
 
host$ '''cd BeagleBoard/exercises/setup'''
 
host$ '''cat firstssh.sh'''
 
host$ '''./firstssh.sh'''
 
 
 
When you look inside '''firstssh.sh''' you'll see it sets the Domain Name Server (DNS) on the Bone so it uses the host as a gateway and it sets the correct date.  Once that's done it ssh's over. 
 
 
 
If you always use firstssh.sh the Bone will always be on the network and have the correct date.
 
 
 
== Proxy ==
 
 
IIT Mandi uses a proxy, so the following might be needed
 
IIT Mandi uses a proxy, so the following might be needed
  
Line 83: Line 54:
 
  git config --global https.proxy https://10.8.0.1:8080
 
  git config --global https.proxy https://10.8.0.1:8080
  
== In summary ==
 
Normally the Bone is already set up, so all I do after booting the host is
 
 
host$ '''cd BeagleBoard/exercises/setup'''
 
host$ '''./ipMasquerade.sh eth0'''
 
host$ '''./firstssh.sh'''
 
  
and I'm logged onto the Bone and it has access to the Internet through my host.
 
  
 
{{YoderFoot}}
 
{{YoderFoot}}

Latest revision as of 10:47, 27 August 2020

thumb‎ Embedded Linux Class by Mark A. Yoder

Openlogo-50.png


This is a guide to the many scripts I've written that make getting the Bone running much easier. Do this after you have updated the OS and used git to get the support materials.

Some of the things listed here have to be done only once, others are done every time you reboot, or more often.

Do when the bone is running a new image

There are a number of files I like to have on the Bone. Rather than remember what they all are, I just put them in a script and run it on the host. Take a look at my installStudent.sh script.

host$ cd exerciese/setup
host$ nano installStudent.sh

You'll see things like

  • Setting the Bone's date to the host's date
  • Turning off login messages

There is a line that starts with ssh root@$BONE " that runs all the following commands, up to the closing " on the bone. These commands

  • Set up git
  • Copy over .bashrc
  • Set the timezone

and so on.

Edit installStudent.sh to install what you want. Then run it.

host$ ./installStudent.sh

Proxy (Not needed at Rose)

IIT Mandi uses a proxy, so the following might be needed

apt-get install dconf-tools
for proxy in ftp http https socks 
do
   echo $proxy 
   dconf write /system/proxy/$proxy/host "'10.8.0.1'"
   dconf write /system/proxy/$proxy/port "'8080'"
done

I don't know if this is needed on the Bone, but it's needed on the host to reach the Bone

dconf write /system/proxy/ignore-hosts "['localhost', '127.0.0.0/8', '192.168.7.0/8', '::1']"
dconf write /system/proxy/mode  "'manual'"
dconf write /system/proxy/use-same-proxy  "false"
dconf dump /system/proxy/  

export http_proxy=http://10.8.0.1:8080/
export https_proxy=https://10.8.0.1:8080/

From http://jjasonclark.com/how-to-setup-node-behind-web-proxy/

npm config set proxy http://10.8.0.1:8080
npm config set https-proxy http://10.8.0.1:8080

git config --global http.proxy http://10.8.0.1:8080
git config --global https.proxy https://10.8.0.1:8080





thumb‎ Embedded Linux Class by Mark A. Yoder