tails-boot-to-kexec 559 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
#!/bin/sh

running_on_amd64_hardware() {
   egrep '^flags[[:space:]]+:' /proc/cpuinfo | uniq | grep -qw lm
}

case "$1" in
   kernel)
      boot_kernel="$2"
      if running_on_amd64_hardware ; then
	 echo "$boot_kernel" | sed -e 's,/vmlinuz$,/vmlinuz3,'
      else
	 echo "$boot_kernel"
      fi
      ;;
   initrd)
      boot_initrd="$2"
      if running_on_amd64_hardware ; then
	 echo "$boot_initrd" | sed -e 's,/initrd\.img$,/initrd3.img,'
      else
	 echo "$boot_initrd"
      fi
      ;;
   *)
      usage "$0 kernel|initrd"
      exit 3
esac

exit 0