Browse Source

build static library as pre-configure task

- hackish way, but I was not in the mood to hack the autotool stuff
- add patch I wanted to add last time ;)
Waldemar Brodkorb 15 years ago
parent
commit
5ea6a2557f
2 changed files with 30 additions and 0 deletions
  1. 13 0
      package/cryptsetup/Makefile
  2. 17 0
      package/cryptsetup/patches/patch-lib_setup_c

+ 13 - 0
package/cryptsetup/Makefile

@@ -24,6 +24,19 @@ CONFIGURE_ARGS+=	--disable-static
 BUILD_STYLE:=		auto
 INSTALL_STYLE:=		auto
 
+# hackish way to although build the static libraries for cryptinit
+pre-configure:
+	(cd ${WRKBUILD}; \
+		env ${CONFIGURE_ENV} \
+		./configure --enable-static \
+			--build=${GNU_HOST_NAME} \
+			--host=${GNU_TARGET_NAME} \
+			--target=${GNU_TARGET_NAME} \
+	);
+	$(MAKE) -C $(WRKBUILD) CC="$(TARGET_CC)"
+	$(MAKE) -C $(WRKBUILD) CC="$(TARGET_CC)" DESTDIR='${WRKINST}' install
+	$(MAKE) -C $(WRKBUILD) CC="$(TARGET_CC)" clean
+
 post-install:
 	${INSTALL_DIR} ${IDIR_CRYPTSETUP}/usr/sbin ${IDIR_CRYPTSETUP}/usr/lib
 	${CP} ${WRKINST}/usr/lib/libcryptsetup.so.* \

+ 17 - 0
package/cryptsetup/patches/patch-lib_setup_c

@@ -0,0 +1,17 @@
+already added in svn upstream
+--- cryptsetup-1.0.7.orig/lib/setup.c	2009-07-22 13:12:44.000000000 +0200
++++ cryptsetup-1.0.7/lib/setup.c	2009-08-22 15:10:32.000000000 +0200
+@@ -542,7 +542,12 @@ static int __crypt_luks_open(int arg, st
+ start:
+ 	mk=NULL;
+ 
+-	if(get_key(prompt, &password, &passwordLen, 0, options->key_file, options->passphrase_fd, options->timeout, options->flags))
++	if(options->passphrase) {
++		passwordLen = strlen(options->passphrase);
++		password = safe_alloc(passwordLen + 1);
++		strncpy(password, options->passphrase, passwordLen + 1);
++		tries = 0;
++	} else if(get_key(prompt, &password, &passwordLen, 0, options->key_file, options->passphrase_fd, options->timeout, options->flags))
+ 		tries--;
+ 	else
+ 		tries = 0;