[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#604839: [installation-guide] Planned overhaul of chapter 4.3 "Preparing Files for USB Memory Stick Booting"



On Thu, 28 Oct 2021 at 14:12, Nicholas D Steeves <nsteeves@gmail.com> wrote:
> Holger Wansing <hwansing@mailbox.org> writes:
> > David <bouncingcats@gmail.com> wrote (Sat, 9 Oct 2021 21:56:24 +1100):

> >> I see that the suggestion to use 'cat' comes
> >> from #604839.
> >>
> >> Yes, 'cat' will "work", however I feel there is no
> >> good reason to use 'cat' there.
> >>
> >> Because the purpose of 'cat' is for concatenating
> >> multiple files, and it also requires a shell redirection
> >> from stdout. Both are unnecessary here.
> >>
> >> I suggest this command should be used:
> >> # cp /usr/lib/syslinux/mbr.bin /dev/sdX

> Wow that's a new capability :-)  IIRC cp couldn't historically write
> directly to block devices, and DEST had to be either a target file or
> directory.  It makes me wonder if install(1) has also gained spooky new
> capabilities :-p

> > The documentation in the syslinux package also has
> >
> >       A simple MBR, roughly on par with the one installed by DOS (but
> >       unencumbered), is included in the SYSLINUX distribution.  To install
> >       it under Linux, simply type:
> >
> >       cat mbr.bin > /dev/XXX
> >
> >       ... where /dev/XXX is the device you wish to install it on.
> >
> > so I guess there is some good reason to do it thisSection 4.3.1 way.

Hello again,

I noticed a discussion [1][2][3] today which reports that using 'cp'
for this kind of action is successful with some Gnu version of 'cp'
but not with some version of Busybox.

The person also states that they would not expect 'cp' to succeed ...
'''On a traditional linux system where dev is just a directory in root
and the device files are created using mknod'''.

In my first message to this bug I suggested to use 'cp', but my
suggestion was only motivated by desire to avoid apparent
inconsistency with Section 4.3.1. Which uses the 'cat' command for an
identical purpose, as I mentioned at the time.

So it appears that if Gnu 'cp' is to be used for both situations then
that would work. On the other hand, if a non-Gnu 'cp' might be used,
then perhaps both commands in the Installation Guide should be changed
to 'cat', for consistency.

I do not have a strong opinion, nor interest, nor technical argument.
I just try to provide information which might assist to achieve the
best outcome.

With best regards, David

[1] https://www.reddit.com/r/linux/comments/qzxdg4/psa_dd_for_writing_a_disk_image/hlpz1b6/
[2] https://www.reddit.com/r/linux/comments/qzxdg4/psa_dd_for_writing_a_disk_image/hlq1cdl/
[3] https://www.reddit.com/r/linux/comments/qzxdg4/psa_dd_for_writing_a_disk_image/hlq8ohw/


Reply to: