code: plan9front

Download patch

ref: 00d06ac617f27e7e63f70612698a7ff5dc7a9a1a
parent: 08488fb430c1febae359ac11f95962638e3068fc
author: Arne Meyer <meyer.arne83@netcologne.de>
date: Sat Oct 1 06:15:53 EDT 2022

nusb/disk: fix interactions with libdisk

libdisk openscsi expects that the ctl file, starts with "inquiry".
All other sd drivers do this, so nusb/disk should too.

--- a/sys/src/cmd/nusb/disk/disk.c
+++ b/sys/src/cmd/nusb/disk/disk.c
@@ -155,10 +155,10 @@
 	part = &lun->part[0];
 
 	fmtstrinit(&fmt);
-	fmtprint(&fmt, "dev %s\n", dev->dir);
-	fmtprint(&fmt, "lun %zd\n", lun - &ums->lun[0]);
 	if(lun->flags & Finqok)
 		fmtprint(&fmt, "inquiry %s\n", lun->inq);
+	fmtprint(&fmt, "dev %s\n", dev->dir);
+	fmtprint(&fmt, "lun %zd\n", lun - &ums->lun[0]);
 	if(lun->blocks > 0)
 		fmtprint(&fmt, "geometry %llud %ld\n", lun->blocks, lun->lbsize);
 	for (p = &part[Qdata+1]; p < &part[Qmax]; p++)