Create Debian 9 (Stretch) minimal ISO similar to DebianDog

A home for all kinds of Puppy related projects
Message
Author
User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#766 Post by rcrsn51 »

PeasyClock manages your system clock - date, time and zone.

Debian likes to run in UTC mode - it synchronizes its clock with Greenwich, England. Check the file /etc/adjtime to see the current mode. Use the Mode button for quick access to this file.

If you want to stick with UTC, here is the setup.

1. Google "current time greenwich england"

2. Run PeasyClock.

3. The initial time zone is Etc/UTC. Set your own time zone. Refresh.

4. Set your current local date and time. Note: Sometimes, the tray clock won't sync up until the next reboot.

Important: Stretch auto-updates the BIOS clock at the end of a session, so it's essential that you have the zone and local time set correctly in PeasyClock BEFORE you quit. You do NOT need to run "Update hardware clock".

5. Reboot. Open the BIOS and check the hardware clock. It should be set to Greenwich time!

6. The Stretch tray clock will show your local time. It takes the hardware UTC time and adjusts it using your time zone.

Note to Puppy users: Puppy works in LOCAL mode by default (you can switch it to UTC) and stores the setting in /etc/clock. It does NOT auto-update the BIOS clock at shutdown. But if the clock already has the correct time for your mode, you do NOT need to change it. See below.

-----------------------------

If you are sharing your machine with Windows or Puppy, local time is the preferred choice. Other OS's don't know that the clock is set to Greenwich time!

1. In /etc/adjtime, change UTC to LOCAL.

2. Set your own time zone. Refresh.

3. Set your date and time. See the Important note above.

4. Reboot. Open the BIOS and check the clock. It should now be your own local time.

5. The Stretch tray clock will show your local time and PeasyClock will show the correct zone.

Read here for more examples.

--------------------------

Updates: Version 1.4 has several additions.

1. The Time Zone list now contains the default zone Etc/UTC.

2. The BIOS button displays the actual current value of the hardware clock regardless of your mode. So you don't need to boot into the BIOS to check it.

3. The Now button shows you the current time at any location selected from the Time Zone list. (You don't need to set the zone first.)

4. You can optionally set the date/time from an NTP server. On a Puppy system, you would then update the hardware clock in local mode.

-------------------

PeasyClock is now in Fred's repo. It installs in the System menu.
-----------------------
Attachments
snappie.png
(22.14 KiB) Downloaded 578 times
Last edited by rcrsn51 on Wed 08 Nov 2017, 14:10, edited 34 times in total.

zagreb999
Posts: 567
Joined: Fri 11 Apr 2014, 06:39
Location: Yugoslavija

tzclock_3.0.6-1_i386.deb

#767 Post by zagreb999 »

REGARDS

TIME, ZONE, CLOCK

BETTER, THE BEST IS
tzclock_3.0.6-1_i386.deb

IT WORKS PERFECTLY

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

Re: tzclock_3.0.6-1_i386.deb

#768 Post by rcrsn51 »

zagreb999 wrote:BETTER, THE BEST IS tzclock_3.0.6-1_i386.deb
How do you know? You haven't even bothered to try PeasyClock yet.

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#769 Post by fredx181 »

rcrsn51 wrote:PeasyClock manages your system clock - date, time and zone. Read the Help for information about UTC versus local time modes.
Very good! I tested using the local time setup. I always used in Debian for setting up timezone "dpkg-reconfigure tzdata", but it doesn't give the option to change the time, so I had to change (to localtime) in the BIOS, your program has that option, so no need to go in the BIOS.
Added to repositories and added link to your post in useful info section at first post.
EDIT: Also added your cputemp package to repos, very nice also, thanks!

@zagreb999 Can you please stop posting discouraging comments ?

Fred

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#770 Post by rcrsn51 »

Thanks. I just now posted a new version (still 1.0) with online help.

It took a while to figure this out. It looks like the hwclock tool automatically updates /etc/adjtime depending on which mode you pick to set the hardware clock.

I originally started this project for Puppy, which scatters date/time/zone functions over several applets.

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#771 Post by fredx181 »

Hi Bill, OK, replaced older peasyclock with your new version in repos.

Tested again now (fresh Stretch-Live install) with localtime setup, but didn't edit /etc/adjtime (so kept as UTC) and all worked as expected after configuring peasyclock ,(after reboot it was changed to LOCAL in /etc/adjtime)
So it seems to me that this, what you wrote, is not needed ?
1. In /etc/adjtime, change UTC to LOCAL
Fred

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#772 Post by rcrsn51 »

If your hardware clock currently has the correct local time and you don't want to update it with PeasyClock, you would need to manually change /etc/adjtime. (I think).

Otherwise, Stretch would assume that the hardware clock time was actually UTC and it would display your local time incorrectly.

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#773 Post by fredx181 »

Ok, did manually change to LOCAL in /etc/adjtime now. Then, If I change timezone in peasyclock and do refresh, the time changes to one hour later, if I keep it like that, and reboot, my hardware clock is wrong set, so changing the time in peasyclock to the correct (local) time is absolutely necessary anyway, I think, no matter if I edited /etc/adjtime or not.
But perhaps I misunderstood what you mean.

Fred

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#774 Post by rcrsn51 »

This gets confusing, doesn't it? I guess that's why Debian likes to leave the hardware clock as UTC and handle all changes through the time zone selection.

Here is what I tried.

1. I set the BIOS clock to my own local time, as if it were a Windows machine.

2. I boot a clean install of Stretch.

3. I install PeasyClock.

4. The initial, default timezone is Etc/UTC and the tray clock has my correct local time. That's because Stretch assumes that I am currently in Greenwich and it doesn't need to adjust the time.

5. I change the time zone to Canada/Eastern and refresh. The time is now wrong by 4 hours (5 time zones minus daylight savings).

6. I set the time correctly JUST for the purposes of this session.

7. I do NOT update the hardware clock, because I know that it contains my correct local time.

8. I manually update /etc/adjtime to LOCAL.

9. I reboot. The tray clock time is correct. Because I am in local mode, Stretch doesn't need to adjust it for the time zone.

10. When I run the "date" command, it shows my correct time and the correct EDT time zone.

----------------------

In your example, it sounds like the BIOS clock was previous set to Greenwich, so your time zone change to Holland put the local time one hour off.

In that case, you would definitely need to update the hardware clock to Holland time.

[Edit] Apparently, if you are in LOCAL mode and make a time zone change, Stretch will sometimes automatically adjust the BIOS clock for you to the new zone. Which would mess up your Windows time.

Now I am really confused.
Last edited by rcrsn51 on Wed 01 Nov 2017, 21:18, edited 1 time in total.

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#775 Post by fredx181 »

rcrsn51 wrote:This gets confusing, doesn't it?
Well, not very much, I think.
All I tried to mention is that manually editing /etc/adjtime to set to LOCAL may be not needed at all (although it does not harm of course), configuring your program the right way does it all from what I tested.
But not sure, I'll do some more testing tomorrow (getting late here now)

Fred

dancytron
Posts: 1519
Joined: Wed 18 Jul 2012, 19:20

#776 Post by dancytron »

FWIW, I changed me etc/adjtime to local, set my timezone (U.S. Central), then installed ntp.

On reboot, everything was correct and it coexisted with Windows XP without an issue.

Maybe it is the order that you do things that matters (i.e. set hardware clock to correct value last).

My notes:
12. /etc/adjtime from UTC to LOCAL. Set timezone to central. save2flash
13. Reboot. Time is wrong.
root@live:~# dpkg-reconfigure tzdata

Current default time zone: 'America/Chicago'
Local time is now: Fri Oct 13 11:51:20 CDT 2017.
Universal Time is now: Fri Oct 13 16:51:20 UTC 2017.

apt-get install ntp
Now time is correct.
root@live:~# date
Fri Oct 13 16:47:59 CDT 2017

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#777 Post by rcrsn51 »

Thanks. Could you try the following?

1. Imagine you fly to LA.
2. You open your laptop and set the new time zone.
3. Does ntp automatically fix the local time?
4. Check the BIOS. Has its clock changed?
5. Run XP. What does it know? The new time? The new zone?
6. If you need to update the XP time and zone, that should also change the BIOS. How does that affect your Stretch setup?

dancytron
Posts: 1519
Joined: Wed 18 Jul 2012, 19:20

#778 Post by dancytron »

Do you want me to use your application or the default "setup timezone?"

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#779 Post by rcrsn51 »

It shouldn't matter. All the timezone setup does (I think) is make a link from /etc/localtime into /usr/share/zoneinfo.

AndresC2
Posts: 76
Joined: Sun 09 Jul 2017, 02:12

#780 Post by AndresC2 »

Hi All

this work for me.

in debian stretch script I add.

#Setup Timezone

echo "America/Caracas" > /etc/timezone

build debian stretch iso.

and now not change my bios time anymore.

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#781 Post by rufwoof »

I just run

# dpkg-reconfigure tzdata

but that may be systemd specific ???

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#782 Post by rcrsn51 »

rufwoof wrote:I just run # dpkg-reconfigure tzdata
But which mode are you in? UTC or LOCAL?

zagreb999
Posts: 567
Joined: Fri 11 Apr 2014, 06:39
Location: Yugoslavija

#783 Post by zagreb999 »

WITH ALL RESPECT , FRED...

PLEASE, CAN YOU TEST
tzclock_3.0.6-1_i386.deb BEFORE
COMMENTING...
APSSOLUTELY IT IS
INCOMPARABLE WITH

PeasyClock
KIND REGARDS.

jd7654
Posts: 296
Joined: Mon 06 Apr 2015, 16:10

#784 Post by jd7654 »

fredx181 wrote:...All I tried to mention is that manually editing /etc/adjtime to set to LOCAL may be not needed at all (although it does not harm of course), configuring your program the right way does it all from what I tested.
Are you in UTC zone? Only then it would not matter.

For the rest of us, there is a bit of complication in getting time correct in Dogs. Puppy is easy, if a bit messy with a bunch of time, zone and PSync utilities, but it works. Just set zone, and check/activate Internet time sync and all is good.

Dog and DebLive only include the Time Zone tool by default, but they are set up with different time Standard, which is part of the confusion.
DebDog comes with: LOCAL time standard, and default zone UTC
DebLive comes with: UTC time standard, and default zone UTC.

I always setup and fix the time/zone/standard whenever I setup Linux, whether it is Systemd, or Puppy, or whatever. So I've gone through this a lot. A sample fix for DebLive:

Current time around 10:46PM:

Code: Select all

root@live:~# date
Wed Nov  1 22:46:14 UTC 2017
root@live:~# hwclock
2017-11-01 22:46:16.265059+0000
Change time zone to HST:

Code: Select all

root@live:~# date
Wed Nov  1 12:48:02 HST 2017
root@live:~# hwclock
2017-11-01 12:48:04.479502-1000
System time and RTC time are both now wrong, -10 hours,

Edit time standard in /etc/adjtime to LOCAL:

Code: Select all

root@live:~# date
Wed Nov  1 12:50:51 HST 2017
root@live:~# hwclock
2017-11-01 22:50:52.374192-1000
System time is still wrong, RTC is correct.

Fix system time to be same as RTC time:

Code: Select all

root@live:~# hwclock --hctosys
root@live:~# date
Wed Nov  1 22:53:06 HST 2017
root@live:~# hwclock
2017-11-01 22:53:09.890005-1000
Time is now correct: time standard (localtime/Windows), time zone, system and hardware clocks.

Peasyclock takes care of the above time zone and time standard issues with a gui, but still leaves the last part of system time and rtc time out of sync. Also, fixes should be added to include back Etc/UTC in the zone selection list after first use, and have it read the /etc/adjtime value instead of only displaying local default.

And to make Dog automatically adjust to NTP server, can install NTP client package ntpdate. That would probably be a nice default package for DDog, DebLive and StretchDog to have. Antix also includes the small ntpdate instead of full ntp package.

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

PeasyClock test

#785 Post by fredx181 »

Hi All, did some further testing PeasyClock and did WITHOUT changing /etc/adjtime manually first (so it's set to UTC (as by default)
My time in the BIOS is set to localtime, at this point around 11:08, the time is synchronized, but it's set to utc time (/etc/timezone has Etc/UTC)

Code: Select all

root@live:~# date 
Thu Nov  2 11:08:04 UTC 2017
root@live:~# hwclock 
2017-11-02 11:08:09.561478+0000
I will change to localtime now by setting up my timezone
Next I run peasyclock, (time shows 11:09, changed timezone to Europe/Amsterdam and click "Set" and then "Refresh"
Now the time showed in peasyclock is one hour later 12:09 and date and hwclock are around the same:

Code: Select all

root@live:~# date
Thu Nov  2 12:10:08 CET 2017
root@live:~# hwclock
2017-11-02 12:10:15.233405+0100
Then I changed the time in peasyclock to the correct time (one hour back) and clicked "Set", now current time is correct but the hardware clock is not synchronized with the current time:

Code: Select all

root@live:~# date
Thu Nov  2 11:11:04 CET 2017
root@live:~# hwclock
2017-11-02 12:11:09.295938+0100
Next I clicked "Set" next to "Update the hardware clock" ('Local time' is checked)
And the result is exactly as it should be IMO

Code: Select all

root@live:~# date
Thu Nov  2 11:12:07 CET 2017
root@live:~# hwclock
2017-11-02 11:12:13.420914+0100
Also the file /etc/adjtime did change to LOCAL (previous step did that, I think):

Code: Select all

root@live:~# cat /etc/adjtime
0.000000 1509617396 0.000000
1509617396
LOCAL
After reboot all was still fine

Fred

Post Reply