<div dir="ltr"><div>Something got confused with the git comment on that. To generate the test image file run...</div><div><pre>xorriso -as mkisofs -V 'MYISO' -o iso \ <br> --modification-date=1970010212554200 \<br> /dev/null
<br>bzip2 iso<br></pre></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 6 Feb 2023 at 14:53, Eric Molitor <<a href="mailto:emolitor@molitor.org">emolitor@molitor.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Add iso9660 support to blkid. Rather than attach a binary for the test generate the blkid test image file in tests/files/blkid via<br></div><div><br></div>xorriso -as mkisofs -V 'MYISO' -o iso --modification-date=1970010212554200 /dev/null<br><div>bzip2 iso<br></div><div>- Eric<br></div><div>---</div> tests/blkid.test | 3 +++<br> toys/other/blkid.c | 12 +++++++++++-<br> 2 files changed, 14 insertions(+), 1 deletion(-)<br><br>diff --git a/tests/blkid.test b/tests/blkid.test<br>index fd336663..4c385dcb 100755<br>--- a/tests/blkid.test<br>+++ b/tests/blkid.test<br>@@ -28,6 +28,9 @@ testing "ext4" "BLKID ext4" \<br> testing "f2fs" "BLKID f2fs" \<br> 'temp.img: LABEL="myf2fs" UUID="b53d3619-c204-4c0b-8504-36363578491c" TYPE="f2fs"\n' \<br> "" ""<br>+testing "iso" "BLKID iso" \<br>+ 'temp.img: SEC_TYPE="msdos" LABEL="MYISO" UUID="1970-01-02-12-55-42-00" TYPE="iso9660"\n' \<br>+ "" ""<br> testing "msdos" "BLKID msdos" \<br> 'temp.img: SEC_TYPE="msdos" LABEL="mymsdos" UUID="6E1E-0851" TYPE="vfat"\n' \<br> "" ""<br>diff --git a/toys/other/blkid.c b/toys/other/blkid.c<br>index 46c9a3ff..726ae754 100644<br>--- a/toys/other/blkid.c<br>+++ b/toys/other/blkid.c<br>@@ -54,6 +54,7 @@ struct fstype {<br> {"btrfs", 0x4D5F53665248425FULL, 8, 65600, 65803, 256, 65819},<br> {"cramfs", 0x28cd3d45, 4, 0, 0, 16, 48},<br> {"f2fs", 0xF2F52010, 4, 1024, 1132, 512, 0x47c},<br>+ {"iso9660", 0x444301, 3, 0x8000, 0x832d, 32, 0x8028},<br> {"jfs", 0x3153464a, 4, 32768, 32920, 16, 32904},<br> {"nilfs", 0x3434, 2, 1030, 1176, 80, 1192},<br> {"reiserfs", 0x724573496552ULL, 6, 8244, 8276, 16, 8292},<br>@@ -166,7 +167,7 @@ static void do_blkid(int fd, char *name)<br> len = fstypes[i].label_len;<br> if (!FLAG(U) && len) {<br> s = toybuf+fstypes[i].label_off-off;<br>- if (!strcmp(type, "vfat")) {<br>+ if (!strcmp(type, "vfat") || !strcmp(type, "iso9660")) {<br> show_tag("SEC_TYPE", "msdos");<br> while (len && s[len-1]==' ') len--;<br> if (strstart(&s, "NO NAME")) len=0;<br>@@ -198,6 +199,15 @@ static void do_blkid(int fd, char *name)<br> } else if (!strcmp(type, "vfat")) {<br> s += sprintf(s, "%02X%02X-%02X%02X", toybuf[uoff+3], toybuf[uoff+2],<br> toybuf[uoff+1], toybuf[uoff]);<br>+ } else if (!strcmp(type, "iso9660")) {<br>+ s += sprintf(s, "%c%c%c%c-", toybuf[uoff], toybuf[uoff+1],<br>+ toybuf[uoff+2], toybuf[uoff+3]);<br>+ s += sprintf(s, "%c%c-", toybuf[uoff+4], toybuf[uoff+5]);<br>+ s += sprintf(s, "%c%c-", toybuf[uoff+6], toybuf[uoff+7]);<br>+ s += sprintf(s, "%c%c-", toybuf[uoff+8], toybuf[uoff+9]);<br>+ s += sprintf(s, "%c%c-", toybuf[uoff+10], toybuf[uoff+11]);<br>+ s += sprintf(s, "%c%c-", toybuf[uoff+12], toybuf[uoff+13]);<br>+ s += sprintf(s, "%c%c", toybuf[uoff+14], toybuf[uoff+15]);<br> } else {<br> for (j = 0; j < 16; j++)<br> s += sprintf(s, "-%02x"+!(0x550 & (1<<j)), toybuf[uoff+j]);<br>-- <br>2.39.1<br></div>
</blockquote></div>