Your message dated Sat, 04 Jan 2025 21:54:48 +0000
with message-id <[email protected]>
and subject line Bug#983121: fixed in tiny-initramfs 0.1-6
has caused the Debian Bug report #983121,
regarding tiny-initramfs: Add hibernation support to tiny-initramfs
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
983121: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=983121
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: tiny-initramfs
Version: 0.1-5
Severity: wishlist
Tags: patch upstream

Dear Maintainer,

I'd like to use tiny-initramfs because it suits my needs very well, and
makes my computer boot a bit faster and thus makes me feel happier :)

The only issue I found with this nice piece of software is that it
doesn't allow me to resume from hibernation. So I looked into the code
of the tiny-initramfs and it turned out that it is very easy to add this
support.

I've made a patch that adds the support for resuming from hibernation,
and I'm attaching it to the bug report. It would be nice if someone
checked it for errors, since last time I wrote something substantial in
C was years ago. Anyway, it works fine for me (built my own package
with this patch) and it would be nice to help someone else who has the
same problem.

I'm aware that this has no chance to be included in bullseye, but oh
well.

Thanks in advace!


-- System Information:
Debian Release: 10.8
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 4.19.0-14-686 (SMP w/4 CPU cores)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE=C.UTF-8 
(charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages tiny-initramfs depends on:
ii  tiny-initramfs-core  0.1-5

tiny-initramfs recommends no packages.

tiny-initramfs suggests no packages.

-- no debconf information
Description: Make tirfs able to resume from hibernation 
Author: Mikhail Krylov <[email protected]>
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/tiny_initramfs.c
+++ b/tiny_initramfs.c
@@ -64,6 +64,7 @@ static char root_nfsdir[MAX_LINE_LEN];
 static char root_nfsoptions[MAX_LINE_LEN];
 #endif
 static char root_fstype[MAX_FILESYSTEM_TYPE_LEN];
+static char resume_device[MAX_FILESYSTEM_TYPE_LEN];
 static int root_delay;
 static int root_wait_indefinitely;
 static char init_binary[MAX_PATH_LEN];
@@ -112,6 +113,37 @@ int main(int argc, char **argv)
   warn("Parsed ", PROC_CMDLINE_FILENAME, NULL);
 #endif
 
+  if (!strlen(resume_device)){
+
+#ifdef ENABLE_DEBUG
+    warn("No resume device specified");
+#endif
+
+  } else {
+    // We won't need /target on a successful resume
+    r = mount("sysfs", "/target", "sysfs", MS_NODEV | MS_NOEXEC | MS_NOSUID, 
NULL);
+    if (r < 0)
+      panic(errno, "Could not mount /target for hibernation resume", NULL);
+
+#ifdef ENABLE_DEBUG
+    warn("Mounted /target for hibernation resume", NULL);
+#endif
+
+    int fd = open("/target/power/resume", O_WRONLY);
+
+    if (fd < 0) {
+      warn("Couldn't open /target/power/resume", strerror(errno), NULL);
+      // Continue just like nothing happened
+      umount("/target");
+    }
+
+    write(fd, resume_device, strlen(resume_device));
+    close(fd);
+    // If we are still here, that means resume failed, continue booting
+    umount("/target");
+  }
+
+
   if (!strlen(root_device)) {
 #ifdef ENABLE_NFS4
     if (strlen(root_nfshost))
@@ -366,6 +398,11 @@ int parse_cmdline_helper(void *data, const char *line, int 
line_is_incomplete)
       if (strlen(token) > MAX_PATH_LEN - 1)
         panic(0, "Parameter init=", token, " too long", NULL);
       set_buf(init_binary, MAX_PATH_LEN, token, NULL);
+    } else if (!strncmp(token, "resume=", 7)){
+      token += 7;
+      if (strlen(token) > MAX_PATH_LEN - 1)
+        panic(0, "Parameter resume=", token, " too long", NULL);
+      set_buf(resume_device, MAX_PATH_LEN, token, NULL);
     }
 #ifdef ENABLE_NFS4
     else if (!strncmp(token, "nfsroot=", 8)) {

--- End Message ---
--- Begin Message ---
Source: tiny-initramfs
Source-Version: 0.1-6
Done: Andreas Tille <[email protected]>

We believe that the bug you reported is fixed in the latest version of
tiny-initramfs, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Andreas Tille <[email protected]> (supplier of updated tiny-initramfs package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Sat, 04 Jan 2025 21:05:00 +0100
Source: tiny-initramfs
Architecture: source
Version: 0.1-6
Distribution: unstable
Urgency: medium
Maintainer: Christian Seiler <[email protected]>
Changed-By: Andreas Tille <[email protected]>
Closes: 983121 1018290 1063904
Changes:
 tiny-initramfs (0.1-6) unstable; urgency=medium
 .
   * Team upload
 .
   [ Jelmer Vernooij ]
   * Migrate repository from alioth to salsa.
 .
   [ Andreas Tille ]
   * Fix watch file
   * Standards-Version: 4.7.0 (routine-update)
   * debhelper-compat 13 (routine-update)
   * Secure URI in copyright format (routine-update)
   * Rules-Requires-Root: no (routine-update)
   * Change priority extra to priority optional.
   * Remove field Priority on binary package tiny-initramfs that duplicates
     source.
   * Installation to /usr/libexec
   * Add Victor Westerhuis who filed ITS as Uploader
     Closes: #1063904
 .
   [ Victor Westerhuis ]
   * Run hook scripts in /etc/initramfs/post-update.d
     Closes: #1018290
 .
   [ Michael Krylov ]
   * Make tirfs able to resume from hibernation
     Closes: #983121
 .
   [ MichaIng ]
   * Skip initrd generation if not needed by kernel
Checksums-Sha1:
 d05cd369e57726b66592a37229266028f4b0942e 2321 tiny-initramfs_0.1-6.dsc
 7542617995f57aae407ed976939aa7b41dff2d69 93916 tiny-initramfs_0.1.orig.tar.xz
 3673540987e00513c97c134d8a12b6b8305ec7aa 801 tiny-initramfs_0.1.orig.tar.xz.asc
 f1d172392fe7dcf7e56d57c3fd6fb1aa8592ceac 17768 
tiny-initramfs_0.1-6.debian.tar.xz
 8fb75257cadc6065499243fb08c562bc99792438 6737 
tiny-initramfs_0.1-6_amd64.buildinfo
Checksums-Sha256:
 f811c0189fb3b262c4d4a8f5d2f6cd102ad5d590cb600b074e90289dde6d1112 2321 
tiny-initramfs_0.1-6.dsc
 321c34bd492b2328f5bbfb718fe7a0d99b6d1281060bcb794fe33eff737c6452 93916 
tiny-initramfs_0.1.orig.tar.xz
 77840ba0d0a0e50a609097454ab83b3936bc621881cc9e06c6427ac43efb36dc 801 
tiny-initramfs_0.1.orig.tar.xz.asc
 a412c7eebe895d789304f2c212a9472a1b6533c15523e3dac470bc5b6460e0c0 17768 
tiny-initramfs_0.1-6.debian.tar.xz
 9dc16db004d7b46c159c6f9afca4a184bc4a530f6f3bcc4a0836202493a7ffa6 6737 
tiny-initramfs_0.1-6_amd64.buildinfo
Files:
 42f0e9c621843882af01bccfc23d05ac 2321 utils optional tiny-initramfs_0.1-6.dsc
 5bcf9f168332bf97892c2c35ac3aaf9d 93916 utils optional 
tiny-initramfs_0.1.orig.tar.xz
 7c8f5858531d02f895193503b4f8e506 801 utils optional 
tiny-initramfs_0.1.orig.tar.xz.asc
 0a8e8866679f21dae232c0e2ab96dddc 17768 utils optional 
tiny-initramfs_0.1-6.debian.tar.xz
 b2dc97e3e3d152e6c565cbae82b534f8 6737 utils optional 
tiny-initramfs_0.1-6_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQJFBAEBCgAvFiEE8fAHMgoDVUHwpmPKV4oElNHGRtEFAmd5oTMRHHRpbGxlQGRl
Ymlhbi5vcmcACgkQV4oElNHGRtFeYg//TVOwU5gQK9LyfV73VABYgK2KPr6ikNd9
zXiW+fX1BQ0N6wgK+I7x7HoU6pUeCPFTEIN7t8dmE74YowoLRtANKd/8LF+hXFI9
dm8V9CAo1clYDdbGykkJFhFcMr/tCkLzANHwwvi0P5mvhqAVUbUFUIuP5kCOytLm
CSbASxFcVcAJlImFN9nFnIfNnY2YsmLFAJm4WVDm5hCDFbm5cNJUu4P0SF7K/Hnu
QaYLOVQSJlg+POiz6a3tuiRHt5tpDy4+PilnEAEk+QzUeFkqfYkJtPjAX/dv1BhP
LSeN3uX5HCoCPqSuyMW+I9y1iMjf+ai8ajtjmAYdnx2OKVxUyAkEvYO7xPFxBa2F
3imlSQVEdByDAaxiZzf9/7s5Vaw28O33/0ZOJ76HFiecjeU3+Nmnpw0qOULDAWkF
BXShh4C0qGpTvSxtL5O1z+wmjZFwahI5/J2ec3FV7SMoT2h0mcjdo8QjWFdGJFSk
AmNVJjZ8iJu340uZgXtiseAUCzENdka6hCbQANrQ1fIuFzBQgRD+pkqFd9m0nUWT
m0bDk4lQc7ZoYNsCSIpo38DOUm+OCgdLoP5xHDCwsuMKG+1kzAljl2dlt54PXwuB
KHTJ6A4rdLQgw2OcS6C2iqUghYOm0YUhJvj4eHuyc/ITlqO7kSgAgqSTBC4JsJKD
eaawIflsJhA=
=Movs
-----END PGP SIGNATURE-----

Attachment: pgpVwlZH88Sos.pgp
Description: PGP signature


--- End Message ---

Reply via email to