tazlito rev 362

tazlito: bi kernel support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Nov 16 14:42:08 2014 +0100 (2014-11-16)
parents 90ccc147f462
children 7908e4582efa
files tazlito
line diff
     1.1 --- a/tazlito	Mon Oct 27 13:37:15 2014 +0100
     1.2 +++ b/tazlito	Sun Nov 16 14:42:08 2014 +0100
     1.3 @@ -216,6 +216,21 @@
     1.4  	fi
     1.5  }
     1.6  
     1.7 +# isolinux.conf doesn't know the kernel version.
     1.8 +# We name then kernel image 'bzImage'.
     1.9 +# isolinux/syslinux first try with '64' suffix with a 64bits cpu.
    1.10 +make_bzImage_hardlink()
    1.11 +{
    1.12 +	if [ -s ${1:-.}/vmlinuz*slitaz ]; then
    1.13 +		rm -f ${1:-.}/bzImage 2> /dev/null
    1.14 +		ln ${1:-.}/vmlinuz*slitaz ${1:-.}/bzImage
    1.15 +	fi
    1.16 +	if [ -s ${1:-.}/vmlinuz*slitaz64 ]; then
    1.17 +		rm -f ${1:-.}/bzImage64 2> /dev/null
    1.18 +		ln ${1:-.}/vmlinuz*slitaz64 ${1:-.}/bzImage64
    1.19 +	fi
    1.20 +}
    1.21 +
    1.22  create_iso()
    1.23  {
    1.24  	cd $2
    1.25 @@ -230,12 +245,7 @@
    1.26  	boldify "Generating ISO image"
    1.27  	separator
    1.28  	echo "Generating $1"
    1.29 -	if [ $(ls $2/boot/vmlinuz* $2/boot/bzImage | wc -l) -eq 2 ]; then
    1.30 -		if cmp $2/boot/vmlinuz* $2/boot/bzImage > /dev/null; then
    1.31 -			rm -f $2/boot/bzImage
    1.32 -			ln $2/boot/vmlinuz* $2/boot/bzImage
    1.33 -		fi
    1.34 -	fi
    1.35 +	make_bzImage_hardlink $2/boot
    1.36  	genisoimage -R -o $1 -b boot/isolinux/isolinux.bin \
    1.37   		-c boot/isolinux/boot.cat -no-emul-boot -boot-load-size 4 \
    1.38  		-V "$VOLUM_NAME" -p "$PREPARED" -input-charset iso8859-1 \
    1.39 @@ -385,7 +395,7 @@
    1.40  					hardlinks=$(($hardlinks+1)) &&
    1.41  					save="$(($save+(${attr%%-*}+512)/1024))"
    1.42  				else
    1.43 -					cp "$old_file" "$file"
    1.44 +					cp -a "$old_file" "$file"
    1.45  				fi
    1.46  			fi
    1.47  		fi
    1.48 @@ -1094,8 +1104,7 @@
    1.49  	build_initfs ram || return 1
    1.50  	build_loram_rootfs
    1.51  	cp -a $TMP_DIR/iso $TMP_DIR/loramiso
    1.52 -	rm -f $TMP_DIR/loramiso/boot/bzImage
    1.53 -	ln $TMP_DIR/loramiso/boot/vmlinuz* $TMP_DIR/loramiso/boot/bzImage
    1.54 +	make_bzImage_hardlink $TMP_DIR/loramiso/boot
    1.55  	mv $TMP_DIR/initfs.gz $TMP_DIR/loramiso/boot/rootfs.gz
    1.56  	cp $TMP_DIR/rootfs* $TMP_DIR/loramiso/boot
    1.57  	update_metaiso_sizes
    1.58 @@ -1112,7 +1121,7 @@
    1.59  
    1.60  	# Clean hardlinks and files patched by genisofs in /boot
    1.61  	for i in isolinux/isolinux.bin isolinux/boot.cat bzImage ; do
    1.62 -		rm -f $1/boot/$i
    1.63 +		rm -f $1/boot/$i*
    1.64  	done
    1.65  
    1.66  	# Clean files generated in post_install
    1.67 @@ -1308,7 +1317,7 @@
    1.68  		mkdir -p $TARGET/rootcd/boot
    1.69  		echo -n "Copying the Linux kernel..."
    1.70  		if cp $TMP_DIR/boot/vmlinuz* $TARGET/rootcd/boot 2> /dev/null; then
    1.71 -			ln $TARGET/rootcd/boot/vmlinuz* $TARGET/rootcd/boot/bzImage
    1.72 +			make_bzImage_hardlink $TARGET/rootcd/boot
    1.73  		else
    1.74  			cp $TMP_DIR/boot/bzImage $TARGET/rootcd/boot
    1.75  		fi
    1.76 @@ -2083,7 +2092,7 @@
    1.77  			echo -n "Moving the boot directory..."
    1.78  			mv $ROOTFS/boot $ROOTCD
    1.79  			cd $ROOTCD/boot
    1.80 -			ln vmlinuz-* bzImage
    1.81 +			make_bzImage_hardlink
    1.82  			status
    1.83  		fi
    1.84  		cd $DISTRO
    1.85 @@ -2354,12 +2363,12 @@
    1.86  
    1.87  		# Now we need the kernel and isolinux files.
    1.88  		if  mount /dev/cdrom /media/cdrom 2>/dev/null; then
    1.89 -			cp /media/cdrom/boot/bzImage $ROOTCD/boot
    1.90 +			cp /media/cdrom/boot/bzImage* $ROOTCD/boot
    1.91  			cp -a /media/cdrom/boot/isolinux $ROOTCD/boot
    1.92  			unmeta_boot $ROOTCD
    1.93  			umount /media/cdrom
    1.94  	      elif  mount |grep /media/cdrom; then
    1.95 -	                cp /media/cdrom/boot/bzImage $ROOTCD/boot
    1.96 +	                cp /media/cdrom/boot/bzImage* $ROOTCD/boot
    1.97  		        cp -a /media/cdrom/boot/isolinux $ROOTCD/boot
    1.98  			unmeta_boot $ROOTCD
    1.99  			umount /media/cdrom;
   1.100 @@ -2474,8 +2483,7 @@
   1.101  		mount -o loop,ro $1 $TMP_DIR/mnt 2> /dev/null
   1.102  		status || cleanup_merge
   1.103  		cp -a $TMP_DIR/mnt $TMP_DIR/iso
   1.104 -		rm -f $TMP_DIR/iso/boot/bzImage
   1.105 -		ln $TMP_DIR/iso/boot/vmlinuz* $TMP_DIR/iso/boot/bzImage
   1.106 +		make_bzImage_hardlink $TMP_DIR/iso/boot
   1.107  		umount -d $TMP_DIR/mnt
   1.108  		if [ -f $TMP_DIR/iso/boot/rootfs1.gz ]; then
   1.109  			echo "$1 is already a merged iso. Aborting."