Caramel wrote: Fri Apr 26, 2024 7:27 am
Just installed.
After first creation of a snapshot, the information on desktop has changed, but the number is 3 instead 2 (btrfs subvolume list / confirm 2 subvolumes was created) and the date is a day in advance.
After second snapshot, the number is 4 (increased by 1) and the date has not changed (still a day in advance)
Yes, at first bootup. snapshot 2 is created, as a backup of pristine conditions.
You can see it in /mnt/${WKG_DEV}/quantumvis/snapshot-record
The date is only yymmdd
Regarding being a day in advance, I attempted to obtain the accurate date in the initrd. This code in 'init' script:
Code: Select all
###set date and time###
#see TZ set early in script.
#20240320 settimeofday() error, see: https://bkhome.org/news/202402/hwclock-fail-in-easyvoid-603.html
# getting this error in initrd. now have static hwclock with old musl
# ...it does not accept -l requires --localtime
CLKflg=1
if [ -e /sys/class/rtc/rtc0 ];then
#20240424 get timezone...
if [ -e /tempmnt/${QV}/etc/localtime ];then
NEWTZ="$(readlink /tempmnt/${QV}/etc/localtime)" #ex: /usr/share/zoneinfo/Etc/GMT-8
mkdir -p ${NEWTZ%/*}
cp -a ${NEWTZ} ${NEWTZ%/*}/
cp -a /tempmnt/${QV}/etc/localtime /etc/
unset TZ #otherwise it will override /etc/localtime
export TZ
fi
if [ -s /tempmnt/${QV}/etc/clock ];then
. /tempmnt/${QV}/etc/clock #has HWCLOCKTIME=localtime or utc
case "$HWCLOCKTIME" in
localtime) hwclock -s --localtime -f /dev/rtc0; CLKflg=$? ;;
utc) hwclock -s -u -f /dev/rtc0; CLKflg=$? ;;
esac
else #first bootup, assume hw clock is localtime...
hwclock -s -l -f /dev/rtc0
fi
fi
if [ $CLKflg -ne 0 ];then
if [ -s /tempmnt/${QV}/var/local/shutdown_date_saved ];then
date -s "$(cat /tempmnt/${QV}/var/local/shutdown_date_saved)" > /dev/null
fi
fi
#rpi does not have a hardware clock, set it to something sane at 1st bootup...
YEAR=$(date +%Y) #ex: 1970
if [ $YEAR -lt 2020 ];then
#set date same as init file...
fDATE="$(stat -c %y /init | cut -f 1,2 -d ':')"
DATE="$(date -s "$fDATE")"
else
DATE="$(date)"
fi
export DATE #ex: Tue Mar 3 07:09:34 +08 2020
At first bootup, assumes hw clock is local time.
Subsequent bootups, reads /etc/localtime symlink in the @qv folder and copies it, as well as what it points to, into the initrd.
Then, it is hoped, the date will be set correctly.
But maybe the code has a problem, if you are getting a day ahead.