From 650aae7b5832b4479f47592315c431bde865cd68 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Mon, 29 Dec 2008 15:59:18 +0100 Subject: [PATCH] kernel: added a prepost-action script to create the initramfs. --HG-- extra : convert_revision : 50026c51a815fafbe655d39c8fa3dd31dffd5846 --- templates/kernel.prepost-action | 39 +++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 templates/kernel.prepost-action diff --git a/templates/kernel.prepost-action b/templates/kernel.prepost-action new file mode 100644 index 0000000000..3898259db3 --- /dev/null +++ b/templates/kernel.prepost-action @@ -0,0 +1,39 @@ +#!/bin/sh -e + +export PATH="/bin:/sbin:/usr/bin:/usr/sbin" + +# $1 = chrootdir +# $2 = action +# $3 = pkgname +# $4 = version + +case "$2" in +preinst) + ;; +postinst) + echo "Running $3-$4 post-installation command..." + if [ "$1" = "NOTSET" ]; then + if $(mount|grep "^/proc" 2>&1 >/dev/null); then + mntproc_cmd="mount -t proc proc /proc" + umntproc_cmd="umount /proc" + fi + initramfs_cmd="update-initramfs" + else + mntproc_cmd="chroot $1 mount -t proc proc ./proc" + umntproc_cmd="chroot $1 umount ./proc" + initramfs_cmd="chroot $1 update-initramfs" + fi + + if [ ! -f ./var/lib/initramfs-tools/$4 ]; then + initramfs_cmd="$initramfs_cmd -c -k $4" + else + initramfs_cmd="$initramfs_cmd -u -k $4" + fi + + ${mntproc_cmd} + ${initramfs_cmd} + ${umntproc_cmd} + ;; +esac + +exit 0