[Yaird-devel] Template to support rootfs by and tuxonice swap partitions by uuid

list at mofokom.biz list at mofokom.biz
Wed Jul 23 09:55:35 UTC 2008


Hello,

I have been hacking yaird (rather poorly) to get it to support rootfs 
and tuxonice swap partitions by UUID so my kernel params look like this

kernel /boot/vmlinuz rootfs=UUID=3a2838c5-5908-41cb-a910-b0c8469b3e98 
root=/dev/ram0 rootfstype=cpio 
resume=swap:UUID=5b825071-2bed-4a35-aec7-4251439e3449 rootw
ait init=/init ydebug=yes

I tried to make a patch against the latest code - but I couldn't find 
this Templates.cfg file.  I have included my Templates.cfg file.

	TEMPLATE mount
	BEGIN
		SCRIPT "/init"
		BEGIN
			!/bin/mount -n \
			!	<TMPL_IF NAME=isRoot>$ro</TMPL_IF> \
			!	-t <TMPL_VAR NAME=fsType> \
			!	<TMPL_VAR NAME=options> \
			!	$rootfs \
			!	'<TMPL_VAR NAME=target>'
		END SCRIPT
	END TEMPLATE



	TEMPLATE resume
	BEGIN
     FILE  "/usr/bin/awk"
     FILE  "/lib/udev/vol_id"
		SCRIPT "/init"
		BEGIN
			!if [ -z "$noresume" ]
			!then
                         !  TARGET=/sys/power/resume
                         !  INIT_RESUME=/sys/power/resume
                         !  echo $resume
			!  # for suspend2 (>= 2.2-rc8)
			!  if [ -w /sys/power/tuxonice/version ]; then
                         !    TARGET=/sys/power/tuxonice/resume
                         !    INIT_RESUME=/sys/power/tuxonice/do_resume
			!  fi
			!  # for suspend2 (< 2.2-rc8)
			!  if [ -w /proc/software_suspend/do_resume ]; then
			!    INIT_RESUME=/proc/software_suspend/do_resume
			!  fi
			!  # for swsusp
			!  if [ -n "$resume" ]
			!  then
                         !    #uuid to dev translation
			!    case "$resume" in
                         !    swap:UUID=[0-9a-zA-Z-]*)
                         !      uuid=${resume#swap:UUID=}
                         !    for i in `/usr/bin/awk '{print $4}' 
/proc/partitions ` ; do
                         !      case `/lib/udev/vol_id --uuid /dev/$i 2> 
/dev/null` in
                         !     *$uuid)
                         !       SOURCE=/dev/$i
                         !     ;;
                         !     esac
                         !    done
                         !      #no error condition handleing
                         !      ;;
                         !    [0-9]*:[0-9]*)
                         !      SOURCE=$resume
                         !      ;;
                         !    *[a-z]*[0-9])
                         !      SOURCE=`cat 
/sys/block/*/${resume#/dev/}/dev`
                         !      ;;
                         !		 esac
                         !    echo $SOURCE $TARGET $INIT_RESUME
                         !    echo "$SOURCE" > $TARGET
                         !    echo "$SOURCE" > $INIT_RESUME
                         !  else
                         !    echo <TMPL_VAR NAME=devno> > /sys/power/resume
                         !  fi
                         !fi
		END SCRIPT
	END TEMPLATE




More information about the Yaird-devel mailing list