tails-get-bootinfo 532 Bytes
Newer Older
1
2
#!/bin/sh

3
LIVE_IMAGE_MOUNTPOINT=/lib/live/mount/medium
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
for arg in $(cat /proc/cmdline) ; do
   case "$arg" in
      BOOT_IMAGE=*)
         kernel="${arg#BOOT_IMAGE=}"
	 ;;
      initrd=*)
         initrd="${arg#initrd=}"
	 ;;
   esac
done

# Sanity checks
[ -n "$kernel" ] || exit 4
[ -n "$initrd" ] || exit 5

case "$1" in
   kernel)
      echo "${LIVE_IMAGE_MOUNTPOINT}${kernel}"
      ;;
   initrd)
      echo "${LIVE_IMAGE_MOUNTPOINT}${initrd}"
      ;;
   *)
27
      echo "Usage: $0 kernel|initrd" >&2
28
29
30
31
      exit 3
esac

exit 0