04-14-2019 07:34 AM - edited 04-14-2019 07:40 AM
This document helps to boot NCS5500 series router through USB devices. This very useful for customers installing the routers where they don’t have access to install framework nor to have complicated install procedure. Please follow the steps defined in the document step-by-step to achieve the USB boot on NCS5500 devices.
A Linux machine meets following requirements
Note: Kernel version of the system should be greater than 3.16 or greater than the version of kernel of cisco iso because of the initrd.img file creation during gisobuild process
2 files required to be downloaded from git
gisobuild.py [-h] -i BUNDLE_ISO [-r RPMREPO] [-c XRCONFIG][-s SCRIPT] [-l GISOLABEL] [-m] [-o] [-x] [-v]
Utility to build Golden/Custom iso. Please provide atleast repo path or config file along with bundle iso
optional arguments:
-h, --help show this help message and exit
-r RPMREPO, --repo RPMREPO
Path to RPM repository
-c XRCONFIG, --xrconfig XRCONFIG
Path to XR config file
-s SCRIPT, --script SCRIPT
Path to user executable script
-l GISOLABEL, --label GISOLABEL
Golden ISO Label
-m, --migration To build Migration tar only for ASR9k
-o, --optimize Optimize GISO by recreating and resigning initrd
-x, --x86_only Use only x86_64 rpms even if arm is applicable for the platform
-v, --version Print version of this script and exit
required arguments:
-i BUNDLE_ISO, --iso BUNDLE_ISO
Path to Mini.iso/Full.iso file
[root@nb-server3 653-8I]# /router/bin/python gisobuild.py -i ncs5500-mini-x-6.5.3.08I.iso -r . -s test.sh -c running.cfg Info: Golden ISO label is not specified so defaulting to 0
System requirements check [PASS] Golden ISO build process starting...
Platform: ncs5500 Version: 6.5.3.08I
XR-Config file (/auto/tftp-vista/narvenka/core/653-8I/running.cfg) will be encapsulated in Golden ISO.
Scanning repository [/auto/tftp-vista/narvenka/core/653-8I]...
Building RPM Database... Total 2 RPM(s) present in the repository path provided in CLI [ 1] ncs5500-mgbl-3.0.0.0-r65308I.x86_64.rpm [ 2] ncs5500-k9sec-3.1.0.0-r65308I.x86_64.rpm
Following XR x86_64 rpm(s) will be used for building Golden ISO:
(+) ncs5500-mgbl-3.0.0.0-r65308I.x86_64.rpm (+) ncs5500-k9sec-3.1.0.0-r65308I.x86_64.rpm
...RPM compatibility check [PASS]
User Script (/auto/tftp-vista/narvenka/core/653-8I/test.sh) will be encapsulated in Golden ISO.
Building Golden ISO... Summary .....
XR rpms: ncs5500-mgbl-3.0.0.0-r65308I.x86_64.rpm ncs5500-k9sec-3.1.0.0-r65308I.x86_64.rpm
XR Config file: router.cfg
User script: autorun
...Golden ISO creation SUCCESS.
Golden ISO Image Location: /auto/tftp-vista/narvenka/core/653-8I/ncs5500-goldenk9-x-6.5.3.08I-0.iso |
In case if you want to specify label information and autorun script please mention like below:
/router/bin/python gisobuild.py -i ncs5500-mini-x-6.5.3.8I.iso -r . -c running.cfg -s script.sh -l 653rev1
Sample script:
#!/bin/bash
export PATH=$PATH:/bin:/pkg/bin
mkdir -p /harddisk:/test_folder cd /harddisk:/test_folder date > log.txt id >> log.txt echo "this is a test of CSCvo27339 smu" >> log.txt /pkg/bin/show_platform_sysdb >> log.txt ng_show_version >> log.txt #show version o/p redirect to log.txt file echo -ne "2048\n" | ce_cmd addkey rsa nooption general-keys #to auto generate keys during startup sleep 1 echo "end of testing" >> log.txt |
[root@nb-server3 653-8I]# mount -o loop ncs5500-goldenk9-x-6.5.3.08I-0.iso /mnt/giso
[root@nb-server3 653-8I]# tree /mnt/giso/
/mnt/giso/
├── autorun----------------à autorun script to execute at boot up
├── boot
│ ├── bzImage
│ ├── certs
│ │ ├── CertFile
│ │ ├── crl.der
│ │ └── Root_Certificate_Store.bin
│ ├── grub
│ │ ├── device.map
│ │ ├── e2fs_stage1_5
│ │ ├── fat_stage1_5
│ │ ├── ffs_stage1_5
│ │ ├── iso9660_stage1_5
│ │ ├── jfs_stage1_5
│ │ ├── menu.lst
│ │ ├── menu.lst.install
│ │ ├── menu.lst.ucs
│ │ ├── menu.lst.ucs.install
│ │ ├── menu.lst.xboard
│ │ ├── minix_stage1_5
│ │ ├── reiserfs_stage1_5
│ │ ├── stage1
│ │ ├── stage2
│ │ ├── stage2_eltorito
│ │ ├── ufs2_stage1_5
│ │ ├── vstafs_stage1_5
│ │ └── xfs_stage1_5
│ ├── grub2
│ │ ├── bootx64.efi
│ │ ├── grub.cfg
│ │ ├── grub-usb.cfg
│ │ ├── grub-usb.efi
│ │ ├── NCS-55xx_pubkey.der
│ │ ├── README
│ │ └── swims_client.log
│ ├── initrd.img
│ ├── NCS-55xx_pubkey.der
│ ├── signature.initrd.img
│ └── swims_client.log
├── boot.catalog
├── giso_info.txt
├── giso_summary.txt
├── iosxr_image_mdata.yml
├── iso_info.txt
├── release-rpms-admin-arm.txt
├── release-rpms-admin-x86_64.txt
├── release-rpms-xr-x86_64.txt
├── router.cfg ---------------------------------------à running config file
└── xr_rpms ---------------------à RPM’s included to build an GISO.
├── ncs5500-k9sec-3.1.0.0-r65308I.x86_64.rpm
└── ncs5500-mgbl-3.0.0.0-r65308I.x86_64.rpm
5 directories, 46 files
1. Create USB bootable file:
[root@nb-server3 653-8I]# ./create_usb_zip ncs5500 ncs5500-goldenk9-x-6.5.3.08I-0.iso
adding: boot/ (stored 0%)
adding: boot/install-image.iso (deflated 0%)
adding: EFI/ (stored 0%)
adding: EFI/boot/ (stored 0%)
adding: EFI/boot/grub.cfg (deflated 66%)
adding: EFI/boot/bootx64.efi (deflated 67%)
Zip file created - ncs5500-usb_boot.zip
2. Insert the USB into the router this will mounted as /disk2:/ in the router or any device then just unzip it. Now the bootable USB is ready.
[xr-vm_node0_RP0_CPU0:/disk2:]$unzip ncs5500-usb_boot.zip
Archive: ncs5500-usb_boot.zip
creating: boot/
inflating: boot/install-image.iso
creating: EFI/
creating: EFI/boot/
inflating: EFI/boot/grub.cfg
inflating: EFI/boot/bootx64.efi
Insert the boot device into a router USB port and then just power cycle the device.
During the boot up enter the esc character to enter into BIOS settings.
Choose USB drive for boot as mentioned below:
Image Name = \EFI\BOOT\BOOTX64.EFI
Image Size = 915998 Bytes
------------Cisco Secure Boot: Begin ------------
-----------Cisco Secure Boot: Verifying-----------
Image verified successfully. Booting..
------------Cisco Secure Boot: End ------------
GNU GRUB version 2.00
Press F2 to goto grub Menu..
Booting from USB..
Loading Kernel..
Kernel Secure Boot Validation Result: PASSED
Loading initrd..
Initrd Secure Boot Validation Result: PASSED
.
.
.
LC/0/0/CPU0:Mar 27 00:41:06.279 UTC: fia_driver[259]: %PLATFORM-DPA-2-RX_FAULT : Interface HundredGigE0/0/0/22, Detected Remote Fault
LC/0/0/CPU0:Mar 27 00:41:06.304 UTC: ifmgr[152]: %PKT_INFRA-LINK-3-UPDOWN : Interface HundredGigE0/0/0/22, changed state to Up
LC/0/0/CPU0:Mar 27 00:41:07.380 UTC: fia_driver[259]: %PLATFORM-DPA-2-RX_FAULT : Interface HundredGigE0/0/0/4, Detected Remote Fault
LC/0/0/CPU0:Mar 27 00:41:07.407 UTC: ifmgr[152]: %PKT_INFRA-LINK-3-UPDOWN : Interface HundredGigE0/0/0/4, changed state to Up
LC/0/0/CPU0:Mar 27 00:41:21.119 UTC: fia_driver[259]: %FABRIC-FIA_DRVR-2-LINK_REACH_REQ_COUNT : [3267] : LC-Bandwidth-Degradation :CLEAR :0/0/1
LC/0/0/CPU0:Mar 27 00:41:21.120 UTC: fia_driver[259]: %PKT_INFRA-FM-2-FAULT_CRITICAL : ALARM_CRITICAL :LC-BW-DEG :CLEAR :0/0/CPU0:
User Access Verification
Username: root
Password:
Router load completed with specified actions.
1. How to run crypto key command at the startup without user intervention?
Add the following text to a file and and give input while building GISO
#!/bin/bash
export PATH=$PATH:/bin:/pkg/bin
echo -ne "2048\n" | ce_cmd addkey rsa nooption general-keys
2. How to add custom files or rpms to spcified location using GISO?
create a directory on USB disk named “other-rpms” and put a few files in it. And then create a script “test.sh” with the below content into the GISO. After USB boot, the script copied the files from USB other-rpm directory to /harddisk:/additional_rpms directory.
#!/bin/bash
export PATH=$PATH:/bin:/pkg/bin
RPM_DIRECTORY="/disk2:/other-rpms"
echo -ne "2048\n" | ce_cmd addkey rsa nooption general-keys
sleep 1
if [ -d "$RPM_DIRECTORY" ] && [ "$(ls -A $RPM_DIRECTORY)" ]; then
echo "copying the file"
mkdir -p /harddisk:/additional_rpms/
cp -r "$RPM_DIRECTORY"/* /harddisk:/additional_rpms/
fi
echo "end of testing" >> log.txt
3. Do we need any particular version of linux required?
Any linux version with mentioned shell utils in the requirements section should work
Venkateswaran Nagarajan
Technical Leader – IOS-XR platforms
Attached the PPT version for your offline reference
Useful, thank you.
One question, with GISO should the useful "Label :" line show up in the "show version" ? I am not seeing it on 6.5.3 on NCS5501, with a confirmed GISO boot.
Hi Andre, sorry somehow missed your comment, yeah it would show up something like below
RP/0/RP0/CPU0:OC-PF#show version
Wed May 22 04:26:36.457 UTC
Cisco IOS XR Software, Version 6.5.3
Copyright (c) 2013-2019 by Cisco Systems, Inc.
Build Information:
Built By : ahoang
Built On : Tue Mar 26 06:46:13 PDT 2019
Built Host : iox-ucs-027
Workspace : /auto/srcarchive13/prod/6.5.3/ncs5500/ws
Version : 6.5.3
Location : /opt/cisco/XR/packages/
Label : 6.5.3-rev0 ---> Label info.
If not shown can you please tthe command used to build GISO?
Hello,
I'm trying the to boot the NCS55a2 with a GISO build with 4 RPMs + xr_config file.
Below the elements that are included the build:
RPM
- ncs5500-isis-2.1.0.0-r661.x86_64.rpm
- ncs5500-k9sec-3.1.0.0-r661.x86_64.rpm
- ncs5500-mcast-2.1.0.0-r661.x86_64.rpm
- ncs5500-mgbl-3.0.0.0-r661.x86_64.rpm
ISO
- ncs5500-mini-x-6.6.1.iso
The problem is that when the router boots up it has installed only ncs5500-xr-6.6.1 version=6.6.1 [Boot image].
There are no RPMs nor xr_config injected.
Did anyone have this kind of problem or can share any remarks that could help to solve this issue.
I'd be grateful for any kind of help.
Thank you.
Wojciech
Hello Narvenka,
Thanks for your response. I've checked already the content of the GISO build before reboot/installation and all looked fine.
Please see below the information that you are asking for.
GISO COMMAND
./gisobuild.py -i ncs5500-mini-x-6.6.1.iso -r . -c router.cfg -l template
CISCO
RP/0/RP0/CPU0:ios#sh install active summary
Fri Dec 7 06:49:35.830 UTC
Active Packages: 1
ncs5500-xr-6.6.1 version=6.6.1 [Boot image]
RP/0/RP0/CPU0:ios#sh install log
Fri Dec 7 06:50:57.629 UTC
No install operation performed
TREE
root@wojciech:~/Desktop/NCS# tree /mnt/giso/
/mnt/giso/
├── boot
│ ├── bzImage
│ ├── certs
│ │ ├── CertFile
│ │ ├── crl.der
│ │ └── Root_Certificate_Store.bin
│ ├── grub
│ │ ├── device.map
│ │ ├── e2fs_stage1_5
│ │ ├── fat_stage1_5
│ │ ├── ffs_stage1_5
│ │ ├── iso9660_stage1_5
│ │ ├── jfs_stage1_5
│ │ ├── menu.lst
│ │ ├── menu.lst.install
│ │ ├── menu.lst.ucs
│ │ ├── menu.lst.ucs.install
│ │ ├── menu.lst.xboard
│ │ ├── minix_stage1_5
│ │ ├── reiserfs_stage1_5
│ │ ├── stage1
│ │ ├── stage2
│ │ ├── stage2_eltorito
│ │ ├── ufs2_stage1_5
│ │ ├── vstafs_stage1_5
│ │ └── xfs_stage1_5
│ ├── grub2
│ │ ├── bootx64.efi
│ │ ├── grub.cfg
│ │ ├── grub-usb.cfg
│ │ ├── grub-usb.efi
│ │ ├── NCS-55xx_pubkey.der
│ │ ├── README
│ │ └── swims_client.log
│ ├── initrd.img
│ ├── NCS-55xx_pubkey.der
│ ├── signature.initrd.img
│ └── swims_client.log
├── boot.catalog
├── giso_info.txt
├── giso_summary.txt
├── iosxr_image_mdata.yml
├── iso_info.txt
├── release-rpms-admin-arm.txt
├── release-rpms-admin-x86_64.txt
├── release-rpms-xr-x86_64.txt
├── router.cfg
└── xr_rpms
├── ncs5500-isis-2.1.0.0-r661.x86_64.rpm
├── ncs5500-k9sec-3.1.0.0-r661.x86_64.rpm
├── ncs5500-mcast-2.1.0.0-r661.x86_64.rpm
└── ncs5500-mgbl-3.0.0.0-r661.x86_64.rpm
5 directories, 47 files
--
Wojciech
Hello narvenka,
Thanks for writing this article, it's very helpful. I didn't have any issues creating the GISO, that script works great, however I'm not able to run the create_usb_script. I get a syntax error that I'm not sure how to resolve:
./create_usb_zip: 16: Syntax error: "(" unexpected
Any help you can provide here would be greatly appreciated.
Hi All ,
I had issue with NCS 5501-SE, Device was stuck in boot <pic attached>
Device was not showing on console , & Led Status were amber & flashing ,
after power cycle Below screen appeared on console , baud rate 115200
as per TAC , you need to download zip recovery file from cisco software webesite & download to USB/Pendrive drive ( format pendrive with fat32)
extract 2 folders ( boot , EFI) to pendrive only & delete other empty folder , This is create bootable USB drive
then plug usb drive to device , it will get detected as disk1 or disk2
when you hit C for normal boot , press esc or delete , It will Open BIOS , there you can choose UEFI USB media to boot from usb
2nd option , you can choose shell to manually give boot command
a. in shell type , fs1:
b. ls -ltr , you can see two folders boot & EFI
c. cd EFI
d. cd boot
e. ls -ltr , then you can see file bootx64.efi
f. type bootx64.efi, system will start booting from usb pendrive
unfortuantely for me , This dis not recover device & had to do RMA
https://software.cisco.com/download/home/286313162/type/280805694/release/7.10.2
>
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: