#!/bin/sh

if [ ! -e /boot/barebox/config ]; then
  /usr/local/bin/zy-nand-get
fi

if [ -e /boot/barebox/config ]; then
  #if [ ! -e /boot/barebox/bin/b0 ]; then
  #   cd /boot/
  #   tar xzvf /usr/local/share/linux-bsp-nas5xx/nas540-barebox-boot.tar.gz     
  #   cd - > /dev/null
  #fi
  if [ -e /boot/barebox/bin/boot ]; then
    bash /usr/local/bin/zy-bb-env-write
  fi
fi

bash /usr/local/bin/zy-kernel2-write

