wok-current view linux/receipt @ rev 25697
Up apache (CVE-2023-38709, CVE-2024-24795, CVE-2024-27316), up libarchive, qemu, add amdgpu/touchpad support and clean modules.list, up website for repology
author | Stanislas Leduc <shann@slitaz.org> |
---|---|
date | Tue Apr 16 17:00:21 2024 +0000 (7 months ago) |
parents | db14014acdba |
children | b24b6ee1d4d2 |
line source
1 # SliTaz package receipt.
3 PACKAGE="linux"
4 VERSION="5.10.215"
5 CATEGORY="base-system"
6 SHORT_DESC="The Linux kernel and modules."
7 MAINTAINER="devel@slitaz.org"
8 LICENSE="GPL2"
9 TARBALL="$PACKAGE-$VERSION.tar.xz"
10 WEB_SITE="https://www.kernel.org/"
11 WGET_URL="https://cdn.kernel.org/pub/linux/kernel/v${VERSION%%.*}.x/$TARBALL"
12 HOST_ARCH="i486 arm x86_64"
14 DEPENDS="kmod"
15 BUILD_DEPENDS="bash perl git xz lzma patch kmod bc findutils diffutils \
16 sysfsutils-dev elfutils-dev libtool glib-dev libwrap-dev openssl-dev \
17 udev-dev autoconf automake"
19 #
20 # The Linux receipt handle cross compilation. For x86_64 we actually use
21 # the uclibc-cross-compiler-x86_64 and for ARM we use a real cross env.
22 # Please discuss any change and keep it simple, dont play with VERSION
23 # string or Kernel SUBLEVEL because depmod and Pankso dont like that!
24 #
25 # The receipt also handle some cook options for faster build:
26 # --nox32 : skip the x86 compilation
27 # --nox64 : skip the x86_64 cross compilation
28 # --nopae : skip the PAE compilation
29 # --nonomods : skip bzImage without modules build
30 #
32 # Aufs enable chroot
33 #AUFS_NOT_RAMFS="uclibc-cross-compiler-x86_64 is not compatible with aufs+tmpfs 8("
35 current_version()
36 {
37 wget -O - $WEB_SITE 2> /dev/null | grep -A 1 longterm | \
38 sed '/strong/!d;s|.*<strong>||;s|</s.*||;q'
39 }
41 # Handle multiarch compilation. Less bdeps when cross-compiling for ARM
42 case "$ARCH" in
43 arm) BUILD_DEPENDS="xz" ;;
44 x86_64) BUILD_DEPENDS="xz" ;;
45 esac
47 # Handle multiarch installation. ARM use Busybox modutils, so avoid any
48 # deps on kmod. SLITAZ_ARCH can have also custom post_install commands
49 if [ -f $root/etc/slitaz/slitaz.conf ]; then
50 . $root/etc/slitaz/slitaz.conf
51 case "$SLITAZ_ARCH" in
52 arm) DEPENDS="" ;;
53 esac
54 fi
56 install_module_headers()
57 {
58 local path
59 path=usr/src/linux-$KVERSION
60 mkdir -p $1/lib/modules/$KVERSION
61 ln -sf /$path $1/lib/modules/$KVERSION/build
62 install -D -m644 $src/Makefile \
63 $1/$path/Makefile
64 install -D -m644 $src/kernel/Makefile \
65 $1/$path/kernel/Makefile
66 install -D -m644 $src/.config \
67 $1/$path/.config
68 mkdir -p $1/$path/include
70 cp -a $src/include/* $1/$path/include/
71 rm -f $1/$path/include/Kbuild
73 # copy arch includes for external modules
74 mkdir -p $1/$path/arch/x86
75 cp -a $src/arch/x86/include $1/$path/arch/x86/
77 # copy files necessary for later builds, like nvidia and vmware
78 cp -a $src/Module.symvers $1/$path/Module.symvers
79 cp -a $src/scripts $1/$path
80 # fix permissions on scripts dir
81 chmod og-w -R $1/$path/scripts
82 mkdir -p $1/$path/.tmp_versions
84 mkdir -p $1/$path/arch/x86/kernel
85 cp -a $src/arch/x86/Makefile $1/$path/arch/x86/
86 cp -a $src/arch/x86/Makefile_32.cpu $1/$path/arch/x86/
87 cp -a $src/arch/x86/kernel/asm-offsets.s $1/$path/arch/x86/kernel/
89 # add headers for lirc package
90 mkdir -p $1/$path/drivers/media
91 ( cd $src/drivers/media ; find i2c -name '*.h' | cpio -o -H newc ) | \
92 ( cd $1/$path/drivers/media ; cpio -idmu )
94 # add dm headers
95 mkdir -p $1/$path/drivers/md
96 cp -a $src/drivers/md/*.h $1/$path/drivers/md
98 # add inotify.h
99 mkdir -p $1/$path/include/linux
100 cp -a $src/include/linux/inotify.h $1/$path/include/linux/
102 # add wireless headers
103 mkdir -p $1/$path/net/mac80211/
104 cp -a $src/net/mac80211/*.h $1/$path/net/mac80211/
106 # add dvb headers for external modules
107 # in reference to:
108 # http://bugs.archlinux.org/task/9912
109 #mkdir -p $1/$path/drivers/media/dvb-core
110 #cp -a $src/drivers/media/dvb-core/*.h $1/$path/drivers/media/dvb-core/
112 # add dvb headers for external modules
113 # in reference to:
114 # http://bugs.archlinux.org/task/11194
115 if [ -d $src/include/config/dvb/ ]; then
116 mkdir -p $1/$path/include/config/dvb/
117 cp $src/include/config/dvb/*.h $1/$path/include/config/dvb/
118 fi
120 # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new
121 # in reference to:
122 # http://bugs.archlinux.org/task/13146
123 mkdir -p $1/$path/drivers/media/dvb-frontends/
124 cp -a $src/drivers/media/dvb-frontends/lgdt330x.h $1/$path/drivers/media/dvb-frontends/
125 cp -a $src/drivers/media/i2c/msp3400-driver.h $1/$path/drivers/media/dvb-frontends/
127 # add dvb headers
128 # in reference to:
129 # http://bugs.archlinux.org/task/20402
130 mkdir -p $1/$path/drivers/media/usb/dvb-usb
131 cp -a $src/drivers/media/usb/dvb-usb/*.h $1/$path/drivers/media/usb/dvb-usb/
132 mkdir -p $1/$path/drivers/media/dvb-frontends
133 cp -a $src/drivers/media/dvb-frontends/*.h $1/$path/drivers/media/dvb-frontends/
134 mkdir -p $1/$path/drivers/media/tuners
135 cp -a $src/drivers/media/tuners/*.h $1/$path/drivers/media/tuners/
137 # add xfs and shmem for aufs building
138 mkdir -p $1/$path/fs/xfs
139 mkdir -p $1/$path/mm
140 #cp -a $src/fs/xfs/xfs_sb.h $1/$path/fs/xfs/xfs_sb.h
141 cp -a $src/fs/*.h $1/$path/fs/
143 # copy in Kconfig files
144 for i in $(find . -name "Kconfig*"); do
145 mkdir -p $1/$path/$(echo $i | sed 's|/Kconfig.*||')
146 cp -a $src/$i $1/$path/$i
147 done
149 chown -R root.root $1/$path
150 find $1/$path -type d -exec chmod 755 {} \;
151 # remove unneeded architectures
152 rm -rf $1/$path/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}
153 }
155 # Rules to configure and make the package.
156 compile_rules()
157 {
158 if [ -f "/usr/share/boot/initrd" ]; then
159 cp /usr/share/boot/initrd initrd.cpio
160 fi
162 # Handle cross compilation
163 case "$ARCH" in
164 arm)
165 echo "Compiling: $ARCH Kernel"
166 make mrproper
167 patch -Np1 < $stuff/$ARCH/linux-arm.patch || exit 1
168 cp -f $stuff/$ARCH/linux-arm.config .config
169 yes '' | make ARCH=$ARCH oldconfig
170 make ARCH=$ARCH CROSS_COMPILE=${HOST_SYSTEM}- bzImage &&
171 make ARCH=$ARCH CROSS_COMPILE=${HOST_SYSTEM}- modules &&
172 make ARCH=$ARCH CROSS_COMPILE=${HOST_SYSTEM}- \
173 INSTALL_MOD_PATH=$DESTDIR modules_install &&
174 mkdir -p $DESTDIR/boot &&
175 cp -a arch/arm/boot/zImage \
176 $DESTDIR/boot/linux-$VERSION-slitaz-$ARCH
177 #$stuff/gztazmod.sh $DESTDIR/lib/modules/$VERSION-slitaz
178 return 0 ;;
179 x86_64)
180 echo "TODO: Maybe use default ? But cross compile in x86_64 chroot"
181 echo "so we can remove the 64 build by uclibc-cross-compiler-x86_64"
182 return 0 ;;
183 esac
185 # Check for Aufs and get source/patches if needed
186 echo "Checking for Aufs packages..."
187 AUFSVER=$(grep ^VERSION= $WOK/linux-aufs/receipt | cut -d "=" -f2 | sed -e 's/"//g')
188 AUFSSRCDIR="$WOK/linux-aufs/source"
189 AUFSDIR="$AUFSSRCDIR/linux-aufs-${AUFSVER}"
190 if [ ! -d "$AUFSDIR" ]; then
191 [ ! -f "$SRC/aufs-${AUFSVER}.tar.bz2" ] && cook aufs --getsrc
192 mkdir -p $AUFSSRCDIR
193 echo "Extracting: aufs-${AUFSVER}.tar.bz2"
194 tar xjf $SRC/aufs-${AUFSVER}.tar.bz2 -C $AUFSSRCDIR/
195 mv $AUFSSRCDIR/aufs-${AUFSVER} $AUFSDIR
196 ( cd $AUFSDIR ; [ -d fs ] || git checkout origin/aufs${VERSION%.*} )
197 fi
199 echo "cook:linux" > $command
201 echo "Copying Aufs files and patches..."
202 cp -a $AUFSDIR/Documentation $AUFSDIR/fs $AUFSDIR/include $src
204 # Use fixed patchs from stuff
205 cp -a $AUFSDIR/aufs5-*.patch $stuff
207 # SliTaz db stuff
208 [ -d $WOK/$PACKAGE/source/slitaz ] && rm -rf $WOK/$PACKAGE/source/slitaz
209 mkdir -p $WOK/$PACKAGE/source/slitaz
210 echo "$WGET_URL" > $WOK/$PACKAGE/source/slitaz/url
211 cp $stuff/gztazmod.sh $stuff/list_modules.sh $WOK/$PACKAGE/source/slitaz
212 cp $stuff/bootloader.sh $WOK/$PACKAGE/source/slitaz
214 # Apply patches
215 echo "Applying patches..."
216 while read patch_file; do
217 echo "$patch_file" >> $WOK/$PACKAGE/source/slitaz/patches
218 cp $stuff/$patch_file $WOK/$PACKAGE/source/slitaz
219 if [ -f done.$patch_file ]; then
220 echo "Skipping $patch_file" && continue
221 fi
222 echo "Apply $patch_file"
223 patch -p1 < $WOK/$PACKAGE/source/slitaz/$patch_file || return 1
224 touch done.$patch_file
225 done <<EOT
226 aufs5-base.patch
227 aufs5-standalone.patch
228 aufs5-mmap.patch
229 EOT
231 # Patch for 3.16.55, need tweak for 4.x
232 #$PACKAGE-diff.u
233 #$PACKAGE-freeinitrd.u
234 #$PACKAGE-subroot.u
235 #$PACKAGE-romfs.u
236 #$PACKAGE-tcp_stealth.u
237 #$PACKAGE-efi.u
239 # Patch for GCC > 6.x
240 # usbip (format overflow / implicit-fallthrough)
241 # kernel (format overflow)
242 #patch -p1 < $stuff/linux-usbip-fix-format-overflow-gcc8.patch
243 #patch -p1 < $stuff/linux-usbip-fix-implicit-fallthrough-gcc8.patch
244 #patch -p1 < $stuff/linux-fix-format-overflow-gcc8.patch
245 #patch -p1 < $stuff/linux-fix-noreturn-attributes-gcc8.patch
247 # Patch for Picasso AMDGPU, until switch to 5.x
248 # see https://bugs.gentoo.org/696164
249 #patch -p1 < $stuff/picasso-amdgpu.patch
251 # Mrproper
252 echo "Make kernel proper..."
253 make mrproper
255 echo "Build usbip..."
256 cd $src/tools/usb/usbip
257 ./autogen.sh
258 ./configure CFLAGS="$CFLAGS -Wno-error=uninitialized" \
259 --with-usbids-dir=/usr/share/misc \
260 --mandir=/usr/share/man $CONFIGURE_ARGS &&
261 make && make DESTDIR=$DESTDIR/usbip install || return 1
263 cd $src
265 #
266 # Arch x86_64: TODO have a real cross environment
267 #
268 if [ ! "$nox64" ]; then
269 echo "Compiling: x86_64 Kernel"
271 # Use cross toolchain x86_64
272 export PATH=$PATH:/cross/x86_64/tools/bin
274 # Build bzImage64 without modules first
275 if [ ! "$nonomods" ]; then
276 [ -d $DESTDIR/linux64 ] || mkdir -p $DESTDIR/linux64 ||
277 return 1
278 cp -f $stuff/$PACKAGE-slitaz.config64 .config
279 sed -i 's/CONFIG_MODULES=y/# CONFIG_MODULES is not set/' .config
280 echo -e "\n* Configure bzImage64 without modules...\n"
281 yes '' | make ARCH=x86_64 CROSS_COMPILE=x86_64-slitaz-linux- oldconfig
282 echo -e "\n* Building bzImage64 without modules...\n"
283 make ARCH=x86_64 CROSS_COMPILE=x86_64-slitaz-linux- bzImage || exit 1
284 mv arch/x86/boot/bzImage $DESTDIR/linux64
285 mv System.map System.map-without-modules64
286 mv vmlinux vmlinux-without-modules64
287 mv .config config-without-modules64
288 fi
290 # Build bzImage64 with modules
291 cp -f $stuff/$PACKAGE-slitaz.config64 .config
292 echo -e "\n* Configure bzImage64 with modules...\n"
293 yes '' | make ARCH=x86_64 CROSS_COMPILE=x86_64-slitaz-linux- oldconfig
294 echo -e "\n* Building bzImage64 with modules...\n"
295 make ARCH=x86_64 CROSS_COMPILE=x86_64-slitaz-linux- bzImage &&
296 make ARCH=x86_64 CROSS_COMPILE=x86_64-slitaz-linux- modules &&
297 make ARCH=x86_64 INSTALL_MOD_PATH=$DESTDIR/linux64 modules_install &&
298 make ARCH=x86_64 INSTALL_HDR_PATH=$DESTDIR/linux64/usr headers_install &&
299 ln .config $WOK/$PACKAGE/source/slitaz/config64
300 [ -s arch/x86/boot/bzImage ] || return 1
301 mkdir -p $DESTDIR/linux64/boot 2> /dev/null
302 mv arch/x86/boot/bzImage $DESTDIR/linux64/boot/vmlinuz-$VERSION-slitaz64
303 KVERSION=$VERSION-slitaz64
304 install_module_headers $DESTDIR/linux64
306 if [ -d "$DESTDIR/linux64/lib/modules/$VERSION-slitaz64" ]; then
307 $stuff/gztazmod.sh $DESTDIR/linux64/lib/modules/$VERSION-slitaz64
308 fi
310 ln System.map System.map-modules64
311 ln vmlinux vmlinux-modules64
312 ln Module.symvers Module.symvers-modules64
313 cp .config config-modules64
314 else
315 echo "* Skipping: x86_64 Kernel..."
316 fi
318 #
319 # Linux Arch i386 - GCC arch i486
320 #
321 if [ ! "$nox32" ]; then
322 echo "Compiling: i386 Kernel..."
324 # Build bzImage without modules first
325 if [ ! "$nonomods" ]; then
326 cp -f $stuff/$PACKAGE-slitaz.config .config
327 sed -i 's/CONFIG_MODULES=y/# CONFIG_MODULES is not set/' .config
328 echo -e "\n* Configure bzImage without modules...\n"
329 yes '' | make ARCH=i386 oldconfig
330 echo -e "\n* Building bzImage without modules...\n"
331 make ARCH=i386 bzImage || exit 1
332 [ -d $DESTDIR ] || mkdir -p $DESTDIR
333 mv arch/x86/boot/bzImage $DESTDIR
334 mv System.map System.map-without-modules
335 mv vmlinux vmlinux-without-modules
336 mv .config config-without-modules
337 fi
339 # Build bzImage with modules
340 cp -f $stuff/$PACKAGE-slitaz.config .config
341 echo -e "\n* Configure bzImage with modules...\n"
342 yes '' | make ARCH=i386 oldconfig
343 ln .config $WOK/$PACKAGE/source/slitaz/config
344 echo -e "\n* Building bzImage with modules...\n"
345 make ARCH=i386 bzImage &&
346 make ARCH=i386 modules &&
347 make ARCH=i386 INSTALL_MOD_PATH=$DESTDIR modules_install &&
348 make ARCH=i386 INSTALL_HDR_PATH=$DESTDIR/usr headers_install &&
349 [ -s arch/x86/boot/bzImage ] || return 1
350 mkdir -p $DESTDIR/boot 2> /dev/null
351 mv arch/x86/boot/bzImage $DESTDIR/boot/vmlinuz-$VERSION-slitaz
352 KVERSION=$VERSION-slitaz
353 install_module_headers $DESTDIR
355 # Compress all modules.
356 if [ -d "$DESTDIR/lib/modules/$VERSION-slitaz" ]; then
357 $stuff/gztazmod.sh $DESTDIR/lib/modules/$VERSION-slitaz
358 else
359 return 1
360 fi
361 ln System.map System.map-modules
362 ln vmlinux vmlinux-modules
363 ln Module.symvers Module.symvers-modules
364 cp .config config-modules
365 else
366 echo "* Skipping: x86 Kernel..."
367 fi
369 #
370 # Linux Arch i386 - GCC arch i486 - PAE
371 #
372 if [ ! "$nopae" ]; then
373 echo "Compiling: PAE Kernel..."
375 # Build PAE bzImage without modules first
376 if [ ! "$nonomods" ]; then
377 [ -d $DESTDIR/linux-pae ] || mkdir -p $DESTDIR/linux-pae ||
378 return 1
379 cp -f $stuff/$PACKAGE-slitaz-pae.config .config
380 sed -i 's/CONFIG_MODULES=y/# CONFIG_MODULES is not set/' .config
381 echo -e "\n* Configure bzImage PAE without modules...\n"
382 yes '' | make ARCH=i386 oldconfig
383 echo -e "\n* Building bzImage PAE without modules...\n"
384 make ARCH=i386 bzImage || exit 1
385 mv arch/x86/boot/bzImage $DESTDIR/linux-pae
386 mv System.map System.map-without-modules-pae
387 mv vmlinux vmlinux-without-modules-pae
388 mv .config config-without-modules-pae
389 fi
391 # Build PAE bzImage with modules
392 cp -f $stuff/$PACKAGE-slitaz-pae.config .config
393 echo -e "\n* Configure bzImage PAE with modules...\n"
394 yes '' | make ARCH=i386 oldconfig
395 echo -e "\n* Building bzImage PAE with modules...\n"
396 make ARCH=i386 bzImage &&
397 make ARCH=i386 modules &&
398 make ARCH=i386 INSTALL_MOD_PATH=$DESTDIR/linux-pae modules_install &&
399 make ARCH=i386 INSTALL_HDR_PATH=$DESTDIR/linux-pae/usr headers_install &&
400 ln .config $WOK/$PACKAGE/source/slitaz/configpae
401 [ -s arch/x86/boot/bzImage ] || return 1
402 mkdir -p $DESTDIR/linux-pae/boot 2> /dev/null
403 mv arch/x86/boot/bzImage $DESTDIR/linux-pae/boot/vmlinuz-$VERSION-slitaz-pae
404 KVERSION=$VERSION-slitaz-pae
405 install_module_headers $DESTDIR/linux-pae
407 # Compress all modules.
408 if [ -d "$DESTDIR/linux-pae/lib/modules/$VERSION-slitaz-pae" ]; then
409 $stuff/gztazmod.sh $DESTDIR/linux-pae/lib/modules/$VERSION-slitaz-pae
410 else
411 return 1
412 fi
413 ln System.map System.map-modules-pae
414 ln vmlinux vmlinux-modules-pae
415 ln Module.symvers Module.symvers-modules-pae
416 cp .config config-modules-pae
417 else
418 echo "* Skipping: x86 PAE Kernel..."
419 fi
420 }
422 # Rules to gen a SliTaz package suitable for Tazpkg.
423 genpkg_rules()
424 {
425 case "$ARCH" in
426 arm)
427 echo "Packing: ARM Kernel"
428 cp -a $install/* $fs
429 rm -f $fs/lib/modules/*/build $fs/lib/modules/*/source
430 return 0 ;;
431 x86_64)
432 echo "TODO: use default or custom x86_64 packing"
433 return 0 ;;
434 esac
436 export PACKAGE VERSION
437 local path
438 cp -a $install/boot $fs
440 # Compress all modules.
441 path=$fs/lib/modules/$VERSION-slitaz/kernel
442 mkdir -p $path
444 # Get the base modules
445 export src install
446 mkdir -p $WOK/$PACKAGE/source/tmp
447 # Warning stuff/list_modules.sh must find the generated modules.list
448 $stuff/list_modules.sh \
449 $(cat $stuff/modules.list) > $WOK/$PACKAGE/source/tmp/modules.list
450 while read module; do
451 dir=$(dirname $module)
452 [ -d $path/$dir ] || mkdir -p $path/$dir
453 cp -a $install/lib/modules/$VERSION-slitaz/kernel/$module $path/$dir
454 done < $WOK/$PACKAGE/source/tmp/modules.list
456 # Remove unresolved links
457 rm -f $fs/lib/modules/$VERSION-slitaz/build
458 rm -f $fs/lib/modules/$VERSION-slitaz/source
460 # We only need module.{order,builtin} because other map files are
461 # generated by depmod in post_install
462 cp -a $install/lib/modules/$VERSION-slitaz/modules.order \
463 $install/lib/modules/$VERSION-slitaz/modules.builtin \
464 $fs/lib/modules/$VERSION-slitaz
466 # Pack all packages with a kernel module
467 sed -i "/^$PACKAGE\$/d" $CACHE/broken 2>/dev/null || true
468 for i in $(cd $WOK; grep -l '^WANTED="linux"' */receipt); do
469 [ ! -d "$install/lib/modules/$VERSION-slitaz" ] && return 1
470 cook ${i%/receipt}
471 done
473 # Check any module in kernel .config that's not added to a linux-* pkgs
474 # and remove aufs patches: we dont need them in HG wok.
475 $stuff/check_modules.sh
477 # Keep fixed patches !
478 #rm -f $stuff/aufs3-*
479 }
481 # Pre and post install commands for Tazpkg.
482 post_install()
483 {
484 chroot "$root/" depmod -a $VERSION-slitaz
486 # Handle multiarch installation
487 case "$SLITAZ_ARCH" in
488 arm)
489 echo "Kernel : /boot/linux-$VERSION-slitaz-$ARCH"
490 echo "Modules: /lib/modules/$VERSION-slitaz"
491 return 0 ;;
492 esac
494 # GRUB stuff.
495 if [ -f "$1/boot/grub/menu.lst" ]; then
496 # Current root device
497 root_dev="/dev/$(lsblk | grep '/$'| grep -o '[a-z]d[a-z][0-9]*')"
498 grub_part="$(( $(echo $root_dev | grep -o '[0-9]*$')-1 ))"
499 # Use device.map to find grub device number
500 grub_dev="$(grep $(echo $root_dev | grep -o '^/dev/.d.' ) \
501 "$1/boot/grub/device.map" | cut -f1 | sed "s/)$/.$grub_part)/g")"
503 # Add and clean kernel entries in case of upgrade for installed system.
504 if ! grep -q vmlinuz-$VERSION-slitaz "$1/boot/grub/menu.lst"; then
506 # Clean the old entry
507 # TODO: old vmlinuz file is removed but the entry is still there.
508 # So grub error:15 when selected: http://bugs.slitaz.org/?id=74
510 # Add the new entry
511 cat >> "$1/boot/grub/menu.lst" << EOT
513 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
514 $grub_dev
515 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev quiet
516 EOT
517 # Make it the default entry
518 last_entry=$(( $(grep -c '^title' "$1/boot/grub/menu.lst")-1 ))
519 sed -e "s/^default.*/default $last_entry/g" -i "$1/boot/grub/menu.lst"
520 fi
522 # Display information message.
523 cat <<EOT
525 ----
526 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst:
528 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
529 $grub_dev
530 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
531 ----
532 EOT
533 fi
534 true
535 }