wok-next annotate linux/receipt @ rev 21018

Nasty typo broke the cooker
author Aleksej Bobylev <al.bobylev@gmail.com>
date Wed Oct 17 03:59:24 2018 +0300 (2018-10-17)
parents 751dc2b613cd
children d5aab818505e
rev   line source
al@19772 1 # SliTaz package receipt v2.
pankso@3 2
pankso@3 3 PACKAGE="linux"
al@20892 4 VERSION="4.17.7"
al@20892 5 KBASEVER="$(echo $VERSION | cut -d. -f1,2)"
pankso@3 6 CATEGORY="base-system"
al@19772 7 SHORT_DESC="The Linux Kernel"
pankso@3864 8 MAINTAINER="devel@slitaz.org"
pascal@14657 9 LICENSE="GPL2"
al@19583 10 WEB_SITE="https://www.kernel.org/"
pankso@12803 11 HOST_ARCH="i486 arm x86_64"
pankso@12803 12
al@19595 13 TARBALL="$PACKAGE-$KBASEVER.tar.xz"
al@19583 14 WGET_URL="https://www.kernel.org/pub/linux/kernel/v4.x/$TARBALL"
al@19583 15
al@20437 16 BUILD_DEPENDS_arm="xz"
al@20892 17 BUILD_DEPENDS_x86_64="perl xz patch kmod bc elfutils-dev openssl-dev"
al@20892 18 BUILD_DEPENDS="perl xz lzma patch kmod bc elfutils-dev openssl-dev" # git
al@20897 19 # Removed: lguest, linux-firmware, linux-logfs, linux-irda, linux-toshiba
al@20437 20 SPLIT="\
al@20437 21 linux-acpi linux-agp linux-aoe \
al@20437 22 linux-appletalk linux-arcnet linux-autofs \
al@20437 23 linux-bluetooth linux-bridge linux-btrfs \
al@20437 24 linux-cifs linux-coda linux-cpufreq \
al@20437 25 linux-cramfs linux-crypto linux-cryptoloop \
al@20437 26 linux-dialup linux-dlm linux-drm \
al@20437 27 linux-ecryptfs linux-efi linux-ethernet \
al@20437 28 linux-exofs linux-firewire linux-gfs2 \
al@20437 29 linux-hfs linux-hfsplus linux-hid \
al@20437 30 linux-hwmon linux-ide linux-input-misc \
al@20437 31 linux-input-tablet linux-input-touchscreen linux-ipv6 \
al@20893 32 linux-isdn linux-jfs \
al@20437 33 linux-joystick linux-kvm linux-md \
al@20437 34 linux-media linux-memstick linux-minix \
al@20437 35 linux-mmc linux-module-headers linux-mwave \
al@20893 36 linux-ncpfs linux-nbd linux-netfilter \
al@20437 37 linux-nfc linux-nfs linux-nfsd \
al@20437 38 linux-ocfs2 linux-orangefs linux-radio \
al@20437 39 linux-reiserfs linux-romfs linux-sched \
al@20437 40 linux-scsi linux-sound linux-source \
al@20437 41 linux-speakup linux-squashfs linux-staging \
al@20437 42 linux-usb-gadget linux-usb-misc linux-usbdsl \
al@20437 43 linux-usbip linux-uwb linux-video \
al@20437 44 linux-wan linux-watchdog linux-wimax \
al@20437 45 linux-wireless linux-without-modules linux-zram"
al@20892 46 COOKOPTS="skip-log-errors"
al@19595 47
al@19595 48 if [ "$KBASEVER" != "${VERSION%.0}" ]; then
al@19595 49 PATCH="$(dirname $WGET_URL)/patch-$VERSION.xz"
al@19595 50 EXTRA_SOURCE_FILES="$(basename $PATCH)"
al@19595 51 fi
pankso@12824 52
pankso@15855 53 #
al@20437 54 # The Linux receipt handle cross compilation; for ARM we use a real cross env.
al@20437 55 # Please discuss any change and try to keep it simple.
pankso@15855 56 #
al@20437 57 # The receipt handle cook option for faster build:
pankso@15855 58 # --nonomods : Skip bzImage without modules build
pankso@15855 59 #
pankso@3 60
al@20441 61 # CONFIG_PAGE_TABLE_ISOLATION
al@20441 62 # against Meltdown currently available in 4.14 only for x86_64 architecture.
al@20441 63 # CONFIG_RETPOLINE
al@20441 64 # against Spectre v.2 available both for i386 and x86_64 architectures.
al@20441 65
pankso@15855 66 # Handle multiarch installation. ARM use Busybox modutils, so avoid any
pankso@15855 67 # deps on kmod. SLITAZ_ARCH can have also custom post_install commands
pankso@15921 68 if [ -f $root/etc/slitaz/slitaz.conf ]; then
pankso@15921 69 . $root/etc/slitaz/slitaz.conf
pankso@15921 70 case "$SLITAZ_ARCH" in
pankso@15921 71 arm) DEPENDS="" ;;
pankso@15921 72 esac
pankso@15921 73 fi
pankso@12824 74
pankso@3 75 # Rules to configure and make the package.
al@20437 76 compile_rules() {
al@20437 77 case $ARCH in
al@20441 78 # Linux don't supported i386 CPU, but ARCH should be 'i386' if we need 32bit CPU support
al@20441 79 i?86) ConfigFile="$stuff/linux-slitaz.config"; Arch='i386';;
al@20441 80 x86_64) ConfigFile="$stuff/linux-slitaz64.config"; Arch='x86_64';;
al@20441 81 arm*) ConfigFile="$stuff/arm/linux-arm.config"; Arch='arm';;
al@20437 82 esac
al@20437 83
al@19595 84 # Update sources to the $VERSION using base sources ($KBASEVER) and patch
al@19595 85 if [ "$KBASEVER" != "${VERSION%.0}" ]; then
al@19595 86 [ -s $SRC/$(basename $PATCH) ] || wget $PATCH -O $SRC/$(basename $PATCH)
al@19595 87 # don't patch twice for `cook $PACKAGE --continue`
al@19595 88 if [ ! -f "done.patch-$VERSION" ]; then
al@19595 89 xzcat $SRC/$(basename $PATCH) | patch -Np1
al@19595 90 touch done.patch-$VERSION
al@19595 91 fi
al@19595 92 fi
al@19595 93
al@19595 94 #
pankso@15921 95 if [ -f "/usr/share/boot/initrd" ]; then
pankso@15921 96 cp /usr/share/boot/initrd initrd.cpio
pankso@15921 97 fi
pankso@12803 98
pankso@15855 99 # Handle cross compilation
pankso@12803 100 case "$ARCH" in
pankso@12803 101 arm)
al@20441 102 echo "Compiling: $Arch Kernel"
pankso@12824 103 make mrproper
al@20437 104 patch -Np1 < $stuff/arm/linux-arm.patch || exit 1
al@20437 105 cp -f $ConfigFile .config
al@20441 106 yes '' | make ARCH=$Arch oldconfig
al@20441 107 make ARCH=$Arch CROSS_COMPILE=${HOST_SYSTEM}- bzImage &&
al@20441 108 make ARCH=$Arch CROSS_COMPILE=${HOST_SYSTEM}- modules &&
al@20441 109 make ARCH=$Arch CROSS_COMPILE=${HOST_SYSTEM}- \
pankso@12803 110 INSTALL_MOD_PATH=$DESTDIR modules_install &&
pankso@12803 111 mkdir -p $DESTDIR/boot &&
pankso@12824 112 cp -a arch/arm/boot/zImage \
pankso@12803 113 $DESTDIR/boot/linux-$VERSION-slitaz-$ARCH
al@19595 114 #$stuff/tools/gztazmod.sh $DESTDIR/lib/modules/$VERSION-slitaz
pankso@12803 115 return 0 ;;
pankso@12803 116 esac
pankso@12803 117
al@19595 118 # Get and apply Aufs patches
al@19595 119 . $stuff/tools/aufs-patches
al@19583 120
pankso@12285 121 echo "cook:linux" > $command
pankso@12285 122
al@19595 123 # Apply misc patches
pankso@9731 124 echo "Applying patches..."
pascal@521 125 while read patch_file; do
pascal@1442 126 if [ -f done.$patch_file ]; then
al@19583 127 echo "Skipping $patch_file"; continue
pascal@1442 128 fi
al@19583 129 echo -e "\nApply $patch_file"
al@19595 130 patch -p1 -i $stuff/patches/$patch_file || return 1
pascal@1442 131 touch done.$patch_file
al@19595 132 done < $stuff/patches/patch.order
al@19583 133
al@20437 134 echo "Making kernel proper..."
pankso@3864 135 make mrproper
al@19583 136
al@20441 137
al@20441 138
al@20441 139 echo "Making $Arch Kernel..."
pankso@12803 140
pankso@12294 141 # Build bzImage without modules first
al@19583 142 if [ -z "$nonomods" ]; then
al@20437 143 cp -f $ConfigFile .config
pankso@15855 144 sed -i 's/CONFIG_MODULES=y/# CONFIG_MODULES is not set/' .config
al@19583 145 # We can't keep every driver in staging???
al@19595 146 sed -i \
al@19595 147 -e 's/^CONFIG_RTL8192/#&/' \
pankso@15855 148 -e 's/^CONFIG_R8187SE/#&/' \
pankso@15855 149 -e 's/^CONFIG_RT2870/#&/' .config
al@19583 150
al@19595 151 title 'Configure bzImage without modules...'
al@20441 152 yes '' | make ARCH=$Arch oldconfig
al@19583 153
al@19595 154 title 'Building bzImage without modules...'
al@20441 155 make ARCH=$Arch -j4 bzImage || exit 1
al@19583 156
al@19595 157 mkdir -p $DESTDIR
pankso@15855 158 mv arch/x86/boot/bzImage $DESTDIR
pankso@15855 159 mv System.map System.map-without-modules
pankso@12294 160 fi
al@19583 161
pankso@12294 162 # Build bzImage with modules
al@20437 163 cp -f $ConfigFile .config
al@19583 164
al@19595 165 title 'Configure bzImage with modules...'
al@20441 166 yes '' | make ARCH=$Arch oldconfig
al@19583 167
al@19583 168
al@19595 169 title 'Building bzImage with modules...'
al@20441 170 make ARCH=$Arch -j4 bzImage &&
al@20441 171 make ARCH=$Arch -j4 modules &&
al@20441 172 make ARCH=$Arch INSTALL_MOD_PATH=$DESTDIR modules_install &&
al@20441 173 make ARCH=$Arch INSTALL_HDR_PATH=$DESTDIR/usr headers_install &&
al@19583 174
pankso@15855 175 [ -s arch/x86/boot/bzImage ] || return 1
al@19595 176 mkdir -p $DESTDIR/boot
pankso@12294 177 mv arch/x86/boot/bzImage $DESTDIR/boot/vmlinuz-$VERSION-slitaz
al@19583 178
al@19595 179 $stuff/tools/install_module_headers.sh $DESTDIR $src $VERSION-slitaz
al@19583 180
pascal@7667 181 ln System.map System.map-modules
pascal@7667 182 ln Module.symvers Module.symvers-modules
al@19772 183
al@19772 184 # for linux-zram package
al@19772 185 mkdir -p $install/etc/init.d
al@20437 186 install -o root -m755 $stuff/compcache $install/etc/init.d/
al@20437 187 install -o root -m644 $stuff/compcache.conf $install/etc/
pankso@3864 188 }
erjo@253 189
al@20437 190
pankso@3 191 # Rules to gen a SliTaz package suitable for Tazpkg.
al@20437 192 genpkg_rules() {
al@19772 193 DEPENDS="linux" # default, may be subject to change later
al@19772 194
al@19772 195 case $PACKAGE in
al@19772 196 *-acpi) c="ACPI modules";;
al@19772 197 *-agp) c="AGP modules";;
al@19772 198 *-aoe) c="AoE (ATA over Ethernet) modules";;
al@19772 199 *-appletalk) c="Appletalk modules";;
al@19772 200 *-arcnet) c="ARCnet modules";;
al@19772 201 *-autofs) c="Automounter module";;
al@19772 202 *-bluetooth) c="Bluetooth modules";;
al@19772 203 *-bridge) c="Bridge modules";;
al@19772 204 *-btrfs) c="Btrfs module"; DEPENDS="linux-crypto";;
al@19772 205 *-cifs) c="CIFS module";;
al@19772 206 *-coda) c="Coda module";;
al@19772 207 *-cpufreq) c="Cpufreq modules";;
al@19772 208 *-cramfs) c="CramFs module";;
al@19772 209 *-crypto) c="Crypto modules";;
al@19772 210 *-cryptoloop) c="Cryptoloop modules"; DEPENDS="linux-crypto";;
al@19772 211 *-dialup) c="Dial-up modules";;
al@19772 212 *-dlm) c="DLMFS module";;
al@19772 213 *-drm) c="DRM module"; DEPENDS="linux-agp";;
al@19772 214 *-ecryptfs) c="eCrypt FS module";;
al@19772 215 *-efi) c="EFI modules";;
al@19777 216 *-ethernet) c="Ethernet drivers"; DEPENDS="linux-crypto";;
al@19772 217 *-exofs) c="OSD based FS module"; DEPENDS="linux-crypto";;
al@19772 218 *-firewire) c="Firewire modules";;
al@19772 219 *-gfs2) c="GFS2 module";;
al@19772 220 *-hfs) c="HFS module";;
al@19772 221 *-hfsplus) c="HFSplus module";;
al@19772 222 *-hid) c="HID (human interface device) modules";;
al@19772 223 *-hwmon) c="Hwmon modules";;
al@19772 224 *-ide) c="IDE modules";;
al@19772 225 *-input-misc) c="misc. input drivers";;
al@19772 226 *-input-tablet) c="tablet input drivers";;
al@19772 227 *-input-touchscreen) c="touchscreen input drivers";;
al@19772 228 *-ipv6) c="IPv6 modules"; DEPENDS="linux-netfilter";;
al@19772 229 *-isdn) c="ISDN modules";;
al@19772 230 *-jfs) c="JFS module";;
al@19772 231 *-joystick) c="joystick modules";;
al@19772 232 *-kvm) c="KVM and Virtio modules";;
al@19772 233 *-md) c="MD modules"; DEPENDS="linux-crypto";;
al@19772 234 *-media) c="media modules"; DEPENDS="linux-radio";;
al@19772 235 *-memstick) c="Sony memory stick modules";;
al@19772 236 *-minix) c="Minix module";;
al@19772 237 *-mmc) c="MMC modules - card reader";;
al@19772 238 *-mwave) c="ACP Modem driver module - for IBM Thinkpad";;
al@19772 239 *-nbd) c="NBD (network block device) modules";;
al@19772 240 *-ncpfs) c="NCPFS module";;
al@19772 241 *-netfilter) c="Netfilter modules";;
al@19772 242 *-nfc) c="NFC modules";;
al@19772 243 *-nfs) c="NFS modules"; DEPENDS="linux-crypto";;
al@19772 244 *-nfsd) c="NFS server module"; DEPENDS="linux-nfs";;
al@19772 245 *-ocfs2) c="OCFS2 modules"; DEPENDS="linux-dlm";;
al@19772 246 *-orangefs) c="OrangeFS module";;
al@19777 247 *-radio) c="radio modules"; DEPENDS="linux-sound";;
al@19772 248 *-reiserfs) c="ReiserFS module";;
al@19772 249 *-romfs) c="ROMFS module";;
al@19772 250 *-sched) c="Sched modules";;
al@19772 251 *-scsi) c="SCSI modules";;
al@19772 252 *-sound) c="sound modules"
al@19772 253 copy firmware/ess/ firmware/korg/ firmware/sun/ firmware/yamaha/
al@19772 254 ;;
al@19772 255 *-speakup) c="Speakup modules";;
al@19772 256 *-squashfs) c="Squashfs module"; PROVIDE="squashfs-module";;
al@19772 257 *-staging) c="staging kernel modules";;
al@19772 258 *-toshiba) c="Toshiba module";;
al@19772 259 *-usb-gadget) c="USB gadget modules";;
al@19772 260 *-usb-misc) c="misc. USB drivers";;
al@19772 261 *-usbdsl) c="USB DSL modem modules";;
al@19772 262 *-usbip) c="Usbip module"; PROVIDE="usbip-module";;
al@19772 263 *-uwb) c="UWB modules";;
al@19772 264 *-video) c="video modules";;
al@19772 265 *-wan) c="Wide Area Networks (WANs) modules"; DEPENDS="linux-wireless";;
al@19772 266 *-watchdog) c="watchdog drivers";;
al@19772 267 *-wimax) c="Wimax modules";;
al@19772 268 *-wireless) c="wireless modules"; DEPENDS="linux-crypto wireless_tools";;
al@19772 269 *-zram) c="compressed caching support"; PROVIDE="compcache"
al@19772 270 copy compcache compcache.conf
al@19772 271 ;;
pankso@12803 272 esac
pankso@12803 273
al@19772 274 case $PACKAGE in
al@19772 275 linux)
al@19777 276 DEPENDS="kmod"
al@19772 277 case "$ARCH" in
al@19772 278 arm)
al@19772 279 echo "Packing: ARM Kernel"
al@19772 280 cp -a $install/* $fs
al@19772 281 rm -f $fs/lib/modules/*/build $fs/lib/modules/*/source
al@19772 282 return 0 ;;
al@19772 283 esac
al@18734 284
al@19772 285 # Copy the Kernel
al@19772 286 cp -a $install/boot $fs
al@18734 287
al@19772 288 # Copy base modules
al@19772 289 . $stuff/tools/copy_modules.sh
al@18734 290
al@20437 291 # We only need modules.{order,builtin} because other map files are
al@20437 292 # generated by depmod in post_install()
al@19772 293 copy modules.order modules.builtin
al@19772 294 rm -rf $fs/usr
al@18734 295
al@19772 296 # Pack all packages with a Kernel modules
al@19772 297 [ ! -d "$install/lib/modules/$VERSION-slitaz" ] && return 1
al@19772 298
al@19772 299 # Checking for Linux Kernel modules that don't belong to any of the packages
al@19772 300 # $stuff/tools/check_modules.sh
al@19777 301 # please, see web interface instead
al@19772 302 ;;
al@19772 303 *-firmware)
al@19772 304 mkdir -p $fs/lib
al@19772 305 cp -a $install/lib/firmware $fs/lib
al@19772 306 # remove linux-sound firmware files
al@19772 307 for i in ess korg sun yamaha; do
al@19772 308 rm -rf $fs/lib/firmware/$i
al@19772 309 done
al@19772 310 CAT="non-free|firmware thats compiled from Linux source code"
al@19772 311 PROVIDE="linux64-firmware"
al@19772 312 ;;
al@19772 313 *-module-headers)
al@19772 314 CAT="development|header files and scripts for building modules for Linux Kernel"
al@19772 315 KVERSION="$VERSION-slitaz"
al@19772 316 DEPENDS="slitaz-toolchain"
al@19772 317 mkdir -p $fs/lib/modules/$KVERSION $fs/usr
al@19772 318 cp -a $install/usr/src $fs/usr
al@19772 319 ;;
al@19772 320 *-source)
al@19772 321 CAT="development|source files"
al@19772 322 DEPENDS="linux slitaz-toolchain ncurses-dev perl xz lzma patch busybox-boot"
al@19772 323
al@19772 324 local _AUFSVER=$(. $WOK/aufs/receipt; echo $VERSION)
al@19772 325 local AUFSDIR="aufs-${_AUFSVER}"
al@19772 326 kps=$fs/usr/src/kernel-patches/slitaz
al@19772 327 mkdir -p $kps \
al@19772 328 $fs/lib/modules/$VERSION-slitaz \
al@19772 329 $fs/usr/bin $fs/usr/sbin
al@19772 330
al@19772 331 # URL
al@19772 332 echo $(. $WOK/linux/receipt; echo $WGET_URL) > $kps/url
al@19772 333 # stuff
al@19772 334 cp $stuff/tools/* $stuff/bootloader.sh $kps
al@19772 335 # Kernel patch
al@19772 336 xzcat $SRC/patch-$VERSION.xz > $kps/linux-$VERSION.patch
al@19772 337 echo "linux-$VERSION.patch" > $kps/patches
al@19772 338 # Aufs patches
al@19772 339 sed '/^aufs4.*patch$/!d' $stuff/tools/aufs-patches | \
al@19772 340 tee -a $kps/patches | \
al@19772 341 while read i; do
al@19772 342 cp $WOK/aufs/source/*/$i $kps
al@19772 343 done
al@19772 344 # misc. patches
al@19772 345 cat $stuff/patches/patch.order >> $kps/patches
al@19772 346 cp $stuff/patches/* $kps
al@19772 347 rm $kps/patch.order
al@19772 348 # config
al@19772 349 cp $WOK/linux/source/linux-$VERSION/.config $kps/config
al@19772 350
al@19772 351 cp -a $stuff/linux-source/buildtaz $kps
al@19772 352 cp -a $stuff/linux-source/make-tazpkg.u $kps
al@19772 353 cp -a $stuff/linux-source/get-linux-source $fs/usr/bin
al@19772 354 cp -a $stuff/linux-source/list_modules.sh $kps
al@19772 355 cp -a $stuff/linux-source/rdev $fs/usr/sbin
al@19772 356 ln -s rdev $fs/usr/sbin/rootflags
al@19772 357 ln -s rdev $fs/usr/sbin/ramsize
al@19772 358 ln -s rdev $fs/usr/sbin/vidmode
al@19772 359 sed -i "s|=XXX|=$VERSION|g" $fs/usr/bin/get-linux-source
al@19772 360
al@19772 361 # Copy Aufs4 source files
al@20437 362 if [ -d $WOK/aufs/$AUFSDIR ]; then
al@19772 363 mkdir $fs/usr/src/kernel-patches/slitaz/aufs4
al@20437 364 cp -a $WOK/aufs/$AUFSDIR/Documentation \
al@20437 365 $WOK/aufs/$AUFSDIR/fs \
al@20437 366 $WOK/aufs/$AUFSDIR/include \
al@20437 367 $fs/usr/src/kernel-patches/slitaz/aufs4
al@19772 368 fi
al@19772 369
al@19772 370 ln -s ../../../usr/src/linux-$VERSION $fs/lib/modules/$VERSION-slitaz/source
al@19772 371
al@19772 372 chown -R root:root $fs
al@19772 373 ;;
al@19772 374 *-without-modules)
al@19772 375 CAT="base-system|without module support"
al@19772 376 PROVIDE="linux"
al@19772 377 mkdir -p $fs/boot
al@19772 378 cp -a $install/bzImage $fs/boot/vmlinuz-$VERSION-slitaz-without-modules
al@19772 379 ;;
al@19772 380 *)
al@19772 381 . $stuff/tools/copy_modules.sh
al@19772 382 CAT="base-system|$c"
al@19772 383 ;;
al@19772 384 esac
al@19772 385
al@19772 386 case $PACKAGE in
al@19772 387 *fs|*fs2|*-coda|*-dlm|*-hfsplus|*-minix|*-nfsd)
al@19772 388 CONFIG_FILES="/etc/filesystems";;
al@19772 389 *-zram)
al@19772 390 CONFIG_FILES="/etc/compcache.conf";;
al@19772 391 esac
pankso@3 392 }
pankso@3 393
al@19772 394
al@19772 395 post_install_linux() {
al@18734 396 # Handle multiarch installation
al@18734 397 case "$SLITAZ_ARCH" in
pankso@12803 398 arm)
pankso@12803 399 echo "Kernel : /boot/linux-$VERSION-slitaz-$ARCH"
pankso@12803 400 echo "Modules: /lib/modules/$VERSION-slitaz"
pankso@12803 401 return 0 ;;
pankso@12803 402 esac
al@18734 403
pankso@15855 404 # GRUB stuff.
pankso@15855 405 if [ -f "$1/boot/grub/menu.lst" ]; then
pankso@15855 406 # Current root device
pankso@15855 407 root_dev="/dev/$(lsblk | grep '/$'| grep -o '[a-z]d[a-z][0-9]*')"
pankso@15855 408 grub_part="$(( $(echo $root_dev | grep -o '[0-9]*$')-1 ))"
pankso@15855 409 # Use device.map to find grub device number
pankso@15855 410 grub_dev="$(grep $(echo $root_dev | grep -o '^/dev/.d.' ) \
al@19583 411 "$1/boot/grub/device.map" | cut -f1 | sed "s/)$/.$grub_part)/g")"
al@18734 412
al@19583 413 # Add and clean Kernel entries in case of upgrade for installed system.
pascal@18730 414 if ! grep -q vmlinuz-$VERSION-slitaz "$1/boot/grub/menu.lst"; then
al@18734 415
pankso@15855 416 # Clean the old entry
pankso@15855 417 # TODO: old vmlinuz file is removed but the entry is still there.
pankso@15855 418 # So grub error:15 when selected: http://bugs.slitaz.org/?id=74
border@13797 419
pankso@15855 420 # Add the new entry
al@19583 421 cat >> "$1/boot/grub/menu.lst" <<EOT
pankso@4056 422
pankso@4056 423 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
border@13754 424 $grub_dev
border@13754 425 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev quiet
pankso@4056 426 EOT
border@13754 427 # Make it the default entry
pascal@18730 428 last_entry=$(( $(grep -c '^title' "$1/boot/grub/menu.lst")-1 ))
pascal@18730 429 sed -e "s/^default.*/default $last_entry/g" -i "$1/boot/grub/menu.lst"
pankso@4056 430 fi
al@18734 431
pankso@4056 432 # Display information message.
al@19595 433 [ -z "$quiet" ] && cat <<EOT
al@18734 434
pankso@4056 435 ----
al@19583 436 GRUB is installed, these three lines must be in your /boot/grub/menu.lst:
pankso@1154 437
pankso@1154 438 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
pankso@1154 439 $grub_dev
pankso@4056 440 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
pascal@886 441 ----
pascal@886 442 EOT
pankso@1154 443 fi
al@19586 444 :
pankso@3 445 }
al@19772 446
al@19772 447 pre_remove_linux_module_headers() {
al@19772 448 if [ -e "$1/usr/src/linux" ]; then
al@19772 449 rm -rf "$1/usr/src/linux"
al@19772 450 fi
al@19772 451 }
al@19772 452
al@19772 453 # Added soft link to make it easier to point to kernel folder
al@19772 454 post_install_linux_module_headers() {
al@19772 455 KVERSION="$VERSION-slitaz"
al@19772 456 [ -L "$1/usr/src/linux" ] && rm -f "$1/usr/src/linux"
al@19772 457 ln -sf /usr/src/linux-$KVERSION "$1/usr/src/linux"
al@19772 458 ln -sf /usr/src/linux-$KVERSION "$1/lib/modules/$KVERSION/build"
al@19772 459 }
al@19772 460
al@19772 461 post_install_linux_zram() {
al@19772 462 chroot "$1/" depmod -a $VERSION-slitaz &&
al@19777 463 RAM=$(grep MemTotal /proc/meminfo | tr -dc 0-9) &&
al@19772 464 echo "SIZE_KB="$(($RAM/2)) > "$1/etc/compcache.conf"
al@19772 465 [ -n "$quiet" ] || cat <<EOT
al@19772 466
al@19772 467 You can add compressed swap according /etc/compcache.conf configuration with:
al@19772 468 # /etc/init.d/compcache start
al@19772 469 Or add compcache to the RUN_DAEMONS list of /etc/rcS.conf.
al@19772 470 EOT
al@19772 471 }