Page 1 of 1

pfix parameter "nocopy" README is wrong

Posted: Mon Dec 26, 2022 11:47 am
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)
:?:


Re: pfix parameter "nocopy"

Posted: Mon Dec 26, 2022 11:55 am
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.)


Re: pfix parameter "nocopy"

Posted: Mon Dec 26, 2022 12:56 pm
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.


Re: pfix parameter "nocopy" README is wrong

Posted: Mon Dec 26, 2022 1:46 pm
by amethyst

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


Re: pfix parameter "nocopy" README is wrong

Posted: Mon Dec 26, 2022 2:10 pm
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.


Re: pfix parameter "nocopy"

Posted: Mon Dec 26, 2022 2:16 pm
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)


Re: pfix parameters

Posted: Tue Dec 27, 2022 2:04 am
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