tazusb rev 186

oops, merge...
author Xander Ziiryanoff <psychomaniak@xakep.ru>
date Fri Feb 19 16:14:24 2016 +0200 (2016-02-19)
parents 1a1165db2fc2
children f95528a9b180
files tazusb
line diff
     1.1 --- a/tazusb	Fri Feb 19 16:07:14 2016 +0200
     1.2 +++ b/tazusb	Fri Feb 19 16:14:24 2016 +0200
     1.3 @@ -9,7 +9,7 @@
     1.4  # Authors: see AUTHORS file
     1.5  #
     1.6  
     1.7 -VERSION=182
     1.8 +VERSION=4.2.6
     1.9  
    1.10  . /lib/libtaz.sh
    1.11  
    1.12 @@ -39,7 +39,7 @@
    1.13  	optlist "\
    1.14  usage		$(_ 'Print this short usage.')
    1.15  writefs		$(_ 'Write the current filesystem to rootfs.gz. Supported compression: lzma, gzip, none.')
    1.16 -format		$(_ 'Format and label device with ext3, ext2 or fat32 filesystem (for LiveUSB or /home). Default is ext3.')
    1.17 +format		$(_ 'Format and label device with ext4, ext3, ext2 or fat32 filesystem (for LiveUSB or /home). Default is ext3.')
    1.18  gen-liveusb	$(_ 'Generate a bootable LiveUSB using files from the LiveCD.')
    1.19  gen-swap	$(_ 'Create or recreate and activate additional swap memory.')
    1.20  gen-iso2usb	$(_ 'Generate a bootable LiveUSB using files from ISO file.')
    1.21 @@ -111,22 +111,10 @@
    1.22  }
    1.23  
    1.24  
    1.25 -# Format target device and label partition.
    1.26 -
    1.27 -mkfs_ext3() {
    1.28 -	get_label
    1.29 -
    1.30 -	_ 'Label: %s' "$label"
    1.31 -	echo "Mkfs: mkfs.ext3 -L \"$label\" $DEVICE"
    1.32 -	newline; sleep 2
    1.33 -	mkfs.ext3 -L "$label" $DEVICE
    1.34 -}
    1.35 -
    1.36 -
    1.37  # Get fs type. Supported fs are ext3, ext2, fat32
    1.38  
    1.39  get_fs_type() {
    1.40 -	_n 'Please specify a filesystem type ext2, ext3 or fat32 (ext3): '
    1.41 +	_n 'Please specify a filesystem type ext2, ext3, ext4 or fat32 (ext3): '
    1.42  	read fs_type
    1.43  	[ -z "$fs_type" ] && fs_type='ext3'
    1.44  }
    1.45 @@ -136,7 +124,7 @@
    1.46  
    1.47  ask_for_fs_type() {
    1.48  	_ 'Please specify the filesystem type to %s.' "$COMMAND"
    1.49 -	_ 'Available formats are ext3(default), ext2 or fat32.'
    1.50 +	_ 'Available formats are ext4, ext3(default), ext2 or fat32.'
    1.51  	_ 'Press enter to keep the default value.'
    1.52  	newline
    1.53  	_n 'File system type: '; read answer
    1.54 @@ -148,15 +136,15 @@
    1.55  }
    1.56  
    1.57  
    1.58 -# Format target device in ext3, ext2 or fat32.
    1.59 -# Usage: make_fs ext2|fat32|ext3 (default)
    1.60 +# Format target device in ext4, ext3, ext2 or fat32.
    1.61 +# Usage: make_fs ext2|ext4|fat32|ext3 (default)
    1.62  
    1.63  make_fs() {
    1.64  	local answer
    1.65  
    1.66  	FS=$(echo $fs_type | tr '[A-Z]' '[a-z]')
    1.67  	case "$FS" in
    1.68 -		ext3|ext2)
    1.69 +		ext4|ext3|ext2)
    1.70  			newline; _ 'Processing...'
    1.71  			_ 'Label: %s' "$label"
    1.72  			echo "Mkfs: mkfs.$FS -L \"$label\" $DEVICE"
    1.73 @@ -318,10 +306,10 @@
    1.74  	sed -i -e "s/\(root=.*\)/\1 home=$UUID/" $(grep -l append $TARGET_ROOT/boot/$ST/*)
    1.75  
    1.76  	# Splash screen and help files.
    1.77 -	cp /media/cdrom/boot/isolinux/splash.* $TARGET_ROOT/boot/$ST
    1.78 -	cp /media/cdrom/boot/isolinux/*.cfg    $TARGET_ROOT/boot/$ST
    1.79 -	cp /media/cdrom/boot/isolinux/*.kbd    $TARGET_ROOT/boot/$ST
    1.80 -	cp /media/cdrom/boot/isolinux/*.c32    $TARGET_ROOT/boot/$ST
    1.81 +	cp /media/cdrom/boot/isolinux/splash.*	$TARGET_ROOT/boot/$ST
    1.82 +	cp /media/cdrom/boot/isolinux/*.cfg	$TARGET_ROOT/boot/$ST
    1.83 +	cp /media/cdrom/boot/isolinux/*.kbd	$TARGET_ROOT/boot/$ST
    1.84 +	cp /media/cdrom/boot/isolinux/*.c32	$TARGET_ROOT/boot/$ST
    1.85  	sed -i -e s/'SliTaz GNU\/Linux'/'SliTaz GNU\/Linux LiveUSB'/ \
    1.86  		-e "s/isolinux/$ST/" $TARGET_ROOT/boot/$ST/$ST.$STE
    1.87  }
    1.88 @@ -354,8 +342,9 @@
    1.89  		umount $TARGET_ROOT 2>/dev/null
    1.90  		_n 'Setting %s as bootable...' "$DEVICE"
    1.91  		fdisk $DISK >/dev/null << EOF
    1.92 +$(fdisk -l $DISK | grep $DISK  | sed "/\\*/!ds#$DISK##;s# .*##;s#.*#&\na#")
    1.93  a
    1.94 -1
    1.95 +${DEVICE#$DISK}
    1.96  w
    1.97  EOF
    1.98  		status
    1.99 @@ -573,7 +562,6 @@
   1.100  		get_label
   1.101  		unmount_target_usb
   1.102  		make_fs "$fs_type"
   1.103 -		# mkfs_ext3
   1.104  		separator
   1.105  		longline "$(_ 'Device %s is ready to use as LiveUSB and/or /home partition.' "$label ($DEVICE)")"
   1.106  		;;