linux-chromebook.install 766 B

123456789101112131415161718192021222324252627
  1. post_install () {
  2. if mountpoint -q /boot; then
  3. major=$(mountpoint -d /boot | cut -f 1 -d ':')
  4. minor=$(mountpoint -d /boot | cut -f 2 -d ':')
  5. else
  6. major=$(mountpoint -d / | cut -f 1 -d ':')
  7. minor=$(mountpoint -d / | cut -f 2 -d ':')
  8. fi
  9. device=$(cat /proc/partitions | awk {'if ($1 == "'${major}'" && $2 == "'${minor}'") print $4 '})
  10. device="/dev/${device/%2/1}"
  11. echo "A new kernel version needs to be flashed onto ${device}."
  12. echo "Do you want to do this now? [y|N]"
  13. read -r shouldwe
  14. if [[ $shouldwe =~ ^([yY][eE][sS]|[yY])$ ]]; then
  15. dd if=/boot/vmlinux.kpart of=${device}
  16. sync
  17. else
  18. echo "You can do this later by running:"
  19. echo "# dd if=/boot/vmlinux.kpart of=${device}"
  20. fi
  21. }
  22. post_upgrade() {
  23. post_install
  24. }