Bug#945497: initramfs-tools: Resume function does not check for swap file

2019-11-25 Thread Keven L. Ates
Package: initramfs-tools
Version: 0.133ubuntu10
Severity: normal

Dear Maintainer,

The resume hook script (/usr/share/initramfs-tools/hooks/resume) does not check
for a swap file. It checks for a swap device referenced by the RESUME variable.
The RESUME_OFFSET variable is additionally used to point to a file in the
RESUME device that acts as the swap device. In this case, since RESUME points
to a standard file system, a warning is generated:

  W: initramfs-tools configuration sets RESUME=$RESUME
  W: but no matching swap device is available.

The following contains a possible solution to check for a swap file. It relies
on a set RESUME_OFFSET variable indicating a swap file. At least two files
should be modified: 1) the resume hook script and 2) the mkinitramfs script.

The resume script contains the following line numbered items. The unnumbered
lines contain a possible fix to check for the use of a swap file.

 20 # First check if a location is set and is a valid swap partition.
 21 # If so, the config file will be copied in and there is nothing to do.
 22 if [ -n "$RESUME" ] && [ "$RESUME" != auto ]; then
 23 if [ "$RESUME" = none ]; then
 24 exit 0
 25 fi
if resume_dev_node="$(resolve_device "$RESUME")"; then
if [ -z "$RESUME_OFFSET" ] && \
   blkid -p -n swap "$resume_dev_node" >/dev/null 2>&1;
then
exit 0
fi
# Assume RESUME_OFFSET is a proper offset pointing to
#   the first data block of an inode in RESUME.
# Then, the swap filename should be in /proc/swaps.
# Get largest filename that is NOT a /dev/...
for resume_filename in $( grep -v ^/dev/ /proc/swaps |
grep ^/ | sort -rnk3 | cut -d " " -f 1 ); do
if [ -n "$resume_filename" ] && \
   blkid -p -n swap "$resume_filename"
>/dev/null 2>&1; then
exit 0
fi
break
done

echo >&2 "W: initramfs-tools configuration sets
RESUME=$RESUME and
echo >&2 "W:
RESUME_OFFSET=$RESUME_OFFSET"
echo >&2 "W: but no matching swap file is available."
 29 fi
 30
 31 echo >&2 "W: initramfs-tools configuration sets RESUME=$RESUME"
 32 echo >&2 "W: but no matching swap device is available."
 33 fi

Getting a file name from an inode from a block offset might be done, but is
problematic as tools related to this are dependent on the file system.  For
ext*, this could be:

  resume_inode=$( debugfs -R "icheck $RESUME_OFFSET" $resume_dev_node
2>/dev/null | tail -1 | cut -f2 )
  resume_fn=$( debugfs -R "ncheck ${RESUME_INODE}" ${RESUME_DEV} 2>/dev/null |
tail -1 | cut -f2 )

However, this process is not generic and may not be available for every file
system.

Additionally, the mkinitramfs script (/usr/sbin/mkinitramfs) does not export
the RESUME_OFFSET variable.  It should be exported for use by the hook scripts.

242 # Export environment for hook scripts.
243 #
244 export MODULESDIR
245 export version
246 export CONFDIR
247 export DESTDIR
248 export DPKG_ARCH
249 export verbose
250 export MODULES
251 export BUSYBOX
252 export COMPCACHE_SIZE
253 export RESUME
export RESUME_OFFSET
254



-- System Information:
Debian Release: buster/sid
  APT prefers eoan-updates
  APT policy: (500, 'eoan-updates'), (500, 'eoan-security'), (500, 'eoan'), 
(100, 'eoan-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.3.0-23-generic (SMP w/8 CPU cores)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US 
(charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages initramfs-tools depends on:
ii  initramfs-tools-core  0.133ubuntu10
ii  linux-base4.5ubuntu2

initramfs-tools recommends no packages.

Versions of packages initramfs-tools suggests:
ii  bash-completion  1:2.9-1ubuntu1

-- no debconf information



Bug#944375: synaptic: Add option to explicitly accept repository changes

2019-11-08 Thread Keven L. Ates
Package: synaptic
Version: 0.84.5
Severity: wishlist

Occasionally, repository owners change related information, keys, etc. This
generally causes apt to issue an error to the user, such as:

...
Reading package lists... Done
E: Repository 'http://ppa.launchpad.net///ubuntu disco
InRelease' changed its 'Label' value from '' to ''
N: This must be accepted explicitly before updates for this repository can be
applied. See apt-secure(8) manpage for details.
...

When using "apt" on the command line, the system asks:

Do you want to accept these changes and continue updating from this repository?
[y/N]

Synaptic will report the error, but does nothing to allow the user to accept
changes. The older "apt-get" tool does the same unless a --allow-releaseinfo-
change update" switch is given:

sudo apt-get --allow-releaseinfo-change update

I suggest an enhancement to allow synaptic to somehow "accept the changes" for
the affected repository(s).



-- System Information:
Debian Release: buster/sid
  APT prefers disco-updates
  APT policy: (500, 'disco-updates'), (500, 'disco-security'), (500, 'disco'), 
(100, 'disco-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.0.0-32-generic (SMP w/8 CPU cores)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US 
(charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages synaptic depends on:
ii  hicolor-icon-theme  0.17-2
ii  libapt-inst2.0  1.8.3
ii  libapt-pkg5.0   1.8.3
ii  libc6   2.29-0ubuntu2
ii  libc6-udeb [libc6]  2.30-0ubuntu2
ii  libept1.5.0 1.1+nmu3build1
ii  libgcc1 1:9.1.0-2ubuntu2~19.04
ii  libgdk-pixbuf2.0-0  2.38.1+dfsg-1
ii  libglib2.0-02.60.4-0ubuntu0.19.04.1
ii  libgtk-3-0  3.24.8-1ubuntu1
ii  libpango-1.0-0  1.42.4-6ubuntu0.1
ii  libstdc++6  9.1.0-2ubuntu2~19.04
ii  libvte-2.91-0   0.56.2-1ubuntu1~19.04.1
ii  libxapian30 1.4.10-1
ii  policykit-1 0.105-25

Versions of packages synaptic recommends:
ii  libgtk2-perl  2:1.24992-1build2
ii  xdg-utils 1.1.3-1ubuntu2

Versions of packages synaptic suggests:
ii  apt-xapian-index 0.47ubuntu13
pn  deborphan
pn  dwww 
pn  menu 
ii  software-properties-gtk  0.97.11
pn  tasksel  

-- no debconf information