Re: ews4800mips ramdisk out of bounds

Izumi Tsutsui <[email protected]>
Newsgroups gmane.os.netbsd.ports.mips.devel
Message-ID <[email protected]>
> we haven't had a full working build in > 2 weeks now, and after fighting
> down various fires/issues there is now one left where I am out of ideas.
> 
> Since the proplib extensions the ews4800mips ramdisk build does not fit
> any more - and I don't see a good / easy way to shrink it.

---
all ===> etc/ews4800mips/floppies/instkernel
mapped netbsd-RAMDISK.tmp
got symbols from netbsd-RAMDISK.tmp
root @ 0x205710/3145728
copying image /home/builds/ab/HEAD/ews4800mips/202006131940Z-obj/home/source/ab/HEAD/src/distrib/ews4800mips/floppies/ramdisk/ramdisk.fs into netbsd-RAMDISK.tmp (3145728 bytes)
done copying image
exiting
rm -f netbsd-RAMDISK.gz
mapped boot-RAMDISK.tmp
got symbols from boot-RAMDISK.tmp
root @ 0x15384/2143232
mipseb--netbsd-mdsetimage: fs image (2151064 bytes) too big for buffer (2143232 bytes)
---

It's not ramdisk.fs embedded to RAMDISK kernel but
compressed RAMDISK kernel embedded into bootloader,
so my recent commits may help.
 https://mail-index.netbsd.org/source-changes/2020/06/14/msg118306.html
 https://mail-index.netbsd.org/source-changes/2020/06/14/msg118308.html

I've also put a log message to clarify:
 https://mail-index.netbsd.org/source-changes/2020/06/14/msg118309.html
---
all ===> instkernel

 :

Creating a bootloader binary with embedded RAMDISK kernel
mapped boot-RAMDISK.tmp
got symbols from boot-RAMDISK.tmp
root @ 0x15384/2143232
copying image netbsd-RAMDISK.gz into boot-RAMDISK.tmp (2142460 bytes)
done copying image
exiting
---

(BTW, build.sh -U -m ews4800mips on my machine doesn't cause error
 but I'm not sure why.)

Is it also worth to print an actual "fs image" filename in
error paths of mdsetimage(8)?

---
Index: mdsetimage.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/mdsetimage/mdsetimage.c,v
retrieving revision 1.24
diff -u -p -d -r1.24 mdsetimage.c
--- mdsetimage.c	18 Dec 2016 18:32:24 -0000	1.24
+++ mdsetimage.c	14 Jun 2020 10:38:06 -0000
@@ -166,10 +166,10 @@ main(int argc, char *argv[])
 		if (fstat(fsfd, &fssb) == -1)
 			err(1, "fstat %s", fsfile);
 		if ((uintmax_t)fssb.st_size != (size_t)fssb.st_size)
-			errx(1, "fs image is too big");
+			errx(1, "fs image %s is too big", fsfile);
 		if (fssb.st_size > md_root_size_value)
-			errx(1, "fs image (%jd bytes) too big for buffer"
-			    " (%u bytes)", (intmax_t) fssb.st_size,
+			errx(1, "fs image %s (%jd bytes) too big for buffer"
+			    " (%u bytes)", fsfile, (intmax_t) fssb.st_size,
 			    md_root_size_value);
 		left_to_copy = fssb.st_size;
 	}

---
Creating a bootloader binary with embedded RAMDISK kernel
mapped boot-RAMDISK.tmp
got symbols from boot-RAMDISK.tmp
root @ 0x15384/2143232
mipseb--netbsd-mdsetimage: fs image netbsd-RAMDISK.gz (5613960 bytes) too big fo
r buffer (2143232 bytes)

*** Failed target:  boot-RAMDISK.gz
---

For proplib, it looks the only user is src/sbin/fsck/partutil.c
(I'm not sure what's "MD_MAY_SWAP_TO" option in sysinst though)
so it might be possible to have pre-proplib (without DIOCGDISKINFO)
version in src/distrib/x_fsck etc.
 https://mail-index.netbsd.org/source-changes/2009/06/05/msg221973.html
 https://mail-index.netbsd.org/source-changes/2009/06/05/msg221973.html

---
Izumi Tsutsui
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.