summaryrefslogtreecommitdiff
path: root/makekernel.conf.in
blob: 1d7038be6b1fcb691e4c522f775a1c1acc82de5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

kernelDir=#SRCDIR#/kernel
proxyPrefix='http://mirror.home.eckner.net/'

before_install_hook() {
  mount -o remount,rw /boot
}

after_install_hook() {
  summen="$(sha512sum /boot/grub/grub.cfg /boot/vmlinuz-*)"
  original=$(mount | grep '^[^ ]* on /boot' | awk '{print $1;}')
  kopie=$(mdadm --detail /dev/disk/by-uuid/080c93f3-0c76-4821-b72f-3d1b7d807a70 | tail -n2 | sed 's/2$/1/' | grep -v "${original}" | sed 's/.* //')
  echo "${summen}"
  echo "${original}"
  echo "${kopie}"
  umount /boot || exit 1
  dd if="${original}" of="${kopie}" bs=1M || (sync; mount /boot; exit 1) || exit 1
  sync || exit 1
  mount "${kopie}" /boot -o ro || exit 1
  echo -ne "${summen}" | sha512sum -c || exit 1
}