Advertisement
Guest User

Untitled

a guest
Apr 15th, 2014
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.19 KB | None | 0 0
  1. ali@build:~/src/base-installer$ cat ./kernel/i386.sh
  2. arch_get_kernel_flavour () {
  3.     # Should we offer an amd64 kernel?
  4.     local HAVE_LM
  5.     if grep -q '^flags.*\blm\b' "$CPUINFO"; then
  6.         HAVE_LM=y
  7.     else
  8.         HAVE_LM=n
  9.     fi
  10.  
  11.     # Should we offer a PAE kernel?
  12.     local HAVE_PAE
  13.     if grep -q '^flags.*\bpae\b' "$CPUINFO"; then
  14.         HAVE_PAE=y
  15.     else
  16.         HAVE_PAE=n
  17.     fi
  18.  
  19.     case "$HAVE_LM$HAVE_PAE" in
  20.         yy)
  21.         echo 686-pae 686-bigmem amd64 486
  22.         return 0
  23.         ;;
  24.         yn)
  25.         warning "Processor with LM but no PAE???"
  26.         ;;
  27.         ny)
  28.         echo 686-pae 686-bigmem 486
  29.         return 0
  30.         ;;
  31.         nn)
  32.         echo 486
  33.         ;;
  34.     esac
  35. }
  36.  
  37. arch_check_usable_kernel () {
  38.     local NAME="$1"
  39.  
  40.     set -- $2
  41.     while [ $# -ge 1 ]; do
  42.         case "$1:$NAME" in
  43.             *:*-"$1" | *:*-"$1"-*)
  44.             # Allow any other hyphenated suffix
  45.             return 0
  46.             ;;
  47.             686-*:*-generic | 686-*:*-generic-*)
  48.             return 0
  49.             ;;
  50.             686-*:*-virtual | 686-*:*-virtual-*)
  51.             return 0
  52.             ;;
  53.         esac
  54.         shift
  55.     done
  56.     return 1
  57. }
  58.  
  59. arch_get_kernel () {
  60.     imgbase="linux-image"
  61.  
  62.     set -- $1
  63.     while [ $# -ge 1 ]; do
  64.         case $1 in
  65.             686-*)
  66.             echo "linux-generic"
  67.             echo "linux-image-generic"
  68.             echo "linux-virtual"
  69.             echo "linux-image-virtual"
  70.             break
  71.             ;;
  72.         esac
  73.         shift
  74.     done
  75. }
  76. ali@build:~/src/base-installer$ ^C
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement