Suggestion: see if we can get Hibernate to work and back on the menu

Forum Forums antiX-development Development Suggestion: see if we can get Hibernate to work and back on the menu

  • This topic has 9 replies, 5 voices, and was last updated Apr 4-7:30 am by sleekmason.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #8185
    Member
    AvatarBobC

    Hibernating uses no power at all, and most of my machines are old, so battery is a concern when travelling.

    I found the problem with the Hibernate code and have it fixed on mine, but everytime the desktop-session-antix package gets changed I need to reimplement it, so its gotten to where I’ve given up fixing it and just run “sudo acpitool -S” from a terminal to hibernate because the other components I needed are all still in place, ie fstab, grub.cfg, and the resume file, IIRC.

    I was able to fix the part of the desktop code that was broken. Would it help if I provided the code?

    But I couldn’t figure out where the code to tell it the the location to save or resume from was, and so I hand typed that part in and have no idea where that is to be able to fix it so the install (guessing GUI and CLI, unless the GUI setup calls the CLI routine) would set it up initially.

    Also, the Skylake bug did cause it to not work unless I use the right kernel and right boot option sting on the machine with the Skylake CPU and Optimus graphics, but that’s not an AntiX problem, as I see it.

    I plan to do a clean 17.1 install. If I do that, do you want me to post the changes needed?

    #8186
    Member
    linuxdaddylinuxdaddy

    Hi BobC,
    I have several older machines that would really help on, but I didn’t know coding at all to fix
    it. It would really help if you post the changes/steps needed in a small tutorial under tips&tricks.

    Normal == 🙂
    depends on the surrounding crowd ?!

    #8188
    Member
    Avatarskidoo

    BobC explained the steps in post #4278 here ——-v
    https://www.antixforum.com/forums/topic/hibernate-is-missing-from-the-logout-menu/

    I was able to fix the part of the desktop code that was broken. Would it help if I provided the code?
    If the forum chokes (spamblock) when you attempt to post the code, post it to pastebin.com then embed a link in your post.

    #8191
    Member
    AvatarBobC

    I think the right thing to do is to fix it so everyone that has a computer that is able to do hibernation can use it.

    I really think it was just a one character typo that caused it in the first place, causing a bunch of code change to disable it, is all.

    I will do it again and post it so someone can run a diff on it to see what I did.

    PS: linuxdaddy, I don’t think you can just run the command to hibernate and then expect to be able to power back up and resume unless grub, fstab and the resume file are all setup correctly. I know how to do those setups by hand from trial and error, but don’t know how to get the system to do it. I do think that at one point a release or 2 or 3 back that those things were there and worked, so I’m hoping it would just be a question of turning them back on, but not familiar at all with that code.

    • This reply was modified 2 years, 4 months ago by BobC.
    #8570
    Member
    AvatarBobC

    I got my Dell XPS 15 able to boot 17.1 now. The problem was the flashdrive was incorrect, and an MD5 checksum found it for me.

    I reinstalled Antix-17.1_x64-Full and will now see if I can get it to suspend and wake up, and hibernate and resume, manually, and then from the menus.

    BTW, this is the machine with the Skylake processor and dual intel/nvidia graphics that has always had trouble waking up or resuming, so its pretty much a worst case scenario.

    PS: Ok, if I add the kernel to Linux 4.9.0-6-amd64 via synaptic, add my skylake boot cheat codes below and update-grub, then reboot using that kernel

    i915_preliminary_hw_support=1 acpi_osi=! acpi_osi=Windows

    I can suspend and resume
    I can hibernate with pm-hibernate from a terminal as root, and when it starts to boot, select that same kernel again, and it resumes also.

    What this tells us is that the pm-hibernate must setup the resume in the grub.cfg, resume file and fstab, because I didn’t set any of them up, yet it worked.

    So now I know that hibernate/resume works manually when working with a normal hard drive install setup. Next will be to fix the hibernate bug and undo the menu changes that removed Hibernation from the menus.

    I will now also remove the other kernels that have trouble so that the default one is the one that works.

    • This reply was modified 2 years, 4 months ago by BobC.
    #8574
    Member
    AvatarBobC

    I have changed 2 programs, and renamed them in my attachments to folder_subfolder_filename.rtf

    They need to be owned by root and executable looking like this in their folders if you ran an ls -l looking for them

    /usr/local/bin
    -rwxr-xr-x 1 root root 1510 Mar 31 22:26 desktop-session-exit

    /usr/local/lib/desktop-session
    -rwxr-xr-x 1 root root 3307 Mar 31 23:21 desktop-session-exit.py

    Don’t install till I confirm that I have tested them ok. Note that I tested them on an installed system, not a live usb, and did not test with any persistence

    It did work without any troubles, same as on 17 on the old HP. This particular machine has 16 gb of memory, so there was about a 30 second delay while shutting down for it to save from memory to disk (I think it saves it to the swap drive), and another 30 seconds or so resuming to restore from disk to memory, so be patient with it if you have lots of memory.

    I do have a github account, but have never uploaded or changed anything there, in case that’s easier than dealing with my .rtf hack. PS:note that the website would not allow .py.rtf, so I made that _py.rtf to get by the censors. The code changes are very small, but prevented it from working, which I’m sure caused complaints because the system would not have hibernated.

    • This reply was modified 2 years, 4 months ago by BobC.
    • This reply was modified 2 years, 4 months ago by BobC.
    #8614
    Member
    capreacaprea

    BobC, I tried your desktop-session-exit changes on my lenovo T60.
    Both, the hybernate and resume and stanby to ram are working here perfectly.
    Thanks for your investigations and spending time.

    • This reply was modified 2 years, 4 months ago by caprea.
    #8633
    Member
    AvatarBobC

    Thanks for testing it. I got it working on 3 machines here.

    I even got the pm-suspend-hybrid working on an old Dell, but it didn’t work on the others, so I didn’t include the code changes for that.

    #8700
    Member
    AvatarBobC

    Linixdaddy was asking some questions about his setup, ie would it work under sid vs stretch, and so maybe others would be interested in the same thing. I would say look for yourself before you make changes and make backup copies of anything you change for sure, and be real careful what you change. In this case I don’t think that would be a problem, but better to look and know how to look.

    I would suggest running a diff program to compare your existing files to the new ones I posted to verify that my hibernate changes are the only differences, and if so, then make backup copies of the 2 files (i rename originals to .orig) and then implement my versions. Bear in mind I don’t normally program on lixux till lately, so maybe I therefore am guessing how to do things and don’t know to do things in a linux way unless someone tells me.

    I just fixed the bug that got the devs to remove the hibernate option, and changed the menu to add the hibernate back, and then re-enabled it on the menu. I made no changes to what pm-hibernate actually does when its called.

    I was running as root because I couldn’t replace the commands without root authority. Here is what running diff on the 2 files looked like:

    
    # diff desktop-session-exit desktop-session-exit.orig
    3,4d2
    < echo "$1 Your option"
    < sleep 10
    11,12c9
    <     echo "-h | --help       Help";
    <     echo "-H | --hibernate  Set the machine into hibernate";
    ---
    >     echo "-h | --hibernate  Set the machine into hibernate";
    26c23
    < -h|--help)
    ---
    > h|--help)
    29,31c26,28
    < -H|--hibernate)
    <     sudo pm-hibernate
    <     ;;
    ---
    > #-H|--hibernate)
    > #    sudo pm-hibernate
    > #    ;;
    root@hpdv9917d:/usr/local/bin
    
    root@hpdv9917d:/usr/local/lib/desktop-session
    # diff desktop-session-exit.py desktop-session-exit.py.orig
    79c79
    <         self.build_button(ICONS+"/hibernate.svg","Hibernate","desktop-session-exit -H","right")
    ---
    >
    root@hpdv9917d:/usr/local/lib/desktop-session
    #
    
    • This reply was modified 2 years, 4 months ago by BobC.
    • This reply was modified 2 years, 4 months ago by BobC.
    #8719
    Member
    sleekmasonsleekmason

    Working here as well on 2009 studio 1737

    -Changed /etc/default/grub

    -Had swap already so no need to change fstab for me

    -added file in etc.

    -added files to /usr/local/bin and /usr/local/lib and made executable

    -updated grub and initramfs

    put an option in my fluxbox menu — [exec] (Suspend) {sudo pm-suspend}

    Excellent! Thank you for taking the time to get this going! Both suspend and hibernate work here, but no suspend-hybrid. eh..sokay

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.