diff options
Diffstat (limited to 'libre-testing/linux-libre-veyron/linux.install')
-rw-r--r-- | libre-testing/linux-libre-veyron/linux.install | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/libre-testing/linux-libre-veyron/linux.install b/libre-testing/linux-libre-veyron/linux.install new file mode 100644 index 000000000..a524c8c38 --- /dev/null +++ b/libre-testing/linux-libre-veyron/linux.install @@ -0,0 +1,38 @@ + +flash_kernel() { + major=$(mountpoint -d / | cut -f 1 -d ':') + minor=$(mountpoint -d / | cut -f 2 -d ':') + device=$(awk '{if ($1 == "'"${major}"'" && $2 == "'"${minor}"'") print $4}' < /proc/partitions) + device="/dev/${device/%2/1}" + + echo "A new kernel version needs to be flashed onto ${device}." + echo -n " do you want to do this now? [y/N] " + read -n 1 -r + (( ${#REPLY} == 1 )) && echo + + if [[ ! $REPLY =~ ^[Yy]$ ]]; then + echo "You can do this later by running:" + echo "# dd if=/boot/vmlinux.kpart of=${device}" + else + dd if=/boot/vmlinux.kpart of="${device}" + sync + fi +} + +post_install () { + flash_kernel +} + +post_upgrade() { + if [ "$(uname -m)" = "x86_64" ] || [ "$(uname -m)" = "i686" ]; then + if findmnt --fstab -uno SOURCE /boot &>/dev/null && ! mountpoint -q /boot; then + echo "WARNING: /boot appears to be a separate partition but is not mounted." + fi + fi + flash_kernel +} + +post_remove() { + rm -f boot/initramfs-%PKGBASE%.img + rm -f boot/initramfs-%PKGBASE%-fallback.img +} |