Closed ShaneMcC closed 1 year ago
Hi there
Unfortunately it has been some time since I updated this Github repo (7 months or so) and so the version here is behind with quite a few fixes and changes (there's lots of additional functionality added to my local version).
The "--experimental" option enables some stuff that is still work-in-progress and this PTP related stuff is one of them.
This is functionality that I have been working on for cloud-init that will be submitted upstream shortly (which is why you found no mention of it), I'm testing locally with a modified cloud-init package.
I've now hidden the PTP stuff behind an addition cli option (rather than just "--experimental).
The script wants to use /dev/ptp_kvm, but this doesn't exist on v3.17 or edge, it seems to just be /dev/ptp0 now (on proxmox at least).
That is strange as I submitted the changes to the Alpine mdev package for /dev/ptp_kvm and those changes are in Alpine 3.17 and Edge. From your mention of /dev/ptp0 I guess you are looking on Proxmox host itself rather than inside the VM? /dev/ptp_kvm should appear in the Alpine VM (as long as the ptp_kvm kernel module is loaded) as KVM (which Proxmox uses) provides this to VMs for performing timesync with the host machine.
Regarding this problem and your 2 PRs, I will be concentrating on this script this week and intend to update this repo shortly, that will then address all 3 issues.
Hey
Thanks for the response, wasn't sure if you had been actively working on it in the background or not and thanks for explaining about the cloud-init stuff.
This is definitely inside the image, and only the /dev/ptp0 exists:
alpine [~]# echo 'Kernel:'; uname -a; echo 'Version:'; cat /etc/alpine-release; echo 'Modules:'; lsmod | grep -i ptp; echo 'Devices:'; ls -l /dev | grep -i ptp;
Kernel:
Linux alpine 5.15.101-0-virt #1-Alpine SMP Sun, 12 Mar 2023 13:50:37 +0000 x86_64 GNU/Linux
Version:
3.17.2
Modules:
ptp_kvm 16384 0
Devices:
crw------- 1 root root 249, 0 Mar 13 04:40 ptp0
alpine [~]#
I've not really looked too much more into it, but it seemed like 3.16 had it, then 3.17 and edge did not, and chrony seemed perfectly happy using the /dev/ptp0
device. I figured this was an intentional change to standardise on a common device name rather than per-module device names.
I look forward to the updated version of the repo, I'll hold off on any other issues/PRs until that drops.
Sorry about the long delay, a minor change turned into a major rework.
Anyway new version has been pushed.
Building with both
--experimental
and--release edge
generates an invalidcreate.sh
script:The NTP section ends up like:
There are actually 2 bugs here:
1)
cat <<'EOF' >> "$run_script"
should becat <<EOF >> "$run_script"
2) The 4 lines above it need to have$
added after the:-
otherwise it just putsCONSTANT_DEFAULT_...
in the fileHowever, even after fixing this, there are other bugs.
The script wants to use
/dev/ptp_kvm
, but this doesn't exist onv3.17
oredge
, it seems to just be/dev/ptp0
now (on proxmox at least).But also, enabling it causes
cloud-init
to fail to work at all with the following error:This seems to be the result of specifying 2 layers of invalid config.
I get similar of I add:
A single layer of invalid config just gives a nice error:
I also can't find any mention of the
hypervisor_clock
setting that it's trying to set anywhere: https://github.com/search?q=repo%3Acanonical%2Fcloud-init+hypervisor_clock&type=code