Imported reiserfsprogs-3.6.20

This commit is contained in:
Jeff Mahoney committed 2012-10-11 11:32:09 -04:00
1 parent 0ed773997f
commit dac518d099
189 files changed
+43353 -29787

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
sbin_PROGRAMS = mkfs.reiserfs
man_MANS = mkfs.reiserfs.8
EXTRA_DIST = mkfs.reiserfs.8
mkfs_reiserfs_SOURCES = mkreiserfs.c
mkfs_reiserfs_LDADD = $(top_builddir)/libreiserfs/libreiserfs-static.a \
$(top_builddir)/libutil/libutil-static.a \
$(top_builddir)/libmisc/libmisc-static.a
mkfs_reiserfs_LDFLAGS = @PROGS_LDFLAGS@
mkfs_reiserfs_CFLAGS = @CFLAGS@
INCLUDES = -I$(top_srcdir)/include
uninstall-mkreiserfs:
if test -f $(DESTDIR)$(sbindir)/mkreiserfs; then \
rm -f $(DESTDIR)$(sbindir)/mkreiserfs; \
fi;
install-mkreiserfs:
if test -f $(DESTDIR)$(sbindir)/mkfs.reiserfs; then \
rm -f $(DESTDIR)$(sbindir)/mkreiserfs; \
ln $(DESTDIR)$(sbindir)/mkfs.reiserfs $(DESTDIR)$(sbindir)/mkreiserfs; \
fi;
install-data-local: install-mkreiserfs
uninstall-local: uninstall-mkreiserfs
+501
View File
@@ -0,0 +1,501 @@
# Makefile.in generated by automake 1.9.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
SOURCES = $(mkfs_reiserfs_SOURCES)
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
sbin_PROGRAMS = mkfs.reiserfs$(EXEEXT)
subdir = utils/mkfs
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man8dir)"
sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(sbin_PROGRAMS)
am_mkfs_reiserfs_OBJECTS = mkfs_reiserfs-mkreiserfs.$(OBJEXT)
mkfs_reiserfs_OBJECTS = $(am_mkfs_reiserfs_OBJECTS)
mkfs_reiserfs_DEPENDENCIES = \
$(top_builddir)/libreiserfs/libreiserfs-static.a \
$(top_builddir)/libutil/libutil-static.a \
$(top_builddir)/libmisc/libmisc-static.a
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(mkfs_reiserfs_SOURCES)
DIST_SOURCES = $(mkfs_reiserfs_SOURCES)
man8dir = $(mandir)/man8
NROFF = nroff
MANS = $(man_MANS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PROGS_LDFLAGS = @PROGS_LDFLAGS@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
UUID_LIBS = @UUID_LIBS@
VERSION = @VERSION@
ac_ct_CC = @ac_ct_CC@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
man_MANS = mkfs.reiserfs.8
EXTRA_DIST = mkfs.reiserfs.8
mkfs_reiserfs_SOURCES = mkreiserfs.c
mkfs_reiserfs_LDADD = $(top_builddir)/libreiserfs/libreiserfs-static.a \
$(top_builddir)/libutil/libutil-static.a \
$(top_builddir)/libmisc/libmisc-static.a
mkfs_reiserfs_LDFLAGS = @PROGS_LDFLAGS@
mkfs_reiserfs_CFLAGS = @CFLAGS@
INCLUDES = -I$(top_srcdir)/include
all: all-am
.SUFFIXES:
.SUFFIXES: .c .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu utils/mkfs/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu utils/mkfs/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
install-sbinPROGRAMS: $(sbin_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)"
@list='$(sbin_PROGRAMS)'; for p in $$list; do \
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
if test -f $$p \
; then \
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
echo " $(INSTALL_PROGRAM_ENV) $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \
$(INSTALL_PROGRAM_ENV) $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \
else :; fi; \
done
uninstall-sbinPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(sbin_PROGRAMS)'; for p in $$list; do \
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \
rm -f "$(DESTDIR)$(sbindir)/$$f"; \
done
clean-sbinPROGRAMS:
-test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS)
mkfs.reiserfs$(EXEEXT): $(mkfs_reiserfs_OBJECTS) $(mkfs_reiserfs_DEPENDENCIES)
@rm -f mkfs.reiserfs$(EXEEXT)
$(LINK) $(mkfs_reiserfs_LDFLAGS) $(mkfs_reiserfs_OBJECTS) $(mkfs_reiserfs_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkfs_reiserfs-mkreiserfs.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
mkfs_reiserfs-mkreiserfs.o: mkreiserfs.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mkfs_reiserfs_CFLAGS) $(CFLAGS) -MT mkfs_reiserfs-mkreiserfs.o -MD -MP -MF "$(DEPDIR)/mkfs_reiserfs-mkreiserfs.Tpo" -c -o mkfs_reiserfs-mkreiserfs.o `test -f 'mkreiserfs.c' || echo '$(srcdir)/'`mkreiserfs.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/mkfs_reiserfs-mkreiserfs.Tpo" "$(DEPDIR)/mkfs_reiserfs-mkreiserfs.Po"; else rm -f "$(DEPDIR)/mkfs_reiserfs-mkreiserfs.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mkreiserfs.c' object='mkfs_reiserfs-mkreiserfs.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mkfs_reiserfs_CFLAGS) $(CFLAGS) -c -o mkfs_reiserfs-mkreiserfs.o `test -f 'mkreiserfs.c' || echo '$(srcdir)/'`mkreiserfs.c
mkfs_reiserfs-mkreiserfs.obj: mkreiserfs.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mkfs_reiserfs_CFLAGS) $(CFLAGS) -MT mkfs_reiserfs-mkreiserfs.obj -MD -MP -MF "$(DEPDIR)/mkfs_reiserfs-mkreiserfs.Tpo" -c -o mkfs_reiserfs-mkreiserfs.obj `if test -f 'mkreiserfs.c'; then $(CYGPATH_W) 'mkreiserfs.c'; else $(CYGPATH_W) '$(srcdir)/mkreiserfs.c'; fi`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/mkfs_reiserfs-mkreiserfs.Tpo" "$(DEPDIR)/mkfs_reiserfs-mkreiserfs.Po"; else rm -f "$(DEPDIR)/mkfs_reiserfs-mkreiserfs.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mkreiserfs.c' object='mkfs_reiserfs-mkreiserfs.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mkfs_reiserfs_CFLAGS) $(CFLAGS) -c -o mkfs_reiserfs-mkreiserfs.obj `if test -f 'mkreiserfs.c'; then $(CYGPATH_W) 'mkreiserfs.c'; else $(CYGPATH_W) '$(srcdir)/mkreiserfs.c'; fi`
uninstall-info-am:
install-man8: $(man8_MANS) $(man_MANS)
@$(NORMAL_INSTALL)
test -z "$(man8dir)" || $(mkdir_p) "$(DESTDIR)$(man8dir)"
@list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
case "$$i" in \
*.8*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
else file=$$i; fi; \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
case "$$ext" in \
8*) ;; \
*) ext='8' ;; \
esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst"; \
done
uninstall-man8:
@$(NORMAL_UNINSTALL)
@list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
case "$$i" in \
*.8*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
case "$$ext" in \
8*) ;; \
*) ext='8' ;; \
esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " rm -f '$(DESTDIR)$(man8dir)/$$inst'"; \
rm -f "$(DESTDIR)$(man8dir)/$$inst"; \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS) $(MANS)
installdirs:
for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man8dir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-sbinPROGRAMS mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am: install-data-local install-man
install-exec-am: install-sbinPROGRAMS
install-info: install-info-am
install-man: install-man8
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am uninstall-local uninstall-man \
uninstall-sbinPROGRAMS
uninstall-man: uninstall-man8
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-sbinPROGRAMS ctags distclean distclean-compile \
distclean-generic distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-data-local install-exec \
install-exec-am install-info install-info-am install-man \
install-man8 install-sbinPROGRAMS install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
uninstall-am uninstall-info-am uninstall-local uninstall-man \
uninstall-man8 uninstall-sbinPROGRAMS
uninstall-mkreiserfs:
if test -f $(DESTDIR)$(sbindir)/mkreiserfs; then \
rm -f $(DESTDIR)$(sbindir)/mkreiserfs; \
fi;
install-mkreiserfs:
if test -f $(DESTDIR)$(sbindir)/mkfs.reiserfs; then \
rm -f $(DESTDIR)$(sbindir)/mkreiserfs; \
ln $(DESTDIR)$(sbindir)/mkfs.reiserfs $(DESTDIR)$(sbindir)/mkreiserfs; \
fi;
install-data-local: install-mkreiserfs
uninstall-local: uninstall-mkreiserfs
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
+115
View File
@@ -0,0 +1,115 @@
.\" -*- nroff -*-
.\" Copyright 1996-2004 Hans Reiser.
.\"
.TH mkfs.reiserfs 8 "February 2004" "Reiserfsprogs-3.6.19"
.SH NAME
mkfs.reiserfs \- The create tool for the Linux ReiserFS filesystem.
.SH SYNOPSIS
.B mkfs.reiserfs
[ \fB-dfV\fR ]
[ \fB-b\fR | \fB--block-size \fIN\fR ]
[ \fB-h\fR | \fB--hash \fIHASH\fR ]
[ \fB-u\fR | \fB--uuid \fIUUID\fR ]
[ \fB-l\fR | \fB--label \fILABEL\fR ]
[ \fB--format \fIFORMAT\fR ]
[ \fB-q\fR | \fB--quiet\fR ]
[ \fB-j\fR | \fB--journal-device \fIFILE\fR ]
[ \fB-s\fR | \fB--journal-size \fIN\fR ]
[ \fB-o\fR | \fB--journal-offset \fIN\fR ]
[ \fB-t\fR | \fB--transaction-max-size\fR \fIN\fR ]
[ \fB-B\fR | \fB--badblocks\fR \fIfile\fR ] \fI device\fR
[ \fIfilesystem-size\fR ]
.SH DESCRIPTION
\fBmkfs.reiserfs\fR creates a Linux ReiserFS filesystem on a device (usually a disk
partition).
.TP
.I device
is the special file corresponding to a device or to a partition (e.g
/dev/hdXX for an IDE disk partition or /dev/sdXX for a SCSI disk partition).
.TP
.I filesystem-size
is the size in blocks of the filesystem. If omitted, \fBmkfs.reiserfs\fR will
automatically set it.
.SH OPTIONS
.TP
\fB-b\fR | \fB--block-size \fIN\fR
\fIN\fR is block size in bytes. It may only be set to a power of 2 within the
512-8192 interval.
.TP
\fB-h\fR | \fB--hash \fIHASH\fR
\fIHASH\fR specifies which hash function will sort the names in the directories.
Choose from r5, rupasov, or tea. r5 is the default one.
.TP
\fB--format \fIFORMAT\fR
\fIFORMAT\fR specifies the format for the new filsystem. Choose format 3.5 or
3.6. If none is specified \fBmkfs.reiserfs\fR will create format 3.6 if running
kernel is 2.4 or higher, and format 3.5 if kernel 2.2 is running, and will
refuse creation under all other kernels.
.TP
\fB-u\fR | \fB--uuid \fIUUID\fR
Sets the Universally Unique IDentifier of the filesystem to \fIUUID\fR
(see also \fBuuidgen(8)\fR). The format of the \fIUUID\fR is a series
of hex digits separated by hypthens, e.g.: "c1b9d5a2-f162-11cf-9ece-0020afc76f16".
If the option is skipped, \fBmkfs.reiserfs\fR will by default generate a new
\fIUUID\fR.
.TP
\fB-l\fR | \fB--label \fILABEL\fR
Sets the volume label of the filesystem. \fILABEL\fR can at most be 16
characters long; if it is longer than 16 characters, \fBmkfs.reiserfs\fR will
truncate it.
.TP
\fB-q\fR | \fB--quiet \fR
Sets \fBmkfs.reiserfs\fR to work quietly without producing messages, progress or
questions. It is useful, but only for use by end users, if you run \fBmkfs.reiserfs\fR
in a script.
.TP
\fB-j\fR | \fB--journal-device \fIFILE\fR
\fIFILE\fR is the name of the block device on which is to be places the
filesystem journal.
.TP
\fB-o\fR | \fB--journal-offset \fIN\fR
\fIN\fR is the offset where the journal starts when it is to be on a separate
device. Default is 0. \fIN\fR has no effect when the journal is to be on the
host device.
.TP
\fB-s\fR | \fB--journal-size \fIN
\fIN\fR is the size of the journal in blocks. When the journal is to be on a
separate device, its size defaults to the number of blocks that the device has.
When journal is to be on the host device, its size defaults to 8193 and the
maximal possible size is 32749 (for blocksize 4k). The minimum size is 513 blocks
(whether the journal is on the host or on a separate device).
.TP
\fB-t\fR | \fB--transaction-max-size \fIN
\fIN\fR is the maximum transaction size parameter for the journal. The
default, and max possible, value is 1024 blocks. It should be less
than half the size of the journal. If specified incorrectly, it will automatically
be adjusted.
.TP
\fB-B\fR | \fB--badblocks \fIfile
\fIFile\fR is the file name of the file that contains the list of blocks to be
marked as bad on the filesystem. This list can be created by
\fB/sbin/badblocks -b block-size device\fR.
.TP
\fB-f\fR
Forces \fBmkfs.reiserfs\fR to continue even when the device is the whole disk,
looks mounted, or is not a block device. If \fB-f\fR is specified more than
once, it allows the user to avoid asking for confirmation.
.TP
\fB-d\fR
Sets \fBmkfs.reiserfs\fR to print debugging information during \fBmkfs.reiserfs\fR.
.TP
\fB-V\fR
Prints the version and then exits.
.SH AUTHOR
This version of
.B mkfs.reiserfs
has been written by Edward Shishkin <edward@namesys.com>.
.SH BUGS
Please report bugs to the ReiserFS developers <reiserfs-dev@namesys.com>, providing
as much information as possible--your hardware, kernel, patches, settings, all printed
messages; check the syslog file for any related information.
.SH SEE ALSO
.BR fsck.reiserfs (8),
.BR debugfs.reiserfs (8),
.BR tunefs.reiserfs (8)
+810
View File
@@ -0,0 +1,810 @@
/*
* Copyright 1996-2004 by Hans Reiser, licensing governed by
* reiserfsprogs/README
*/
/* mkreiserfs is very simple. It skips first 64k of device, and then
writes the super block, the needed amount of bitmap blocks (this
amount is calculated based on file system size), and root block.
Bitmap policy is primitive: it assumes, that device does not have
unreadable blocks, and it occupies first blocks for super, bitmap
and root blocks. bitmap blocks are interleaved across the disk,
mainly to make resizing faster. */
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "reiserfs/libreiserfs.h"
#include "misc/device.h"
#include "util/device.h"
#include "util/misc.h"
#include "util/credits.h"
#include "util/print.h"
#include "util/badblock.h"
#include <getopt.h>
#include <stdarg.h>
#include <sys/stat.h>
#include <time.h>
#include <unistd.h>
#include <errno.h>
#ifdef HAVE_UNAME
# include <sys/utsname.h>
#endif
#if defined(HAVE_LIBUUID) && defined(HAVE_UUID_UUID_H)
# include <uuid/uuid.h>
#endif
char *program_name;
static void message( const char * fmt, ... )
__attribute__ ((format (printf, 1, 2)));
static void message( const char * fmt, ... ) {
char buf[4096];
va_list args;
buf[0] = '\0';
va_start( args, fmt );
vsprintf( buf, fmt, args );
va_end( args );
if( buf[0] != '\0') {
fprintf( stderr, "%s: %s\n", program_name, buf );
}
}
static void print_usage_and_exit(void)
{
fprintf(stderr, "Usage: %s [options] "
" device [block-count]\n"
"\n"
"Options:\n\n"
" -b | --block-size N size of file-system block, in bytes\n"
" -j | --journal-device FILE path to separate device to hold journal\n"
" -s | --journal-size N size of the journal in blocks\n"
" -o | --journal-offset N offset of the journal from the start of\n"
" the separate device, in blocks\n"
" -t | --transaction-max-size N maximal size of transaction, in blocks\n"
" -B | --badblocks file store all bad blocks given in file on the fs\n"
" -h | --hash rupasov|tea|r5 hash function to use by default\n"
" -u | --uuid UUID store UUID in the superblock\n"
" -l | --label LABEL store LABEL in the superblock\n"
" --format 3.5|3.6 old 3.5 format or newer 3.6\n"
" -f | --force specified once, make mkreiserfs the whole\n"
" disk, not block device or mounted partition;\n"
" specified twice, do not ask for confirmation\n"
" -q | --quiet quiet work without messages, progress and\n"
" questions. Useful if run in a script. For use\n"
" by end users only.\n"
" -d | --debug print debugging information during mkreiser\n"
" -V print version and exit\n",
program_name);
exit (1);
}
int Create_default_journal = 1;
int Block_size = 4096;
/* size of journal + 1 block for journal header */
unsigned long Journal_size = 0;
int Max_trans_size = 0; //JOURNAL_TRANS_MAX;
int Hash = DEFAULT_HASH;
int Offset = 0;
char * Format;
char UUID[16];
char * LABEL = NULL;
char * badblocks_file;
enum mkfs_mode {
DEBUG_MODE = 1 << 0,
QUIET_MODE = 1 << 1,
DO_NOTHING = 1 << 2
};
int mode;
/* form super block (old one) */
static void make_super_block (reiserfs_filsys_t * fs)
{
reiserfs_sb_set_umount (fs->fs_ondisk_sb, FS_CLEANLY_UMOUNTED);
reiserfs_sb_set_height (fs->fs_ondisk_sb, 2);
reiserfs_sb_set_hash (fs->fs_ondisk_sb, Hash);
if (fs->fs_format == REISERFS_FORMAT_3_6) {
#if defined(HAVE_LIBUUID) && defined(HAVE_UUID_UUID_H)
if (uuid_is_null(UUID))
uuid_generate(UUID);
memcpy (fs->fs_ondisk_sb->s_uuid, UUID, 16);
#endif
if (LABEL != NULL) {
if (strlen (LABEL) > 16)
reiserfs_warning (stderr, "\nSpecified LABEL is longer then 16 "
"characters, will be truncated\n\n");
strncpy ((char *)fs->fs_ondisk_sb->s_label, LABEL, 16);
}
reiserfs_sb_mkflag (fs->fs_ondisk_sb, reiserfs_attrs_cleared);
}
if (!reiserfs_super_jr_magic (fs->fs_ondisk_sb) ||
strcmp (fs->fs_file_name, fs->fs_j_file_name))
/* either standard journal (and we leave all new fields to be 0) or
journal is created on separate device so there is no space on data
device which can be used as a journal */
reiserfs_sb_set_reserved (fs->fs_ondisk_sb, 0);
else
reiserfs_sb_set_reserved (fs->fs_ondisk_sb,
reiserfs_jp_get_size (reiserfs_sb_jp (fs->fs_ondisk_sb)) + 1);
if (fs->fs_badblocks_bm)
reiserfs_sb_set_free(fs->fs_ondisk_sb, reiserfs_sb_get_free(fs->fs_ondisk_sb) -
fs->fs_badblocks_bm->bm_set_bits);
}
/* wipe out first 64 k of a device and both possible reiserfs super block */
static void invalidate_other_formats (int dev)
{
reiserfs_bh_t * bh;
bh = reiserfs_buffer_read (dev, 0, 64 * 1024);
if (!bh) {
reiserfs_exit(1, "Unable to read first blocks of the device");
}
#if defined(__sparc__) || defined(__sparc_v9__)
memset (bh->b_data + 1024, 0, bh->b_size - 1024);
#else
memset (bh->b_data, 0, bh->b_size);
#endif
reiserfs_buffer_mkuptodate (bh, 1);
reiserfs_buffer_mkdirty (bh);
reiserfs_buffer_write (bh);
reiserfs_buffer_close (bh);
}
void zero_journal (reiserfs_filsys_t * fs)
{
unsigned long start, len, done;
reiserfs_bh_t * bh;
unsigned int i;
fprintf (stdout, "Initializing journal - ");
start = reiserfs_jp_get_start (reiserfs_sb_jp (fs->fs_ondisk_sb));
len = reiserfs_jp_get_size (reiserfs_sb_jp (fs->fs_ondisk_sb));
done = 0;
for (i = 0; i < len; i ++) {
util_misc_progress (stdout, &done, len, 1, 2);
bh = reiserfs_buffer_open (fs->fs_journal_dev, start + i, fs->fs_blocksize);
if (!bh) {
reiserfs_exit(1, "zero_journal: reiserfs_buffer_open failed");
}
memset (bh->b_data, 0, bh->b_size);
reiserfs_buffer_mkdirty (bh);
reiserfs_buffer_mkuptodate (bh, 1);
reiserfs_buffer_write (bh);
reiserfs_buffer_close (bh);
}
fprintf (stdout, "\n");
fflush (stdout);
}
/* this only sets few first bits in bitmap block. Fills not initialized fields
of super block (root block and bitmap block numbers) */
static void make_bitmap (reiserfs_filsys_t * fs) {
reiserfs_sb_t * sb;
unsigned int i;
unsigned long block;
unsigned long count, bmap_nr;
int marked;
sb = fs->fs_ondisk_sb;
count = reiserfs_sb_get_blocks (sb);
marked = 0;
/* mark skipped area and super block */
for (i = 0; i <= fs->fs_super_bh->b_blocknr; i ++) {
reiserfs_bitmap_set_bit (fs->fs_bitmap2, i);
marked ++;
}
if (fs->fs_badblocks_bm) {
for (i = 0; i < count; i ++) {
if (reiserfs_bitmap_test_bit (fs->fs_badblocks_bm, i)) {
reiserfs_bitmap_set_bit (fs->fs_bitmap2, i);
marked ++;
}
}
}
/* mark bitmaps as used */
block = fs->fs_super_bh->b_blocknr + 1;
bmap_nr = reiserfs_bmap_nr(count, fs->fs_blocksize);
for (i = 0; i < bmap_nr; i ++) {
reiserfs_bitmap_set_bit (fs->fs_bitmap2, block);
marked ++;
if (reiserfs_bitmap_spread (fs))
block = (block / (fs->fs_blocksize * 8) + 1) *
(fs->fs_blocksize * 8);
else
block ++;
}
if (!reiserfs_journal_hostsize (fs->fs_ondisk_sb))
/* root block follows directly super block and first bitmap */
block = fs->fs_super_bh->b_blocknr + 1 + 1;
else {
/* makr journal blocks as used */
for (i = 0; i <= reiserfs_jp_get_size (reiserfs_sb_jp (sb)); i ++) {
reiserfs_bitmap_set_bit (fs->fs_bitmap2,
i + reiserfs_jp_get_start (reiserfs_sb_jp (sb)));
marked ++;
}
block = reiserfs_jp_get_start (reiserfs_sb_jp (sb)) + i;
}
/*get correct block - not journal nor bitmap*/
while (reiserfs_journal_block (fs, block) || reiserfs_bitmap_block (fs, block)) {
block++;
}
while ((block < count) && reiserfs_bitmap_test_bit (fs->fs_bitmap2, block))
{
block++;
}
if (block >= count)
reiserfs_exit(1, "mkreiserfs: too many bad blocks");
reiserfs_bitmap_set_bit (fs->fs_bitmap2, block);
marked ++;
reiserfs_sb_set_root (sb, block);
reiserfs_sb_set_free (sb, count - marked);
}
static void set_root_dir_nlink (reiserfs_ih_t *ih, void *sd) {
__u32 nlink;
nlink = 3;
reiserfs_stat_set_nlink (ih, sd, &nlink);
}
/* form the root block of the tree (the block head, the item head, the
root directory) */
static void make_root_block (reiserfs_filsys_t * fs)
{
reiserfs_sb_t * sb;
reiserfs_bh_t * bh;
sb = fs->fs_ondisk_sb;
/* get memory for root block */
bh = reiserfs_buffer_open (fs->fs_dev, reiserfs_sb_get_root (sb),
reiserfs_sb_get_blksize (sb));
if (!bh) {
reiserfs_exit(1, "reiserfs_buffer_open failed");
}
reiserfs_buffer_mkuptodate (bh, 1);
reiserfs_leaf_mkempty (bh);
reiserfs_tree_root (fs, set_root_dir_nlink, 0);
reiserfs_buffer_close (bh);
reiserfs_objmap_set (fs, REISERFS_ROOT_PARENT_OBJECTID);
reiserfs_objmap_set (fs, REISERFS_ROOT_OBJECTID);
}
static void report (reiserfs_filsys_t * fs, char * j_filename)
{
reiserfs_sb_t * sb = (reiserfs_sb_t *)(fs->fs_super_bh->b_data);
struct stat st;
dev_t rdev;
if (!reiserfs_super_magic (sb))
return;
if (fstat (fs->fs_super_bh->b_dev, &st) == -1) {
/*reiserfs_warning (stderr, "fstat failed: %s\n", strerror(errno));*/
rdev = 0;
} else
rdev = st.st_rdev;
if (mode & DEBUG_MODE) {
reiserfs_warning (stdout, "Block %lu (0x%x) contains super block. ",
fs->fs_super_bh->b_blocknr, rdev);
}
switch (reiserfs_super_format (sb)) {
case REISERFS_FORMAT_3_5:
reiserfs_warning (stdout, " Format 3.5 with ");
break;
case REISERFS_FORMAT_3_6:
reiserfs_warning (stdout, "Format 3.6 with ");
break;
}
if (reiserfs_super_jr_magic (sb))
reiserfs_warning (stdout, "non-");
reiserfs_warning (stdout, "standard journal\n");
reiserfs_warning (stdout, "Count of blocks on the device: %u\n",
reiserfs_sb_get_blocks (sb));
reiserfs_warning (stdout, "Number of blocks consumed by mkreiserfs "
"formatting process: %u\n", reiserfs_sb_get_blocks (sb)
- reiserfs_sb_get_free (sb));
if (mode & DEBUG_MODE)
reiserfs_warning (stdout, "Free blocks: %u\n",
reiserfs_sb_get_free (sb));
reiserfs_warning (stdout, "Blocksize: %d\n", reiserfs_sb_get_blksize (sb));
reiserfs_warning (stdout, "Hash function used to sort names: %s\n",
reiserfs_hash_name (reiserfs_sb_get_hash (sb)));
if (mode & DEBUG_MODE) {
reiserfs_warning (stdout, "Number of bitmaps: %u\n", reiserfs_sb_get_bmaps (sb));
reiserfs_warning (stdout, "Root block: %u\n", reiserfs_sb_get_root (sb));
reiserfs_warning (stdout, "Tree height: %d\n", reiserfs_sb_get_height (sb));
reiserfs_warning (stdout, "Objectid map size %d, max %d\n",
reiserfs_sb_get_mapcur (sb), reiserfs_sb_get_mapmax (sb));
reiserfs_warning (stdout, "Journal parameters:\n");
reiserfs_journal_print_params (stdout, reiserfs_sb_jp (sb));
} else {
if (j_filename && strcmp (j_filename, fs->fs_file_name))
reiserfs_warning (stdout, "Journal Device [0x%x]\n",
reiserfs_jp_get_dev (reiserfs_sb_jp (sb)));
reiserfs_warning (stdout, "Journal Size %u blocks (first block %u)\n",
reiserfs_jp_get_size (reiserfs_sb_jp (sb)) + 1,
reiserfs_jp_get_start (reiserfs_sb_jp (sb)));
reiserfs_warning (stdout, "Journal Max transaction length %u\n",
reiserfs_jp_get_tlen (reiserfs_sb_jp (sb)));
}
if (j_filename && strcmp (j_filename, fs->fs_file_name)) {
reiserfs_warning (stdout, "Space on this device reserved by journal: "
"%u\n", reiserfs_sb_get_reserved (sb));
}
if (mode & DEBUG_MODE) {
reiserfs_warning (stdout, "Filesystem state 0x%x\n",
reiserfs_sb_get_state (sb));
reiserfs_warning (stdout, "sb_version %u\n",
reiserfs_sb_get_version (sb));
}
if (reiserfs_super_format (sb) == REISERFS_FORMAT_3_6) {
reiserfs_warning (stdout, "inode generation number: %u\n",
reiserfs_sb_get_gen (sb));
reiserfs_warning (stdout, "UUID: %U\n", sb->s_uuid);
if (strcmp ((char *)sb->s_label, ""))
reiserfs_warning (stdout, "LABEL: %s\n", sb->s_label);
}
return;
}
static void set_hash_function (char * str)
{
if (!strcmp (str, "tea"))
Hash = REISERFS_HASH_TEA;
else if (!strcmp (str, "rupasov"))
Hash = REISERFS_HASH_YURA;
else if (!strcmp (str, "r5"))
Hash = REISERFS_HASH_R5;
else
message("wrong hash type specified. Using default");
}
static void set_reiserfs_version (char * str)
{
if (!strcmp (str, "3.5"))
Format = "3.5";
else {
Format = "3.6";
if (strcmp (str, "3.6"))
message("wrong reiserfs version specified. "
"Using default 3.6 format");
}
}
static int str2int (char * str)
{
int val;
char * tmp;
val = (int) strtol (str, &tmp, 0);
if (*tmp) {
reiserfs_exit (1, "%s: strtol is unable to make an integer of %s\n",
program_name, str);
}
return val;
}
static void set_block_size (char * str, int *b_size)
{
*b_size = str2int (str);
if (!reiserfs_fs_blksize_check (*b_size))
reiserfs_exit (1, "%s: wrong blocksize %s specified, "
"only power of 2 from 512-8192 interval "
"are supported", program_name, str);
}
static void set_transaction_max_size (char * str)
{
Max_trans_size = str2int( str );
}
/* reiserfs_journal_create will check this */
static void set_journal_device_size (char * str)
{
Journal_size = str2int (str);
/*
if (Journal_size < JOURNAL_MIN_SIZE)
misc_die ("%s: wrong journal size specified: %lu. Should be at least %u",
program_name,
Journal_size + 1, JOURNAL_MIN_SIZE + 1);
*/
}
/* reiserfs_journal_create will check this */
static void set_offset_in_journal_device (char * str)
{
Offset = str2int( str );
}
static int is_journal_default (char * name, char * jname, int blocksize)
{
if (jname && strcmp (name, jname))
return 0;
if (Journal_size && Journal_size !=
reiserfs_journal_default(REISERFS_DISK_OFFSET_IN_BYTES / blocksize,
blocksize) + 1)
/* journal size is set and it is not default size */
return 0;
if (Max_trans_size && Max_trans_size != JOURNAL_TRANS_MAX)
return 0;
return 1;
}
/* if running kernel is 2.2 - mkreiserfs creates 3.5 format, if 2.4 - 3.6,
otherwise - mkreiserfs fails */
static int select_format (void)
{
#ifdef HAVE_UNAME
struct utsname sysinfo;
#endif
char *release = NULL;
if (Format) {
if (!strcmp (Format, "3.5"))
return REISERFS_FORMAT_3_5;
if (strcmp (Format, "3.6")) {
message ("Unknown fromat %s specified\n", Format);
exit (1);
}
return REISERFS_FORMAT_3_6;
}
#ifdef HAVE_UNAME
reiserfs_warning (stdout, "Guessing about desired format.. ");
if (uname (&sysinfo) == -1) {
message ("could not get system info: %s", strerror(errno));
exit (1);
}
reiserfs_warning(stdout, "Kernel %s is running.\n", sysinfo.release);
release = sysinfo.release;
#endif
if (!release) {
message("Failed to detect the running kernel. To create "
"reiserfs filesystem\nspecify desired format with "
"--format. Choose 3.5 if you use 2.2 kernel;\n3.6 "
"if 2.4 or higher.");
exit(1);
}
if (strncmp (release, "2.4", 3) >= 0)
return REISERFS_FORMAT_3_6;
if (strncmp (release, "2.2", 3)) {
message( "You should run either 2.2 or 2.4 or higher to be able "
"to create reiserfs filesystem or specify desired format with --format");
exit (1);
}
reiserfs_warning(stdout, "Creating filesystem of format 3.5\n");
return REISERFS_FORMAT_3_5;
}
/* Reads the "CREDITS" file and prints one paragraph from it. */
static void mkfs_print_credit(FILE *out) {
char *line;
__u32 num1, num2;
fprintf(out, "A pair of credits:\n");
srandom (time (0));
num1 = random() % CREDITS_COUNT;
line = credits[num1];
fprintf(out, "%s\n", line);
while ((num1 == (num2 = random() % CREDITS_COUNT))) {}
line = credits[num2];
fprintf(out, "%s\n", line);
}
int main (int argc, char **argv)
{
reiserfs_filsys_t * fs;
int force = 0;
char * device_name = NULL;
char * jdevice_name = NULL;
unsigned long fs_size = 0;
int c;
static int flag;
program_name = strrchr( argv[ 0 ], '/' );
if (program_name)
program_name++;
else
program_name = argv[ 0 ];
if (argc < 2)
print_usage_and_exit ();
memset(UUID, 0, 16);
while (1) {
static struct option options[] = {
{"block-size", required_argument, 0, 'b'},
{"journal-device", required_argument, 0, 'j'},
{"journal-size", required_argument, 0, 's'},
{"transaction-max-size", required_argument, 0, 't'},
{"journal-offset", required_argument, 0, 'o'},
{"badblocks", required_argument, 0, 'B'},
{"hash", required_argument, 0, 'h'},
{"uuid", required_argument, 0, 'u'},
{"label", required_argument, 0, 'l'},
{"format", required_argument, &flag, 1},
{0, 0, 0, 0}
};
int option_index;
c = getopt_long (argc, argv, "b:j:s:t:o:h:u:l:VfdB:q",
options, &option_index);
if (c == -1)
break;
switch (c) {
case 0:
if (flag) {
Format = optarg;
flag = 0;
}
break;
case 'b': /* --block-size */
set_block_size (optarg, &Block_size);
break;
case 'j': /* --journal-device */
Create_default_journal = 0;
jdevice_name = optarg;
break;
case 's': /* --journal-size */
Create_default_journal = 0;
set_journal_device_size (optarg);
break;
case 't': /* --transaction-max-size */
Create_default_journal = 0;
set_transaction_max_size (optarg);
break;
case 'o': /* --offset */
Create_default_journal = 0;
set_offset_in_journal_device (optarg);
break;
case 'B': /* --badblock-list */
badblocks_file = optarg;
break;
case 'h': /* --hash */
set_hash_function (optarg);
break;
case 'v': /* --format */
set_reiserfs_version (optarg);
break;
case 'V':
mode = DO_NOTHING;
break;
case 'f':
force ++;
break;
case 'd':
mode |= DEBUG_MODE;
break;
case 'u':
#if defined(HAVE_LIBUUID) && defined(HAVE_UUID_UUID_H)
if (uuid_parse(optarg, UUID) < 0) {
reiserfs_warning(stderr, "Invalid UUID '%s' is "
"specified\n", optarg);
return 1;
}
#else
message ("Cannot set up the UUID, uuidlib was not "
"found by configure.\n");
return 1;
#endif
break;
case 'l':
LABEL = optarg;
break;
case 'q':
mode |= QUIET_MODE;
break;
default:
print_usage_and_exit();
}
}
util_print_banner(program_name);
mkfs_print_credit(stdout);
printf("\n");
if (mode & QUIET_MODE)
fclose(stdout);
if (mode == DO_NOTHING)
exit(0);
/* device to be formatted */
device_name = argv [optind];
if (optind == argc - 2) {
/* number of blocks for filesystem is specified */
fs_size = str2int (argv[optind + 1]);
} else if (optind == argc - 1) {
/* number of blocks is not specified */
if (!(fs_size = misc_device_count_blocks (device_name, Block_size)))
exit(1);
} else {
print_usage_and_exit ();
}
if (is_journal_default (device_name, jdevice_name, Block_size))
Create_default_journal = 1;
if (!(mode & QUIET_MODE) && !util_device_formatable (device_name, force))
return 1;
if (jdevice_name)
if (!(mode & QUIET_MODE) && !util_device_formatable (jdevice_name, force))
return 1;
fs = reiserfs_fs_create (device_name, select_format(), fs_size, Block_size,
Create_default_journal, 1);
if (!fs) {
return 1;
}
if (!reiserfs_journal_create (fs, jdevice_name, Offset, Journal_size,
Max_trans_size))
{
return 1;
}
if (!(fs->fs_bitmap2 = reiserfs_bitmap_create(fs_size)))
return 1;
/* these fill buffers (super block, first bitmap, root block) with
reiserfs structures */
#if defined(HAVE_LIBUUID) && defined(HAVE_UUID_UUID_H)
if (!uuid_is_null(UUID) && fs->fs_format != REISERFS_FORMAT_3_6) {
reiserfs_warning(stderr, "UUID can be specified only with 3.6 format\n");
return 1;
}
#endif
if (badblocks_file) {
if (util_badblock_load (fs, badblocks_file))
exit(1);
}
make_super_block (fs);
make_bitmap (fs);
make_root_block (fs);
reiserfs_badblock_flush (fs, 1);
report (fs, jdevice_name);
if (!force && !(mode & QUIET_MODE)) {
fprintf (stderr, "ATTENTION: YOU SHOULD REBOOT AFTER FDISK!\n"
"\tALL DATA WILL BE LOST ON '%s'", device_name);
if (jdevice_name && strcmp (jdevice_name, device_name))
fprintf (stderr, " AND ON JOURNAL DEVICE '%s'", jdevice_name);
if (!util_user_confirmed (stderr, "!\nContinue (y/n):", "y\n"))
return 1;
}
invalidate_other_formats (fs->fs_dev);
zero_journal (fs);
reiserfs_fs_close (fs);
printf ("Syncing.."); fflush (stdout);
sync ();
printf ("ok\n");
if (mode & DEBUG_MODE)
return 0;
printf("\nTell your friends to use a kernel based on 2.4.18 or "
"later, and especially not a\nkernel based on 2.4.9, "
"when you use reiserFS. Have fun.\n\n");
printf("ReiserFS is successfully created on %s.\n", device_name);
return 0;
}
/*
* Use BSD fomatting.
* Local variables:
* c-indentation-style: "bsd"
* mode-name: "BSDC"
* c-basic-offset: 4
* tab-width: 4
* End:
*/