LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).

Notices


Reply
  Search this Thread
Old 03-11-2012, 06:54 AM   #1
edbarx
Member
 
Registered: Sep 2010
Distribution: Used Debian since Sarge. (~2005)
Posts: 373

Rep: Reputation: 21
Need to create a custom init script to override a bug.


I have the Acer Aspire 7715z laptop which has the long overdue backlight bug. I reported this bug in June 2011 to debian.org and to freedesktop.org but it is still unresolved. However, in the meantime, I found a workaround that I wish to include in an init custom script which need to be run after udev populates /dev. This bug does not manifest itself under kernels < 2.6.38. I am writing because I need to be able to upgrade my linux-image (ie vmlinuz-*) whenever I upgrade my major version of GNU/Linux.

Please, note that this bug is not distribution specific as it is a bug entirely caused by the linux-kernel.

What should I do to create a custom init script and package it as a .deb package to allow dpkg -i to install it?
 
Old 03-14-2012, 05:51 AM   #2
FrankP
Member
 
Registered: Aug 2003
Location: Britain
Distribution: AntiX, Debian, Gentoo
Posts: 65

Rep: Reputation: 18
Hi, well done for finding the workaround.

A new init script should go in /etc/init.d and needs to respond to the arguments 'start', 'stop' and 'restart'. Then you would create symlinks to it from the runlevel directories rc*.d so that it will be run on startup at its place in the sequence of other scripts.

Alternatively, instead of a new script it might be easier to add your fix as a patch to one of the existing init scripts - then if there was a new version after an upgrade you would re-patch the newly installed version.

I'm not sure if your question is "how to write the script" or "how to install it when it's done"? So, apologies if I'm telling you what you already know because I wasn't sure where to start. Once it's written and running on your system, packaging will be a later step.
 
Old 03-16-2012, 01:44 PM   #3
edbarx
Member
 
Registered: Sep 2010
Distribution: Used Debian since Sarge. (~2005)
Posts: 373

Original Poster
Rep: Reputation: 21
The patch needs to run immediately after udev populates /dev because it is at that point that the backlight is switched off. I think, your idea of inserting my patch at the end of udev's script is the best option that I may have at the moment.

Thanks.
 
Old 03-16-2012, 05:21 PM   #4
rigor
Member
 
Registered: Sep 2003
Location: 19th moon ................. ................Planet Covid ................Another Galaxy;............. ................Not Yours
Posts: 705

Rep: Reputation: Disabled
Hi edbarx,

Sorry but, since "patch" can be used in different ways, and especially since you've said
Quote:
upgrade my linux-image (ie vmlinuz-*)
but didn't appear to specify the exact nature of the workaround, I'm not entirely clear what procedure you expect to follow.

If by "upgrade" you mean replace the vmlinuz-* file, then you would usually need to re-start the kernel in some way, after the "patch", before the patch would have any effect. If that's what you intended, that sounds like a clever idea to automate the patch process. But, I suspect you probably would not want to replace the file containing the running kernel as such, instead you'd want to provide a different kernel file to run, after a re-start. Yet handling that with an init-script, you'd probably want to be very sure that the init-script did the "patch", only once after the first re-start of the kernel, in response to an upgrade to the major version of GNU/Linux. Otherwise you could create a so called "infinite loop" of kernel re-starts.

If instead, you are are talking about changing values in kernel memory for a kernel that's already running, without re-starting the kernel after the changes, you'd need to be very sure that you were changing values that either didn't need to effectively be copied to somewhere else in kernel memory, or hadn't already been copied, and also could be accessed safely at that exact moment.
 
Old 03-21-2012, 05:50 PM   #5
edbarx
Member
 
Registered: Sep 2010
Distribution: Used Debian since Sarge. (~2005)
Posts: 373

Original Poster
Rep: Reputation: 21
For simple commands placing them in /etc/rc.local is enough. This is what I did and it worked.
 
  


Reply



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
Need help installing a custom init script. edbarx Linux - General 2 09-26-2011 02:10 AM
Problems with logging the output of a custom daemon with a custom init script d1s4st3r *BSD 3 04-30-2010 04:46 AM
custom init.d script will start but won't stop Qwerty9119 Red Hat 2 05-03-2007 12:51 PM
custom init.d script will start but won't stop Qwerty9119 Linux - General 2 05-03-2007 12:23 PM
network init script bug? ardya Slackware 8 05-11-2006 01:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook

All times are GMT -5. The time now is 09:47 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