Use the swap partition.
authorWilliam Douglas <william.douglas@intel.com>
Fri, 31 May 2013 19:43:34 +0000 (12:43 -0700)
committerWilliam Douglas <william.douglas@intel.com>
Thu, 13 Jun 2013 19:17:43 +0000 (12:17 -0700)
While we were creating a partition to be used for swap, it was not
actually getting formatted or mounted.

Also since we are using swap for hibernate make sure to add resume
from the swap partition to the syslinux config file.

Signed-off-by: William Douglas <william.douglas@intel.com>
scripts/install.sh

index c060121..69ac67e 100644 (file)
@@ -43,7 +43,7 @@ sfdisk -uM $TARGET_DEV << EOF
 EOF
 sync
 
-
+/sbin/mkswap ${TARGET_DEV}1
 /usr/sbin/mkfs.btrfs -L ROOTFS ${TARGET_DEV}2
 
 squash_img=/run/initramfs/live/LiveOS/squashfs.img
@@ -69,6 +69,21 @@ echo $SFILES
 
 rsync --progress -WaAHXSzh $SRCOSMNT/ $TGTMNT
 
+rm ${TGTMNT}/etc/fstab
+SYSTEMD_ESCAPED_DEV=$(echo ${TARGET_DEV} | sed 's|^/||' | sed 's|/|-|g')
+mkdir -p ${TGTMNT}/usr/lib/systemd/system/swap.target.wants
+cat > ${TGTMNT}/usr/lib/systemd/system/${SYSTEMD_ESCAPED_DEV}1.swap << EOF
+[Unit]
+Description=Swap Filesystem
+Documentation=man:systemd.swap(5)
+Documentation=http://www.freedesktop.org/wiki/Software/systemd/systemd.swap.html
+
+[Swap]
+What=${TARGET_DEV}1
+EOF
+
+ln -s ../${SYSTEMD_ESCAPED_DEV}1.swap ${TGTMNT}/usr/lib/systemd/system/swap.target.wants/${SYSTEMD_ESCAPED_DEV}1.swap
+
 mkdir -p ${TGTMNT}/boot/extlinux
 cat > ${TGTMNT}/boot/extlinux/extlinux.conf << EOF
 default vesamenu.c32
@@ -91,7 +106,7 @@ menu clear
 label tizen
   menu label Boot Tizen
   kernel ../vmlinuz
-  append root=${TARGET_DEV}2 ro vga=current  splash quiet rootflags=subvol=tizen
+  append root=${TARGET_DEV}2 rw vga=current splash quiet rootflags=subvol=tizen resume=${TARGET_DEV}1
 menu default
 EOF