tails-boot-to-kexec 548 Bytes
Newer Older
1 2
#!/bin/sh

3 4
running_amd64_kernel() {
   uname -r | grep -qs 'amd64$'
5 6 7 8 9
}

case "$1" in
   kernel)
      boot_kernel="$2"
10
      if running_amd64_kernel ; then
11 12 13 14
         echo "$boot_kernel" | sed -e 's,/vmlinuz$,/vmlinuz2,'
      else
         echo "$boot_kernel"
      fi
15 16 17
      ;;
   initrd)
      boot_initrd="$2"
18
      if running_amd64_kernel ; then
19 20 21 22
         echo "$boot_initrd" | sed -e 's,/initrd\.img$,/initrd2.img,'
      else
         echo "$boot_initrd"
      fi
23 24
      ;;
   *)
25
      echo "Usage: $0 kernel|initrd" >&2
26 27 28 29
      exit 3
esac

exit 0