From 4649c57e55dba15ba5f5b014ee7bcf89cea4cdfd Mon Sep 17 00:00:00 2001 From: Simone <26844016+simonebortolin@users.noreply.github.com> Date: Fri, 10 Feb 2023 21:20:45 +0100 Subject: New Lantiq tool for reading and writing the EEPROM (#147) * use vue * update tool for edit the EEPROM for rooted * new tool for read the EEPROM for all lantiq --- _ont/ont-huawei-ma5671a-rooted.md | 103 +-- _tools/ont-lantiq-print-eeprom.md | 17 + assets/js/vue-eeprom.js | 28 + assets/js/vue/vue-lantiq-eeprom.vue | 1237 +++++++++++++++++++++++++++++++++++ 4 files changed, 1299 insertions(+), 86 deletions(-) create mode 100644 _tools/ont-lantiq-print-eeprom.md create mode 100644 assets/js/vue-eeprom.js create mode 100644 assets/js/vue/vue-lantiq-eeprom.vue diff --git a/_ont/ont-huawei-ma5671a-rooted.md b/_ont/ont-huawei-ma5671a-rooted.md index 04b15a2..95d579e 100644 --- a/_ont/ont-huawei-ma5671a-rooted.md +++ b/_ont/ont-huawei-ma5671a-rooted.md @@ -12,96 +12,27 @@ layout: default ## Web procedure -1. Get `sfp_a2_info` and paste into the form - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- -
-
- - -
-
- +1. Get `fw_printenv sfp_a2_info` and paste into the form + +
+ +
+ + + + +{% include alert.html content="Executing these commands requires a minimum of familiarity with `vim`. If you do not know `vim`, follow the commands precisely." alert="Danger" icon="svg-warning" color="red" %} {:style="counter-reset:none"} -2. Transfer modified file back into variable `sfp_a2_info`, replace `` with the output of web form. +1. Copy the script's output to the clipboard +1. Run the comman `vim /tmp/sfp_a2.txt` in the stick +1. Press the right mouse button in the terminal or `CTRL`+`V` +1. Press `ESC` command from keyboard +1. Type `:wq` +1. Run: ```shell -fw_setenv sfp_a2_info "" +fw_setenv sfp_a2_info ($cat /tmp/sfp_a2.txt) ``` ## Temporary file procedure diff --git a/_tools/ont-lantiq-print-eeprom.md b/_tools/ont-lantiq-print-eeprom.md new file mode 100644 index 0000000..6d95ebf --- /dev/null +++ b/_tools/ont-lantiq-print-eeprom.md @@ -0,0 +1,17 @@ +--- +title: Lantiq Print EEPROM +has_children: false +layout: default +--- + +1. Get `sfp_a0_low_128` or `sfp_a2_info` and paste into the form + + +
+ +
+ + + + +{% include alert.html content="For more information, see the SFF-8472 Rev 10.2 specification." alert="Info" icon="svg-info" color="blue" %} \ No newline at end of file diff --git a/assets/js/vue-eeprom.js b/assets/js/vue-eeprom.js new file mode 100644 index 0000000..63f9bfb --- /dev/null +++ b/assets/js/vue-eeprom.js @@ -0,0 +1,28 @@ +const { createApp } = Vue; +const { loadModule } = window['vue3-sfc-loader']; +const options = { + moduleCache: { + vue: Vue, + }, + getFile(url) { + return fetch(url).then((resp) => + resp.ok ? resp.text() : Promise.reject(resp) + ); + }, + addStyle(styleStr) { + const style = document.createElement('style'); + style.textContent = styleStr; + const ref = document.head.getElementsByTagName('style')[0] || null; + document.head.insertBefore(style, ref); + }, + log(type, ...args) { + console.log(type, ...args); + }, +}; +const app = createApp({ + components: { + VueLantiqEeprom: Vue.defineAsyncComponent(() => + loadModule('/assets/js/vue/vue-lantiq-eeprom.vue', options) + ), + }, +}).mount('#app'); \ No newline at end of file diff --git a/assets/js/vue/vue-lantiq-eeprom.vue b/assets/js/vue/vue-lantiq-eeprom.vue new file mode 100644 index 0000000..94c3db7 --- /dev/null +++ b/assets/js/vue/vue-lantiq-eeprom.vue @@ -0,0 +1,1237 @@ + + + \ No newline at end of file -- cgit v1.2.3