tazusb rev 206

Create missing partition & syslinux.cfg is not case sensitive
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Aug 19 16:02:37 2020 +0000 (2 months ago)
parents 8d3a1a983aae
children 836bf3399896
files tazusb
line diff
     1.1 --- a/tazusb	Wed Aug 19 10:56:11 2020 +0000
     1.2 +++ b/tazusb	Wed Aug 19 16:02:37 2020 +0000
     1.3 @@ -137,6 +137,21 @@
     1.4  }
     1.5  
     1.6  
     1.7 +check_partition_table() {
     1.8 +	DISK=${DEVICE%[1-99]}
     1.9 +	fdisk -l $DISK | grep -q ^$DEVICE: || fdisk $DISK <<EOT
    1.10 +n
    1.11 +p
    1.12 +1
    1.13 +
    1.14 +
    1.15 +t
    1.16 +$1
    1.17 +w
    1.18 +EOT
    1.19 +}
    1.20 +
    1.21 + 
    1.22  # Format target device in ext4, ext3, ext2 or fat32.
    1.23  # Usage: make_fs ext2|ext4|fat32|ext3 (default)
    1.24  
    1.25 @@ -146,6 +161,7 @@
    1.26  	FS=$(echo $fs_type | tr '[A-Z]' '[a-z]')
    1.27  	case "$FS" in
    1.28  		ext4|ext3|ext2)
    1.29 +			check_partition_table 83
    1.30  			newline; _ 'Processing...'
    1.31  			_ 'Label: %s' "$label"
    1.32  			echo "Mkfs: mkfs.$FS -L \"$label\" $DEVICE"
    1.33 @@ -154,6 +170,7 @@
    1.34  			;;
    1.35  		fat32)
    1.36  			if [ -x '/sbin/mkdosfs' ];then
    1.37 +				check_partition_table C
    1.38  				newline; _ 'Processing...'
    1.39  				_ 'Label: %s' "$label"
    1.40  				echo "Mkfs: mkdosfs -F 32 -n \"$label\" $DEVICE"
    1.41 @@ -260,7 +277,7 @@
    1.42  	cp /media/cdrom/boot/bzImage*    $TARGET_ROOT/boot
    1.43  	cp /media/cdrom/boot/rootfs*.gz* $TARGET_ROOT/boot
    1.44  	cp /media/cdrom/boot/memtest*    $TARGET_ROOT/boot 2>/dev/null
    1.45 -	cp /media/cdrom/boot/*pxe*       $TARGET_ROOT/boot 2>/dev/null
    1.46 +	cp /media/cdrom/boot/*xe*        $TARGET_ROOT/boot 2>/dev/null
    1.47  	status
    1.48  }
    1.49  
    1.50 @@ -301,10 +318,10 @@
    1.51  	cp /media/cdrom/boot/isolinux/isolinux.cfg $TARGET_ROOT/boot/$ST/$ST.$STE
    1.52  
    1.53  	# Update DVD autoinstall
    1.54 -	sed -i "s/LABEL=packages-[^,]*/UUID=$UUID/g" $(grep -l append $TARGET_ROOT/boot/$ST/*)
    1.55 +	sed -i "s/LABEL=packages-[^,]*/UUID=$UUID/g" $(grep -il append $TARGET_ROOT/boot/$ST/*)
    1.56  
    1.57  	# Add home=$UUID to kernel line in extlinux or syslinux.cfg
    1.58 -	sed -i -e "s/\(root=.*\)/\1 home=$UUID/" $(grep -l append $TARGET_ROOT/boot/$ST/*)
    1.59 +	sed -i -e "s/\(root=.*\)/\1 home=$UUID/" $(grep -il append $TARGET_ROOT/boot/$ST/*)
    1.60  
    1.61  	# Splash screen and help files.
    1.62  	cp /media/cdrom/boot/isolinux/splash.*	$TARGET_ROOT/boot/$ST