zram.sh 526 B

12345678910111213141516171819202122232425262728
  1. #!/bin/bash
  2. # SPDX-License-Identifier: GPL-2.0
  3. TCID="zram.sh"
  4. . ./zram_lib.sh
  5. run_zram () {
  6. echo "--------------------"
  7. echo "running zram tests"
  8. echo "--------------------"
  9. ./zram01.sh
  10. echo ""
  11. ./zram02.sh
  12. }
  13. check_prereqs
  14. # check zram module exists
  15. MODULE_PATH=/lib/modules/`uname -r`/kernel/drivers/block/zram/zram.ko
  16. if [ -f $MODULE_PATH ]; then
  17. run_zram
  18. elif [ -b /dev/zram0 ]; then
  19. run_zram
  20. else
  21. echo "$TCID : No zram.ko module or /dev/zram0 device file not found"
  22. echo "$TCID : CONFIG_ZRAM is not set"
  23. exit 1
  24. fi