aboutsummaryrefslogtreecommitdiffstats
path: root/packages/dreambox
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.ne>2005-09-22 02:49:38 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2005-09-22 02:49:38 +0000
commit5566ef08f6f85cc2fc6445c8f2b7a044488764a0 (patch)
tree1953ba7cf17d4dbb59c79d33d75b0eea06bbe243 /packages/dreambox
parentee85b3cb291c8bcb733fd889c2cdd6ea9c141a41 (diff)
downloadopenembedded-5566ef08f6f85cc2fc6445c8f2b7a044488764a0.tar.gz
dreambox-buildimage: new flash partition layout for dm702x
Diffstat (limited to 'packages/dreambox')
-rw-r--r--packages/dreambox/dreambox-buildimage-native.bb2
-rw-r--r--packages/dreambox/dreambox-buildimage-native/buildimage.c23
2 files changed, 18 insertions, 7 deletions
diff --git a/packages/dreambox/dreambox-buildimage-native.bb b/packages/dreambox/dreambox-buildimage-native.bb
index 230d63dcbf..4fd12b95d9 100644
--- a/packages/dreambox/dreambox-buildimage-native.bb
+++ b/packages/dreambox/dreambox-buildimage-native.bb
@@ -1,6 +1,8 @@
DESCRIPTION = "create Dreambox NAND boot images"
SECTION = "console/utils"
MAINTAINER = "Felix Domke <tmbinc@elitedvb.net>"
+PV = "1.0"
+PR = "r1"
SRC_URI = "file://buildimage.c"
diff --git a/packages/dreambox/dreambox-buildimage-native/buildimage.c b/packages/dreambox/dreambox-buildimage-native/buildimage.c
index 11cd32ba43..c8377dae62 100644
--- a/packages/dreambox/dreambox-buildimage-native/buildimage.c
+++ b/packages/dreambox/dreambox-buildimage-native/buildimage.c
@@ -210,6 +210,9 @@ void emit_file(FILE *src, int size, fnc_encode_ecc * eccfnc)
die("size changed");
}
+ /* reserve to two sectors plus 1% for badblocks, and round down */
+#define BADBLOCK_SAFE(x) ( ((x) - (16384 * 2) - (x) / 100) &~ 16384 )
+
int main(int argc, char **argv)
{
if ((argc != 4) && (argc != 5))
@@ -224,17 +227,23 @@ int main(int argc, char **argv)
file_open(&f_2nd, &size_2nd, argv[1]);
file_open(&f_boot, &size_boot, argv[2]);
file_open(&f_root, &size_root, argv[3]);
+
+ // pre-35 have old layout
+#ifdef OLD_LAYOUT
+ int partition[] = {0x20000, 0x200000, 0x2000000};
+#else
+ int partition[] = {0x40000, 0x400000, 0x2000000};
+#endif
- if (size_2nd > 128 * 1024)
- die("2nd stage max. size is 128k. did you gzip it before?");
- if (size_boot > 2 * 1024 * 1024)
- die("boot is > 2M. You can modify the buildimage tool, but you don't want that.");
- if (size_root > 30 * 1024 * 1024)
- die("root is > 30M. This doesn't work. sorry.");
+ if (size_2nd > BADBLOCK_SAFE(partition[0]))
+ die("2nd stage is too big. did you gzip it before?");
+ if (size_boot > BADBLOCK_SAFE(partition[1] - partition[0]))
+ die("boot is too big. You can modify the buildimage tool, but you don't want that.");
+ if (size_root > BADBLOCK_SAFE(partition[2] - partition[1]))
+ die("root is too big. This doesn't work. sorry.");
int sectors_2nd = TO_SECT(size_2nd), sectors_boot = TO_SECT(size_boot), sectors_root = TO_SECT(size_root);
- int partition[] = {0x20000, 0x200000, 0x2000000};
int num_partitions = 3;
int total_size = 4 + num_partitions * 4 + 4 + sectors_2nd * 528 + 4 + sectors_boot * 528 + 4 + sectors_root * 528;