Skip to content

Commit eaa7186

Browse files
committed
Add symlink for ENA PTP device.
ENA PTP device does not have the unique symlink unlike other clock devices: $ sudo rmmod ena && sudo modprobe ena phc_enable=1 $ ls -al /dev/*ptp* crw-------. 1 root root 245, 0 May 29 17:34 /dev/ptp0 $ sudo modprobe ptp_kvm $ ls -al /dev/*ptp* crw-------. 1 root root 245, 0 May 29 17:34 /dev/ptp0 crw-------. 1 root root 245, 1 May 29 17:35 /dev/ptp1 lrwxrwxrwx. 1 root root 4 May 29 17:35 /dev/ptp_kvm -> ptp1 This could lead customers to use a wrong device. Let's add a udev rule to create the unique symlink for ENA PTP as ptp_ena. With the new rule: $ sudo rmmod ena && sudo modprobe ena phc_enable=1 $ ls -al /dev/*ptp* lrwxrwxrwx. 1 root root 4 May 29 17:37 /dev/ptp_ena -> ptp0 crw-------. 1 root root 245, 0 May 29 17:37 /dev/ptp0 crw-------. 1 root root 245, 1 May 29 17:35 /dev/ptp1 lrwxrwxrwx. 1 root root 4 May 29 17:35 /dev/ptp_kvm -> ptp1 Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
1 parent 09b53f2 commit eaa7186

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

51-ec2-ena-ptp-device.rules

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SUBSYSTEM=="ptp", ATTR{clock_name}=="ena-ptp-*", SYMLINK += "ptp_ena"

amazon-ec2-utils.spec

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Source23: ec2nvme-nsid
1414
Source24: ebsnvme-id
1515
Source25: 51-ec2-xen-vbd-devices.rules
1616
Source26: 53-ec2-read-ahead-kb.rules
17+
Source27: 51-ec2-ena-ptp-device.rules
1718

1819
URL: https://github.com/aws/amazon-ec2-utils
1920
BuildArch: noarch
@@ -47,6 +48,7 @@ install -m755 %{SOURCE1} $RPM_BUILD_ROOT/%{_sbindir}
4748
install -m644 %{SOURCE2} $RPM_BUILD_ROOT%{_udevrulesdir}
4849
install -m644 %{SOURCE25} $RPM_BUILD_ROOT%{_udevrulesdir}
4950
install -m644 %{SOURCE26} $RPM_BUILD_ROOT%{_udevrulesdir}
51+
install -m644 %{SOURCE27} $RPM_BUILD_ROOT%{_udevrulesdir}
5052
# Install 60-cdrom_id.rules to /etc rather than %{_udevrulesdir}
5153
# because it is intended as an override of a systemd-provided rules
5254
# file:
@@ -68,13 +70,17 @@ rm -rf $RPM_BUILD_ROOT
6870
%{_sbindir}/ec2nvme-nsid
6971
%{_sbindir}/ebsnvme-id
7072
%{_sbindir}/ec2udev-vbd
73+
/usr/lib/udev/rules.d/51-ec2-ena-ptp-device.rules
7174
/usr/lib/udev/rules.d/51-ec2-hvm-devices.rules
7275
/usr/lib/udev/rules.d/51-ec2-xen-vbd-devices.rules
7376
/usr/lib/udev/rules.d/53-ec2-read-ahead-kb.rules
7477
/usr/lib/udev/rules.d/70-ec2-nvme-devices.rules
7578
/etc/udev/rules.d/60-cdrom_id.rules
7679

7780
%changelog
81+
* Wed May 29 2024 Kuniyuki Iwashima <kuniyu@amazon.com> - 2.2.1
82+
- Add symlink for ENA PTP device.
83+
7884
* Thu Jan 18 2024 Keith Gable <gablk@amazon.com> - 2.2.0-1
7985
- Corrected issue where an ec2-metadata error was written to stdout
8086
- Change ec2nvme-nsid to use Bash string manipulation to improve

0 commit comments

Comments
 (0)