pfix parameter "nocopy" README is wrong

Post here if you feel others can duplicate your so discovered "bug"

Moderator: Forum moderators

Post Reply
User avatar
MochiMoppel
Posts: 1139
Joined: Mon Jun 15, 2020 6:25 am
Location: Japan
Has thanked: 18 times
Been thanked: 372 times

pfix parameter "nocopy" README is wrong

Post by MochiMoppel »

Strictly speaking this is not a bug but may be a typo.
It's stated in the otherwise excellent README file within initrd.gz , and it has been there for ages. In fact it is stated in so many other places that I'm starting to wonder if my English comprehension is at fault. It is also included in @rockedge 's Getting Started guidelines.

The explanation for pfix parameters states:

copy: copy .sfs files into ram
nocopy: do not copy .sfs files into ram (default is copy if ram <= 1024 MB).

Shouldn't it be
nocopy: do not copy .sfs files into ram (default is copy if ram > 1024 MB)
or
nocopy: do not copy .sfs files into ram (default if ram<= 1024 MB)
:?:

dimkr
Posts: 2018
Joined: Wed Dec 30, 2020 6:14 pm
Has thanked: 38 times
Been thanked: 926 times

Re: pfix parameter "nocopy"

Post by dimkr »

Both are wrong. Currently, if neither pfix=copy nor pfix=nocopy is specified, the init script checks if the amount of RAM is > 1 GB and >= (the main SFS size plus 1 Mb) x 2.

(https://github.com/puppylinux-woof-CE/woof-CE/pull/3777 is a proposal to change the logic, so a SFS is copied only if all SFSs before it were copied and the ramdisk would have at least 512 MB of free space after the copying.)

User avatar
MochiMoppel
Posts: 1139
Joined: Mon Jun 15, 2020 6:25 am
Location: Japan
Has thanked: 18 times
Been thanked: 372 times

Re: pfix parameter "nocopy"

Post by MochiMoppel »

dimkr wrote: Mon Dec 26, 2022 11:55 am

Both are wrong.

Both what? Assuming that you mean the 2 quoted statements, not my 2 proposals.

Currently, if neither pfix=copy nor pfix=nocopy is specified, the init script checks if the amount of RAM is > 1 GB and >= (the main SFS size plus 1 Mb) x 2.

...and if it is greater it applies COPY2RAM="yes". So at least the current explanation for "nocopy" is wrong. In the init script I now found the comment #do not copy .sfs files into ram (default is copy if enough ram), and this should be OK even for any future versions

As for the "pfix=copy" the explanation seems to be only insufficient because it doesn't mention the conditions attached.

(https://github.com/puppylinux-woof-CE/woof-CE/pull/3777 is a proposal to change the logic, so a SFS is copied only if all SFSs before it were copied and the ramdisk would have at least 512 MB of free space after the copying.)

I wasn't aware that this topic is under discussion in woof-CE. I like the proposal.

User avatar
amethyst
Posts: 2357
Joined: Tue Dec 22, 2020 6:35 am
Has thanked: 55 times
Been thanked: 477 times

Re: pfix parameter "nocopy" README is wrong

Post by amethyst »

In the init I've checked this copying is done with the cp command. Wouldn't rsync be faster?

User avatar
rockedge
Site Admin
Posts: 5847
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2096 times
Been thanked: 2188 times
Contact:

Re: pfix parameter "nocopy" README is wrong

Post by rockedge »

Once this is hammered out straight, let me know what to change in the forum supplied documentation. To insure the information is accurate.

dimkr
Posts: 2018
Joined: Wed Dec 30, 2020 6:14 pm
Has thanked: 38 times
Been thanked: 926 times

Re: pfix parameter "nocopy"

Post by dimkr »

MochiMoppel wrote: Mon Dec 26, 2022 12:56 pm

Both what?

The proposals.

The two quoted lines from README are out of sync with the code.

If I understand the code correctly, the README should say:

nocopy: do not copy .sfs files into ram (default is copy if ram > 1024 MB and ram > the main SFS size*2 + 2Mb.

or:

nocopy: do not copy .sfs files into ram (default if ram<= 1024 MB or ram <= the main SFS size*2 + 2Mb)

User avatar
MochiMoppel
Posts: 1139
Joined: Mon Jun 15, 2020 6:25 am
Location: Japan
Has thanked: 18 times
Been thanked: 372 times

Re: pfix parameters

Post by MochiMoppel »

The "ram" parameter seems very much related. As far as I understand this stuff this may clarify the relationship:

copy:    copy .sfs files into RAM if sufficient RAM is available. This is the default
ram:     same as pfix=copy but do not load ${DISTRO_FILE_PREFIX}save
nocopy:  do not copy .sfs files into RAM

Post Reply

Return to “Bug Reports”