burncd code
I'm sure you've all heard about troubles with burncd and audio CDs. I'm one of the people having trouble. I can write data CDs just fine, but when I try to burn an audio disc, it fails, no matter what speed. It simply says "writing -1 of X bytes" and quits. If I try to fixate the disc in the same pass, it gives me an ioctl error. Rather than invest in a SCSI controller and burner, I'm going to get this damn drive working for me. I know the problem is a software one, since if I try to burn the raw audio data as a data disc, it works just fine. Furthermore, I had it working under Linux with SCSI emulation. Hunting through burncd.c, I see that the "audio" or "raw" option defines the integer datablock_type as CDR_DB_RAW in the structure cdr_track in /usr/include/sys/cdrio.h (CDR_DB_RAW is defined there as well). CDR_DB_RAW corresponds with blocks of 2352 blocks of raw data. Clearly this doesn't work. I've found other CDR_DB_RAW defines in cdrio.h, as follows: #define CDR_DB_RAW 0x0 /* 2352 bytes of raw data */ #define CDR_DB_RAW_PQ0x1 /* 2368 bytes raw data + P/Q subchan */ #define CDR_DB_RAW_PW0x2 /* 2448 bytes raw data + P-W subchan */ #define CDR_DB_RAW_PW_R 0x3 /* 2448 bytes raw data + P-W raw sub */ Would any of these make a better selection for the burncd "audio" or "raw" directives? I'm sorry, but I know nothing of the structure of audio CDs. Any help would be greatly appreciated, and I would, of course, submit any patches I make. -- Andrew Hesford [EMAIL PROTECTED] To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Mounting partitions with RO flag
Hello, I have a really stupid question, so please forgive me if the answer is trivial for you... With the appearing of the jail() in 4.0 I think it would be very good to have the functionality of mounting already mounted (RW) filesystems read only to another directory. For example there are several daemons which can run on a read only filesystem, like an anonymous FTP daemon for extra security in a jail. nullfs and unionfs would be suitable for these tasks but they have problems in at least -STABLE, so there are only hacks for doing this, like NFS mounted filesystems and partition "magic" (defining a lot of partitions onto the same physical space). So I am wondering, why the unices block mounting an already mounted partition read only again. Would it be possible to solve this under FreeBSD? Thanks, -- Attila Nagye-mail: [EMAIL PROTECTED] Budapest Polytechnic (BMF.HU) @work: +361 210 1415 (194) H-1084 Budapest, Tavaszmezo u. 15-17. cell.: +3630 306 6758 To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Mounting partitions with RO flag
Attila Nagy writes: > I have a really stupid question, so please forgive me if the answer is > trivial for you... > > With the appearing of the jail() in 4.0 I think it would be very good to > have the functionality of mounting already mounted (RW) filesystems read > only to another directory. > > For example there are several daemons which can run on a read only > filesystem, like an anonymous FTP daemon for extra security in a jail. > > nullfs and unionfs would be suitable for these tasks but they have > problems in at least -STABLE, so there are only hacks for doing this, like > NFS mounted filesystems and partition "magic" (defining a lot of > partitions onto the same physical space). > > So I am wondering, why the unices block mounting an already mounted > partition read only again. > > Would it be possible to solve this under FreeBSD? I am second for it. I am using some partition "magic" and know dark side of it. > -- > Attila Nagye-mail: [EMAIL PROTECTED] > Budapest Polytechnic (BMF.HU) @work: +361 210 1415 (194) > H-1084 Budapest, Tavaszmezo u. 15-17. cell.: +3630 306 6758 -- @BABOLO http://links.ru/ To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Mounting partitions with RO flag
Hello, > > Would it be possible to solve this under FreeBSD? > I am second for it. I hope somebody will enlighten my dark mind, because I am really curious about this :) > I am using some partition "magic" and know dark side of it. What the problem is with it besides the ugly hacking and the small number of possible partitions? -- Attila Nagye-mail: [EMAIL PROTECTED] Budapest Polytechnic (BMF.HU) @work: +361 210 1415 (194) H-1084 Budapest, Tavaszmezo u. 15-17. cell.: +3630 306 6758 To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Mounting partitions with RO flag
Attila Nagy writes: > > > Would it be possible to solve this under FreeBSD? > > I am second for it. > I hope somebody will enlighten my dark mind, because I am really curious > about this :) > > > I am using some partition "magic" and know dark side of it. > What the problem is with it besides the ugly hacking and the small number > of possible partitions? How much partitions do you want? adNs[0..30][a..h] 31*8= 248 if it is low enough, just use vn[0..]s[0..30][a..h] ... with some more dark sides, of cause About dark side: 0garkin~(4)#df Filesystem 1K-blocks UsedAvail Capacity Mounted on ... /dev/ad0s2h7993324 461995 6891864 6%/usr /dev/ad0s3a7993324 441159 6912700 6%/jail/pent/usr There is physically the same fs marked as /dev/ad0s2h and /dev/ad0s3a in this example. The /usr is rw mounted and /jail/pent/usr is ro mounted. Do you see a difference? You can really stuck VM system with ro mount that is really rw mount in another mount. Instances of shared fs do not share buffers - which IS a real point - just allow second mount does not solve a problem IMHO The only way of use this method of fs sharing in production is ro mount of any instance and do not upgrade without all jails stopped. And a lot of memory for files buffers :-( -- @BABOLO http://links.ru/ To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
Re: Mounting partitions with RO flag
On Sun, Apr 08, 2001 at 09:13:15PM +0200, Attila Nagy wrote: > So I am wondering, why the unices block mounting an already mounted > partition read only again. Have you considered using ACLs perhaps? Sure it's not in -STABLE, but it's a thought.. - alex To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message
[PATCH] Automatic string allocation for scanf() family
Perhaps not in the true Unix spirit of fixed-size buffers, I've written a patch to add automatic storage allocation to the scanf() family of functions when dealing with strings. I later found out that GNU had a very similar interface in its glibc scanf() functions and made sure that behavior was similar in an effort to maximize portability. The result is attached. With this patch, something like this is now possible: char *buf; sscanf(string, "%as bar", &buf); or sscanf(string, "%a[^ ]", &buf); (providing string was "foo bar", buf would now contain "foo"). Resulting strings can be freed by free(3). The only difference between my implementation and the one in GNU libc is that glibc will return with an error if one of the stdlib memory allocation functions fails, whereas this will continue to run through the string and simply place a NULL at the address where the resulting string would normally have gone. This could be changed if one were so inclined. If this sort of thing is frowned upon for whatever reason, feel free to ignore this message -- I just thought it may be useful. (By the way, this patch is meant for RELENG_4, not HEAD.) --- /usr/src/lib/libc/stdio/vfscanf.c.orig Sun Apr 8 21:19:16 2001 +++ /usr/src/lib/libc/stdio/vfscanf.c Sun Apr 8 21:19:21 2001 @@ -69,6 +69,7 @@ #defineSUPPRESS0x08/* suppress assignment */ #definePOINTER 0x10/* weird %p pointer (`fake hex') */ #defineNOSKIP 0x20/* do not skip blanks */ +#defineALLOC 0x800 /* allocate space for string assignment */ #defineQUAD0x400 /* @@ -170,6 +171,9 @@ case 'L': flags |= LONGDBL; goto again; + case 'a': + flags |= ALLOC; + goto again; case 'h': flags |= SHORT; goto again; @@ -361,7 +365,7 @@ if (flags & SUPPRESS) { n = 0; while (ccltab[*fp->_p]) { - n++, fp->_r--, fp->_p++; + n++, nread++, fp->_r--, fp->_p++; if (--width == 0) break; if (fp->_r <= 0 && __srefill(fp)) { @@ -373,10 +377,32 @@ if (n == 0) goto match_failure; } else { - p0 = p = va_arg(ap, char *); + if (flags & ALLOC) { + /* +* 64 is optimistic. If malloc fails, +* we'll skip this string as if SUPPRESS +* was set in ``flags." +*/ + n = 64; + p0 = p = (char *)malloc(n); + } else + p0 = p = va_arg(ap, char *); + while (ccltab[*fp->_p]) { fp->_r--; - *p++ = *fp->_p++; + if (p0) + *p++ = *fp->_p; + fp->_p++, nread++; + if (flags & ALLOC && p0 && p == p0 + n){ + size_t p0_off = p - p0; + /* +* Retain the offset of p, and +* reallocate p0. +*/ + n += 64; + p0 = (char *)reallocf(p0, n); + p = p0 + p0_off; + } if (--width == 0) break; if (fp->_r <= 0 && __srefill(fp)) { @@ -385,13 +411,14 @@ break; } } - n = p - p0; - if (n == 0) + if (p == p0) goto match_failure; - *p = 0; + if (p0) + *p = 0; + if (flags & ALLOC) +
Re: Adding a new drive
On 0, Jon Molin <[EMAIL PROTECTED]> wrote: > Wrote FDISK partition information out successfully. > > After that i quit back to config menu, goes into label and there i just do an > 'auto' to see if it works, there i get the following when i write: > Unable to add /dev/ad3s1b as a swap device: Device not configured > and similar errors for the rest of the partitions. Out of curiosity, and because I have this annoying itch in my brain that's telling me I ran into this problem recently: Are the entries for ad3* actually in /dev? I recall having to ./MAKEDEV them for the ad2 and ad3 disks on one of my machines that I added a drive to not more than a couple of weeks ago... Depending on how disklabel works, I could see it returning the "Device not configured" message if the /dev file isn't there... mike PGP signature