LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 10-16-2014, 01:32 AM   #1
hardikgohil1988
Member
 
Registered: Sep 2014
Posts: 63

Rep: Reputation: Disabled
connect date command with hardware clock


Hello,

I am working on Linux-2.6 kernel

I want to configure command date such that whenever I change date and time using date command the changes should get reflected in hardware clock which can be checked by hwclock command.

I am using Busybox-1.21.0.
 
Old 10-16-2014, 02:00 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,830

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
the command date has no such option, but there is another command named hwclock.
 
Old 10-16-2014, 02:14 AM   #3
hardikgohil1988
Member
 
Registered: Sep 2014
Posts: 63

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
the command date has no such option, but there is another command named hwclock.
Ya you are write hwclock is there.

I want to customise command Date such that when ever i enter date to sets time to system and custom is set time in hwclock

this is my question
 
Old 10-16-2014, 02:17 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,830

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
That is not a question but a statement. If you want to modify the functionality of a command you need to download its source and implement the new features.
 
Old 10-16-2014, 04:39 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,696

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
Ther source in this case is busybox.

http://www.ibm.com/developerworks/li...ary/l-busybox/
 
Old 10-20-2014, 02:02 PM   #6
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
I'm more of a proponent of writing a script and then using the commands for their intended purpose. Everytime I modify a binary command my use of it is highly specific as this would be, so I stopped because there's really a different, and supported way to accomplish that goal.

Further, my tendency in many cases is to remove a particular Busybox link and put in the true binary for a command, because I had found that the Busybox alternative didn't fully support options I needed/wanted to use. Grep and find are big candidates for replacement in my book. Busybox has gotten better over the years.
 
Old 11-03-2014, 07:33 PM   #7
hardikgohil1988
Member
 
Registered: Sep 2014
Posts: 63

Original Poster
Rep: Reputation: Disabled
Thank you every one,

I have used the Sytem API to do this

rtc_set_mmss
 
  


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
command 'clock' and 'date' branddonchau Linux - Newbie 3 03-24-2013 11:56 PM
Setting system date and time affecting the clock and date on BIOS satimis Ubuntu 7 09-21-2007 08:02 AM
Slow system clock and stray hardware clock, pleas help! Epox Linux - General 6 01-02-2007 02:43 PM
Adjust system date to hardware clock Winanjaya Linux - General 1 10-13-2006 05:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

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