SWIX format
(verified 2010 May. / EOS 4.3.0 / DCS-7120T-4S 03.01)
SWIX format
SWIX (Software image extension) format is dedicated for Extension of Arista. It is zipped file and it includes one or more RPM files and one manifest.txt file.
Disassembling : manifest.txt file
If you unzip the hello.swix file that we show it in Extention document. (you can get it from our Resources.)
It includes manifest.txt file and a RPM file as follows;
$ ls
hello.swix
$ unzip hello.swix
Archive: hello.swix
extracting: manifest.txt
extracting: hello-1.0-0.noarch.rpm
$ ls
hello-1.0-0.noarch.rpm hello.swix manifest.txt
$ ls -l
total 12
-rwxrwx--- 1 admin eosadmin 2821 May 13 18:16 hello-1.0-0.noarch.rpm
-rwxr-x--- 1 admin eosadmin 3246 May 14 11:28 hello.swix
-rwxrwx--- 1 admin eosadmin 115 May 13 18:17 manifest.txt
$
Here is the content of manifest.txt file.
$ cat manifest.txt
format: 1
primaryRpm: hello-1.0-0.noarch.rpm
hello-1.0-0.noarch.rpm-sha1: 9d801cb69a6d8189cc5fecdfce72402bdb63f8f3
$
Each parameter means,
- format number : fixed to 1 ( not sure the other variations )
- primaryRpm : when it includes multiple RPM files, select one RPM by this. Even if there is only single RPM file, it needs to write like above example. SHOW EXTENSIONS DETAIL command will pick information from specified RPM.
- SHA1 hash : each RPM hash value.
Please remind that the above knowledges are discovered from EOS behavior and pieces of source codes. So it may be wrong.
Building
swix command is available. It builds SWIX format package from RPM files automatically. It is able to use from bash.
[admin@localhost ~]$ swix create hello.swi hello-1.0-0.noarch.rpm
adding: manifest.txt (stored 0%)
adding: hello-1.0-0.noarch.rpm (stored 0%)
[admin@localhost ~]$ ls -l hello.swi
-rw-r--r-- 1 admin eosadmin 3246 May 14 11:44 hello.swi
[admin@localhost ~]$ ls -l hello-1.0-0.noarch.rpm
-rwxrwx--- 1 admin eosadmin 2821 May 13 18:16 hello-1.0-0.noarch.rpm
[admin@localhost ~]$
It looks there is no other options of swix command.
[admin@localhost ~]$ swix
Unknown command. Try 'swix help' for info.
[admin@localhost ~]$ swix help
create Create a swix file with the given name
[admin@localhost ~]$
By the way, swix command is Python script and it is simple wrapper of Swix library under site-script directory. For more detail of SWIX, it is the best way to follow the source code of the library.
And of course, SWIX file structure is very simple. It is possible to build SWIX package without swix command or library. Just write manifest.txt file then pack files by generic zip utility.