wok annotate linux-libre/receipt @ rev 25636

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