slitaz-boot-scripts rev 320

system.sh: do not trust id for swap
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Oct 01 15:10:59 2012 +0200 (2012-10-01)
parents 3dd56819a891
children f637482683e2
files etc/init.d/system.sh
line diff
     1.1 --- a/etc/init.d/system.sh	Tue Sep 11 08:56:08 2012 +0200
     1.2 +++ b/etc/init.d/system.sh	Mon Oct 01 15:10:59 2012 +0200
     1.3 @@ -104,8 +104,8 @@
     1.4  fi
     1.5  
     1.6  # Activate an eventual swap file or partition
     1.7 -if [ "$(fdisk -l | grep swap)" ]; then
     1.8 -	for swd in $(fdisk -l | sed '/swap/!d;s/ .*//'); do
     1.9 +if [ "$(blkid | grep 'TYPE="swap"')" ]; then
    1.10 +	for swd in $(blkid | sed '/TYPE="swap"/!d;s/:.*//'); do
    1.11  		if ! grep -q "$swd	" /etc/fstab; then
    1.12  			echo "Swap memory detected on: $swd"
    1.13  		cat >> /etc/fstab <<EOT