1 --- a/block/partitions/Kconfig 2013-10-01 14:29:39.166124545 +0200
2 +++ b/block/partitions/Kconfig 2013-10-01 14:30:10.646126376 +0200
8 + bool "PS3 Partition support"
9 + depends on PARTITION_ADVANCED
11 + Say Y here if you would like to use PS3 hard disks under Linux.
13 config CMDLINE_PARTITION
14 bool "Command line partition support" if PARTITION_ADVANCED
16 --- a/block/partitions/Makefile 2012-09-06 18:41:11.858905657 +0200
17 +++ b/block/partitions/Makefile 2012-09-06 18:56:12.622291395 +0200
19 obj-$(CONFIG_EFI_PARTITION) += efi.o
20 obj-$(CONFIG_KARMA_PARTITION) += karma.o
21 obj-$(CONFIG_SYSV68_PARTITION) += sysv68.o
22 +obj-$(CONFIG_PS3_PARTITION) += ps3.o
23 --- a/block/partitions/check.c 2013-10-01 14:33:08.996136753 +0200
24 +++ b/block/partitions/check.c 2013-10-01 14:32:17.909467114 +0200
32 int warn_no_part = 1; /*This is ugly: should make genhd removable media aware*/
34 #ifdef CONFIG_SYSV68_PARTITION
37 +#ifdef CONFIG_PS3_PARTITION
43 --- /dev/null 2012-09-06 18:32:42.202209340 +0200
44 +++ b/block/partitions/ps3.h 2012-09-06 18:41:52.025574661 +0200
47 + * fs/partitions/ps3.h
50 +int ps3_partition(struct parsed_partitions *state);
51 --- /dev/null 2012-09-06 18:32:42.202209340 +0200
52 +++ b/block/partitions/ps3.c 2012-09-06 20:56:28.612711200 +0200
55 + * fs/partitions/ps3.c
57 + * Copyright (C) 2012 glevand <geoffrey.levand@mail.ru>
63 +#define SECTOR_SIZE 512
64 +#define MAX_ACL_ENTRIES 8
65 +#define MAX_PARTITIONS 8
67 +#define MAGIC1 0x0FACE0FFULL
68 +#define MAGIC2 0xDEADFACEULL
78 + struct p_acl_entry p_acl[MAX_ACL_ENTRIES];
87 + struct d_partition d_partitions[MAX_PARTITIONS];
88 + u8 d_pad[0x600 - MAX_PARTITIONS * sizeof(struct d_partition)- 0x30];
91 +static bool ps3_read_disklabel(struct parsed_partitions *state, struct disklabel *label)
94 + unsigned char *data;
97 + for (i = 0; i < sizeof(struct disklabel) / SECTOR_SIZE; i++) {
98 + data = read_part_sector(state, i, §);
102 + memcpy((unsigned char *) label + i * SECTOR_SIZE, data, SECTOR_SIZE);
104 + put_dev_sector(sect);
110 +int ps3_partition(struct parsed_partitions *state)
112 + struct disklabel *label = NULL;
117 + label = kmalloc(sizeof(struct disklabel), GFP_KERNEL);
121 + if (!ps3_read_disklabel(state, label))
126 + if ((be64_to_cpu(label->d_magic1) != MAGIC1) ||
127 + (be64_to_cpu(label->d_magic2) != MAGIC2))
130 + for (i = 0; i < MAX_PARTITIONS; i++) {
131 + if (label->d_partitions[i].p_start && label->d_partitions[i].p_size) {
132 + put_partition(state, slot,
133 + be64_to_cpu(label->d_partitions[i].p_start),
134 + be64_to_cpu(label->d_partitions[i].p_size));
139 + strlcat(state->pp_buf, "\n", PAGE_SIZE);