Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
inbox:toh:cisco:vedge_1000 [2024/06/02 21:24] – [Installing OpenWrt] bluecmdinbox:toh:cisco:vedge_1000 [2024/08/11 12:20] – [Installing OpenWrt] bluecmd
Line 44: Line 44:
  
  
 +USB per-port power switching (PPPS) is available for both USB 3 front ports.
  
 /*** if info available: uncomment and fill in /*** if info available: uncomment and fill in
Line 54: Line 55:
 ==== Installing OpenWrt ==== ==== Installing OpenWrt ====
  
 +=== Alternative 1: Boot installation from unlocked u-boot via TFTP ===
  
-=== Alternative 1: Boot installation from inside OEM OS (USB drive, SD card, SSH, HTTP(S)) ===+  * Download the ''openwrt-octeon-generic-cisco_vedge1000-initramfs-kernel.bin'' file somewhere locally and set up a TFTP server serving the file. 
 +    * Example TFTP server command to serve the files in the current directory: ''sudo /usr/sbin/in.tftpd -sLv .'' 
 +  * Calculate the CRC32 of your boot file using the following command: <code>python3 -c 'd = open("openwrt-octeon-generic-cisco_vedge1000-initramfs-kernel.bin", "rb").read(); import binascii; print("crc32 -v 0x20000000 " + hex(len(d)) + " " + hex(binascii.crc32(d))[2:].rjust(8, "0"))'</code> 
 + 
 +  * If you are not in the u-boot prompt, reboot the device and press **Ctrl-x** to enter u-boot 
 +    * If this does not work, see the "Unlock u-boot" section. 
 +  * Connect the vEdge 1000 via the management Ethernet port to a network with DHCP available 
 +  * Run the following commands, replace the IP with your TFTP server: 
 +    * ''setenv ethact octmgmt0; dhcp; setenv serverip 10.1.2.3'' 
 +    * ''setenv ethact octmgmt0; tftpboot $loadaddr $serverip:/openwrt-octeon-generic-cisco_vedge1000-initramfs-kernel.bin'' 
 +    * ''crc32 -v 0x20000000 0x?????? ????????'' (use the already prepared CRC32 command from earlier) 
 +    * If the previous crc32 command does not complain, continue with the boot 
 +    * ''bootoctlinux $loadaddr endbootargs'' 
 +  * Continue with the **Prepare the disk** step 
 + 
 +=== Alternative 2: Boot installation from inside OEM OS (USB drive, SD card, SSH, HTTP(S)) ===
  
 **Note:** OEM OS only supports mounting vfat partitions automatically **Note:** OEM OS only supports mounting vfat partitions automatically
  
-  * Copy ./bin/targets/octeon/generic/openwrt-octeon-generic-cisco_vedge1000-initramfs-kernel.bin  to /boot/openwrt-install.bin+  * Copy ''openwrt-octeon-generic-cisco_vedge1000-initramfs-kernel.bin'' to ''/boot/openwrt-install.bin''
   * ''touch /boot/in_prod'' to unlock u-boot if required   * ''touch /boot/in_prod'' to unlock u-boot if required
   * Reboot vEdge   * Reboot vEdge
Line 67: Line 84:
     * ''ext2load usb 0:1 $loadaddr openwrt-install.bin''     * ''ext2load usb 0:1 $loadaddr openwrt-install.bin''
     * ''bootoctlinux $loadaddr endbootargs''     * ''bootoctlinux $loadaddr endbootargs''
-  * Skip to the **Prepare the disk step** +  * Continue with the **Prepare the disk** step
- +
-=== Alternative 2: Boot installation from unlocked u-boot via TFTP === +
- +
-  * If you are not in the u-boot prompt, reboot the device and press **Ctrl-x** to enter u-boot +
-    * If this does not work, see the "Unlock u-boot" section. +
-  * Connect the vEdge 1000 via the management Ethernet port to a network with DHCP available +
-  * Run the following commands, replace the IP with your TFTP server: +
-    * ''setenv ethact octmgmt0; dhcp; setenv serverip 10.1.2.3'' +
-    * ''setenv ethact octmgmt0; tftpboot $loadaddr $serverip:/openwrt-octeon-generic-cisco_vedge1000-initramfs-kernel.bin'' +
-    * ''bootoctlinux $loadaddr endbootargs'' +
- +
-Example tftp server command: ''sudo /usr/sbin/in.tftpd -sLv .''+
  
 === Prepare the disk === === Prepare the disk ===
Line 89: Line 94:
   * Generate a new disk ID by running the following commands:   * Generate a new disk ID by running the following commands:
     * <code>     * <code>
-udhcpc -i br-lan 
-echo 'nameserver 1.1.1.1' > /etc/resolv.conf 
-opkg update 
-opkg install sfdisk 
 source /lib/upgrade/platform.sh source /lib/upgrade/platform.sh
 sfdisk --disk-id "$(platform_get_n821_disk)" 0x10"${RANDOM}" sfdisk --disk-id "$(platform_get_n821_disk)" 0x10"${RANDOM}"
Line 102: Line 103:
 You need to make the file ''openwrt-octeon-generic-cisco_vedge1000-squashfs-sysupgrade.tar'' available to the installation. You need to make the file ''openwrt-octeon-generic-cisco_vedge1000-squashfs-sysupgrade.tar'' available to the installation.
  
-== HTTP from Github ==+**Example using OpenSSH:**
  
 <code> <code>
 udhcpc -i br-lan udhcpc -i br-lan
-echo 'nameserver 8.8.8.8' > /etc/resolv.conf +# On another machinescp -openwrt-octeon-generic-cisco_vedge1000-squashfs-sysupgrade.tar root@10.x.x.x:/tmp/ 
-cd /tmp/ +sysupgrade -n /tmp/openwrt-octeon-generic-cisco_vedge1000-squashfs-sysupgrade.tar
-wget https://github.com/sonix-network/openwrt/releases/download/[..]octeon-generic-cisco_vedge1000-squashfs-sysupgrade.tar +
-sysupgrade -n /tmp/*vedge1000-squashfs-sysupgrade.tar+
 </code> </code>
  
-== USB drive ==+**Example using a USB drive:**
  
 <code> <code>
 mount /dev/sdb1 /mnt mount /dev/sdb1 /mnt
 sysupgrade -n /mnt/openwrt-octeon-generic-cisco_vedge1000-squashfs-sysupgrade.tar sysupgrade -n /mnt/openwrt-octeon-generic-cisco_vedge1000-squashfs-sysupgrade.tar
-</code> 
- 
-== OpenSSH SCP == 
- 
-<code> 
-udhcpc -i br-lan 
-# On another machine: scp -O openwrt-octeon-generic-cisco_vedge1000-squashfs-sysupgrade.tar root@10.x.x.x:/tmp/ 
-sysupgrade -n /tmp/openwrt-octeon-generic-cisco_vedge1000-squashfs-sysupgrade.tar 
 </code> </code>
  
Line 136: Line 127:
  
 <code> <code>
 +# optional: ensure USB3 ports are enabled
 +setenv ext_usb_setup "i2c dev 1; i2c smbwrite 6e 01 01 ff; cpld_wr 0x4 0x00"
 +
 cpld_wr 0xa 0x2 cpld_wr 0xa 0x2
 saveenv saveenv
Line 975: Line 969:
 ===== Notes ===== ===== Notes =====
  
 +==== USB power switching ====
 +
 +To power down the top port you can do:
 +
 +<code>
 +echo 1 > /sys/devices/pci0000:01/0000:01:00.0/usb3/3-0:1.0/usb3-port2/disable
 +echo 1 > /sys/devices/pci0000:01/0000:01:00.0/usb4/4-0:1.0/usb4-port2/disable
 +</code>
 +
 +For the bottom port use ''usb3-port1'' and ''usb4-port1''. Both ports need to be disabled due to USB 3.0/2.x duality. Enable the port by writing 0 in the same fashion.
 +
 +The software uhubctl can be used, but as of this writing there are some issues regarding endianness and devices hanging around in the kernel even when being powered down.
  
 ==== Gotchas ==== ==== Gotchas ====
  • Last modified: 2024/09/02 20:29
  • by bluecmd