cancel
Showing results for 
Search instead for 
Did you mean: 
cancel

NCS5500 GISO Boot via USB

1884
Views
0
Helpful
5
Comments

 

 

Introduction

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.

Golden ISO(GISO)

 

  • GISO is a customised iso (iso 9660 file system), which includes desired version of iso +  rpms + SMUs + router config + autorun scripts [6.5.3]for making image management easy
  • Compared to TAR format, iso has native support in Linux for boot/installation process, eg. bundling device config within an ISO
  • RPMs and bug fixes can be delivered via GISO format helps to simplify during install process
  • GISO is a single file with FCS image or image with bug fixes

 

GISO image

Requirements

A Linux machine meets following requirements

  • 'mount','rm','cp','umount','zcat','chroot','mkisofs' tools should be available
  • User should have privilege to execute all of the above linux tool/cmd
  • Minimum python version 2.7 
  • system should have at least 4 GB free disk space
  • py script (available on all eXR running routers in the location: /pkg/bin/gisobuild.py)
    • mini iso is mandatory on file system [mandatory]
    • Desired rpms to build GISO [mandatory]
    • config file or running configuration [optional]
    • auto-run script are optional [optional]
      • Script helps to execute right after install automatically
    • Right (rx) permissions for the rpms and the other files

 

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

  1. gisobuild.py (click me to clone the file)
  2. create_usb_zip (click me to clone usb zip)

Build a GISO

 

  1. Download gisobuild.py
  2. usage

 

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

Sample execution

[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

Verify the content of GISO

 

[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

Creating an USB bootable file

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

 

USB boot in action

 

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:

Screen Shot 2019-04-13 at 4.09.48 PM.png

 

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.

 

Q  & A

 

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

Reference:

 

Venkateswaran Nagarajan

Technical Leader – IOS-XR platforms

 

Attached the PPT version for your offline reference

Comments
Beginner

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.

Cisco Employee

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?

Beginner

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

 

 

 

 

Cisco Employee
Hi Wojciech,

Sure, Can you please share your command used to generate GISO and show install active summary after boot up?
You can mount your iso with loop option and check if configs and rpms are part of the iso.

Sample as mentioned in the doc.

[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/


Beginner

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

CreatePlease to create content
Content for Community-Ad

Cisco COVID-19 Survey