LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-20-2012, 08:00 AM   #1
Chiff
LQ Newbie
 
Registered: Dec 2010
Location: NSW, Australia
Distribution: Trying A Few
Posts: 21

Rep: Reputation: 0
Question Re: Script and Making it Executable


Hi,
I have a Asus UX31E laptop and this (below) is one of the fixes for
it. I have NO idea how to go about it. Can some one please give
step by step advice.

The source of the following is:
https://help.ubuntu.com/community/As...ok#BIOS_Update


Suspend, Hibernate, Shut-down and Reboot

The kernel USB 3.0 (and sometimes 2.0) modules needs to be unloaded before suspending, and in kernels prior to 3.1 X also needs to disable/enable DPMS to get the screen back on resume. Save the following script as /etc/pm/sleep.d/20_zenbook (and make it executable):

IconsPage/warning.png If this workaround not used, there have been reports that the laptop's memory controller setting may be screwed. After an incorrect suspend, if the corruption happens, many memory blocks starting with ~1G will be corrupt. Good way to see it is to use "memtest86+". The only way to fix controller setting is to open the case and plug off the battery. Please note that on this ultrabook the battery is not a user serviceable part and this could mean that by opening you can get your warranty void! If you start Windows or Linux with a corrupted controller, you will get system crashes or/and damaged file system. More info here: https://bugzilla.kernel.org/show_bug.cgi?id=42728 and https://bugs.launchpad.net/ubuntu/+s...ux/+bug/962798

For kernel 3.1 or newer (Ubuntu 12.04 LTS):

EHCI_BUSES="0000:00:1a.0 0000:00:1d.0"
case "${1}" in
hibernate|suspend)
# Switch USB buses off
for bus in $EHCI_BUSES; do
echo -n $bus > /sys/bus/pci/drivers/ehci_hcd/unbind
done
;;
resume|thaw)
# Switch USB buses back on
for bus in $EHCI_BUSES; do
echo -n $bus > /sys/bus/pci/drivers/ehci_hcd/bind
done
;;
esac


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
So how do you put this in a script file and make it executable so that it
runs each time the computer starts up? Does it still run if one uses a different desktop other than say Gnome? Will it work under em, XFCE or KDE?

Thanks heaps for the kind help.
 
Old 05-20-2012, 08:45 AM   #2
qweeak
LQ Newbie
 
Registered: Jan 2012
Posts: 24

Rep: Reputation: 2
My suggestion would be put that script in /etc/rc.local file.
 
Old 05-20-2012, 09:43 AM   #3
Chiff
LQ Newbie
 
Registered: Dec 2010
Location: NSW, Australia
Distribution: Trying A Few
Posts: 21

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by qweeak View Post
My suggestion would be put that script in /etc/rc.local file.
I understand copy and paste commands.

So I copy the text into a text editor

and then WHAT ???

What does one save it as eg: scriptfile.?
How does it run every time one boots ?
What is the difference between a text file and a Script file?

As this is a Major issue with the hardware why is not in the latest Kernel ?
The Asus UX31E has been out for some time. I would have thought that all the
fixes would be in the OS. Can someone please put them in and all the other
issues from the source page which is in the first message. THANKS HEAPS.

Sorry for the funny questions but if I don't ask I won't know and I'll bet
there are many on this board who don't know too whom this will help out.

THANKS heaps for your kind help.

Last edited by Chiff; 05-20-2012 at 09:48 AM. Reason: text addition
 
Old 05-20-2012, 01:20 PM   #4
qweeak
LQ Newbie
 
Registered: Jan 2012
Posts: 24

Rep: Reputation: 2
I'm not sure this will work, but worth trying. Try copying the specified contents into /etc/rc.local and reboot the lap. This file is executed every time the system is booted.

What is the difference between a text file and a Script file?

script file does some action for you. It usually have permission of 755. Text file simply stores data for you.

As this is a Major issue with the hardware why is not in the latest Kernel ?

I don't think this is a kernel issue. You should ask the Ubuntu guys about this.
 
Old 05-20-2012, 04:09 PM   #5
Chiff
LQ Newbie
 
Registered: Dec 2010
Location: NSW, Australia
Distribution: Trying A Few
Posts: 21

Original Poster
Rep: Reputation: 0
What file extension do I use? .txt or ???
 
Old 05-20-2012, 05:27 PM   #6
xjonquilx
Member
 
Registered: Jul 2011
Location: FL, USA
Distribution: Linux Mint 13
Posts: 169

Rep: Reputation: Disabled
For a script you use the extension .sh

For a text file you use the extension .txt

You also need to make that script executable.

chmod +x /path/to/script.sh
 
Old 05-20-2012, 06:52 PM   #7
Chiff
LQ Newbie
 
Registered: Dec 2010
Location: NSW, Australia
Distribution: Trying A Few
Posts: 21

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by xjonquilx View Post
For a script you use the extension .sh

For a text file you use the extension .txt

You also need to make that script executable.

chmod +x /path/to/script.sh
Thanks.

What directory do I save the script in ?
 
Old 05-20-2012, 07:33 PM   #8
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
The page you linked to tells you where to save the script and what to name it. It should be in the directory /etc/pm/sleep.d/ and be named 20_zenbook.
You can create it by typing the following in a terminal:
Code:
sudo gedit /etc/pm/sleep.d/20_zenbook
Then pasting the code and saving the file. To make it executable you can type the following in a terminal:
Code:
sudo chmod +x /etc/pm/sleep.d/20_zenbook
 
Old 05-21-2012, 07:11 PM   #9
Chiff
LQ Newbie
 
Registered: Dec 2010
Location: NSW, Australia
Distribution: Trying A Few
Posts: 21

Original Poster
Rep: Reputation: 0
Thanks heaps for your kind help.
 
Old 05-21-2012, 07:14 PM   #10
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
You're welcome. If your problem is solved, please remember to mark the thread solved.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Making windows executable cygwin scripts sarenace Programming 10 05-11-2012 10:05 PM
Making everything executable problems installing and downloading mandibabe83 Linux - Newbie 18 11-13-2010 04:24 AM
[SOLVED] making script executable rabiticide Linux - Software 3 09-08-2009 09:41 PM
making script executable; getting no such file or directory madwida Slackware 4 10-08-2008 09:19 AM
Making an executable/path into a command kc0ltv SUSE / openSUSE 2 01-22-2006 01:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration