diff options
author | ngie <ngie@FreeBSD.org> | 2015-10-21 13:15:04 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2015-10-21 13:15:04 +0000 |
commit | 91302d1c6215c41b396e33d3f51e7180e0488db7 (patch) | |
tree | 18ab6d442e290bef25fed7a862cadcdb5e58ae1d /usr.sbin/makefs | |
parent | 6a7bd1fb9e0408191a89afc2476a899cda78c06f (diff) | |
download | FreeBSD-src-91302d1c6215c41b396e33d3f51e7180e0488db7.zip FreeBSD-src-91302d1c6215c41b396e33d3f51e7180e0488db7.tar.gz |
Revert r289694
I committed some other undesirable local changes by accident
Diffstat (limited to 'usr.sbin/makefs')
-rw-r--r-- | usr.sbin/makefs/Makefile | 6 | ||||
-rw-r--r-- | usr.sbin/makefs/cd9660/iso9660_rrip.c | 9 | ||||
-rw-r--r-- | usr.sbin/makefs/makefs.8 | 16 | ||||
-rw-r--r-- | usr.sbin/makefs/makefs.c | 6 | ||||
-rw-r--r-- | usr.sbin/makefs/tests/Makefile | 15 | ||||
-rwxr-xr-x | usr.sbin/makefs/tests/makefs_cd9660_tests.sh | 62 | ||||
-rwxr-xr-x | usr.sbin/makefs/tests/makefs_ffs_tests.sh | 64 | ||||
-rwxr-xr-x | usr.sbin/makefs/tests/makefs_tests_common.sh | 81 |
8 files changed, 11 insertions, 248 deletions
diff --git a/usr.sbin/makefs/Makefile b/usr.sbin/makefs/Makefile index 7a0ebf0..882fe45 100644 --- a/usr.sbin/makefs/Makefile +++ b/usr.sbin/makefs/Makefile @@ -1,7 +1,5 @@ # $FreeBSD$ -.include <src.opts.mk> - PROG= makefs CFLAGS+=-I${.CURDIR} @@ -34,8 +32,4 @@ SRCS+= ffs_tables.c CFLAGS+= -I${.CURDIR}/../../lib/libnetbsd LIBADD= netbsd util sbuf -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif - .include <bsd.prog.mk> diff --git a/usr.sbin/makefs/cd9660/iso9660_rrip.c b/usr.sbin/makefs/cd9660/iso9660_rrip.c index 749747b..5382857 100644 --- a/usr.sbin/makefs/cd9660/iso9660_rrip.c +++ b/usr.sbin/makefs/cd9660/iso9660_rrip.c @@ -1,4 +1,4 @@ -/* $NetBSD: iso9660_rrip.c,v 1.14 2014/05/30 13:14:47 martin Exp $ */ +/* $NetBSD: iso9660_rrip.c,v 1.11 2012/04/29 13:32:21 joerg Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -656,14 +656,13 @@ cd9660node_rrip_pn(struct ISO_SUSP_ATTRIBUTES *pn_field, fsnode *fnode) pn_field->attr.rr_entry.PN.h.length[0] = 20; pn_field->attr.rr_entry.PN.h.version[0] = 1; - if (sizeof (fnode->inode->st.st_rdev) > 4) - cd9660_bothendian_dword( - (uint64_t)fnode->inode->st.st_rdev >> 32, + if (sizeof (fnode->inode->st.st_dev) > 32) + cd9660_bothendian_dword((uint64_t)fnode->inode->st.st_dev >> 32, pn_field->attr.rr_entry.PN.high); else cd9660_bothendian_dword(0, pn_field->attr.rr_entry.PN.high); - cd9660_bothendian_dword(fnode->inode->st.st_rdev & 0xffffffff, + cd9660_bothendian_dword(fnode->inode->st.st_dev & 0xffffffff, pn_field->attr.rr_entry.PN.low); return 1; } diff --git a/usr.sbin/makefs/makefs.8 b/usr.sbin/makefs/makefs.8 index db6b322..025066d 100644 --- a/usr.sbin/makefs/makefs.8 +++ b/usr.sbin/makefs/makefs.8 @@ -53,7 +53,7 @@ .Op Fl m Ar maximum-size .Op Fl N Ar userdb-dir .Op Fl o Ar fs-options -.Op Fl R Ar roundup-size +.Op Fl r Ar roundup .Op Fl S Ar sector-size .Op Fl s Ar image-size .Op Fl t Ar fs-type @@ -196,12 +196,9 @@ Deprecated. See the .Fl Z flag. -.It Fl R Ar roundup-size -Round the image up to -.Ar roundup-size . -.Ar roundup-size -should be a multiple of the file system block size specified by -.Ar bsize . +.It Fl r Ar roundup +Round the image up to specified block size that should be multiple +of block size. .It Fl S Ar sector-size Set the file system sector size to .Ar sector-size . @@ -280,11 +277,6 @@ or .Ql time . .It Sy extent Maximum extent size. -.It Sy roundup -Round the image up to -.Ar roundup-size . -should be a multiple of -.Ar bsize . .It Sy maxbpcg Maximum total number of blocks in a cylinder group. .It Sy version diff --git a/usr.sbin/makefs/makefs.c b/usr.sbin/makefs/makefs.c index bca9722..5e419cc 100644 --- a/usr.sbin/makefs/makefs.c +++ b/usr.sbin/makefs/makefs.c @@ -209,10 +209,10 @@ main(int argc, char *argv[]) fsoptions.sparse = 1; break; - case 'R': + case 'r': /* Round image size up to specified block size */ fsoptions.roundup = - strsuftoll("roundup-size", optarg, 0, LLONG_MAX); + strsuftoll("roundup", optarg, 0, LLONG_MAX); break; case 's': @@ -365,7 +365,7 @@ usage(void) prog = getprogname(); fprintf(stderr, "usage: %s [-t fs-type] [-o fs-options] [-d debug-mask] [-B endian]\n" -"\t[-S sector-size] [-M minimum-size] [-m maximum-size] [-R roundup-size]\n" +"\t[-S sector-size] [-M minimum-size] [-m maximum-size] [-r roundup ]\n" "\t[-s image-size] [-b free-blocks] [-f free-files] [-F mtree-specfile]\n" "\t[-xZ] [-N userdb-dir] image-file directory | manifest [extra-directory ...]\n", prog); diff --git a/usr.sbin/makefs/tests/Makefile b/usr.sbin/makefs/tests/Makefile deleted file mode 100644 index 4373277..0000000 --- a/usr.sbin/makefs/tests/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -# $FreeBSD$ - -ATF_TESTS_SH+= makefs_cd9660_tests -ATF_TESTS_SH+= makefs_ffs_tests - -BINDIR= ${TESTSDIR} - -SCRIPTS+= makefs_tests_common.sh -SCRIPTSNAME_makefs_tests_common.sh= makefs_tests_common.sh - -.for t in ${ATF_TESTS_SH} -TEST_METADATA.$t+= required_user="root" -.endfor - -.include <bsd.test.mk> diff --git a/usr.sbin/makefs/tests/makefs_cd9660_tests.sh b/usr.sbin/makefs/tests/makefs_cd9660_tests.sh deleted file mode 100755 index 55465bd..0000000 --- a/usr.sbin/makefs/tests/makefs_cd9660_tests.sh +++ /dev/null @@ -1,62 +0,0 @@ -# -# Copyright 2015 EMC Corp. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# $FreeBSD$ -# - -. "$(dirname "$0")/makefs_tests_common.sh" - -MAKEFS="makefs -t cd9660" -TEST_IMAGE="test.iso" - -atf_test_case basic_cd9660 cleanup -basic_cd9660_body() -{ - create_test_inputs - - atf_check -e empty -o empty -s exit:0 \ - $MAKEFS $TEST_IMAGE $TEST_INPUTS_DIR - atf_check -e empty -o save:$TEST_MD_DEVICE_FILE -s exit:0 \ - mdconfig -a -f $TEST_IMAGE - atf_check -e empty -o empty -s exit:0 \ - mount_cd9660 /dev/$(cat $TEST_MD_DEVICE_FILE) $TEST_MOUNT_DIR - atf_check -e empty -o not-empty -s exit:0 ls $TEST_MOUNT_DIR -} -basic_cd9660_cleanup() -{ - ls -a - - test_md_device=$(cat $TEST_MD_DEVICE_FILE) || return - - umount -f /dev/$test_md_device - mdconfig -d -u $test_md_device -} - -atf_init_test_cases() -{ - - atf_add_test_case basic_cd9660 -} diff --git a/usr.sbin/makefs/tests/makefs_ffs_tests.sh b/usr.sbin/makefs/tests/makefs_ffs_tests.sh deleted file mode 100755 index ff86c74..0000000 --- a/usr.sbin/makefs/tests/makefs_ffs_tests.sh +++ /dev/null @@ -1,64 +0,0 @@ -# -# Copyright 2015 EMC Corp. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# $FreeBSD$ -# - -. "$(dirname "$0")/makefs_tests_common.sh" - -MAKEFS="makefs -t ffs" -TEST_IMAGE="test.img" - -atf_test_case basic_ffs cleanup -basic_ffs_body() -{ - create_test_inputs - - atf_check -e empty -o not-empty -s exit:0 \ - $MAKEFS -M 1m $TEST_IMAGE $TEST_INPUTS_DIR - atf_check -e empty -o save:$TEST_MD_DEVICE_FILE -s exit:0 \ - mdconfig -a -f $TEST_IMAGE - atf_check -e save:$ATF_TMPDIR/tunefs.output -o empty -s exit:0 \ - tunefs -p /dev/$(cat $TEST_MD_DEVICE_FILE) - atf_check -e empty -o empty -s exit:0 \ - mount /dev/$(cat $TEST_MD_DEVICE_FILE) $TEST_MOUNT_DIR - atf_check -e empty -o not-empty -s exit:0 ls $TEST_MOUNT_DIR -} -basic_ffs_cleanup() -{ - ls -a - - test_md_device=$(cat $TEST_MD_DEVICE_FILE) || return - - umount -f /dev/$test_md_device - mdconfig -d -u $test_md_device -} - -atf_init_test_cases() -{ - - atf_add_test_case basic_ffs -} diff --git a/usr.sbin/makefs/tests/makefs_tests_common.sh b/usr.sbin/makefs/tests/makefs_tests_common.sh deleted file mode 100755 index c90557a..0000000 --- a/usr.sbin/makefs/tests/makefs_tests_common.sh +++ /dev/null @@ -1,81 +0,0 @@ -# -# Copyright 2015 EMC Corp. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# $FreeBSD$ -# - -TEST_MD_DEVICE_FILE="md.output" -TEST_MOUNT_DIR="mnt" - -create_test_dir() -{ - [ -z "$ATF_TMPDIR" ] || return 0 - - export ATF_TMPDIR=$(pwd) - - TEST_MD_DEVICE_FILE="${ATF_TMPDIR}/${TEST_MD_DEVICE_FILE}" - TEST_MOUNT_DIR="${ATF_TMPDIR}/${TEST_MOUNT_DIR}" - - # XXX: need to nest this because of how kyua creates $TMPDIR; otherwise - # it will run into EPERM issues later - TEST_INPUTS_DIR="${ATF_TMPDIR}/test/inputs" - - atf_check -e empty -s exit:0 mkdir -m 0777 -p $TEST_MOUNT_DIR - atf_check -e empty -s exit:0 mkdir -m 0777 -p $TEST_INPUTS_DIR - cd $TEST_INPUTS_DIR -} - -create_test_inputs() -{ - create_test_dir - - atf_check -e empty -s exit:0 mkdir -m 0755 -p a/b/1 - atf_check -e empty -s exit:0 ln -s a/b c - atf_check -e empty -s exit:0 touch d - atf_check -e empty -s exit:0 ln d e - atf_check -e empty -s exit:0 touch .f - atf_check -e empty -s exit:0 mkdir .g - atf_check -e empty -s exit:0 mkfifo h - atf_check -e ignore -s exit:0 dd if=/dev/zero of=i count=1000 bs=1 - atf_check -e empty -s exit:0 touch klmn - atf_check -e empty -s exit:0 touch opqr - atf_check -e empty -s exit:0 touch stuv - atf_check -e empty -s exit:0 install -m 0755 /dev/null wxyz - atf_check -e empty -s exit:0 touch 0b00000001 - atf_check -e empty -s exit:0 touch 0b00000010 - atf_check -e empty -s exit:0 touch 0b00000011 - atf_check -e empty -s exit:0 touch 0b00000100 - atf_check -e empty -s exit:0 touch 0b00000101 - atf_check -e empty -s exit:0 touch 0b00000110 - atf_check -e empty -s exit:0 touch 0b00000111 - atf_check -e empty -s exit:0 touch 0b00001000 - atf_check -e empty -s exit:0 touch 0b00001001 - atf_check -e empty -s exit:0 touch 0b00001010 - atf_check -e empty -s exit:0 touch 0b00001011 - atf_check -e empty -s exit:0 touch 0b00001100 - atf_check -e empty -s exit:0 touch 0b00001101 - atf_check -e empty -s exit:0 touch 0b00001110 -} |