Skip to content

Commit

Permalink
Use /sbin/gpg from system, don't compile it
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabio Erculiani committed May 5, 2013
1 parent 546d990 commit 5750b8a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 61 deletions.
5 changes: 0 additions & 5 deletions defaults/software.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,3 @@ ISCSI_VER="${ISCSI_VER:-VERSION_ISCSI}"
ISCSI_DIR="${ISCSI_DIR:-open-iscsi-${ISCSI_VER}}"
ISCSI_SRCTAR="${ISCSI_SRCTAR:-${DISTDIR}/open-iscsi-${ISCSI_VER}.tar.gz}"
ISCSI_BINCACHE="${ISCSI_BINCACHE:-%%CACHE%%/iscsi-${ISCSI_VER}-%%ARCH%%.bz2}"

GPG_VER="${GPG_VER:-VERSION_GPG}"
GPG_DIR="${GPG_DIR:-gnupg-${GPG_VER}}"
GPG_SRCTAR="${GPG_SRCTAR:-${DISTDIR}/gnupg-${GPG_VER}.tar.bz2}"
GPG_BINCACHE="${GPG_BINCACHE:-%%CACHE%%/gnupg-${GPG_VER}-%%ARCH%%.bz2}"
45 changes: 0 additions & 45 deletions gen_compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -452,48 +452,3 @@ compile_iscsi() {
rm -rf "${ISCSI_DIR}" > /dev/null
fi
}

compile_gpg() {
if [ -f "${GPG_BINCACHE}" ]
then
print_info 1 "gnupg: >> Using cache"
else
[ ! -f "${GPG_SRCTAR}" ] &&
gen_die "Could not find gnupg source tarball: ${GPG_SRCTAR}. Please place it there, or place another version, changing /etc/genkernel.conf as necessary!"
cd "${TEMP}"
rm -rf "${GPG_DIR}"
tar -jxf "${GPG_SRCTAR}"
[ ! -d "${GPG_DIR}" ] &&
gen_die "gnupg directory ${GPG_DIR} invalid"
cd "${GPG_DIR}"
apply_patches gnupg ${GPG_VER}
print_info 1 'gnupg: >> Configuring...'
# --enable-minimal works, but it doesn't reduce the command length much.
# Given its history and the precision this needs, explicit is cleaner.
LDFLAGS='-static' CFLAGS='-Os' ./configure --prefix=/ \
--enable-static-rnd=linux --disable-dev-random --disable-asm \
--disable-selinux-support --disable-gnupg-iconv --disable-card-support \
--disable-agent-support --disable-bzip2 --disable-exec \
--disable-photo-viewers --disable-keyserver-helpers --disable-ldap \
--disable-hkp --disable-finger --disable-generic --disable-mailto \
--disable-keyserver-path --disable-dns-srv --disable-dns-pka \
--disable-dns-cert --disable-nls --disable-threads --disable-regex \
--disable-optimization --with-included-zlib --without-capabilities \
--without-tar --without-ldap --without-libcurl --without-mailprog \
--without-libpth-prefix --without-libiconv-prefix --without-libintl-prefix\
--without-zlib --without-bzip2 --without-libusb --without-readline \
>> ${LOGFILE} 2>&1 || gen_die 'Configuring gnupg failed!'
print_info 1 'gnupg: >> Compiling...'
compile_generic "" "utils"
print_info 1 'gnupg: >> Copying to cache...'
[ -f "${TEMP}/${GPG_DIR}/g10/gpg" ] ||
gen_die 'gnupg executable does not exist!'
strip "${TEMP}/${GPG_DIR}/g10/gpg" ||
gen_die 'Could not strip gpg binary!'
bzip2 -z -c "${TEMP}/${GPG_DIR}/g10/gpg" > "${GPG_BINCACHE}" ||
gen_die 'Could not copy the gpg binary to the package directory, does the directory exist?'

cd "${TEMP}"
rm -rf "${GPG_DIR}" > /dev/null
fi
}
2 changes: 0 additions & 2 deletions gen_determineargs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,12 @@ determine_real_args() {
BUSYBOX_BINCACHE=`cache_replace "${BUSYBOX_BINCACHE}"`
ISCSI_BINCACHE=`cache_replace "${ISCSI_BINCACHE}"`
BLKID_BINCACHE=`cache_replace "${BLKID_BINCACHE}"`
GPG_BINCACHE=`cache_replace "${GPG_BINCACHE}"`

DEFAULT_KERNEL_CONFIG=`arch_replace "${DEFAULT_KERNEL_CONFIG}"`
BUSYBOX_CONFIG=`arch_replace "${BUSYBOX_CONFIG}"`
BUSYBOX_BINCACHE=`arch_replace "${BUSYBOX_BINCACHE}"`
ISCSI_BINCACHE=`arch_replace "${ISCSI_BINCACHE}"`
BLKID_BINCACHE=`arch_replace "${BLKID_BINCACHE}"`
GPG_BINCACHE=`arch_replace "${GPG_BINCACHE}"`

if [ -n "${CMD_BOOTLOADER}" ]
then
Expand Down
16 changes: 7 additions & 9 deletions gen_initramfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -456,18 +456,16 @@ append_gpg() {
then
rm -r "${TEMP}/initramfs-gpg-temp"
fi
cd ${TEMP}
mkdir -p "${TEMP}/initramfs-gpg-temp/sbin/"
if [ ! -e ${GPG_BINCACHE} ] ; then
print_info 1 ' GPG: Adding support (compiling binaries)...'
compile_gpg
fi
bzip2 -dc "${GPG_BINCACHE}" > "${TEMP}/initramfs-gpg-temp/sbin/gpg" ||
gen_die 'Could not extract gpg binary cache!'
chmod a+x "${TEMP}/initramfs-gpg-temp/sbin/gpg"

print_info 1 "Including GPG support"
copy_binaries /sbin/gpg

cd "${TEMP}/initramfs-gpg-temp/"
log_future_cpio_content
find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}"
find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \
|| gen_die "compressing gpg cpio"
cd "${TEMP}"
rm -rf "${TEMP}/initramfs-gpg-temp" > /dev/null
}

Expand Down

0 comments on commit 5750b8a

Please sign in to comment.