wok view linux-libre/receipt @ rev 20604

Up linux-libre (3.18.129)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Dec 17 23:42:42 2018 +0100 (2018-12-17)
parents 10c74e95b062
children 0f7e6289846d
line source
1 # SliTaz package receipt.
3 PACKAGE="linux-libre"
4 VERSION="3.18.129-gnu"
5 CATEGORY="base-system"
6 SHORT_DESC="The Linux Libre kernel and modules."
7 MAINTAINER="gokhlayeh@slitaz.org"
8 LICENSE="GPL2"
9 PROVIDE="linux"
10 TARBALL="$PACKAGE-$VERSION.tar.bz2"
11 WEB_SITE="http://www.fsfla.org/svnwiki/selibre/linux-libre/"
12 WGET_URL="http://www.fsfla.org/svnwiki/selibre/linux-libre/download/releases/$VERSION/$TARBALL"
14 DEPENDS="kmod"
15 BUILD_DEPENDS="slitaz-toolchain perl git xz lzma patch kmod bc \
16 sysfsutils-dev libtool glib-dev libwrap libwrap-dev udev-dev"
18 # Rules to configure and make the package.
19 compile_rules()
20 {
21 # SliTaz db
22 rm -rf $WOK/$PACKAGE/slitaz && mkdir $WOK/$PACKAGE/slitaz
23 echo "$WGET_URL" > $WOK/$PACKAGE/slitaz/url
24 cp $stuff/gztazmod.sh $stuff/list_modules.sh $WOK/$PACKAGE/slitaz
25 cp $stuff/bootloader.sh $WOK/$PACKAGE/slitaz
27 # Apply patches
28 echo "Applying patches..."
29 while read patch_file; do
30 echo "$patch_file" >> $WOK/$PACKAGE/slitaz/patches
31 cp $stuff/$patch_file $WOK/$PACKAGE/slitaz
32 if [ -f done.$patch_file ]; then
33 echo "Skipping $patch_file"
34 continue
35 fi
36 echo "Apply $patch_file"
37 patch -p1 < $WOK/$PACKAGE/slitaz/$patch_file || return 1
38 touch done.$patch_file
39 done <<EOT
40 $PACKAGE-lzma-$VERSION.u
41 $PACKAGE-freeinitrd-$VERSION.u
42 EOT
44 make mrproper
45 cd tools/lguest
46 make $MAKEFLAGS lguest || return 1
47 cd $src
49 # Build bzImage without modules first
50 cp -f $stuff/$PACKAGE-$VERSION-slitaz.config .config
51 sed -i 's/CONFIG_MODULES=y/# CONFIG_MODULES is not set/' .config
53 yes '' | make oldconfig
54 make $MAKEFLAGS bzImage || return 1
55 [ -d $DESTDIR ] || mkdir -p $DESTDIR
56 mv arch/x86/boot/bzImage $DESTDIR
57 mv System.map System.map-without-modules
59 # Build bzImage with modules
60 cp -f $stuff/$PACKAGE-$VERSION-slitaz.config .config
61 make oldconfig
62 ln .config $WOK/$PACKAGE/slitaz/config
63 make $MAKEFLAGS bzImage &&
64 make $MAKEFLAGS modules &&
65 make INSTALL_MOD_PATH=$DESTDIR modules_install &&
66 make INSTALL_HDR_PATH=$DESTDIR/usr headers_install &&
67 [ -s arch/x86/boot/bzImage ] || return 1
68 mkdir -p $DESTDIR/boot 2> /dev/null
69 mv arch/x86/boot/bzImage $DESTDIR/boot/vmlinuz-$VERSION-slitaz
71 # Compress all modules.
72 $stuff/gztazmod.sh $DESTDIR/lib/modules/$VERSION-slitaz
73 ln System.map System.map-modules
74 ln Module.symvers Module.symvers-modules
75 }
77 # Rules to gen a SliTaz package suitable for Tazpkg.
78 genpkg_rules()
79 {
80 local path
81 cp -a $install/boot $fs
82 # Compress all modules.
83 #$stuff/gztazmod.sh $install/lib/modules/$VERSION-slitaz
84 path=$fs/lib/modules/$VERSION-slitaz/kernel
85 mkdir -p $path
86 cp -a $install/lib/modules/$VERSION-slitaz/mo* \
87 $fs/lib/modules/$VERSION-slitaz
88 # Get the base modules
89 export src
90 export _pkg
91 mkdir $WOK/$PACKAGE/tmp
92 $stuff/list_modules.sh \
93 $(cat stuff/modules-$VERSION.list) > $WOK/$PACKAGE/tmp/modules.list
94 while read module; do
95 dir=$(dirname $module)
96 [ -d $path/$dir ] || mkdir -p $path/$dir
97 cp -a $install/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir
98 done < $WOK/$PACKAGE/tmp/modules.list
99 # Remove unresolved links
100 rm -f $fs/lib/modules/$VERSION-slitaz/build
101 rm -f $fs/lib/modules/$VERSION-slitaz/source
103 # Pack all packages with a kernel module
104 for i in $(cd $WOK; grep -l '^WANTED="linux-libre"' */receipt); do
105 [ ! -d "$install/lib/modules/$VERSION-slitaz" ] && return 1
106 cook ${i%/receipt}
107 done
109 # Check and echo any module in kernel .config that's not added to
110 # one of linux-* pkgs
111 export PACKAGE
112 $stuff/check_modules.sh
113 }
115 # Pre and post install commands for Tazpkg.
116 post_install()
117 {
118 chroot "$1/" depmod -a $VERSION-slitaz
119 # GRUB stuff.
120 if [ -f "$1/boot/grub/menu.lst" ]; then
121 root_dev=$(cat "$1/boot/grub/menu.lst" | grep root= | sed 's/.*root=\([^ ]*\).*/\1/' | head -n 1)
122 grub_dev=$(cat "$1/boot/grub/menu.lst" | grep "root (" | head -n 1)
123 # Add new kernel entry in case of upgrade for installed system.
124 if ! grep -q $PACKAGE-$VERSION-slitaz "$1/boot/grub/menu.lst"; then
125 cat >> "$1/boot/grub/menu.lst" <<EOT
127 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
128 $grub_dev
129 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
130 EOT
131 fi
132 # Display information message.
133 cat <<EOT
134 ----
135 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst:
137 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
138 $grub_dev
139 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
140 ----
141 EOT
142 fi
143 true
144 }