Notices

Water Fountain General Chit/Chat

Reply
 
LinkBack Thread Tools
Old 04-08-07, 09:58 PM   #1 (permalink)
Aximsite Hall of Fame
 
aximbigfan's Avatar
 
Join Date: May 2005
Posts: 9,197
Thanked 0 Times in 0 Posts
Blog Entries: 1
any linux experts here?

ok, basically, i have started doing a lot of my programming in linux. the only thing is that inorder to untar and compile the source tree, it takes quite a few steps. so figured that i would make a simple script file to do a few things:
0.cd to the desktop
1. untar the source tree
2.alert me that the untar is done and that i can start edititing the source tree.
3. change to root (sudo su)
4. cd (to go root)
5. copy the toolchain (which was untarred along wit the image source) to /opt/
6.copy the source tree to opt
5. create a symbalic link (below for details)
6. edit the PATH var.
7. cd to /opt/nasoc/src/apps/
8. print a line of text telling me that the compile is about to happen.
9. make image-Oxford

now, what i did when i first got involved with this is i typed up a list of commands i needed to exicute to comple. thses are:

1. # cd /home/chris/Desktop/
2. # tar xvfz Oxford_GPL_1256_a.tar.gz
3. # sudo su
4. # cd
!!- mod f/w now -!!
5. # cp -R /home/chris/Desktop/opt/brcm/ /opt/
6. # cp -R /home/chris/Desktop/nasoc/ /opt/
7. # ln -s /opt/brcm/hndtools-mipsel-linux-3.0/ /opt/brcm/hndtools-mipsel-linux
8. # export PATH=$PATH:/opt/brcm/hndtools-mipsel-linux/bin/
9. # cd /opt/nasoc/src/apps/
10. # make image-Oxford

normally, i just copy and paste these line by line into the terminal window, but i would liek a bit more automated prosses.

so far i have 2 scripts, one untars the source tree, and one executes the commands leading up to the compile.

script one:
#!/bin/sh
#this is a script to untar the 1256 source tree. this is version 0.00X and 1/2 scripts.
cd /home/chris/Desktop/
tar xvfz Oxford_GPL_1256_a.tar.gz

script 2:
#!/bin/sh
#this is a script to start the compile. this is version 0.00X and is script 2/2.
sudo cp -R /home/chris/Desktop/opt/brcm/ /opt/
sudo cp -R /home/chris/Desktop/nasoc/ /opt/
sudo ln -s /opt/brcm/hndtools-mipsel-linux-3.0/ /opt/brcm/hndtools-mipsel-linux
sudo export PATH=$PATH:/opt/brcm/hndtools-mipsel-linux/bin/
sudo cd /opt/nasoc/src/apps/
sudo make image-Oxford

now, in script 2 i had to put a sudo before eatch command becosue if i tryed to put a sudo su before all of them, the terminal would prompt me for my password, then terminate.


chris
aximbigfan is offline   Reply With Quote
Sponsor Ads
Old 04-08-07, 10:34 PM   #2 (permalink)
Aximsite Elite
 
Join Date: Jun 2005
Posts: 3,250
Thanked 0 Times in 0 Posts
Restart it, maxfangibi, restart it...
Jukov is offline   Reply With Quote
Old 04-09-07, 09:35 AM   #3 (permalink)
Aximsite Veteran
 
CodeBubba's Avatar
 
Join Date: Jan 2005
Location: DeLand, FL
Posts: 1,924
Device: Moto-Q 9C
Carrier: Verizon Wireless
Thanked 8 Times in 8 Posts

Awards Showcase
Aximsite Active Silver Member 
Total Awards: 1

I'd use Visual Studio myself - but that ain't gonna work in Linux.

-CB :)
CodeBubba is offline   Reply With Quote
Old 04-09-07, 09:50 AM   #4 (permalink)
Aximsite Veteran
 
breley's Avatar
 
Join Date: Dec 2005
Location: SW Ohio
Posts: 2,236
Device: HTC Fuze
Carrier: AT&T
Thanked 35 Times in 31 Posts
Blog Entries: 1

Awards Showcase
Aximsite Active Silver Member Aximsite Bronze Tutorials Admin Medal Aximsite Gold Contributors Aximsite Gold Reviews Top Notch MyPDA Reviewer Medal Aximsite Bronze Contributors 
Total Awards: 10

Originally Posted by aximbigfan View Post
now, in script 2 i had to put a sudo before eatch command becosue if i tryed to put a sudo su before all of them, the terminal would prompt me for my password, then terminate.


chris
Did you configure /etc/sudoers to allow your user access to the command(s) requested, something like this example?

I'm no linux script expert, so I'm not sure how much help I can be, but I vaguely remember something like having to do that in some cases.

Also, what about creating a shortcut to the script file and set a "run as" parameter?
__________________
breley | Aximsite/Mobility Site Review Staff, Administrator | Judge, Smartphone & Pocket PC Best Software Awards 2008
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.



breley is offline   Reply With Quote
Old 04-09-07, 05:09 PM   #5 (permalink)
Aximsite Veteran
 
DaLabrador's Avatar
 
Join Date: Jun 2006
Posts: 1,173
Device: Nokia 5310
Thanked 5 Times in 5 Posts
* To spawn a superuser shell (Just a little tip. Nothing important ):
sudo -s (very similar to sudo su)

(I'm guessing that you want to extract the files and edit them as user chris so you really want 2 separate scripts)

* create the 2nd script without the "sudo " stuff,
chmod +x script2 (I'll guess you already knew that)
* This is how you execute the script as root (you can have a shell window open so you'd not have to type in your password all the time):
sudo ./script2 (Execute "script2" located in the present directory)
__________________
  1. Be Kind.
  2. Have fun.
DaLabrador is offline   Reply With Quote
Old 04-12-07, 01:59 AM   #6 (permalink)
Aximsite Hall of Fame
 
aximbigfan's Avatar
 
Join Date: May 2005
Posts: 9,197
Thanked 0 Times in 0 Posts
Blog Entries: 1
Originally Posted by DaLabrador View Post
* To spawn a superuser shell (Just a little tip. Nothing important ):
sudo -s (very similar to sudo su)

(I'm guessing that you want to extract the files and edit them as user chris so you really want 2 separate scripts)

* create the 2nd script without the "sudo " stuff,
chmod +x script2 (I'll guess you already knew that)
* This is how you execute the script as root (you can have a shell window open so you'd not have to type in your password all the time):
sudo ./script2 (Execute "script2" located in the present directory)
i figured you would pich in and help mr GNU logo av....
i will try these when i have a chnace ot get on my devel os...


chris
aximbigfan is offline   Reply With Quote
Reply

Tags
experts, linux

Sponsor Ads

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
tomTom experts? andyw GPS Talk 3 03-30-06 03:04 PM
WPA question for the experts kungfuafrican WiFi Talk 8 03-06-05 11:16 AM
PPXK3 experts PDA_X5 Applications and Utilities 14 02-12-04 09:43 PM
tAgenda experts... Alan X5 Forums 0 03-17-03 06:16 PM


All times are GMT -5. The time now is 09:24 PM.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Copyright © 2003-09 LeckMedia, LLC