wok-next annotate linux/receipt @ rev 20892

linux: up (4.17.7)
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Jul 20 01:20:51 2018 +0300 (2018-07-20)
parents 60e87d3e45c7
children 751dc2b613cd
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@20437 19 # Removed: lguest, linux-firmware, linux-logfs, 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@20437 32 linux-irda 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@20437 36 linux-nbd linux-ncpfs 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 *-irda) c="IRDA modules";;
al@19772 230 *-isdn) c="ISDN modules";;
al@19772 231 *-jfs) c="JFS module";;
al@19772 232 *-joystick) c="joystick modules";;
al@19772 233 *-kvm) c="KVM and Virtio modules";;
al@19772 234 *-logfs) c="Logfs module";;
al@19772 235 *-md) c="MD modules"; DEPENDS="linux-crypto";;
al@19772 236 *-media) c="media modules"; DEPENDS="linux-radio";;
al@19772 237 *-memstick) c="Sony memory stick modules";;
al@19772 238 *-minix) c="Minix module";;
al@19772 239 *-mmc) c="MMC modules - card reader";;
al@19772 240 *-mwave) c="ACP Modem driver module - for IBM Thinkpad";;
al@19772 241 *-nbd) c="NBD (network block device) modules";;
al@19772 242 *-ncpfs) c="NCPFS module";;
al@19772 243 *-netfilter) c="Netfilter modules";;
al@19772 244 *-nfc) c="NFC modules";;
al@19772 245 *-nfs) c="NFS modules"; DEPENDS="linux-crypto";;
al@19772 246 *-nfsd) c="NFS server module"; DEPENDS="linux-nfs";;
al@19772 247 *-ocfs2) c="OCFS2 modules"; DEPENDS="linux-dlm";;
al@19772 248 *-orangefs) c="OrangeFS module";;
al@19777 249 *-radio) c="radio modules"; DEPENDS="linux-sound";;
al@19772 250 *-reiserfs) c="ReiserFS module";;
al@19772 251 *-romfs) c="ROMFS module";;
al@19772 252 *-sched) c="Sched modules";;
al@19772 253 *-scsi) c="SCSI modules";;
al@19772 254 *-sound) c="sound modules"
al@19772 255 copy firmware/ess/ firmware/korg/ firmware/sun/ firmware/yamaha/
al@19772 256 ;;
al@19772 257 *-speakup) c="Speakup modules";;
al@19772 258 *-squashfs) c="Squashfs module"; PROVIDE="squashfs-module";;
al@19772 259 *-staging) c="staging kernel modules";;
al@19772 260 *-toshiba) c="Toshiba module";;
al@19772 261 *-usb-gadget) c="USB gadget modules";;
al@19772 262 *-usb-misc) c="misc. USB drivers";;
al@19772 263 *-usbdsl) c="USB DSL modem modules";;
al@19772 264 *-usbip) c="Usbip module"; PROVIDE="usbip-module";;
al@19772 265 *-uwb) c="UWB modules";;
al@19772 266 *-video) c="video modules";;
al@19772 267 *-wan) c="Wide Area Networks (WANs) modules"; DEPENDS="linux-wireless";;
al@19772 268 *-watchdog) c="watchdog drivers";;
al@19772 269 *-wimax) c="Wimax modules";;
al@19772 270 *-wireless) c="wireless modules"; DEPENDS="linux-crypto wireless_tools";;
al@19772 271 *-zram) c="compressed caching support"; PROVIDE="compcache"
al@19772 272 copy compcache compcache.conf
al@19772 273 ;;
pankso@12803 274 esac
pankso@12803 275
al@19772 276 case $PACKAGE in
al@19772 277 linux)
al@19777 278 DEPENDS="kmod"
al@19772 279 case "$ARCH" in
al@19772 280 arm)
al@19772 281 echo "Packing: ARM Kernel"
al@19772 282 cp -a $install/* $fs
al@19772 283 rm -f $fs/lib/modules/*/build $fs/lib/modules/*/source
al@19772 284 return 0 ;;
al@19772 285 esac
al@18734 286
al@19772 287 # Copy the Kernel
al@19772 288 cp -a $install/boot $fs
al@18734 289
al@19772 290 # Copy base modules
al@19772 291 . $stuff/tools/copy_modules.sh
al@18734 292
al@20437 293 # We only need modules.{order,builtin} because other map files are
al@20437 294 # generated by depmod in post_install()
al@19772 295 copy modules.order modules.builtin
al@19772 296 rm -rf $fs/usr
al@18734 297
al@19772 298 # Pack all packages with a Kernel modules
al@19772 299 [ ! -d "$install/lib/modules/$VERSION-slitaz" ] && return 1
al@19772 300
al@19772 301 # Checking for Linux Kernel modules that don't belong to any of the packages
al@19772 302 # $stuff/tools/check_modules.sh
al@19777 303 # please, see web interface instead
al@19772 304 ;;
al@19772 305 *-firmware)
al@19772 306 mkdir -p $fs/lib
al@19772 307 cp -a $install/lib/firmware $fs/lib
al@19772 308 # remove linux-sound firmware files
al@19772 309 for i in ess korg sun yamaha; do
al@19772 310 rm -rf $fs/lib/firmware/$i
al@19772 311 done
al@19772 312 CAT="non-free|firmware thats compiled from Linux source code"
al@19772 313 PROVIDE="linux64-firmware"
al@19772 314 ;;
al@19772 315 *-module-headers)
al@19772 316 CAT="development|header files and scripts for building modules for Linux Kernel"
al@19772 317 KVERSION="$VERSION-slitaz"
al@19772 318 DEPENDS="slitaz-toolchain"
al@19772 319 mkdir -p $fs/lib/modules/$KVERSION $fs/usr
al@19772 320 cp -a $install/usr/src $fs/usr
al@19772 321 ;;
al@19772 322 *-source)
al@19772 323 CAT="development|source files"
al@19772 324 DEPENDS="linux slitaz-toolchain ncurses-dev perl xz lzma patch busybox-boot"
al@19772 325
al@19772 326 local _AUFSVER=$(. $WOK/aufs/receipt; echo $VERSION)
al@19772 327 local AUFSDIR="aufs-${_AUFSVER}"
al@19772 328 kps=$fs/usr/src/kernel-patches/slitaz
al@19772 329 mkdir -p $kps \
al@19772 330 $fs/lib/modules/$VERSION-slitaz \
al@19772 331 $fs/usr/bin $fs/usr/sbin
al@19772 332
al@19772 333 # URL
al@19772 334 echo $(. $WOK/linux/receipt; echo $WGET_URL) > $kps/url
al@19772 335 # stuff
al@19772 336 cp $stuff/tools/* $stuff/bootloader.sh $kps
al@19772 337 # Kernel patch
al@19772 338 xzcat $SRC/patch-$VERSION.xz > $kps/linux-$VERSION.patch
al@19772 339 echo "linux-$VERSION.patch" > $kps/patches
al@19772 340 # Aufs patches
al@19772 341 sed '/^aufs4.*patch$/!d' $stuff/tools/aufs-patches | \
al@19772 342 tee -a $kps/patches | \
al@19772 343 while read i; do
al@19772 344 cp $WOK/aufs/source/*/$i $kps
al@19772 345 done
al@19772 346 # misc. patches
al@19772 347 cat $stuff/patches/patch.order >> $kps/patches
al@19772 348 cp $stuff/patches/* $kps
al@19772 349 rm $kps/patch.order
al@19772 350 # config
al@19772 351 cp $WOK/linux/source/linux-$VERSION/.config $kps/config
al@19772 352
al@19772 353 cp -a $stuff/linux-source/buildtaz $kps
al@19772 354 cp -a $stuff/linux-source/make-tazpkg.u $kps
al@19772 355 cp -a $stuff/linux-source/get-linux-source $fs/usr/bin
al@19772 356 cp -a $stuff/linux-source/list_modules.sh $kps
al@19772 357 cp -a $stuff/linux-source/rdev $fs/usr/sbin
al@19772 358 ln -s rdev $fs/usr/sbin/rootflags
al@19772 359 ln -s rdev $fs/usr/sbin/ramsize
al@19772 360 ln -s rdev $fs/usr/sbin/vidmode
al@19772 361 sed -i "s|=XXX|=$VERSION|g" $fs/usr/bin/get-linux-source
al@19772 362
al@19772 363 # Copy Aufs4 source files
al@20437 364 if [ -d $WOK/aufs/$AUFSDIR ]; then
al@19772 365 mkdir $fs/usr/src/kernel-patches/slitaz/aufs4
al@20437 366 cp -a $WOK/aufs/$AUFSDIR/Documentation \
al@20437 367 $WOK/aufs/$AUFSDIR/fs \
al@20437 368 $WOK/aufs/$AUFSDIR/include \
al@20437 369 $fs/usr/src/kernel-patches/slitaz/aufs4
al@19772 370 fi
al@19772 371
al@19772 372 ln -s ../../../usr/src/linux-$VERSION $fs/lib/modules/$VERSION-slitaz/source
al@19772 373
al@19772 374 chown -R root:root $fs
al@19772 375 ;;
al@19772 376 *-without-modules)
al@19772 377 CAT="base-system|without module support"
al@19772 378 PROVIDE="linux"
al@19772 379 mkdir -p $fs/boot
al@19772 380 cp -a $install/bzImage $fs/boot/vmlinuz-$VERSION-slitaz-without-modules
al@19772 381 ;;
al@19772 382 *)
al@19772 383 . $stuff/tools/copy_modules.sh
al@19772 384 CAT="base-system|$c"
al@19772 385 ;;
al@19772 386 esac
al@19772 387
al@19772 388 case $PACKAGE in
al@19772 389 *fs|*fs2|*-coda|*-dlm|*-hfsplus|*-minix|*-nfsd)
al@19772 390 CONFIG_FILES="/etc/filesystems";;
al@19772 391 *-zram)
al@19772 392 CONFIG_FILES="/etc/compcache.conf";;
al@19772 393 esac
pankso@3 394 }
pankso@3 395
al@19772 396
al@19772 397 post_install_linux() {
al@18734 398 # Handle multiarch installation
al@18734 399 case "$SLITAZ_ARCH" in
pankso@12803 400 arm)
pankso@12803 401 echo "Kernel : /boot/linux-$VERSION-slitaz-$ARCH"
pankso@12803 402 echo "Modules: /lib/modules/$VERSION-slitaz"
pankso@12803 403 return 0 ;;
pankso@12803 404 esac
al@18734 405
pankso@15855 406 # GRUB stuff.
pankso@15855 407 if [ -f "$1/boot/grub/menu.lst" ]; then
pankso@15855 408 # Current root device
pankso@15855 409 root_dev="/dev/$(lsblk | grep '/$'| grep -o '[a-z]d[a-z][0-9]*')"
pankso@15855 410 grub_part="$(( $(echo $root_dev | grep -o '[0-9]*$')-1 ))"
pankso@15855 411 # Use device.map to find grub device number
pankso@15855 412 grub_dev="$(grep $(echo $root_dev | grep -o '^/dev/.d.' ) \
al@19583 413 "$1/boot/grub/device.map" | cut -f1 | sed "s/)$/.$grub_part)/g")"
al@18734 414
al@19583 415 # Add and clean Kernel entries in case of upgrade for installed system.
pascal@18730 416 if ! grep -q vmlinuz-$VERSION-slitaz "$1/boot/grub/menu.lst"; then
al@18734 417
pankso@15855 418 # Clean the old entry
pankso@15855 419 # TODO: old vmlinuz file is removed but the entry is still there.
pankso@15855 420 # So grub error:15 when selected: http://bugs.slitaz.org/?id=74
border@13797 421
pankso@15855 422 # Add the new entry
al@19583 423 cat >> "$1/boot/grub/menu.lst" <<EOT
pankso@4056 424
pankso@4056 425 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
border@13754 426 $grub_dev
border@13754 427 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev quiet
pankso@4056 428 EOT
border@13754 429 # Make it the default entry
pascal@18730 430 last_entry=$(( $(grep -c '^title' "$1/boot/grub/menu.lst")-1 ))
pascal@18730 431 sed -e "s/^default.*/default $last_entry/g" -i "$1/boot/grub/menu.lst"
pankso@4056 432 fi
al@18734 433
pankso@4056 434 # Display information message.
al@19595 435 [ -z "$quiet" ] && cat <<EOT
al@18734 436
pankso@4056 437 ----
al@19583 438 GRUB is installed, these three lines must be in your /boot/grub/menu.lst:
pankso@1154 439
pankso@1154 440 title SliTaz GNU/Linux (Kernel $VERSION-slitaz)
pankso@1154 441 $grub_dev
pankso@4056 442 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev
pascal@886 443 ----
pascal@886 444 EOT
pankso@1154 445 fi
al@19586 446 :
pankso@3 447 }
al@19772 448
al@19772 449 pre_remove_linux_module_headers() {
al@19772 450 if [ -e "$1/usr/src/linux" ]; then
al@19772 451 rm -rf "$1/usr/src/linux"
al@19772 452 fi
al@19772 453 }
al@19772 454
al@19772 455 # Added soft link to make it easier to point to kernel folder
al@19772 456 post_install_linux_module_headers() {
al@19772 457 KVERSION="$VERSION-slitaz"
al@19772 458 [ -L "$1/usr/src/linux" ] && rm -f "$1/usr/src/linux"
al@19772 459 ln -sf /usr/src/linux-$KVERSION "$1/usr/src/linux"
al@19772 460 ln -sf /usr/src/linux-$KVERSION "$1/lib/modules/$KVERSION/build"
al@19772 461 }
al@19772 462
al@19772 463 post_install_linux_zram() {
al@19772 464 chroot "$1/" depmod -a $VERSION-slitaz &&
al@19777 465 RAM=$(grep MemTotal /proc/meminfo | tr -dc 0-9) &&
al@19772 466 echo "SIZE_KB="$(($RAM/2)) > "$1/etc/compcache.conf"
al@19772 467 [ -n "$quiet" ] || cat <<EOT
al@19772 468
al@19772 469 You can add compressed swap according /etc/compcache.conf configuration with:
al@19772 470 # /etc/init.d/compcache start
al@19772 471 Or add compcache to the RUN_DAEMONS list of /etc/rcS.conf.
al@19772 472 EOT
al@19772 473 }