wok-current view linux-lxc/receipt @ rev 15685
linux-lxc: add post_install() for update menu.lst
author | Stanislas Leduc <shann@slitaz.org> |
---|---|
date | Sat Dec 21 07:21:07 2013 +0100 (2013-12-21) |
parents | 78f8749b32c7 |
children | 6c04939f80d7 |
line source
1 # SliTaz package receipt
3 PACKAGE="linux-lxc"
4 VERSION="2.6.37"
5 CATEGORY="misc"
6 SHORT_DESC="The Linux kernel and modules with LXC support."
7 MAINTAINER="shann@slitaz.org"
8 TARBALL="$PACKAGE-$VERSION.tar.gz"
9 WEB_SITE="http://linuxcontainers.org/"
10 WGET_URL="http://people.slitaz.org/~shann/packages/$PACKAGE/$TARBALL"
11 PROVIDE="linux"
13 DEPENDS="lxc"
15 # Rules to gen a SliTaz package suitable for Tazpkg.
16 genpkg_rules()
17 {
18 cp -a $src/boot $fs
19 cp -a $src/lib/modules $fs/lib
20 cp -a $src/lib/firmware $fs/lib
21 chown -R root.root $fs
22 }
24 # Pre and post install commands for Tazpkg.
25 post_install()
26 {
27 echo "Processing post-install commands..."
28 chroot "$1/" depmod -a $VERSION-lxc-slitaz
29 # GRUB stuff.
30 if [ -f "$1/boot/grub/menu.lst" ]; then
31 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^
32 ]*\).*/\1/' | head -n 1`
33 grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n
34 1`
35 # Add new kernel entry in case of upgrade for installed system.
36 if ! grep -q $PACKAGE-$VERSION-lxc-slitaz $1/boot/grub/menu.lst;
37 then
38 cat >> $1/boot/grub/menu.lst << EOT
40 title SliTaz GNU/Linux (Kernel $VERSION-lxc-slitaz)
41 $grub_dev
42 kernel /boot/vmlinuz-$VERSION-lxc-slitaz root=$root_dev
43 EOT
44 fi
45 # Display information message.
46 cat <<EOT
47 ----
48 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst:
50 title SliTaz GNU/Linux (Kernel $VERSION-lxc-slitaz)
51 $grub_dev
52 kernel /boot/vmlinuz-$VERSION-lxc-slitaz root=$root_dev
53 ----
54 EOT
55 fi
56 }