Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/e2fsprogs
- Timestamp:
- Jan 1, 2014, 12:47:38 AM (11 years ago)
- Location:
- branches/3.2/mindi-busybox/e2fsprogs
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mindi-busybox/e2fsprogs/Config.src
r2725 r3232 34 34 bool "lsattr" 35 35 default y 36 depends onPLATFORM_LINUX36 select PLATFORM_LINUX 37 37 help 38 38 lsattr lists the file attributes on a second extended file system. -
branches/3.2/mindi-busybox/e2fsprogs/chattr.c
r2725 r3232 19 19 * 98/12/29 - Display version info only when -V specified (G M Sipe) 20 20 */ 21 22 //usage:#define chattr_trivial_usage 23 //usage: "[-R] [-+=AacDdijsStTu] [-v VERSION] [FILE]..." 24 //usage:#define chattr_full_usage "\n\n" 25 //usage: "Change file attributes on an ext2 fs\n" 26 //usage: "\nModifiers:" 27 //usage: "\n - Remove attributes" 28 //usage: "\n + Add attributes" 29 //usage: "\n = Set attributes" 30 //usage: "\nAttributes:" 31 //usage: "\n A Don't track atime" 32 //usage: "\n a Append mode only" 33 //usage: "\n c Enable compress" 34 //usage: "\n D Write dir contents synchronously" 35 //usage: "\n d Don't backup with dump" 36 //usage: "\n i Cannot be modified (immutable)" 37 //usage: "\n j Write all data to journal first" 38 //usage: "\n s Zero disk storage when deleted" 39 //usage: "\n S Write file contents synchronously" 40 //usage: "\n t Disable tail-merging of partial blocks with other files" 41 //usage: "\n u Allow file to be undeleted" 42 //usage: "\n -R Recurse" 43 //usage: "\n -v Set the file's version/generation number" 21 44 22 45 #include "libbb.h" -
branches/3.2/mindi-busybox/e2fsprogs/e2fs_lib.h
r2725 r3232 8 8 9 9 /* Constants and structures */ 10 #include " e2fs_defs.h"10 #include "bb_e2fs_defs.h" 11 11 12 12 PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN -
branches/3.2/mindi-busybox/e2fsprogs/fsck.c
r2725 r3232 34 34 * It doesn't guess filesystem types from on-disk format. 35 35 */ 36 37 //usage:#define fsck_trivial_usage 38 //usage: "[-ANPRTV] [-C FD] [-t FSTYPE] [FS_OPTS] [BLOCKDEV]..." 39 //usage:#define fsck_full_usage "\n\n" 40 //usage: "Check and repair filesystems\n" 41 //usage: "\n -A Walk /etc/fstab and check all filesystems" 42 //usage: "\n -N Don't execute, just show what would be done" 43 //usage: "\n -P With -A, check filesystems in parallel" 44 //usage: "\n -R With -A, skip the root filesystem" 45 //usage: "\n -T Don't show title on startup" 46 //usage: "\n -V Verbose" 47 //usage: "\n -C n Write status information to specified filedescriptor" 48 //usage: "\n -t TYPE List of filesystem types to check" 36 49 37 50 #include "libbb.h" … … 304 317 FILE *fstab; 305 318 struct mntent mte; 306 struct fs_info *fs;307 319 308 320 fstab = setmntent(filename, "r"); … … 317 329 // mte.mnt_type, mte.mnt_opts, 318 330 // mte.mnt_passno); 319 fs =create_fs_device(mte.mnt_fsname, mte.mnt_dir,331 create_fs_device(mte.mnt_fsname, mte.mnt_dir, 320 332 mte.mnt_type, mte.mnt_opts, 321 333 mte.mnt_passno); … … 467 479 if (verbose > 1) 468 480 printf("Finished with %s (exit status %d)\n", 469 481 inst->device, status); 470 482 num_running--; 471 483 free_instance(inst); … … 833 845 printf("--waiting-- (pass %d)\n", passno); 834 846 status |= wait_many(pass_done ? FLAG_WAIT_ALL : 835 847 FLAG_WAIT_ATLEAST_ONE); 836 848 if (pass_done) { 837 849 if (verbose > 1) -
branches/3.2/mindi-busybox/e2fsprogs/lsattr.c
r2725 r3232 18 18 * 98/12/29 - Display version info only when -V specified (G M Sipe) 19 19 */ 20 21 //usage:#define lsattr_trivial_usage 22 //usage: "[-Radlv] [FILE]..." 23 //usage:#define lsattr_full_usage "\n\n" 24 //usage: "List file attributes on an ext2 fs\n" 25 //usage: "\n -R Recurse" 26 //usage: "\n -a Don't hide entries starting with ." 27 //usage: "\n -d List directory entries instead of contents" 28 //usage: "\n -l List long flag names" 29 //usage: "\n -v List the file's version/generation number" 20 30 21 31 #include "libbb.h" -
branches/3.2/mindi-busybox/e2fsprogs/old_e2fsprogs/blkid/blkid_getsize.c
r1765 r3232 97 97 #ifdef BLKGETSIZE64 98 98 #ifdef __linux__ 99 if ((uname(&ut) == 0) &&100 101 (ut.release[2] < '6') && (ut.release[3] == '.')) )99 uname(&ut); 100 if ((ut.release[0] == '2') && (ut.release[1] == '.') && 101 (ut.release[2] < '6') && (ut.release[3] == '.')) 102 102 valid_blkgetsize64 = 0; 103 103 #endif -
branches/3.2/mindi-busybox/e2fsprogs/old_e2fsprogs/blkid/probe.c
r2725 r3232 576 576 dev->bid_name, diff)); 577 577 578 if (((fd = open(dev->bid_name, O_RDONLY)) < 0) || 579 (fstat(fd, &st) < 0)) { 578 fd = open(dev->bid_name, O_RDONLY); 579 if (fd < 0 580 || fstat(fd, &st) < 0 581 ) { 582 if (fd >= 0) 583 close(fd); 580 584 if (errno == ENXIO || errno == ENODEV || errno == ENOENT) { 581 585 blkid_free_dev(dev); … … 654 658 if (!dev->bid_type) { 655 659 blkid_free_dev(dev); 660 close(fd); 656 661 return NULL; 657 662 } -
branches/3.2/mindi-busybox/e2fsprogs/old_e2fsprogs/e2fsck.c
r2725 r3232 29 29 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 30 30 */ 31 32 /* 33 //usage:#define e2fsck_trivial_usage 34 //usage: "[-panyrcdfvstDFSV] [-b superblock] [-B blocksize] " 35 //usage: "[-I inode_buffer_blocks] [-P process_inode_size] " 36 //usage: "[-l|-L bad_blocks_file] [-C fd] [-j external_journal] " 37 //usage: "[-E extended-options] device" 38 //usage:#define e2fsck_full_usage "\n\n" 39 //usage: "Check ext2/ext3 file system\n" 40 //usage: "\n -p Automatic repair (no questions)" 41 //usage: "\n -n Make no changes to the filesystem" 42 //usage: "\n -y Assume 'yes' to all questions" 43 //usage: "\n -c Check for bad blocks and add them to the badblock list" 44 //usage: "\n -f Force checking even if filesystem is marked clean" 45 //usage: "\n -v Verbose" 46 //usage: "\n -b superblock Use alternative superblock" 47 //usage: "\n -B blocksize Force blocksize when looking for superblock" 48 //usage: "\n -j journal Set location of the external journal" 49 //usage: "\n -l file Add to badblocks list" 50 //usage: "\n -L file Set badblocks list" 51 */ 31 52 32 53 #include "e2fsck.h" /*Put all of our defines here to clean things up*/ … … 561 582 /* 562 583 * Return the given node's successor node---the node which has the 563 * next key in the theleft to right ordering. If the node has584 * next key in the left to right ordering. If the node has 564 585 * no successor, a null pointer is returned rather than a pointer to 565 586 * the nil node. … … 11557 11578 */ 11558 11579 if (!(fs->super->s_feature_compat & 11559 EXT2_FEATURE_COMPAT_RESIZE_INO DE)) {11580 EXT2_FEATURE_COMPAT_RESIZE_INO)) { 11560 11581 if (fs->super->s_reserved_gdt_blocks) { 11561 11582 pctx.num = fs->super->s_reserved_gdt_blocks; … … 11573 11594 if (retval) { 11574 11595 if (fs->super->s_feature_compat & 11575 EXT2_FEATURE_COMPAT_RESIZE_INO DE)11596 EXT2_FEATURE_COMPAT_RESIZE_INO) 11576 11597 ctx->flags |= E2F_FLAG_RESIZE_INODE; 11577 11598 return; … … 11583 11604 */ 11584 11605 if (!(fs->super->s_feature_compat & 11585 EXT2_FEATURE_COMPAT_RESIZE_INO DE)) {11606 EXT2_FEATURE_COMPAT_RESIZE_INO)) { 11586 11607 for (i=0; i < EXT2_N_BLOCKS; i++) { 11587 11608 if (inode.i_block[i]) -
branches/3.2/mindi-busybox/e2fsprogs/old_e2fsprogs/e2fsck.h
r2725 r3232 259 259 #define PR_1_SET_IMMUTABLE 0x010030 /* Immutable flag set on a device or socket inode */ 260 260 #define PR_1_COMPR_SET 0x010031 /* Compression flag set on a non-compressed filesystem */ 261 #define PR_1_SET_NONZSIZE 0x010032 /* Non-zero size on ondevice, fifo or socket inode */261 #define PR_1_SET_NONZSIZE 0x010032 /* Non-zero size on device, fifo or socket inode */ 262 262 #define PR_1_FS_REV_LEVEL 0x010033 /* Filesystem revision is 0, but feature flags are set */ 263 263 #define PR_1_JOURNAL_INODE_NOT_CLEAR 0x010034 /* Journal inode not in use, needs clearing */ -
branches/3.2/mindi-busybox/e2fsprogs/old_e2fsprogs/e2p/feature.c
r1765 r3232 35 35 { E2P_FEATURE_COMPAT, EXT2_FEATURE_COMPAT_DIR_INDEX, 36 36 "dir_index" }, 37 { E2P_FEATURE_COMPAT, EXT2_FEATURE_COMPAT_RESIZE_INO DE,37 { E2P_FEATURE_COMPAT, EXT2_FEATURE_COMPAT_RESIZE_INO, 38 38 "resize_inode" }, 39 39 { E2P_FEATURE_RO_INCOMPAT, EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER, -
branches/3.2/mindi-busybox/e2fsprogs/old_e2fsprogs/ext2fs/ext2_fs.h
r2725 r3232 476 476 #define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0004 477 477 #define EXT2_FEATURE_COMPAT_EXT_ATTR 0x0008 478 #define EXT2_FEATURE_COMPAT_RESIZE_INO DE0x0010478 #define EXT2_FEATURE_COMPAT_RESIZE_INO 0x0010 479 479 #define EXT2_FEATURE_COMPAT_DIR_INDEX 0x0020 480 480 -
branches/3.2/mindi-busybox/e2fsprogs/old_e2fsprogs/ext2fs/ext2fs.h
r2725 r3232 384 384 EXT2_FEATURE_COMPAT_IMAGIC_INODES|\ 385 385 EXT3_FEATURE_COMPAT_HAS_JOURNAL|\ 386 EXT2_FEATURE_COMPAT_RESIZE_INO DE|\386 EXT2_FEATURE_COMPAT_RESIZE_INO|\ 387 387 EXT2_FEATURE_COMPAT_DIR_INDEX|\ 388 388 EXT2_FEATURE_COMPAT_EXT_ATTR) -
branches/3.2/mindi-busybox/e2fsprogs/old_e2fsprogs/ext2fs/ext2fs_inline.c
r2725 r3232 156 156 struct ext2_inode *inode) 157 157 { 158 159 158 return inode->i_blocks - 159 (inode->i_file_acl ? fs->blocksize >> 9 : 0); 160 160 } 161 161 -
branches/3.2/mindi-busybox/e2fsprogs/old_e2fsprogs/ext2fs/get_pathname.c
r2725 r3232 16 16 * directory inode, and <ino> is the inode number itself. If 17 17 * <ino> is zero, then ext2fs_get_pathname will return pathname 18 * of the thedirectory <dir>.18 * of the directory <dir>. 19 19 * 20 20 */ -
branches/3.2/mindi-busybox/e2fsprogs/old_e2fsprogs/ext2fs/getsize.c
r2725 r3232 175 175 #ifdef BLKGETSIZE64 176 176 #ifdef __linux__ 177 if ((uname(&ut) == 0) &&178 179 (ut.release[2] < '6') && (ut.release[3] == '.')) )177 uname(&ut); 178 if ((ut.release[0] == '2') && (ut.release[1] == '.') && 179 (ut.release[2] < '6') && (ut.release[3] == '.')) 180 180 valid_blkgetsize64 = 0; 181 181 #endif -
branches/3.2/mindi-busybox/e2fsprogs/old_e2fsprogs/ext2fs/initialize.c
r1765 r3232 285 285 * check the number of reserved group descriptor table blocks 286 286 */ 287 if (super->s_feature_compat & EXT2_FEATURE_COMPAT_RESIZE_INO DE)287 if (super->s_feature_compat & EXT2_FEATURE_COMPAT_RESIZE_INO) 288 288 rsv_gdt = calc_reserved_gdt_blocks(fs); 289 289 else -
branches/3.2/mindi-busybox/e2fsprogs/old_e2fsprogs/lsattr.c
r2725 r3232 94 94 95 95 if (lstat(path, &st) == -1) 96 bb_ perror_msg(path);96 bb_simple_perror_msg(path); 97 97 else { 98 98 if (de->d_name[0] != '.' || (flags & OPT_ALL)) { -
branches/3.2/mindi-busybox/e2fsprogs/old_e2fsprogs/mke2fs.c
r2725 r3232 758 758 if (rsv_gdb > 0) { 759 759 sb_param->s_feature_compat |= 760 EXT2_FEATURE_COMPAT_RESIZE_INO DE;760 EXT2_FEATURE_COMPAT_RESIZE_INO; 761 761 762 762 sb_param->s_reserved_gdt_blocks = rsv_gdb; … … 779 779 static __u32 ok_features[3] = { 780 780 EXT3_FEATURE_COMPAT_HAS_JOURNAL | 781 EXT2_FEATURE_COMPAT_RESIZE_INO DE|781 EXT2_FEATURE_COMPAT_RESIZE_INO | 782 782 EXT2_FEATURE_COMPAT_DIR_INDEX, /* Compat */ 783 783 EXT2_FEATURE_INCOMPAT_FILETYPE| /* Incompat */ … … 1124 1124 * here if it was explicitly disabled. 1125 1125 */ 1126 if ((param.s_feature_compat & EXT2_FEATURE_COMPAT_RESIZE_INO DE) &&1126 if ((param.s_feature_compat & EXT2_FEATURE_COMPAT_RESIZE_INO) && 1127 1127 !(param.s_feature_ro_compat&EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER)) { 1128 1128 bb_error_msg_and_die("reserved online resize blocks not supported " … … 1313 1313 create_bad_block_inode(fs, bb_list); 1314 1314 if (fs->super->s_feature_compat & 1315 EXT2_FEATURE_COMPAT_RESIZE_INO DE) {1315 EXT2_FEATURE_COMPAT_RESIZE_INO) { 1316 1316 retval = ext2fs_create_resize_inode(fs); 1317 1317 mke2fs_error_msg_and_die(retval, "reserve blocks for online resize"); -
branches/3.2/mindi-busybox/e2fsprogs/tune2fs.c
r2725 r3232 9 9 #include "libbb.h" 10 10 #include <linux/fs.h> 11 #include <linux/ext2_fs.h>11 #include "bb_e2fs_defs.h" 12 12 13 13 // storage helpers … … 29 29 30 30 //usage:#define tune2fs_trivial_usage 31 //usage: "[-c M OUNT_CNT] "31 //usage: "[-c MAX_MOUNT_COUNT] " 32 32 ////usage: "[-e errors-behavior] [-g group] " 33 33 //usage: "[-i DAYS] " 34 34 ////usage: "[-j] [-J journal-options] [-l] [-s sparse-flag] " 35 35 ////usage: "[-m reserved-blocks-percent] [-o [^]mount-options[,...]] " 36 ////usage: "[-r reserved-blocks-count] [-u user] [-C mount-count] " 36 ////usage: "[-r reserved-blocks-count] [-u user] " 37 //usage: "[-C MOUNT_COUNT] " 37 38 //usage: "[-L LABEL] " 38 39 ////usage: "[-M last-mounted-dir] [-O [^]feature[,...]] " … … 47 48 OPT_c = 1 << 1, // max mount count 48 49 OPT_i = 1 << 2, // check interval 50 OPT_C = 1 << 3, // current mount count 49 51 }; 50 52 … … 53 55 { 54 56 unsigned opts; 55 const char *label, *str_c, *str_i ;57 const char *label, *str_c, *str_i, *str_C; 56 58 struct ext2_super_block *sb; 57 59 int fd; 58 60 59 61 opt_complementary = "=1"; 60 opts = getopt32(argv, "L:c:i: ", &label, &str_c, &str_i);62 opts = getopt32(argv, "L:c:i:C:", &label, &str_c, &str_i, &str_C); 61 63 if (!opts) 62 64 bb_show_usage(); … … 71 73 // mangle superblock 72 74 //STORE_LE(sb->s_wtime, time(NULL)); - why bother? 75 76 if (opts & OPT_C) { 77 int n = xatoi_range(str_C, 1, 0xfffe); 78 STORE_LE(sb->s_mnt_count, (unsigned)n); 79 } 73 80 74 81 // set the label
Note:
See TracChangeset
for help on using the changeset viewer.