Hi,
Many people have udev, which will make /dev/snapshot dynamically if
support is available in the kernel. And if it didn't, making it from the
Makefile wouldn't be a solution because it would disappear on the next
reboot.
This patch adds another CONFIG option to the Makefile to not make /dev/snapshot.
Index: Makefile
===================================================================
RCS file: /cvsroot/suspend/suspend/Makefile,v
retrieving revision 1.37
diff -u -u -r1.37 Makefile
--- Makefile 17 Sep 2006 18:41:23 -0000 1.37
+++ Makefile 20 Sep 2006 09:52:14 -0000
@@ -1,6 +1,7 @@
#CONFIG_COMPRESS=yes
#CONFIG_ENCRYPT=yes
#CONFIG_SPLASHY=yes
+#CONFIG_UDEV=yes
ARCH:=$(shell uname -m)
@@ -30,6 +31,12 @@
S2DISK=s2disk
CONFIGFILE=suspend.conf
+ifndef CONFIG_UDEV
+SNAPSHOT=$(DESTDIR)/dev/snapshot
+else
+SNAPSHOT=
+endif
+
ifdef CONFIG_ENCRYPT
all: $(S2DISK) $(S2BOTH) suspend-keygen resume s2ram
else
@@ -118,27 +125,23 @@
suspend-keygen: md5.o keygen.c encrypt.h md5.h
$(CC) $(CFLAGS) -DHAVE_INTTYPES_H -DHAVE_STDINT_H $(CC_FLAGS) md5.o
keygen.c -o suspend-keygen $(LD_FLAGS)
-install-s2disk: $(S2DISK) suspend-keygen conf/$(CONFIGFILE)
- if [ ! -c /dev/snapshot ]; then mknod /dev/snapshot c 10 231; fi
+install-s2disk: $(S2DISK) suspend-keygen conf/$(CONFIGFILE) $(SNAPSHOT)
install --mode=755 suspend-keygen $(DESTDIR)$(SUSPEND_DIR)
install --mode=755 $(S2DISK) $(DESTDIR)$(SUSPEND_DIR)
if [ -f $(DESTDIR)$(CONFIG_DIR)/$(CONFIGFILE) ]; then install
--mode=644 conf/$(CONFIGFILE) $(DESTDIR)$(CONFIG_DIR)/$(CONFIGFILE).new; else
install --mode=644 conf/$(CONFIGFILE) $(DESTDIR)$(CONFIG_DIR); fi
-install-suspend: $(S2DISK) $(S2BOTH) suspend-keygen conf/$(CONFIGFILE)
- if [ ! -c /dev/snapshot ]; then mknod /dev/snapshot c 10 231; fi
+install-suspend: $(S2DISK) $(S2BOTH) suspend-keygen conf/$(CONFIGFILE)
$(SNAPSHOT)
install --mode=755 suspend-keygen $(DESTDIR)$(SUSPEND_DIR)
install --mode=755 $(S2DISK) $(DESTDIR)$(SUSPEND_DIR)
install --mode=755 $(S2BOTH) $(DESTDIR)$(SUSPEND_DIR)
if [ -f $(DESTDIR)$(CONFIG_DIR)/$(CONFIGFILE) ]; then install
--mode=644 conf/$(CONFIGFILE) $(DESTDIR)$(CONFIG_DIR)/$(CONFIGFILE).new; else
install --mode=644 conf/$(CONFIGFILE) $(DESTDIR)$(CONFIG_DIR); fi
install --mode=755 s2ram $(DESTDIR)$(SUSPEND_DIR)
else
-install-s2disk: $(S2DISK) conf/$(CONFIGFILE)
- if [ ! -c /dev/snapshot ]; then mknod /dev/snapshot c 10 231; fi
+install-s2disk: $(S2DISK) conf/$(CONFIGFILE) $(SNAPSHOT)
install --mode=755 $(S2DISK) $(DESTDIR)$(SUSPEND_DIR)
if [ -f $(DESTDIR)$(CONFIG_DIR)/$(CONFIGFILE) ]; then install
--mode=644 conf/$(CONFIGFILE) $(DESTDIR)$(CONFIG_DIR)/$(CONFIGFILE).new; else
install --mode=644 conf/$(CONFIGFILE) $(DESTDIR)$(CONFIG_DIR); fi
-install-suspend: $(S2DISK) $(S2BOTH) conf/$(CONFIGFILE)
- if [ ! -c /dev/snapshot ]; then mknod /dev/snapshot c 10 231; fi
+install-suspend: $(S2DISK) $(S2BOTH) conf/$(CONFIGFILE) $(SNAPSHOT)
install --mode=755 $(S2DISK) $(DESTDIR)$(SUSPEND_DIR)
install --mode=755 $(S2BOTH) $(DESTDIR)$(SUSPEND_DIR)
if [ -f $(DESTDIR)$(CONFIG_DIR)/$(CONFIGFILE) ]; then install
--mode=644 conf/$(CONFIGFILE) $(DESTDIR)$(CONFIG_DIR)/$(CONFIGFILE).new; else
install --mode=644 conf/$(CONFIGFILE) $(DESTDIR)$(CONFIG_DIR); fi
@@ -151,3 +154,6 @@
install-resume: resume
./scripts/install-resume.sh
+$(SNAPSHOT):
+ mknod $(SNAPSHOT) c 10 231;
+
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Suspend-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/suspend-devel