summaryrefslogtreecommitdiffstats
path: root/setup_fs.c
diff options
context:
space:
mode:
authorBrian Swetland <swetland@google.com>2010-09-20 17:06:13 -0700
committerBrian Swetland <swetland@google.com>2010-09-20 17:35:50 -0700
commit921f0de3d7680ec242fd56b9fae27f17ed7bf49c (patch)
tree3bb0ae0f3290daf063640b3a070d1de403659a40 /setup_fs.c
parent96323f74bc43a2a85043c030f5f19fff39ee3fc3 (diff)
downloaddevice_samsung_crespo-921f0de3d7680ec242fd56b9fae27f17ed7bf49c.zip
device_samsung_crespo-921f0de3d7680ec242fd56b9fae27f17ed7bf49c.tar.gz
device_samsung_crespo-921f0de3d7680ec242fd56b9fae27f17ed7bf49c.tar.bz2
new GPT world, switch to JI6 bootloader
- require JI6 bootloader and JI4 radio - machine name is now "herring" - filesystems now mounted by name - setup_fs can now deal with name aliases for devices - kernel updated as below: 6ab2f34 S5PC11X: Fix compile error related sd/mmc platdata of herring f149eab S5PC11X: BATTERY: add gpio irq information at max8998 i2c device a8655ff S5PC11X: FIMC: Update fimc driver. 5d2366a S5PC11X: CONFIG: Add CONFIG_INPUT_KEYCHORD for bugreport service f44d575 S5PC11X: renamed board config file. renamed herring config from crespo and added Herring configuration 5fdbe88 S5PC11X: Add Herring configuration in board file Added configuration for Herring board 0f50abd S5PC11X: remove unused machine check code 1251f00 fs: partitions: add partition name to uevent 94dc613 ARM: crespo: defconfig: disable legacy PTYs 5a3d459 EFI/GPT: Register named partitions. cb2a888 Revert "EFI/GPT: Register named partitions." 719e7bc S5PC11X: I2C: Fix compile warnning. 60db07a S5PC11X: VIBRATOR: Add driver for Imagis ISA1000 haptic 4dce0eb ARM: crespo: defconfig: enable EFI/GPT partitions 7257dce fs: partitions: Add support for named partitions cb9d4a5 ARM: crespo: defconfig: enable DEBUG_FS Change-Id: I7be3ed0d2bf94807f40e0a21b322b49458e71e83
Diffstat (limited to 'setup_fs.c')
-rw-r--r--setup_fs.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/setup_fs.c b/setup_fs.c
index 74a6e71..0acf026 100644
--- a/setup_fs.c
+++ b/setup_fs.c
@@ -9,10 +9,23 @@ const char *mkfs = "/system/bin/make_ext4fs";
int setup_fs(const char *blockdev)
{
- char buf[128];
+ char buf[256], path[128];
pid_t child;
- int status;
+ int status, n;
+ /* we might be looking at an indirect reference */
+ n = readlink(blockdev, path, sizeof(path) - 1);
+ if (n > 0) {
+ path[n] = 0;
+ if (!memcmp(path, "/dev/block/", 11))
+ blockdev = path + 11;
+ }
+
+ if (strchr(blockdev,'/')) {
+ fprintf(stderr,"not a block device name: %s\n", blockdev);
+ return 0;
+ }
+
sprintf(buf,"/sys/fs/ext4/%s", blockdev);
if (access(buf, F_OK) == 0) {
fprintf(stderr,"device %s already has a filesystem\n", blockdev);
@@ -44,8 +57,8 @@ int main(int argc, char **argv)
int need_reboot = 0;
while (argc > 1) {
- if (strlen(argv[1]) > 32) continue;
- need_reboot |= setup_fs(argv[1]);
+ if (strlen(argv[1]) < 128)
+ need_reboot |= setup_fs(argv[1]);
argv++;
argc--;
}