hbugs001 发表于 2020-2-10 09:31:40

华为AR1000v镜像开启串口方法

原帖地址:https://certcollection.org/forum/topic/308980-huawei-ar-1000v/page__st__14#entry1317742

The way to enable telnet for AR1000v is below

Copy the qcow2 file for huawei in /tmp in eve-ng vm

Then we will mount this qcow2 file in eve-ng and edit the boot file grub.cfg -

1 . modprobe nbd
2. qemu-nbd -c /dev/nbd0 /tmp/hda.qcow2
3. mount /tmp/guest /dev/nbd0
4. mount /dev/nbd0p1 /tmp/guest/
5. Make a backup of existing file - cp /tmp/guest/grub/grub.cfg /tmp/guest/grub/grub.cfg.bak
6. edit the boot file for qcow2 image to virtual serial interface -
nano /tmp/guest/grub/grub.cfg
comment these three lines
#serial --unit=0 --speed 115200
#terminal_input console serial
#terminal_output console serial
Add instead these 3 lines -

serial --unit=0 --speed=9600
terminal_output --append serial
terminal_input serial console

Then appendconsole=tty0 console=ttyS0,9600 for menuentry below -


menuentry 'Wind River Linux GNU/Linux' --class wind --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-b26a0881-dd8$
      load_video
      insmod gzio
      insmod part_msdos
      insmod ext2
      set root='hd0,msdos1'
      if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1$
      else
          search --no-floppy --fs-uuid --set=root 89e22363-cbf1-41cc-8d6b-e9b4e932695f
      fi
      echo    'Loading Linux 3.10.62-ltsi-WR6.0.0.12_standard ...'
      linux   /boot_A/bzImage root=/dev/vda2 ro isolcpus=1 systemd.show_status=no console=tty0 console=ttyS0,9600
      initrd/boot_A/rootfs.gz
}
7.Unmount - umount /tmp/guest
8. Disconnect the qcow device - qemu-nbd -d /dev/nbd0
9. Now our qcow file is svaed with edited grub.cfg file.
10. copy the file qcow file to proper location and create a node in eve-ng and select console type telnet instead of VNC.


I am attaching my grub.cfg file for reference.

You can also google for qemu-nbd to understand how it works

haizi595610 发表于 2020-2-10 10:06:28

:lol活抓小蜜蜂。感谢你的分享

小迷糊亮 发表于 2020-2-10 16:32:59

:D:D:D:D:D:D顶一波

lvjianan 发表于 2020-2-13 16:35:49

这个厉害了:L

logloglp 发表于 2020-2-16 16:16:12

虽然资源高了点 还是支持一下

subbz 发表于 2020-2-17 16:18:53

感谢分享

knowseek 发表于 2020-2-20 20:17:16

非常谢谢!

castle 发表于 2020-2-24 17:48:34

不错不错,学习一下

carlos.xue 发表于 2020-2-25 14:34:04

非常感谢

WannaFree 发表于 2020-2-26 13:38:37

谢谢分享
页: [1] 2 3 4 5 6 7 8 9 10
查看完整版本: 华为AR1000v镜像开启串口方法