Date: Wed, 10 Apr 2024 17:57:57 +0100 From: Jessica Clarke <jrtc27@freebsd.org> To: Mark Millard <marklmi@yahoo.com> Cc: dev-commits-src-main@freebsd.org, "cperciva@freebsd.org" <cperciva@FreeBSD.org> Subject: Re: git: a1bff97300ab - main - release: Don't reuse disc1/bootonly directories Message-ID: <2AA8E587-7ED4-434B-AE5A-64CB021A55F9@freebsd.org> In-Reply-To: <73727045-7276-465F-9567-32C7A4FDDAE0@yahoo.com> References: <73727045-7276-465F-9567-32C7A4FDDAE0.ref@yahoo.com> <73727045-7276-465F-9567-32C7A4FDDAE0@yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 10 Apr 2024, at 17:48, Mark Millard <marklmi@yahoo.com> wrote:
>
> Jessica Clarke <jrtc27_at_freebsd.org> wrote on
> Date: Wed, 10 Apr 2024 05:18:23 UTC :
>
>> On 10 Apr 2024, at 04:29, Colin Percival <cperciva@FreeBSD.org> wrote:
>>>
>>> . . .
>>>
>>> +disc1-disc1 disc1-memstick: disc1
>>> + mkdir ${.TARGET}
>>> + tar -cf- -C disc1 . | tar -xf- -C ${.TARGET}
>>
>> What’s wrong with cp -a?
>
> A possibility from "man cp":
>
> QUOTE
> Note that cp copies hard linked files as separate files. If you
> need to preserve hard links, consider using tar(1), cpio(1), or
> pax(1) instead.
> END QUOTE
>
> cp should be avoided if there might be hard links involved on the source materials
> that should be preserved in the destination material produced.
Fair enough then.
>> Besides, shouldn’t this use -p if using tar?
>
>
> (I'm not commenting on the above.)
>
>>
>> And -f- is the same as nothing.
>
> "man tar" reports the deafult as /dev/sa0 on FreeBSD:
>
> QUOTE
> -f file, --file file
> Read the archive from or write the archive to the specified file.
> The filename can be - for standard input or standard output. The
> default varies by system; on FreeBSD, the default is /dev/sa0; on
> Linux, the default is /dev/st0.
> END QUOTE
I dug some more, and the documentation is incomplete:
* If TAPE is set in the environment it will use that.
* Otherwise, if _PATH_DEFTAPE (the default documented there) can be
accessed per access(2) it will use that.
* Otherwise it will use stdin/stdout.
Since most people don’t set TAPE, nor do they have a tape device
present, this effectively means that no -f means -f -, but technically
one should not rely on this. So TIL.
Jess
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2AA8E587-7ED4-434B-AE5A-64CB021A55F9>
