home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / share / ubiquity / check-kernels < prev    next >
Encoding:
Text File  |  2006-04-21  |  1.0 KB  |  41 lines

  1. #! /bin/sh
  2.  
  3. ARCH="$(dpkg --print-architecture)"
  4. SUBARCH="$(archdetect)"
  5. SUBARCH="${SUBARCH#*/}"
  6. CPUINFO=/proc/cpuinfo
  7. KERNEL_MAJOR="$(uname -r | cut -d . -f 1,2)"
  8. KERNEL_VERSION="$(uname -r | cut -d - -f 1)"
  9. KERNEL_ABI="$(uname -r | cut -d - -f 1,2)"
  10. MACHINE="$(uname -m)"
  11. NUMCPUS=
  12.  
  13. if [ -f /usr/lib/ubiquity/base-installer/kernel.sh ]; then
  14.     . /usr/lib/ubiquity/base-installer/kernel.sh
  15. else
  16.     exit 0
  17. fi
  18.  
  19. kernels="$(dpkg-query -f '${status} ${package}\n' -W linux-image-\* | \
  20.         grep '^install ok installed ' | cut -d' ' -f4 | xargs)"
  21.  
  22. flavour="$(arch_get_kernel_flavour || true)"
  23. incompatible=
  24. for kernel in $kernels; do
  25.     if ! arch_check_usable_kernel "$kernel" "$flavour"; then
  26.         incompatible="${incompatible:+$incompatible }$kernel"
  27.     fi
  28. done
  29.  
  30. if [ "$kernels" = "$incompatible" ]; then
  31.     # We must be wrong. After all, we got this far ...
  32.     echo 'No usable kernel found; assuming foreign package naming' >&2
  33. else
  34.     mkdir -p /var/lib/ubiquity
  35.     for kernel in $incompatible; do
  36.         echo "$kernel" >> /var/lib/ubiquity/remove-kernels
  37.     done
  38. fi
  39.  
  40. exit 0
  41.