• 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
Name
Last commit
Last update
binaries Loading commit data...
build Loading commit data...
configs Loading commit data...
doc Loading commit data...
hwinfo-sdb Loading commit data...
kernel Loading commit data...
patches Loading commit data...
robustness/coding Loading commit data...
scripts Loading commit data...
usb-loader Loading commit data...
userspace Loading commit data...
.gitignore Loading commit data...
.gitmodules Loading commit data...
COPYING Loading commit data...
Kconfig Loading commit data...
Makefile Loading commit data...
Makefile.kconfig Loading commit data...
README Loading commit data...