wok-backports annotate linux/receipt @ rev 14
linux: update bdeps (aufs needs bash)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Dec 23 10:02:39 2013 +0000 (2013-12-23) |
parents | 8aa134add845 |
children | 4e65361fc627 |
rev | line source |
---|---|
pascal@0 | 1 # SliTaz package receipt. |
pascal@0 | 2 |
pascal@0 | 3 PACKAGE="linux" |
pascal@0 | 4 VERSION="3.2.53" |
pascal@0 | 5 KBASEVER="${VERSION:0:3}" |
pascal@0 | 6 CATEGORY="base-system" |
pascal@0 | 7 SHORT_DESC="The Linux kernel and modules." |
pascal@0 | 8 MAINTAINER="devel@slitaz.org" |
pascal@0 | 9 LICENSE="GPL2" |
pascal@0 | 10 TARBALL="$PACKAGE-$KBASEVER.tar.xz" |
pascal@0 | 11 WEB_SITE="http://www.kernel.org/" |
pascal@0 | 12 WGET_URL="ftp://ftp.kernel.org/pub/linux/kernel/v3.0/$TARBALL" |
pascal@0 | 13 HOST_ARCH="i486 arm x86_64" |
pascal@0 | 14 |
pascal@0 | 15 DEPENDS="kmod" |
pascal@0 | 16 BUILD_DEPENDS="slitaz-toolchain perl git xz lzma patch \ |
pascal@14 | 17 uclibc-cross-compiler-x86_64 bash" |
pascal@0 | 18 |
pascal@0 | 19 # Use version patch so we dont dl full kernel source on each minor update |
pascal@0 | 20 [ "$KBASEVER" != "$VERSION" ] && |
pascal@0 | 21 PATCH="$(dirname $WGET_URL)/patch-$VERSION.xz" && |
pascal@0 | 22 EXTRA_SOURCE_FILES="$(basename $PATCH)" |
pascal@0 | 23 |
pascal@0 | 24 # Aufs enable chroot |
pascal@0 | 25 AUFS_NOT_RAMFS="uclibc-cross-compiler-x86_64 is not compatible with aufs+tmpfs 8(" |
pascal@0 | 26 |
pascal@0 | 27 # This will save/restore modules.dep but we want to regenerate it on |
pascal@0 | 28 # install or upgrade. |
pascal@0 | 29 #CONFIG_FILES="/lib/modules/$KBASEVER-slitaz/modules.dep" |
pascal@0 | 30 |
pascal@0 | 31 # Handle multiarch compilation. Less bdeps when cross-compiling for ARM |
pascal@0 | 32 case "$ARCH" in |
pascal@0 | 33 arm) BUILD_DEPENDS="xz" TARBALL="$PACKAGE-$VERSION.tar.bz2" ;; |
pascal@0 | 34 x86_64) BUILD_DEPENDS="xz" ;; |
pascal@0 | 35 esac |
pascal@0 | 36 |
pascal@0 | 37 # TODO: slitaz.conf provide SLITAZ_ARCH and must be handled by tazpkg/spk |
pascal@0 | 38 [ -f "$root/etc/slitaz/slitaz.conf" ] && . $root/etc/slitaz/slitaz.conf |
pascal@0 | 39 |
pascal@0 | 40 # Handle multiarch installation. ARM use Busybox modutils, so avoid any |
pascal@0 | 41 # deps on kmod |
pascal@0 | 42 case "$SLITAZ_ARCH" in |
pascal@0 | 43 arm) DEPENDS="" ;; |
pascal@0 | 44 esac |
pascal@0 | 45 |
pascal@0 | 46 # Rules to configure and make the package. |
pascal@0 | 47 compile_rules() |
pascal@0 | 48 { |
pascal@0 | 49 cd $src |
pascal@0 | 50 |
pascal@0 | 51 if [ "$KBASEVER" != "$VERSION" ]; then |
pascal@0 | 52 [ -s $SRC/$(basename $PATCH) ] || |
pascal@0 | 53 wget $PATCH -O $SRC/$(basename $PATCH) |
pascal@0 | 54 xzcat $SRC/$(basename $PATCH) | patch -Np1 |
pascal@0 | 55 touch done.patch-$VERSION |
pascal@0 | 56 fi |
pascal@0 | 57 |
pascal@0 | 58 case "$ARCH" in |
pascal@0 | 59 arm) |
pascal@0 | 60 echo "Compiling: ARM Kernel" |
pascal@0 | 61 if [ ! -s $SRC/$(basename $PATCH) ]; then |
pascal@0 | 62 wget $PATCH -O $SRC/$(basename $PATCH) |
pascal@0 | 63 fi |
pascal@0 | 64 make mrproper |
pascal@0 | 65 # Buggy: we got kernel panic about module not tinted 3.2.14 |
pascal@0 | 66 #echo "Applying patch: $(basename $PATCH)" |
pascal@0 | 67 #xzcat $SRC/$(basename $PATCH) | patch -Np1 >/dev/null |
pascal@0 | 68 patch -Np1 < $stuff/$ARCH/linux-arm.patch || exit 1 |
pascal@0 | 69 cp -f $stuff/$ARCH/linux-arm.config .config |
pascal@0 | 70 make ARCH=$ARCH CROSS_COMPILE=${HOST_SYSTEM}- bzImage && |
pascal@0 | 71 make ARCH=$ARCH CROSS_COMPILE=${HOST_SYSTEM}- modules && |
pascal@0 | 72 make ARCH=$ARCH CROSS_COMPILE=${HOST_SYSTEM}- \ |
pascal@0 | 73 INSTALL_MOD_PATH=$DESTDIR modules_install && |
pascal@0 | 74 mkdir -p $DESTDIR/boot && |
pascal@0 | 75 cp -a arch/arm/boot/zImage \ |
pascal@0 | 76 $DESTDIR/boot/linux-$VERSION-slitaz-$ARCH |
pascal@0 | 77 return 0 ;; |
pascal@0 | 78 x86_64) |
pascal@0 | 79 echo "TODO: Maybe use default ? But cross compile in x86_64 chroot" |
pascal@0 | 80 echo "so we can remove the 64 build by uclibc-cross-compiler-x86_64" |
pascal@0 | 81 return 0 ;; |
pascal@0 | 82 esac |
pascal@0 | 83 |
pascal@0 | 84 [ ! -x /usr/bin/cook ] && report open-bloc |
pascal@0 | 85 |
pascal@0 | 86 # Check for Aufs and cook it if unbuilt. |
pascal@0 | 87 echo "Checking for Aufs packages..." |
pascal@0 | 88 _AUFSVER=`grep ^VERSION= $WOK/aufs/receipt | cut -d "=" -f2 | sed -e 's/"//g'` |
pascal@0 | 89 if [ -x /usr/bin/cook ]; then |
pascal@0 | 90 # Give info an redirect to /dev/null since aufs got it own log. |
pascal@0 | 91 AUFSDIR=$WOK/aufs/source/aufs-${_AUFSVER} |
pascal@0 | 92 [ -d "$AUFSDIR" ] && rm -rf $AUFSDIR |
pascal@0 | 93 #echo "Cook: aufs $_AUFSVER" |
pascal@0 | 94 cook aufs --getsrc |
pascal@0 | 95 mkdir -p $WOK/aufs/source/ |
pascal@0 | 96 tar xjf $SRC/aufs-${_AUFSVER}.tar.bz2 -C $WOK/aufs/source/ |
pascal@0 | 97 elif [ -x /usr/bin/tazwok ]; then |
pascal@0 | 98 # we just need aufs source. Also cooking now is a bad idea since it |
pascal@0 | 99 # needs linux-module-headers. The one your cooking not the one from the web. |
pascal@0 | 100 AUFSDIR=$WOK/aufs/aufs-${_AUFSVER} |
pascal@0 | 101 [ -d "$AUFSDIR" ] && rm -rf $AUFSDIR |
pascal@0 | 102 tazwok get-src aufs --target=$AUFSDIR || { report close-bloc; return 1; } |
pascal@0 | 103 fi |
pascal@0 | 104 echo "cook:linux" > $command |
pascal@0 | 105 |
pascal@0 | 106 echo "Copying Aufs files and patches..." |
pascal@0 | 107 cp -a $AUFSDIR/Documentation $AUFSDIR/fs $AUFSDIR/include $src |
pascal@0 | 108 cp -a $AUFSDIR/aufs3-*.patch $stuff |
pascal@0 | 109 |
pascal@0 | 110 # SliTaz db |
pascal@0 | 111 [ -d $WOK/$PACKAGE/source/slitaz ] && rm -rf $WOK/$PACKAGE/source/slitaz 2> /dev/null |
pascal@0 | 112 mkdir -p $WOK/$PACKAGE/source/slitaz |
pascal@0 | 113 echo "$WGET_URL" > $WOK/$PACKAGE/source/slitaz/url |
pascal@0 | 114 cp $stuff/gztazmod.sh $stuff/list_modules.sh $WOK/$PACKAGE/source/slitaz |
pascal@0 | 115 cp $stuff/bootloader.sh $WOK/$PACKAGE/source/slitaz |
pascal@0 | 116 |
pascal@0 | 117 # Apply patches |
pascal@0 | 118 echo "Applying patches..." |
pascal@0 | 119 while read patch_file; do |
pascal@0 | 120 echo "$patch_file" >> $WOK/$PACKAGE/source/slitaz/patches |
pascal@0 | 121 cp $stuff/$patch_file $WOK/$PACKAGE/source/slitaz |
pascal@0 | 122 if [ -f done.$patch_file ]; then |
pascal@0 | 123 echo "Skipping $patch_file" |
pascal@0 | 124 continue |
pascal@0 | 125 fi |
pascal@0 | 126 echo "Apply $patch_file" |
pascal@0 | 127 if [ -x /usr/bin/cook ]; then |
pascal@0 | 128 patch -p1 < $WOK/$PACKAGE/source/slitaz/$patch_file || return 1 |
pascal@0 | 129 elif [ -x /usr/bin/tazwok ]; then |
pascal@0 | 130 patch -p1 < $WOK/$PACKAGE/source/slitaz/$patch_file || { report close-bloc; return 1; } |
pascal@0 | 131 fi |
pascal@0 | 132 touch done.$patch_file |
pascal@0 | 133 done <<EOT |
pascal@0 | 134 $PACKAGE-diff.u |
pascal@0 | 135 $PACKAGE-header.u |
pascal@0 | 136 $PACKAGE-freeinitrd.u |
pascal@0 | 137 $PACKAGE-subroot.u |
pascal@4 | 138 $PACKAGE-CVE-2013-2929.u |
pascal@0 | 139 aufs3-base.patch |
pascal@0 | 140 aufs3-standalone.patch |
pascal@0 | 141 aufs3-loopback.patch |
pascal@0 | 142 aufs3-proc_map.patch |
pascal@0 | 143 channel-negative-one-maxim.patch |
pascal@0 | 144 mac80211.compat08082009.wl_frag+ack_v1.patch |
pascal@0 | 145 EOT |
pascal@0 | 146 |
pascal@0 | 147 sed -i 's|SUBLEVEL =.*|SUBLEVEL =|g' Makefile |
pascal@0 | 148 |
pascal@0 | 149 [ ! -x /usr/bin/cook ] && report step "Make kernel proper and then build lguest" |
pascal@0 | 150 [ -x /usr/bin/cook ] && echo "Make kernel proper and then build lguest" |
pascal@0 | 151 make mrproper |
pascal@0 | 152 cd Documentation/virtual/lguest |
pascal@0 | 153 if [ -x /usr/bin/cook ]; then |
pascal@0 | 154 make lguest || return 1 |
pascal@0 | 155 elif [ -x /usr/bin/tazwok ]; then |
pascal@0 | 156 make lguest || { report close-bloc; return 1; } |
pascal@0 | 157 fi |
pascal@0 | 158 cd $src |
pascal@0 | 159 |
pascal@0 | 160 case "$opt" in |
pascal@0 | 161 *--no64*);; |
pascal@0 | 162 *) |
pascal@0 | 163 # |
pascal@0 | 164 # Arch x86_64 |
pascal@0 | 165 # |
pascal@0 | 166 [ ! -x /usr/bin/cook ] && report step "Make bzImage64 without modules first" |
pascal@0 | 167 [ -x /usr/bin/cook ] && echo "Building x86_64 Kernel" |
pascal@0 | 168 |
pascal@0 | 169 # Build bzImage64 without modules first |
pascal@0 | 170 cp -f $stuff/$PACKAGE-slitaz.config64 .config |
pascal@0 | 171 sed -i 's/CONFIG_MODULES=y/# CONFIG_MODULES is not set/' .config |
pascal@0 | 172 |
pascal@0 | 173 # We can't keep every driver in staging |
pascal@0 | 174 sed -i -e 's/^CONFIG_RTL8192/#&/' \ |
pascal@0 | 175 -e 's/^CONFIG_R8187SE/#&/' \ |
pascal@0 | 176 -e 's/^CONFIG_RT2870/#&/' .config |
pascal@0 | 177 yes '' | make ARCH=x86_64 oldconfig |
pascal@0 | 178 if [ -x /usr/bin/cook ]; then |
pascal@0 | 179 make -j 4 ARCH=x86_64 CROSS_COMPILE=uclibc-x86_64- bzImage || exit 1 |
pascal@0 | 180 elif [ -x /usr/bin/tazwok ]; then |
pascal@0 | 181 make -j 4 ARCH=x86_64 CROSS_COMPILE=uclibc-x86_64- bzImage || { report close-bloc; return 1; } |
pascal@0 | 182 fi |
pascal@0 | 183 [ -d $DESTDIR ] || mkdir -p $DESTDIR/linux64 |
pascal@0 | 184 mv arch/x86/boot/bzImage $DESTDIR/linux64 |
pascal@0 | 185 mv System.map System.map-without-modules64 |
pascal@0 | 186 |
pascal@0 | 187 [ ! -x /usr/bin/cook ] && report step "Now build bzImage64 with modules" |
pascal@0 | 188 |
pascal@0 | 189 # Build bzImage64 with modules |
pascal@0 | 190 cp -f $stuff/$PACKAGE-slitaz.config64 .config |
pascal@0 | 191 #make ARCH=x86_64 oldconfig |
pascal@0 | 192 make -j 4 ARCH=x86_64 CROSS_COMPILE=uclibc-x86_64- bzImage && |
pascal@0 | 193 make -j 4 ARCH=x86_64 CROSS_COMPILE=uclibc-x86_64- modules && |
pascal@0 | 194 make ARCH=x86_64 INSTALL_MOD_PATH=$DESTDIR/linux64 modules_install && |
pascal@0 | 195 make ARCH=x86_64 INSTALL_HDR_PATH=$DESTDIR/linux64/usr headers_install && |
pascal@0 | 196 ln .config $WOK/$PACKAGE/source/slitaz/config64 |
pascal@0 | 197 if [ -x /usr/bin/cook ]; then |
pascal@0 | 198 [ -s arch/x86/boot/bzImage ] || return 1 |
pascal@0 | 199 elif [ -x /usr/bin/tazwok ]; then |
pascal@0 | 200 [ -s arch/x86/boot/bzImage ] || { report close-bloc; return 1; } |
pascal@0 | 201 fi |
pascal@0 | 202 mkdir -p $DESTDIR/linux64/boot 2> /dev/null |
pascal@0 | 203 mv arch/x86/boot/bzImage $DESTDIR/linux64/boot/vmlinuz-$VERSION-slitaz |
pascal@0 | 204 ln System.map System.map-modules64 |
pascal@0 | 205 ln Module.symvers Module.symvers-modules64 |
pascal@0 | 206 esac |
pascal@0 | 207 |
pascal@0 | 208 # |
pascal@0 | 209 # Standard kernel |
pascal@0 | 210 # |
pascal@0 | 211 [ ! -x /usr/bin/cook ] && report step "Make bzImage without modules first" |
pascal@0 | 212 [ -x /usr/bin/cook ] && echo "Building standard kernel..." |
pascal@0 | 213 |
pascal@0 | 214 # Build bzImage without modules first |
pascal@0 | 215 cp -f $stuff/$PACKAGE-slitaz.config .config |
pascal@0 | 216 sed -i 's/CONFIG_MODULES=y/# CONFIG_MODULES is not set/' .config |
pascal@0 | 217 |
pascal@0 | 218 # We can't keep every driver in staging |
pascal@0 | 219 sed -i -e 's/^CONFIG_RTL8192/#&/' \ |
pascal@0 | 220 -e 's/^CONFIG_R8187SE/#&/' \ |
pascal@0 | 221 -e 's/^CONFIG_RT2870/#&/' .config |
pascal@0 | 222 yes '' | make ARCH=i386 oldconfig |
pascal@0 | 223 if [ -x /usr/bin/cook ]; then |
pascal@0 | 224 make ARCH=i386 -j 4 bzImage || exit 1 |
pascal@0 | 225 elif [ -x /usr/bin/tazwok ]; then |
pascal@0 | 226 make ARCH=i386 -j 4 bzImage || { report close-bloc; return 1; } |
pascal@0 | 227 fi |
pascal@0 | 228 [ -d $DESTDIR ] || mkdir -p $DESTDIR |
pascal@0 | 229 mv arch/x86/boot/bzImage $DESTDIR |
pascal@0 | 230 mv System.map System.map-without-modules |
pascal@0 | 231 |
pascal@0 | 232 [ ! -x /usr/bin/cook ] && report step "Now build bzImage with modules" |
pascal@0 | 233 |
pascal@0 | 234 # Build bzImage with modules |
pascal@0 | 235 cp -f $stuff/$PACKAGE-slitaz.config .config |
pascal@0 | 236 #make ARCH=i386 oldconfig |
pascal@0 | 237 ln .config $WOK/$PACKAGE/source/slitaz/config |
pascal@0 | 238 make ARCH=i386 -j 4 bzImage && |
pascal@0 | 239 make ARCH=i386 -j 4 modules && |
pascal@0 | 240 make ARCH=i386 INSTALL_MOD_PATH=$DESTDIR modules_install && |
pascal@0 | 241 make ARCH=i386 INSTALL_HDR_PATH=$DESTDIR/usr headers_install && |
pascal@0 | 242 if [ -x /usr/bin/cook ]; then |
pascal@0 | 243 [ -s arch/x86/boot/bzImage ] || return 1 |
pascal@0 | 244 elif [ -x /usr/bin/tazwok ]; then |
pascal@0 | 245 [ -s arch/x86/boot/bzImage ] || { report close-bloc; return 1; } |
pascal@0 | 246 fi |
pascal@0 | 247 mkdir -p $DESTDIR/boot 2> /dev/null |
pascal@0 | 248 mv arch/x86/boot/bzImage $DESTDIR/boot/vmlinuz-$VERSION-slitaz |
pascal@0 | 249 |
pascal@0 | 250 [ ! -x /usr/bin/cook ] && report step "Compressing all modules" |
pascal@0 | 251 |
pascal@0 | 252 # Compress all modules. |
pascal@0 | 253 $stuff/gztazmod.sh $DESTDIR/lib/modules/$KBASEVER-slitaz |
pascal@0 | 254 $stuff/gztazmod.sh $DESTDIR/linux64/lib/modules/$KBASEVER-slitaz |
pascal@0 | 255 ln System.map System.map-modules |
pascal@0 | 256 ln Module.symvers Module.symvers-modules |
pascal@0 | 257 |
pascal@0 | 258 if [ ! -x /usr/bin/cook ]; then |
pascal@0 | 259 report close-bloc |
pascal@0 | 260 fi |
pascal@0 | 261 } |
pascal@0 | 262 |
pascal@0 | 263 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@0 | 264 genpkg_rules() |
pascal@0 | 265 { |
pascal@0 | 266 case "$ARCH" in |
pascal@0 | 267 arm) |
pascal@0 | 268 echo "Packing: ARM Kernel" |
pascal@0 | 269 cp -a $install/* $fs |
pascal@0 | 270 rm -f $fs/lib/modules/*/build $fs/lib/modules/*/source |
pascal@0 | 271 return 0 ;; |
pascal@0 | 272 x86_64) |
pascal@0 | 273 echo "TODO: use default or custom x86_64 packing" |
pascal@0 | 274 return 0 ;; |
pascal@0 | 275 esac |
pascal@0 | 276 |
pascal@0 | 277 export PACKAGE VERSION |
pascal@0 | 278 local path |
pascal@0 | 279 cp -a $install/boot $fs |
pascal@0 | 280 # Compress all modules. |
pascal@0 | 281 path=$fs/lib/modules/$KBASEVER-slitaz/kernel |
pascal@0 | 282 mkdir -p $path |
pascal@0 | 283 cp -a $install/lib/modules/$KBASEVER-slitaz/mo* \ |
pascal@0 | 284 $fs/lib/modules/$KBASEVER-slitaz |
pascal@0 | 285 [ "$KBASEVER" != "$VERSION" ] && |
pascal@0 | 286 ln -s $KBASEVER-slitaz $fs/lib/modules/$VERSION-slitaz |
pascal@0 | 287 # Get the base modules |
pascal@0 | 288 export src |
pascal@0 | 289 export _pkg |
pascal@0 | 290 mkdir -p $WOK/$PACKAGE/source/tmp |
pascal@0 | 291 # Warning stuff/list_modules.sh must find the generated modules.list |
pascal@0 | 292 $stuff/list_modules.sh \ |
pascal@0 | 293 $(cat $stuff/modules.list) > $WOK/$PACKAGE/source/tmp/modules.list |
pascal@0 | 294 while read module; do |
pascal@0 | 295 dir=$(dirname $module) |
pascal@0 | 296 [ -d $path/$dir ] || mkdir -p $path/$dir |
pascal@0 | 297 cp -a $install/lib/modules/$KBASEVER-slitaz/kernel/$module $path/$dir |
pascal@0 | 298 done < $WOK/$PACKAGE/source/tmp/modules.list |
pascal@0 | 299 # Remove unresolved links |
pascal@0 | 300 rm -f $fs/lib/modules/$KBASEVER-slitaz/build |
pascal@0 | 301 rm -f $fs/lib/modules/$KBASEVER-slitaz/source |
pascal@0 | 302 # Cook all packages with a kernel module |
pascal@0 | 303 for i in $(cd $WOK; grep -l 'cook linux$' */receipt) |
pascal@0 | 304 do |
pascal@0 | 305 echo cook ${i%/receipt} |
pascal@0 | 306 done |
pascal@0 | 307 # Fixed modules.dep to use right path |
pascal@0 | 308 # saves 100kb of space too |
pascal@0 | 309 sed -i "s|$_pkg||g" $fs/lib/modules/$KBASEVER-slitaz/modules.dep |
pascal@0 | 310 sed -i "s|99.98.$KBASEVER-slitaz|$KBASEVER-slitaz|g" $fs/lib/modules/$KBASEVER-slitaz/modules.dep |
pascal@0 | 311 # Check and echo any module in kernel .config that's not added to |
pascal@0 | 312 # one of linux-* pkgs |
pascal@0 | 313 $stuff/check_modules.sh |
pascal@0 | 314 } |
pascal@0 | 315 |
pascal@0 | 316 # Pre and post install commands for Tazpkg. |
pascal@0 | 317 post_install() |
pascal@0 | 318 { |
pascal@0 | 319 echo "Processing post-install commands..." |
pascal@0 | 320 case "$ARCH" in |
pascal@0 | 321 arm) |
pascal@0 | 322 echo "Kernel : /boot/linux-$VERSION-slitaz-$ARCH" |
pascal@0 | 323 echo "Modules: /lib/modules/$VERSION-slitaz" |
pascal@0 | 324 return 0 ;; |
pascal@0 | 325 esac |
pascal@0 | 326 chroot "$1/" depmod -a $KBASEVER-slitaz |
pascal@0 | 327 # GRUB stuff. |
pascal@0 | 328 if [ -f "$1/boot/grub/menu.lst" ]; then |
pascal@0 | 329 root_dev="/dev/`lsblk | grep '/$'| grep -o '[a-z]d[a-z][0-9]*'`" # current root device |
pascal@0 | 330 grub_part="$(( `echo $root_dev | grep -o '[0-9]*$'`-1 ))" |
pascal@0 | 331 grub_dev="`grep $(echo $root_dev | grep -o '^/dev/.d.' ) $1/boot/grub/device.map |\ |
pascal@0 | 332 cut -f1 | sed "s/)$/.$grub_part)/g"`" # use device.map to find grub device number |
pascal@0 | 333 |
pascal@0 | 334 # Add and clean kernel entrys in case of upgrade for installed system. |
pascal@0 | 335 if ! grep -q vmlinuz-$VERSION-slitaz $1/boot/grub/menu.lst; then |
pascal@0 | 336 |
pascal@0 | 337 #clean the old entry |
pascal@0 | 338 # TODO somewhere, the old vmlinuz file is removed. |
pascal@0 | 339 # but the entry is still there. this cause a grub error:15 when selected |
pascal@0 | 340 # see http://bugs.slitaz.org/?id=74 |
pascal@0 | 341 |
pascal@0 | 342 #add the new |
pascal@0 | 343 cat >> $1/boot/grub/menu.lst << EOT |
pascal@0 | 344 |
pascal@0 | 345 title SliTaz GNU/Linux (Kernel $VERSION-slitaz) |
pascal@0 | 346 $grub_dev |
pascal@0 | 347 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev quiet |
pascal@0 | 348 EOT |
pascal@0 | 349 # Make it the default entry |
pascal@0 | 350 last_entry=$(( $(grep -c '^title' $1/boot/grub/menu.lst)-1 )) |
pascal@0 | 351 sed -e "s/^default.*/default $last_entry/g" -i $1/boot/grub/menu.lst |
pascal@0 | 352 fi |
pascal@0 | 353 # Display information message. |
pascal@0 | 354 cat <<EOT |
pascal@0 | 355 ---- |
pascal@0 | 356 GRUB is installed, these tree lines must be in your /boot/grub/menu.lst: |
pascal@0 | 357 |
pascal@0 | 358 title SliTaz GNU/Linux (Kernel $VERSION-slitaz) |
pascal@0 | 359 $grub_dev |
pascal@0 | 360 kernel /boot/vmlinuz-$VERSION-slitaz root=$root_dev |
pascal@0 | 361 ---- |
pascal@0 | 362 EOT |
pascal@0 | 363 fi |
pascal@0 | 364 } |