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