git: 9front

Download patch

ref: d9e9775d156a09fcee4c47cac1fbae37480d56b4
parent: 2fea91bc46e867f7db21405c5839823d534ee4a1
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++)
--