Socionext development board - reflashing how-to

Step #1 "Setting the environment"

We will need the Oracle VM's Ubuntu virtual system that is supplied on the USB-stick. After launching virtual Ubuntu I would recommend to create a so-called shared folder to provide bidirectional file exchange between virtual Linux and your system (native Linux, in my case). It can be done via menu as shown on the screenshot below:

The settings are trivial: you need just to add a new shared folder and assign its path in both systems:

If everything was done right you should be able to get into this shared folder from virtual linux via filebrowser as shown below:

Step #2 "Creating the whitelist"

The creation of filesystem image for Socionext target is a bit complicated. First of all, the base "all-in-one" heavy filesystem tarball is passed through the filter. This "whitelist" filter is a text file that lists all permitted files: one file string = one full path to the file in target filesystem image. In case if any file would not become mentioned in this whitelist it will not pass to the final image. When talking about default Node.JS distribution we have ~3447 files located in different subdirectories. Some of these subdirectories are really deep. And manual whitelist updating would take much time and becomes boring very soon. Keep in mind, I'm talking about the default Node.JS distribution. In case with any other 3rd-party Node.JS dependency library the whitelist will grow even faster. So I decided to share this work with computer writing this simple Python script:

import os

# our local blacklist
blacklist = [ ".directory", "walk.py", "whitelist32123.txt" ]

for root, dirs, files in os.walk("."):
    for file in files:        
        if file in blacklist:
            continue
        print "/usr/" + root[2:] + "/" + file

It has to be copied in 8.15-release root directory and launched in the following way:

$ python walk.py > whitelist32123.txt

The script's output is saved in whitelist32123.txt file which can be found in attachment to this article. This attachment is ready to be merged with the "official" whitelist. Such an exotic name for the output file was given just to make sure that we will not forbid any real file with simple name to get into final image.

 

Step #3 "Merging the whitelist"

The actual whitelist file is available in virtual Linux on this path /home/socionext/SDK/SDK_work/CA7/projects/Linux/shrivel/whitelist-poky-1.8-netsec

We have to copy the content of the whitelist32123.txt to the very end of this file. i.e. to merge them both.

Step #4 "Making the source rootfs archive even bigger"

The filesystem archive that is supposed to become preprocessed/filtered when creating the target FS image is located in the same directory: /home/socionext/SDK/SDK_work/CA7/projects/Linux/shrivel/rootfs.tar.bz2

We need:

  1. to copy rootfs archive into native Linux environment
  2. to make a backup copy of it in safe place (just in case of emergency)
  3. to untar it
  4. to copy our 8.15-release's directory content into subdirectory /usr/ of the unpacked archive.
  5. to make a tar.bz2 archive from the merged rootfs directory.

I strongly recommend to perform tarballing of the rootfs dir from the terminal with this command:

1 tar cjvf rootfs2.tar.bz2 rootfs --pax-option=delete=SCHILY.,delete=LIBARCHIVE.

The tarball that was made with pax-option keys passes the following image creation stages while the "default" tarball becomes a source of strange errors and even "bricked" device. Also make sure that your tar.bz2 archive's structure is as shown on screenshot:

Pay attention: the top-level directory in archive must be rootfs.

Step #5 "Making binary"

At this step our filtered rootfs archive becomes converted to binary FS image. This is done right as described in the official documentation. In virtual linux terminal:

$ cd /home/socionext/SDK/SDK_work/disk
$ ./makedisk.sh

After executing of the script the binary file data.bin should appear in results subdirectory.

 

Step #6 "Preparing SD-card"

We need FAT32-formatted SD-card. The documentation requires to format the SD-card only with SD Association Formatter. As soon the card becomes ready we need to copy the following files in the its root:

  • data.bin

  • all files from the virtual linux's directory /home/socionext/SDK/SDK_work/disk

Finally you should see the following files in your SD-card's root:

Step #7 "Reflashing the target"

This step is performed in full compliance with the 3.2.4 "Updating Software" chapter of the official SC2000 Smart Kit Short Guide_v0.4 document:

  • Remove power cable
  • Insert microSD card with firmware files into slot on a PCB that is second from the top.
  • Move boot switch to left side position
  • Insert power cable
  • Press power switch – LED over power switch will light green
  • Right flash state LED will light green, start flashing after a while. Flash complete when both flash state LEDs are constantly lighting green.
  • Remove power cable (only way to reset system)
  • Move boot switch to right side position
© "Ctrl-V" 2012 - 2019