a00ae944b5
Some other changes related for this: - Modify binpkg.sh to always insert the INSTALL script at head of the archive, and appending files after it. - Modify binpkg.sh to compress binpkgs with bzip2 -9 to save some bytes. --HG-- extra : convert_revision : b651b944f11c48dede1bbcea658182bf0984e8f3
47 lines
996 B
Text
47 lines
996 B
Text
#!/bin/sh -e
|
|
|
|
export PATH="/bin:/sbin:/usr/bin:/usr/sbin"
|
|
|
|
# $1 = chrootdir
|
|
# $2 = action
|
|
# $3 = pkgname
|
|
# $4 = version
|
|
|
|
case "$2" in
|
|
pre)
|
|
;;
|
|
post)
|
|
echo "Running $3-$4 post installation hooks..."
|
|
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
|
|
if $(mount|grep "^/sys" 2>&1 >/dev/null); then
|
|
mntsys_cmd="mount -t sysfs none /sys"
|
|
umntsys_cmd="umount /sys"
|
|
fi
|
|
initramfs_cmd="update-initramfs"
|
|
else
|
|
mntproc_cmd="chroot $1 mount -t proc proc ./proc"
|
|
umntproc_cmd="chroot $1 umount ./proc"
|
|
mntsys_cmd="chroot $1 mount -t sysfs none ./sys"
|
|
umntsys_cmd="chroot $1 umount ./sys"
|
|
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}
|
|
${mntsys_cmd}
|
|
${initramfs_cmd}
|
|
${umntproc_cmd}
|
|
${umntsys_cmd}
|
|
;;
|
|
esac
|
|
|
|
exit 0
|