- sz = (bp->b_bcount+511)/512;
- off = bp->b_blkno % DMMAX;
- if (bp->b_blkno+sz > nswap || off+sz > DMMAX) {
+#ifdef GENERIC
+ /*
+ * A mini-root gets copied into the front of the swap
+ * and we run over top of the swap area just long
+ * enough for us to do a mkfs and restor of the real
+ * root (sure beats rewriting standalone restor).
+ */
+#define MINIROOTSIZE 4096
+ if (rootdev == dumpdev)
+ bp->b_blkno += MINIROOTSIZE;
+#endif
+ sz = howmany(bp->b_bcount, DEV_BSIZE);
+ if (bp->b_blkno+sz > nswap) {