imx.sh 574 B

123456789101112131415161718192021222324252627282930
  1. #
  2. # Copyright (C) 2010-2013 OpenWrt.org
  3. #
  4. rootpartuuid() {
  5. local cmdline=$(cat /proc/cmdline)
  6. local bootpart=${cmdline##*root=}
  7. bootpart=${bootpart%% *}
  8. local uuid=${bootpart#PARTUUID=}
  9. echo ${uuid%-02}
  10. }
  11. bootdev_from_uuid() {
  12. blkid | grep "PTUUID=\"$(rootpartuuid)\"" | cut -d : -f1
  13. }
  14. bootpart_from_uuid() {
  15. blkid | grep $(rootpartuuid)-01 | cut -d : -f1
  16. }
  17. rootpart_from_uuid() {
  18. blkid | grep $(rootpartuuid)-02 | cut -d : -f1
  19. }
  20. apalis_mount_boot() {
  21. mkdir -p /boot
  22. [ -f /boot/uImage ] || {
  23. mount -o rw,noatime $(bootpart_from_uuid) /boot > /dev/null
  24. }
  25. }