Commit b0bc7ad6 authored by Mike Hibler's avatar Mike Hibler

Get imagezip/frisbee/zapdisk building under Linux MFS build env.

Required updates to Makefile-linux.sa makefiles which are used
in Ryan's build environment.
parent 9f7847fc
#
# Copyright (c) 2000-2014 University of Utah and the Flux Group.
# Copyright (c) 2000-2015 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -21,6 +21,12 @@
# }}}
#
#
# At least support MBR partitioning
#
WITH_MBR = 1
WITH_GPT = 1
# Set to 1 for "secure frisbee" support. Requires openssl libraries.
WITH_CRYPTO = 1
WITH_SIGNING = 1
......@@ -81,6 +87,14 @@ ifeq ($(WITH_CRYPTO),1)
IUZFLAGS += -DWITH_CRYPTO -DSIGN_CHECKSUM
IUZLIBS += -lcrypto
endif
ifeq ($(WITH_MBR),1)
IUZFLAGS += -DWITH_MBR -Imbr
CLIENTOBJS += $(IMAGEZIPDIR)/mbr/mbr.o
endif
ifeq ($(WITH_GPT),1)
IUZFLAGS += -DWITH_GPT -Igpt -Dcrc32=gpt_crc32 -DIMAGEZIP
CLIENTOBJS += $(IMAGEZIPDIR)/gpt/gpt.o $(IMAGEZIPDIR)/gpt/crc32.o $(IMAGEZIPDIR)/gpt/gpt_glue.o
endif
CFLAGS = -O2 -g -Wall -fno-builtin-log \
$(PTHREADCFLAGS) $(LINUXOPTS) -DSTATS -DMASTER_SERVER
......
#
# Copyright (c) 2000-2014 University of Utah and the Flux Group.
# Copyright (c) 2000-2015 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -27,6 +27,12 @@
#
BINDIR= /usr/local/bin
#
# At least support MBR partitioning
#
WITH_MBR = 1
WITH_GPT = 1
# Set to 1 for "secure frisbee" support. Requires openssl libraries.
WITH_CRYPTO = 1
WITH_SIGNING = 1
......@@ -86,6 +92,18 @@ ifeq ($(WITH_V3COMPAT),1)
CFLAGS += -DWITH_V3COMPAT
endif
# MBR
ifeq ($(WITH_MBR),1)
PTOBJS += mbr/mbr.o
CFLAGS += -DWITH_MBR -Imbr
endif
# GPT
ifeq ($(WITH_GPT),1)
PTOBJS += gpt/gpt.o gpt/crc32.o gpt/gpt_glue.o
CFLAGS += -DWITH_GPT -Igpt -Dcrc32=gpt_crc32 -DIMAGEZIP
endif
ifeq ($(WITH_EXTFS),1)
FSOBJS += extfs/extfs.o extfs/reloc_lilo.o
CFLAGS += -DWITH_EXTFS -Iextfs
......@@ -116,10 +134,10 @@ endif
all: imagezip imageunzip imagedump
imagezip: imagezip.o checksum.o version.o $(FSOBJS) $(FSLIBS)
imagezip: imagezip.o sliceinfo.o disksize.o checksum.o version.o $(PTOBJS) $(FSOBJS) $(FSLIBS)
$(CC) $(CFLAGS) $^ $(LIBS) -o imagezip
imageunzip: imageunzip.o checksum.o crc.o version.o disksize.o
imageunzip: imageunzip.o disksize.o checksum.o crc.o version.o $(PTOBJS)
$(CC) $(CFLAGS) $^ $(UNZIPLIBS) -o imageunzip
imageunzip.o: imageunzip.c
......
......@@ -35,6 +35,20 @@
#define drvwrite gpt_drvwrite
#define drvsize gpt_drvsize
#ifdef __linux__
#include <string.h>
#define bcopy(s,d,n) memcpy((d),(s),(n))
#define bzero(m,n) memset((m),0,(n))
#define bcmp(a,b,n) memcmp((a),(b),(n))
#ifndef htole16
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define htole16(x) (x)
#else
#define htole16(x) __bswap_16(x)
#endif
#endif
#endif
/* we want to intercept these */
#define printf gpt_printf
int gpt_printf(const char * __restrict fmt, ...);
......
#
# Copyright (c) 2000-2015 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
# This file is part of the Emulab network testbed software.
#
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
#
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
# License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this file. If not, see <http://www.gnu.org/licenses/>.
#
# }}}
#
#
# At least support MBR partitioning
#
WITH_MBR = 1
WITH_GPT = 1
#
# Makefile for the standalone version of zpadisk.
# (Standalone meaning not part of the Netbed build environment.)
#
SBINDIR=/usr/local/sbin
BINDIR= /usr/local/bin
IMAGEZIPDIR = ../imagezip
# get 64-bit off_t and pread/pwrite protos
LINUXOPTS = -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE \
-D_XOPEN_SOURCE=500 -D_BSD_SOURCE=1
#
# STATIC = yes|no|fail
#
# NOTE: with some newer Linux distros (at least Ubuntu14) we cannot build
# static with libcrypto as that library references the dynamic linker.
# So either choose not to set STATIC for dynamic binaries, or set
# STATIC=fail, in which case the crypto-requiring features are disabled.
#
STATIC = yes
ifeq ($(STATIC),yes)
LINUXOPTS += -static
LDFLAGS += -static
endif
ifeq ($(STATIC),fail)
LINUXOPTS += -static
LDFLAGS += -static
WITH_CRYPTO = 0
WITH_SIGNING = 0
endif
CLIENTFLAGS = $(CFLAGS)
CLIENTLIBS =
CLIENTOBJS = disksize.o zapdisk.o
ifeq ($(WITH_MBR),1)
CFLAGS += -DWITH_MBR -Imbr
CLIENTOBJS += $(IMAGEZIPDIR)/mbr/mbr.o
endif
ifeq ($(WITH_GPT),1)
CFLAGS += -DWITH_GPT -Igpt -Dcrc32=gpt_crc32 -DIMAGEZIP
CLIENTOBJS += $(IMAGEZIPDIR)/gpt/gpt.o $(IMAGEZIPDIR)/gpt/crc32.o $(IMAGEZIPDIR)/gpt/gpt_glue.o
endif
CFLAGS = -O2 -g -Wall -fno-builtin-log $(LINUXOPTS) -I$(IMAGEZIPDIR)
all: zapdisk
zapdisk: $(CLIENTOBJS)
$(CC) $(CFLAGS) $(CLIENTOBJS) -o zapdisk
cp zapdisk zapdisk.debug
strip zapdisk
disksize.o: $(IMAGEZIPDIR)/disksize.c
$(CC) -c $(CFLAGS) -I$(IMAGEZIPDIR) -o disksize.o $<
install:
$(INSTALL) zapdisk $(DESTDIR)$(BINDIR)/zapdisk
clean:
rm -f *.o *.a zapdisk
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment