parse_cmdline_option should accept '|'

Help
Fuchs
2014-02-06
2014-03-07
  • Fuchs
    Fuchs
    2014-02-06

    There are many mount points in the append commandline.
    Instead of

    /live/image
    /lib/live/mount/medium #with new debian version
    /home/partimag #with toram=..
    /mnt #with toram=..

    I would like use e.g.
    ocs_postrun7="find / -name spindown.sh -print0 | xargs -0n2 bash"
    But this can not be executed.

    The function 'parse_cmdline_option' could be improved to accept the pipe operator '|'.

     
  • Steven Shiau
    Steven Shiau
    2014-02-06

    Absolutely!
    Updated in git repository.
    Thanks.

    Steven.

     
  • Fuchs
    Fuchs
    2014-02-16

    Many thanks!
    I have tested the new version and seen that's necessary to change anymore.

    xargs -0n2 bash => xargs -n2 -0 bash # because of '[[:alnum:]]' I think
    sort ' 1 ' # the sign "'" should be accepted
    sed 's ..(sd..).* # the signs "(" , ")" should be accepted

    for e.g.
    ocs_prerun4="lsblk|grep ' 1 '|grep ..sd|sort -k4hr|sed 's|..(sd..).*|mount /dev/\1 /mnt|;1p;d'|bash" #USB,maxSize (mount repository)

    I have used clonezilla-live-2.2.2-7-i686-pae.

     
  • Fuchs
    Fuchs
    2014-02-16

    Many thanks!
    I have tested the new version and seen that's necessary to change anymore.

    xargs -0n2 bash => xargs -n2 -0 bash # because of '[[:alnum:]]' I think
    sort ' 1 ' # the sign "'" should be accepted
    sed 's ..(sd..).* # the signs "(" , ")" should be accepted

    for e.g.
    ocs_prerun4="lsblk|grep ' 1 '|grep ..sd|sort -k4hr|sed 's|..(sd..).*|mount /dev/\1 /mnt|;1p;d'|bash" #USB,maxSize (mount repository)

    I have used clonezilla-live-2.2.2-7-i686-pae.

     
  • Fuchs
    Fuchs
    2014-02-16

    A last try without 'javascript.enabled'.

    Many thanks!
    I have tested the new version and seen that's necessary to change anymore.

    "xargs -0n2 bash to xargs -n2 -0 bash # because of '[[:alnum:]]' I think"
    "sort -k4hr to sort -k4 -hr # because of '[[:alnum:]]'"
    "sort ' 1 ' # the sign ' should be accepted"
    "sed 's|..\(sd..\).* # the signs ( ) should be accepted"

    for e.g.
    ocs_prerun4="lsblk|grep ' 1 '|grep ..sd|sort -k4hr|sed 's|..\(sd..\).*|mount /dev/\1 /mnt|;1p;d'|bash" #USB,maxSize (mount repository)

    I have used clonezilla-live-2.2.2-7-i686-pae.

     
  • Fuchs
    Fuchs
    2014-02-21

    Any elucidations additionally:
    In the moment I am using 3 different external drives with different partitions
    with mount settings in the append line simultaneously:
    ocs_prerun4="mount /dev/sdb1 /mnt"
    ocs_prerun5="mount /dev/sdc1 /mnt"
    ocs_prerun6="mount /dev/sdc2 /mnt"
    ocs_prerun7="mount /dev/sdc5 /mnt"
    ocs_prerun8="mount --bind /mnt /home/partimag/"
    That's very fine for me, but not the best one.
    I would like use now
    ocs_prerun4="lsblk|grep ' 1 '|sort -hrk4|grep -w sd[a-z][1-9]|sed 's|..\(sd..\).*|mount /dev/\1 /mnt|;1p;d'|bash"

     
  • Steven Shiau
    Steven Shiau
    2014-02-24

    Yes, sure, It will be added in the next release.
    Thanks for the suggestion.

    Steven.

     
  • Steven Shiau
    Steven Shiau
    2014-02-25

    Please give the latest Clonezilla live a try, i.e.
    Clonezilla live 2.2.2-16 or 20140224-*.
    Please let us know the results.
    Thanks.

    Steven.

     
  • Fuchs
    Fuchs
    2014-02-25

    It's excellently, but my external rotational Hitachi, WD drives give me with lsblk | grep ' 0 ' only . In the moment I try it with udisks --show-info .. | grep RPM .

    Fuchs

    (clonezilla-live-2.2.2-16-i686-pae)

     
  • Fuchs
    Fuchs
    2014-02-26

    Now it works!
    With
    ocs_prerun4="lsblk|grep ^..sd[^a]|sort -rk2|sed '1,2p;d'|sort -rhk4|sed 's|..(sd..).*|mount /dev/\1 /mnt|;1p;d'|bash"
    ocs_prerun5="mount --bind /mnt /home/partimag/"

    for mount of the repository

    and
    ocs_postrun7="find / -name spindown.sh|sed '1p;d'|bash"

    for spindown the external rotary drive.

    Fuchs

    (clonezilla-live-2.2.2-16-i686-pae)

     
  • Fuchs
    Fuchs
    2014-03-01

    An other possibility in the append line now e.g.
    for saving (fullAutomatic spinDown and powerOff)
    with
    ocs_prerun4="lsblk|grep ^..sd[^a]|sort -rhk4|sed 's|..(sd..).*|mount /dev/\1 /mnt|;1p;d'|bash"
    ocs_prerun5="mount --bind /mnt /home/partimag/"
    ocs_postrun7="find / -name spindown.sh|bash"
    ocs_live_run="ocs-sr -q2 -j2 -nogui -z1 -i 2000 -p true saveparts autoname sda1 sda2 sda3"
    locales=en_US.UTF-8 keyboard-layouts=us

    The 'spindown.sh' script is in the attachment.

    Fuchs

    (clonezilla-live-2.2.2-16-i686-pae)

     
    Attachments
  • Steven Shiau
    Steven Shiau
    2014-03-06

    I do not have environment to test your script. Did you know there is still problem to run ocs_prerun4?
    Or?

    Steven.

     
  • Fuchs
    Fuchs
    2014-03-06

    Thanks Steven
    I have overlooked the special meaning of "\" and "\(" ("SourceForge uses markdown syntax" for formatting).
    It should be:
    ocs_prerun4="lsblk|grep ^..sd[^a]|sort -rhk4|sed 's|..\(sd..\).*|mount /dev/\1 /mnt|;1p;d'|bash"

    Any more of the results of tests with USB devices:
    Stick 64 GB vfat sdb1 found sdb1 clz toram= ok
    Hitachi 320 GB vfat sdc1 found sdb1 clz spindown ok
    Hitachi 1+319GB ntfs sdc2 found sdc1 clz spindown:Permission denied
    WD 16+234 GB ntfs sdc2 found sdb1 clz spindown ok

    Fuchs

     
  • Steven Shiau
    Steven Shiau
    2014-03-06

    So did you mean you might have to polish your script for ocs_prerun4? Or the function parse_cmdline_option still can not meet your need?

    Steven.

     
  • Fuchs
    Fuchs
    2014-03-06

    Excellently I can repeat that.
    This version is the best one.
    Right on.

    Fuchs

     
  • Steven Shiau
    Steven Shiau
    2014-03-07

    OK, cool!
    Thanks for your confirmation.

    Steven.