• Adam Wujek's avatar
    rootfs: fix overwriting hwinfo during switch update (buildroot) · 88d2e085
    Adam Wujek authored
    When switch's firmware with buildroot older than 2016.02 was updated via
    copying wrs-firmware.tar with buildroot at least 2016.02 to the
    /update partition, then hwinfo in the flash was overwriten.
    Such behaviour was caused by crashing during execution of /wr/bin/sdb-read.
    Crashing sdb-read caused the following if's condition from the file
    /etc/init.d/hwinfo to be false.
    
    if /wr/bin/sdb-read /dev/mtd5ro > /dev/null; then
    
    This triggered later overwrite of hwinfo partition.
    
    /wr/bin/sdb-read was crashing because during update the binary /wr/bin/sdb-read
    was called from just extracted firmware. Problem pops up when libraries
    required by sdb-read are in the different versions in the old and the new
    firmware. Unfortunatelly, this problem cannot be easily solved, since we cannot
    change the update procedure in already installed firmware (the one that is
    performing update).
    
    Implemented solution does the following:
    --change the name of /wr/etc/sdb-for-dataflash to /wr/etc/sdb-for-dataflash.bin
      by this /etc/init.d/hwinfo script exits with an error without modification
      to the hwinfo partition.
    --rename link /etc/rcS/S90hwinfo to /etc/rcS/S10hwinfo, which will trigger
      update of hwinfo partition earlier during the boot.
    --restart switch after update of hwinfo in the flash
    --remove calls of /etc/init.d/hwinfo during the update
    Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
    88d2e085
wrs-boot-procedure 6.96 KB