wok annotate linux-libre/receipt @ rev 24299

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