Results 1 to 6 of 6

Thread: Get rid of the casper eject message upon halt/reboot in persistent LiveUSB mode

  1. #1
    Senior Member orange's Avatar
    Join Date
    Jan 2010
    Posts
    134

    Default Get rid of the casper eject message upon halt/reboot in persistent LiveUSB mode

    Community,

    when running BT4PF in persistent LiveUSB mode, it's (at least from my perspective) rather annoying that casper prompts you to eject the LiveCD and press ENTER upon halt/reboot like
    Please remove the disc and close the tray (if any) then press ENTER:
    Fortunately it's rather easy to get rid of this message and I'd herewith like to share the solution with the community. So, here we go:

    1st Step: Modify the lines 82-96 of /etc/init.d/casper appropriately. The result should look like
    Code:
    #    eject -p -m /cdrom >/dev/null 2>&1
    
        [ "$prompt" ] || return 0
    
        stty sane < /dev/console
    
        # XXX - i18n
    #    echo "Please remove the disc and close the tray (if any) then press ENTER: " > /dev/console
    #    if [ -x /sbin/usplash_write ]; then
    #        /sbin/usplash_write "TIMEOUT 86400"
    #        /sbin/usplash_write "TEXT-URGENT Please remove the disc, close the tray (if any)"
    #        /sbin/usplash_write "TEXT-URGENT and press ENTER to continue"
    #    fi
    
    #    read x < /dev/console
    2nd Step (optional): To prevent the system to replace /etc/init.d/casper while upgrading the deb package "casper" from BT4 repositories, you may introduce a local diversion utilizing dpkg-divert
    Code:
    dpkg-divert /etc/init.d/casper

  2. #2
    Junior Member loop4me's Avatar
    Join Date
    Mar 2008
    Posts
    54

    Default

    or4n9e,

    i was just writing the fast solution i did for annoying "Please remove the disc and close the tray (if any) then press ENTER:" and then i saw EDIT and the your post .Xexe

    well, right after the

    echo "Please remove the disc and close the tray (if any) then press ENTER: " > /dev/console
    if [ -x /sbin/usplash_write ]; then
    /sbin/usplash_write "TIMEOUT 86400"
    /sbin/usplash_write "TEXT-URGENT Please remove the disc, close the tray (if any)"
    /sbin/usplash_write "TEXT-URGENT and press ENTER to continue"
    fi

    i made some changes....somethig like this should do the job

    TMOUT=5 # wait the read command...
    read x < /dev/console
    if [ -z "$x" ]
    then
    exit 0
    fi

    }

    ...plus your's 2nd Step

    Well, anyway...it's good. We are making some progress here It's a small step for a man but a big for persistant users...xexe

    P.S I was just wondering why the casper in installed version has the same lines ...the lines that u edited, but the "press ENTER..." never shows up in installed version?

  3. #3
    Senior Member orange's Avatar
    Join Date
    Jan 2010
    Posts
    134

    Default

    TMOUT=5 # wait the read command...
    read x < /dev/console
    if [ -z "$x" ]
    then
    exit 0
    fi
    That would just timeout the user interaction right? But the output of the message remains untouched. Anyway, it's a matter of choice in the end from my perspective. I'm very comfortable not getting annoyed by the message at all now :-)
    I was just wondering why the casper in installed version has the same lines ...the lines that u edited, but the "press ENTER..." never shows up in installed version?
    The answer is pretty simple: casper is completely disabled in the installed version. This also means that any script (be it the local diversion of apt-check or the eject message thing) sits just there but does nothing at all as the service isn't running and even isn't able to start. Just try "/etc/init.d/casper start" - nothing will happen.

  4. #4
    Junior Member loop4me's Avatar
    Join Date
    Mar 2008
    Posts
    54

    Default

    Right. I was probably drunk when i write the P.S

  5. #5
    Just burned his ISO
    Join Date
    Mar 2009
    Posts
    14

    Default

    Thank you! Yesterday I forgot about this nifty 'feature' and walked away from my laptop after doing a 'poweroff.' I came back to it a few hours later to realize my battery was hosed. This will help!

  6. #6
    Junior Member Goldhedge's Avatar
    Join Date
    Sep 2009
    Posts
    60

    Default

    Thanks for this info or4n9e, it works great. This procedure coupled with the power off button I added to my task bar means one click to shut down and I can walk away. Thanks again. -GH

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •