Skip to content

[udev] Add customize udev rule for console switch(for e1031) - #5571

Merged
Blueve merged 7 commits into
sonic-net:masterfrom
sandycelestica:master
Oct 15, 2020
Merged

Blueve merged 7 commits into
sonic-net:masterfrom
sandycelestica:master

Conversation

@sandycelestica

@sandycelestica sandycelestica commented Oct 9, 2020 •

Copy link
Copy Markdown
Contributor

- Why I did it
This is for customers customize their own device name for ttyUSB devices

- How I did it
Design an udev rule for an assigned console switch; And rename all the ports as assigned prefix.
Here is an console switch called C0 and rename 40 console ports as C0-1 to C0-40.

- How to verify it
plugin the C0 use command:
ls /dev/C0* this can check whether we rename success;

- Which release branch to backport (provide reason below if selected)
201911

- Description for the changelog
This design including following files to change:

*.rules this is for the design of udev rules
popmsg.sh this is for pop msg when the device been plugged out. It shows reminder that the device plug out
udev_prefix.sh this file is for record the name prefix that customers want to use
platform-modules-haliburton.install this is config file to copy files *.rules to the /etc/rules.d so that this rule can be loaded when system reboot

@sandycelestica

sandycelestica commented Oct 9, 2020 •

Copy link
Copy Markdown
Contributor Author

- Why I did it
This is for customers customize their own device name for ttyUSB devices

- How I did it
Design an udev rule for an assigned console switch; And rename all the ports as assigned prefix.
Here is an console switch called C0 and rename 40 console ports as C0-1 to C0-40.
- How to verify it
plugin the C0 use command:
ls /dev/C0* this can check whether we rename success;

- Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006

- Description for the changelog
This design including following files to change:

  1. *.rules this is for the design of udev rules
  2. popmsg.sh this is for pop msg when the device been plugged out. It shows reminder that the device plug out
  3. udev_prefix.sh this file is for record the name prefix that customers want to use
  4. platform-modules-haliburton.install this is config file to copy files *.rules to the /etc/rules.d so that this rule can be loaded when system reboot

@Blueve Blueve left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Sandy! The rule looks good to me.
Could you please remove all personal debugging code from your source? We can create a document to help others create/debug new rules.

In other hand, one question: will this rule be loaded automatically after SONiC install/reboot or console device plug-in/out (hot plug)?

Remove some debug codes
remove the debug info
remove debug info
@yxieca

yxieca commented Oct 9, 2020

Copy link
Copy Markdown
Contributor

Please fill in the PR template above.

@sandycelestica

Copy link
Copy Markdown
Contributor Author

- Why I did it

- How I did it

- How to verify it

- Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

- Why I did it
This is for customers customize their own device name for ttyUSB devices

- How I did it
Design an udev rule for an assigned console switch; And rename all the ports as assigned prefix.
Here is an console switch called C0 and rename 40 console ports as C0-1 to C0-40.
- How to verify it
plugin the C0 use command:
ls /dev/C0* this can check whether we rename success;

- Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006

- Description for the changelog
This design including following files to change:

  1. *.rules this is for the design of udev rules
  2. popmsg.sh this is for pop msg when the device been plugged out. It shows reminder that the device plug out
  3. udev_prefix.sh this file is for record the name prefix that customers want to use
  4. platform-modules-haliburton.install this is config file to copy files *.rules to the /etc/rules.d so that this rule can be loaded when system reboot

@sandycelestica sandycelestica changed the title This changes for udev rules design and customize the device name. And the consutil should be change for support this design [udev] Add customize udev rule for console switch(for e1031) Oct 14, 2020
@Blueve

Blueve commented Oct 14, 2020

Copy link
Copy Markdown
Contributor

retest this please

@Blueve
Blueve merged commit 4c8b1c4 into sonic-net:master Oct 15, 2020
santhosh-kt pushed a commit to santhosh-kt/sonic-buildimage that referenced this pull request Feb 25, 2021
…et#5571)

* Add files via upload
* Update platform-modules-haliburton.install
* Update 50-ttyUSB-C0.rules
* Update popmsg.sh
* Update udev_prefix.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants