wok-4.x view linux-lxc/receipt @ rev 12422

linux-lxc: modify post_install() for update /etc/fstab
author Stanislas Leduc <shann@slitaz.org>
date Sat Dec 21 08:41:14 2013 +0100 (2013-12-21)
parents b7c0ad6f5fca
children ab5539bc9d8a
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 "Update /etc/fstab for use cgroup..."
28 echo "none /cgroup cgroup defaults 0 0" >> /etc/fstab
30 echo "Processing post-install commands..."
31 chroot "$1/" depmod -a $VERSION-lxc-slitaz
32 # GRUB stuff.
33 if [ -f "$1/boot/grub/menu.lst" ]; then
34 root_dev=`cat $1/boot/grub/menu.lst | grep root= | sed 's/.*root=\([^
35 ]*\).*/\1/' | head -n 1`
36 grub_dev=`cat $1/boot/grub/menu.lst | grep "root (" | head -n
37 1`
38 # Add new kernel entry in case of upgrade for installed system.
39 if ! grep -q $PACKAGE-$VERSION-lxc-slitaz $1/boot/grub/menu.lst;
40 then
41 cat >> $1/boot/grub/menu.lst << EOT
43 title SliTaz GNU/Linux (Kernel $VERSION-lxc-slitaz)
44 $grub_dev
45 kernel /boot/vmlinuz-$VERSION-lxc-slitaz root=$root_dev
46 EOT
47 fi
48 # Display information message.
49 cat <<EOT
50 ----
51 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst:
53 title SliTaz GNU/Linux (Kernel $VERSION-lxc-slitaz)
54 $grub_dev
55 kernel /boot/vmlinuz-$VERSION-lxc-slitaz root=$root_dev
56 ----
57 EOT
58 fi
59 }