Major rework of the directory structure and the entire build system.
-Erik
diff --git a/util-linux/Makefile b/util-linux/Makefile
new file mode 100644
index 0000000..ddecf50
--- /dev/null
+++ b/util-linux/Makefile
@@ -0,0 +1,48 @@
+# Makefile for busybox
+#
+# Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program 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
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+TOPDIR :=..
+L_TARGET := util-linux.a
+
+obj-y :=
+obj-n :=
+obj- :=
+
+obj-$(CONFIG_DMESG) += dmesg.o
+obj-$(CONFIG_FBSET) += fbset.o
+obj-$(CONFIG_FDFLUSH) += fdflush.o
+obj-$(CONFIG_FREERAMDISK) += freeramdisk.o
+obj-$(CONFIG_FSCK_MINIX) += fsck_minix.o
+obj-$(CONFIG_GETOPT) += getopt.o
+obj-$(CONFIG_MKFS_MINIX) += mkfs_minix.o
+obj-$(CONFIG_MKSWAP) += mkswap.o
+obj-$(CONFIG_MORE) += more.o
+obj-$(CONFIG_MOUNT) += mount.o
+obj-$(CONFIG_NFSMOUNT) += nfsmount.o
+obj-$(CONFIG_PIVOT_ROOT) += pivot_root.o
+obj-$(CONFIG_RDATE) += rdate.o
+obj-$(CONFIG_SWAPONOFF) += swaponoff.o
+obj-$(CONFIG_UMOUNT) += umount.o
+
+# Hand off to toplevel Rules.mak
+include $(TOPDIR)/Rules.mak
+
+clean:
+ rm -f $(L_TARGET) *.o core
+
diff --git a/util-linux/config.in b/util-linux/config.in
new file mode 100644
index 0000000..3eb8ee0
--- /dev/null
+++ b/util-linux/config.in
@@ -0,0 +1,27 @@
+#
+# For a description of the syntax of this configuration file,
+# see scripts/kbuild/config-language.txt.
+#
+
+mainmenu_option next_comment
+comment 'Linux System Utilities'
+
+
+bool 'dmesg' CONFIG_DMESG
+bool 'fbset' CONFIG_FBSET
+bool 'fdflush' CONFIG_FDFLUSH
+bool 'freeramdisk' CONFIG_FREERAMDISK
+bool 'fsck_minix' CONFIG_FSCK_MINIX
+bool 'getopt' CONFIG_GETOPT
+bool 'mkfs_minix' CONFIG_MKFS_MINIX
+bool 'mkswap' CONFIG_MKSWAP
+bool 'more' CONFIG_MORE
+bool 'mount' CONFIG_MOUNT
+bool 'nfsmount' CONFIG_NFSMOUNT
+bool 'pivot_root' CONFIG_PIVOT_ROOT
+bool 'rdate' CONFIG_RDATE
+bool 'swaponoff' CONFIG_SWAPONOFF
+bool 'umount' CONFIG_UMOUNT
+
+endmenu
+
diff --git a/util-linux/fbset.c b/util-linux/fbset.c
index 5ccd80e..2a959c2 100644
--- a/util-linux/fbset.c
+++ b/util-linux/fbset.c
@@ -56,7 +56,7 @@
CMD_INFO = 12,
CMD_CHANGE = 13,
-#ifdef BB_FEATURE_FBSET_FANCY
+#ifdef CONFIG_FEATURE_FBSET_FANCY
CMD_XRES = 100,
CMD_YRES = 101,
CMD_VXRES = 102,
@@ -149,7 +149,7 @@
"-laced", 1, CMD_LACED}, {
"-double", 1, CMD_DOUBLE}, {
"-n", 0, CMD_CHANGE}, {
-#ifdef BB_FEATURE_FBSET_FANCY
+#ifdef CONFIG_FEATURE_FBSET_FANCY
"-all", 0, CMD_ALL}, {
"-xres", 1, CMD_XRES}, {
"-yres", 1, CMD_YRES}, {
@@ -177,7 +177,7 @@
0, 0, 0}
};
-#ifdef BB_FEATURE_FBSET_READMODE
+#ifdef CONFIG_FEATURE_FBSET_READMODE
/* taken from linux/fb.h */
static const int FB_VMODE_INTERLACED = 1; /* interlaced */
static const int FB_VMODE_DOUBLE = 2; /* double scan */
@@ -189,7 +189,7 @@
static int readmode(struct fb_var_screeninfo *base, const char *fn,
const char *mode)
{
-#ifdef BB_FEATURE_FBSET_READMODE
+#ifdef CONFIG_FEATURE_FBSET_READMODE
FILE *f;
char buf[256];
char *p = buf;
@@ -313,7 +313,7 @@
v->vsync_len);
}
printf("\nmode \"%ux%u-%u\"\n", v->xres, v->yres, (int) (vrate + 0.5));
-#ifdef BB_FEATURE_FBSET_FANCY
+#ifdef CONFIG_FEATURE_FBSET_FANCY
printf("\t# D: %.3f MHz, H: %.3f kHz, V: %.3f Hz\n", drate / 1e6,
hrate / 1e3, vrate);
#endif
@@ -377,7 +377,7 @@
case CMD_CHANGE:
g_options |= OPT_CHANGE;
break;
-#ifdef BB_FEATURE_FBSET_FANCY
+#ifdef CONFIG_FEATURE_FBSET_FANCY
case CMD_XRES:
varset.xres = strtoul(argv[1], 0, 0);
break;
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c
index 952968d..dbe4f74 100644
--- a/util-linux/fsck_minix.c
+++ b/util-linux/fsck_minix.c
@@ -191,7 +191,7 @@
#define UPPER(size,n) ((size+((n)-1))/(n))
#define INODE_SIZE (sizeof(struct minix_inode))
-#ifdef BB_FEATURE_MINIX2
+#ifdef CONFIG_FEATURE_MINIX2
#define INODE_SIZE2 (sizeof(struct minix2_inode))
#define INODE_BLOCKS UPPER(INODES, (version2 ? MINIX2_INODES_PER_BLOCK \
: MINIX_INODES_PER_BLOCK))
@@ -232,7 +232,7 @@
#define Super (*(struct minix_super_block *)super_block_buffer)
#define INODES ((unsigned long)Super.s_ninodes)
-#ifdef BB_FEATURE_MINIX2
+#ifdef CONFIG_FEATURE_MINIX2
#define ZONES ((unsigned long)(version2 ? Super.s_zones : Super.s_nzones))
#else
#define ZONES ((unsigned long)(Super.s_nzones))
@@ -252,7 +252,7 @@
static unsigned char *zone_count = NULL;
static void recursive_check(unsigned int ino);
-#ifdef BB_FEATURE_MINIX2
+#ifdef CONFIG_FEATURE_MINIX2
static void recursive_check2(unsigned int ino);
#endif
@@ -408,7 +408,7 @@
return 0;
}
-#ifdef BB_FEATURE_MINIX2
+#ifdef CONFIG_FEATURE_MINIX2
static int check_zone_nr2(unsigned int *nr, int *corrected)
{
if (!*nr)
@@ -515,7 +515,7 @@
return result;
}
-#ifdef BB_FEATURE_MINIX2
+#ifdef CONFIG_FEATURE_MINIX2
static int map_block2(struct minix2_inode *inode, unsigned int blknr)
{
unsigned int ind[BLOCK_SIZE >> 2];
@@ -613,7 +613,7 @@
char blk[BLOCK_SIZE];
int size;
-#ifdef BB_FEATURE_MINIX2
+#ifdef CONFIG_FEATURE_MINIX2
if (version2)
block = Inode2[ROOT_INO].i_zone[0];
else
@@ -644,7 +644,7 @@
namelen = 30;
dirsize = 32;
version2 = 0;
-#ifdef BB_FEATURE_MINIX2
+#ifdef CONFIG_FEATURE_MINIX2
} else if (MAGIC == MINIX2_SUPER_MAGIC) {
namelen = 14;
dirsize = 16;
@@ -742,7 +742,7 @@
return inode;
}
-#ifdef BB_FEATURE_MINIX2
+#ifdef CONFIG_FEATURE_MINIX2
static struct minix2_inode *get_inode2(unsigned int nr)
{
struct minix2_inode *inode;
@@ -798,7 +798,7 @@
die("root inode isn't a directory");
}
-#ifdef BB_FEATURE_MINIX2
+#ifdef CONFIG_FEATURE_MINIX2
static void check_root2(void)
{
struct minix2_inode *inode = Inode2 + ROOT_INO;
@@ -841,7 +841,7 @@
return block;
}
-#ifdef BB_FEATURE_MINIX2
+#ifdef CONFIG_FEATURE_MINIX2
static int add_zone2(unsigned int *znr, int *corrected)
{
int result;
@@ -892,7 +892,7 @@
write_block(block, blk);
}
-#ifdef BB_FEATURE_MINIX2
+#ifdef CONFIG_FEATURE_MINIX2
static void add_zone_ind2(unsigned int *znr, int *corrected)
{
static char blk[BLOCK_SIZE];
@@ -926,7 +926,7 @@
write_block(block, blk);
}
-#ifdef BB_FEATURE_MINIX2
+#ifdef CONFIG_FEATURE_MINIX2
static void add_zone_dind2(unsigned int *znr, int *corrected)
{
static char blk[BLOCK_SIZE];
@@ -977,7 +977,7 @@
add_zone_dind(8 + inode->i_zone, &changed);
}
-#ifdef BB_FEATURE_MINIX2
+#ifdef CONFIG_FEATURE_MINIX2
static void check_zones2(unsigned int i)
{
struct minix2_inode *inode;
@@ -1062,7 +1062,7 @@
return;
}
-#ifdef BB_FEATURE_MINIX2
+#ifdef CONFIG_FEATURE_MINIX2
static void check_file2(struct minix2_inode *dir, unsigned int offset)
{
static char blk[BLOCK_SIZE];
@@ -1143,7 +1143,7 @@
check_file(dir, offset);
}
-#ifdef BB_FEATURE_MINIX2
+#ifdef CONFIG_FEATURE_MINIX2
static void recursive_check2(unsigned int ino)
{
struct minix2_inode *dir;
@@ -1221,7 +1221,7 @@
}
}
-#ifdef BB_FEATURE_MINIX2
+#ifdef CONFIG_FEATURE_MINIX2
static void check_counts2(void)
{
int i;
@@ -1283,7 +1283,7 @@
check_counts();
}
-#ifdef BB_FEATURE_MINIX2
+#ifdef CONFIG_FEATURE_MINIX2
static void check2(void)
{
memset(inode_count, 0, (INODES + 1) * sizeof(*inode_count));
@@ -1305,7 +1305,7 @@
name_list[i] = xmalloc(sizeof(char) * BUFSIZ + 1);
}
-#ifdef BB_FEATURE_CLEAN_UP
+#ifdef CONFIG_FEATURE_CLEAN_UP
/* execute this atexit() to deallocate name_list[] */
/* piptigger was here */
static void free_name_list(void)
@@ -1330,7 +1330,7 @@
int retcode = 0;
alloc_name_list();
-#ifdef BB_FEATURE_CLEAN_UP
+#ifdef CONFIG_FEATURE_CLEAN_UP
/* Don't bother to free memory. Exit does
* that automagically, so we can save a few bytes */
atexit(free_name_list);
@@ -1338,7 +1338,7 @@
if (INODE_SIZE * MINIX_INODES_PER_BLOCK != BLOCK_SIZE)
die("bad inode size");
-#ifdef BB_FEATURE_MINIX2
+#ifdef CONFIG_FEATURE_MINIX2
if (INODE_SIZE2 * MINIX2_INODES_PER_BLOCK != BLOCK_SIZE)
die("bad v2 inode size");
#endif
@@ -1422,7 +1422,7 @@
tcsetattr(0, TCSANOW, &tmp);
termios_set = 1;
}
-#ifdef BB_FEATURE_MINIX2
+#ifdef CONFIG_FEATURE_MINIX2
if (version2) {
check_root2();
check2();
diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c
index ccc0e85..a388d0a 100644
--- a/util-linux/mkfs_minix.c
+++ b/util-linux/mkfs_minix.c
@@ -180,7 +180,7 @@
#define UPPER(size,n) (((size)+((n)-1))/(n))
#define INODE_SIZE (sizeof(struct minix_inode))
-#ifdef BB_FEATURE_MINIX2
+#ifdef CONFIG_FEATURE_MINIX2
#define INODE_SIZE2 (sizeof(struct minix2_inode))
#define INODE_BLOCKS UPPER(INODES, (version2 ? MINIX2_INODES_PER_BLOCK \
: MINIX_INODES_PER_BLOCK))
@@ -208,7 +208,7 @@
static char *inode_buffer = NULL;
#define Inode (((struct minix_inode *) inode_buffer)-1)
-#ifdef BB_FEATURE_MINIX2
+#ifdef CONFIG_FEATURE_MINIX2
#define Inode2 (((struct minix2_inode *) inode_buffer)-1)
#endif
static char super_block_buffer[BLOCK_SIZE];
@@ -216,7 +216,7 @@
#define Super (*(struct minix_super_block *)super_block_buffer)
#define INODES ((unsigned long)Super.s_ninodes)
-#ifdef BB_FEATURE_MINIX2
+#ifdef CONFIG_FEATURE_MINIX2
#define ZONES ((unsigned long)(version2 ? Super.s_zones : Super.s_nzones))
#else
#define ZONES ((unsigned long)(Super.s_nzones))
@@ -436,7 +436,7 @@
write_block(dind, (char *) dind_block);
}
-#ifdef BB_FEATURE_MINIX2
+#ifdef CONFIG_FEATURE_MINIX2
static void make_bad_inode2(void)
{
struct minix2_inode *inode = &Inode2[MINIX_BAD_INO];
@@ -509,7 +509,7 @@
write_block(inode->i_zone[0], root_block);
}
-#ifdef BB_FEATURE_MINIX2
+#ifdef CONFIG_FEATURE_MINIX2
static void make_root_inode2(void)
{
struct minix2_inode *inode = &Inode2[MINIX_ROOT_INO];
@@ -550,7 +550,7 @@
else
inodes = req_nr_inodes;
/* Round up inode count to fill block size */
-#ifdef BB_FEATURE_MINIX2
+#ifdef CONFIG_FEATURE_MINIX2
if (version2)
inodes = ((inodes + MINIX2_INODES_PER_BLOCK - 1) &
~(MINIX2_INODES_PER_BLOCK - 1));
@@ -699,7 +699,7 @@
if (INODE_SIZE * MINIX_INODES_PER_BLOCK != BLOCK_SIZE)
error_msg_and_die("bad inode size");
-#ifdef BB_FEATURE_MINIX2
+#ifdef CONFIG_FEATURE_MINIX2
if (INODE_SIZE2 * MINIX2_INODES_PER_BLOCK != BLOCK_SIZE)
error_msg_and_die("bad inode size");
#endif
@@ -764,7 +764,7 @@
break;
}
case 'v':
-#ifdef BB_FEATURE_MINIX2
+#ifdef CONFIG_FEATURE_MINIX2
version2 = 1;
#else
error_msg("%s: not compiled with minix v2 support",
@@ -796,7 +796,7 @@
if (!device_name || BLOCKS < 10) {
show_usage();
}
-#ifdef BB_FEATURE_MINIX2
+#ifdef CONFIG_FEATURE_MINIX2
if (version2) {
if (namelen == 14)
magic = MINIX2_SUPER_MAGIC;
@@ -830,7 +830,7 @@
check_blocks();
else if (listfile)
get_list_blocks(listfile);
-#ifdef BB_FEATURE_MINIX2
+#ifdef CONFIG_FEATURE_MINIX2
if (version2) {
make_root_inode2();
make_bad_inode2();
diff --git a/util-linux/more.c b/util-linux/more.c
index 780cddf..5fe1da4 100644
--- a/util-linux/more.c
+++ b/util-linux/more.c
@@ -37,7 +37,7 @@
static FILE *cin;
-#ifdef BB_FEATURE_USE_TERMIOS
+#ifdef CONFIG_FEATURE_USE_TERMIOS
#include <termios.h>
#define setTermSettings(fd,argp) tcsetattr(fd,TCSANOW,argp)
#define getTermSettings(fd,argp) tcgetattr(fd, argp);
@@ -54,7 +54,7 @@
putchar('\n');
exit(EXIT_FAILURE);
}
-#endif /* BB_FEATURE_USE_TERMIOS */
+#endif /* CONFIG_FEATURE_USE_TERMIOS */
static int terminal_width = 79; /* not 80 in case terminal has linefold bug */
@@ -69,7 +69,7 @@
FILE *file;
int len, page_height;
-#if defined BB_FEATURE_AUTOWIDTH && defined BB_FEATURE_USE_TERMIOS
+#if defined CONFIG_FEATURE_AUTOWIDTH && defined CONFIG_FEATURE_USE_TERMIOS
struct winsize win = { 0, 0, 0, 0 };
#endif
@@ -83,7 +83,7 @@
if (!cin)
cin = xfopen(CONSOLE_DEV, "r");
please_display_more_prompt = 0;
-#ifdef BB_FEATURE_USE_TERMIOS
+#ifdef CONFIG_FEATURE_USE_TERMIOS
getTermSettings(fileno(cin), &initial_settings);
new_settings = initial_settings;
new_settings.c_lflag &= ~ICANON;
@@ -114,7 +114,7 @@
if(please_display_more_prompt>0)
please_display_more_prompt = 0;
-#if defined BB_FEATURE_AUTOWIDTH && defined BB_FEATURE_USE_TERMIOS
+#if defined CONFIG_FEATURE_AUTOWIDTH && defined CONFIG_FEATURE_USE_TERMIOS
ioctl(fileno(stdout), TIOCGWINSZ, &win);
if (win.ws_row > 4)
terminal_height = win.ws_row - 2;
@@ -147,7 +147,7 @@
* to get input from the user.
*/
input = getc(cin);
-#ifndef BB_FEATURE_USE_TERMIOS
+#ifndef CONFIG_FEATURE_USE_TERMIOS
printf("\033[A"); /* up cursor */
#endif
/* Erase the "More" message */
diff --git a/util-linux/mount.c b/util-linux/mount.c
index af57a76..bfa9a30 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -52,7 +52,7 @@
#include <mntent.h>
#include <ctype.h>
#include "busybox.h"
-#if defined BB_FEATURE_USE_DEVPS_PATCH
+#if defined CONFIG_FEATURE_USE_DEVPS_PATCH
# include <linux/devmtab.h> /* For Erik's nifty devmtab device driver */
#endif
@@ -74,7 +74,7 @@
};
-#if defined BB_FEATURE_MOUNT_LOOP
+#if defined CONFIG_FEATURE_MOUNT_LOOP
#include <fcntl.h>
#include <sys/ioctl.h>
static int use_loop = FALSE;
@@ -123,13 +123,13 @@
char *mtab_opts, int mount_all)
{
int status = 0;
-#if defined BB_FEATURE_MOUNT_LOOP
+#if defined CONFIG_FEATURE_MOUNT_LOOP
char *lofile = NULL;
#endif
if (fakeIt == FALSE)
{
-#if defined BB_FEATURE_MOUNT_LOOP
+#if defined CONFIG_FEATURE_MOUNT_LOOP
if (use_loop==TRUE) {
int loro = flags & MS_RDONLY;
@@ -162,7 +162,7 @@
/* If the mount was sucessful, do anything needed, then return TRUE */
if (status == 0 || fakeIt==TRUE) {
-#if defined BB_FEATURE_MTAB_SUPPORT
+#if defined CONFIG_FEATURE_MTAB_SUPPORT
if (useMtab == TRUE) {
erase_mtab(specialfile); // Clean any stale entries
write_mtab(specialfile, dir, filesystemtype, flags, mtab_opts);
@@ -172,7 +172,7 @@
}
/* Bummer. mount failed. Clean up */
-#if defined BB_FEATURE_MOUNT_LOOP
+#if defined CONFIG_FEATURE_MOUNT_LOOP
if (lofile != NULL) {
del_loop(specialfile);
}
@@ -209,7 +209,7 @@
}
f++;
}
-#if defined BB_FEATURE_MOUNT_LOOP
+#if defined CONFIG_FEATURE_MOUNT_LOOP
if (gotone == FALSE && !strcasecmp("loop", options)) { /* loop device support */
use_loop = TRUE;
gotone = TRUE;
@@ -240,7 +240,7 @@
{
int status = 0;
-#if defined BB_FEATURE_USE_DEVPS_PATCH
+#if defined CONFIG_FEATURE_USE_DEVPS_PATCH
if (strcmp(filesystemType, "auto") == 0) {
static const char *noauto_array[] = { "tmpfs", "shm", "proc", "ramfs", "devpts", "devfs", "usbdevfs", 0 };
const char **noauto_fstype;
@@ -310,7 +310,7 @@
void show_mounts(void)
{
-#if defined BB_FEATURE_USE_DEVPS_PATCH
+#if defined CONFIG_FEATURE_USE_DEVPS_PATCH
int fd, i, numfilesystems;
char device[] = "/dev/mtab";
struct k_mntent *mntentlist;
@@ -337,7 +337,7 @@
mntentlist[i].mnt_opts, mntentlist[i].mnt_freq,
mntentlist[i].mnt_passno);
}
-#ifdef BB_FEATURE_CLEAN_UP
+#ifdef CONFIG_FEATURE_CLEAN_UP
/* Don't bother to close files or free memory. Exit
* does that automagically, so we can save a few bytes */
free( mntentlist);
@@ -357,7 +357,7 @@
}
printf("%s on %s type %s (%s)\n", blockDevice, m->mnt_dir,
m->mnt_type, m->mnt_opts);
-#ifdef BB_FEATURE_CLEAN_UP
+#ifdef CONFIG_FEATURE_CLEAN_UP
if(blockDevice != m->mnt_fsname)
free(blockDevice);
#endif
@@ -408,7 +408,7 @@
case 'f':
fakeIt = TRUE;
break;
-#ifdef BB_FEATURE_MTAB_SUPPORT
+#ifdef CONFIG_FEATURE_MTAB_SUPPORT
case 'n':
useMtab = FALSE;
break;
@@ -467,7 +467,7 @@
singlemount:
string_flags = strdup(string_flags);
rc = EXIT_SUCCESS;
-#ifdef BB_NFSMOUNT
+#ifdef CONFIG_NFSMOUNT
if (strchr(device, ':') != NULL)
filesystemType = "nfs";
if (strcmp(filesystemType, "nfs") == 0) {
diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c
index d9eb5ba..6cc736a 100644
--- a/util-linux/swaponoff.c
+++ b/util-linux/swaponoff.c
@@ -2,9 +2,8 @@
/*
* Mini swapon/swapoff implementation for busybox
*
- *
- * Copyright (C) 1999,2000,2001 by Lineo, inc.
- * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
+ * Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen
+ * Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/util-linux/umount.c b/util-linux/umount.c
index 74638d2..99db308 100644
--- a/util-linux/umount.c
+++ b/util-linux/umount.c
@@ -2,9 +2,8 @@
/*
* Mini umount implementation for busybox
*
- *
- * Copyright (C) 1999,2000,2001 by Lineo, inc.
- * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
+ * Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen
+ * Copyright (C) 1999,2000,2001 by Erik Andersen <andersee@debian.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -57,13 +56,13 @@
-#if defined BB_FEATURE_MOUNT_FORCE
+#if defined CONFIG_FEATURE_MOUNT_FORCE
static int doForce = FALSE;
#endif
-#if defined BB_FEATURE_MOUNT_LOOP
+#if defined CONFIG_FEATURE_MOUNT_LOOP
static int freeLoop = TRUE;
#endif
-#if defined BB_FEATURE_MTAB_SUPPORT
+#if defined CONFIG_FEATURE_MTAB_SUPPORT
static int useMtab = TRUE;
#endif
static int umountAll = FALSE;
@@ -112,7 +111,7 @@
if (which == MTAB_GETMOUNTPT) {
return cur->mountpt;
} else {
-#if !defined BB_FEATURE_MTAB_SUPPORT
+#if !defined CONFIG_FEATURE_MTAB_SUPPORT
if (strcmp(cur->device, "/dev/root") == 0) {
/* Adjusts device to be the real root device,
* or leaves device alone if it can't find it */
@@ -151,7 +150,7 @@
/* Don't bother to clean up, since exit() does that
* automagically, so we can save a few bytes */
-#ifdef BB_FEATURE_CLEAN_UP
+#ifdef CONFIG_FEATURE_CLEAN_UP
static void mtab_free(void)
{
struct _mtab_entry_t *this, *next;
@@ -179,12 +178,12 @@
status = umount(name);
-#if defined BB_FEATURE_MOUNT_LOOP
+#if defined CONFIG_FEATURE_MOUNT_LOOP
if (freeLoop == TRUE && blockDevice != NULL && !strncmp("/dev/loop", blockDevice, 9))
/* this was a loop device, delete it */
del_loop(blockDevice);
#endif
-#if defined BB_FEATURE_MOUNT_FORCE
+#if defined CONFIG_FEATURE_MOUNT_FORCE
if (status != 0 && doForce == TRUE) {
status = umount2(blockDevice, MNT_FORCE);
if (status != 0) {
@@ -202,7 +201,7 @@
}
}
if (status == 0) {
-#if defined BB_FEATURE_MTAB_SUPPORT
+#if defined CONFIG_FEATURE_MTAB_SUPPORT
if (useMtab == TRUE)
erase_mtab(name);
#endif
@@ -246,7 +245,7 @@
if (argc < 2) {
show_usage();
}
-#ifdef BB_FEATURE_CLEAN_UP
+#ifdef CONFIG_FEATURE_CLEAN_UP
atexit(mtab_free);
#endif
@@ -257,17 +256,17 @@
case 'a':
umountAll = TRUE;
break;
-#if defined BB_FEATURE_MOUNT_LOOP
+#if defined CONFIG_FEATURE_MOUNT_LOOP
case 'l':
freeLoop = FALSE;
break;
#endif
-#ifdef BB_FEATURE_MTAB_SUPPORT
+#ifdef CONFIG_FEATURE_MTAB_SUPPORT
case 'n':
useMtab = FALSE;
break;
#endif
-#ifdef BB_FEATURE_MOUNT_FORCE
+#ifdef CONFIG_FEATURE_MOUNT_FORCE
case 'f':
doForce = TRUE;
break;