[Kernel-packages] [Bug 1842320] Re: Can't boot: "error: out of memory." immediately after the grub menu

2022-08-24 Thread IMarvinTPA
Earlier today, I upgraded my Mint 20.3 system to Mint 21.0 and got this
"out of memory" issue (Asus ROG G752VT laptop.).

The fix in comment #41 and #89 worked (changing the compression to 19),
but a lot of the steps were not needed.

This is the minimal steps needed, (maybe fewer possible, anybody up for
some code golf?):

$ sudo su -
# mkdir root
He probably had his disk encrypted, I do not: # cryptsetup luksOpen 
/dev/nvme0n1p3 nvme0n1p3_crypt

This one was very different for me due to mint vs Ubuntu.
# mount /dev/mapper/vgmint-root ./root  was # mount /dev/mapper/vgubuntu-root 
./root

This one makes the computer think the normal root is really root to fake out 
update-initramfs:
# chroot ./root

Yes, do this:
# ### Now edit line 196 of /usr/sbin/mkinitramfs to to use -19 instead of -1
This wasn't completely happy with me, but it worked out ok for me.
# update-initramfs -u -k all

This command completely failed for me, but it didn't seem to hate me afterwards:
# update-grub


# exit
# reboot

I hope you have a happy reboot too.

Then re-run
# update-initramfs -u -k all
and
# update-grub

To clean up any oddities.

I wish there were a way to recompress this from grub though.

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1842320

Title:
  Can't boot: "error: out of memory." immediately after the grub menu

Status in grub:
  Unknown
Status in OEM Priority Project:
  Triaged
Status in grub2-signed package in Ubuntu:
  Confirmed
Status in initramfs-tools package in Ubuntu:
  Confirmed
Status in linux package in Ubuntu:
  Confirmed

Bug description:
  [Impact]

   * In some cases, if the users’ initramfs grow bigger, then it’ll
  likely not be able to be loaded by grub2.

   * Some real cases from OEM projects:

  In many built-in 4k monitor laptops with nvidia drivers, the u-d-c
  puts the nvidia*.ko to initramfs which grows the initramfs to ~120M.
  Also the gfxpayload=auto will remain to use 4K resolution since it’s
  what EFI POST passed.

  In this case, the grub isn't able to load initramfs because the
  grub_memalign() won't be able to get suitable memory for the larger
  file:

  ```
  #0 grub_memalign (align=1, size=592214020) at ../../../grub-core/kern/mm.c:376
  #1 0x7dd7b074 in grub_malloc (size=592214020) at 
../../../grub-core/kern/mm.c:408
  #2 0x7dd7a2c8 in grub_verifiers_open (io=0x7bc02d80, type=131076)
  at ../../../grub-core/kern/verifiers.c:150
  #3 0x7dd801d4 in grub_file_open (name=0x7bc02f00 
"/boot/initrd.img-5.17.0-1011-oem",
  type=131076) at ../../../grub-core/kern/file.c:121
  #4 0x7bcd5a30 in ?? ()
  #5 0x7fe21247 in ?? ()
  #6 0x7bc030c8 in ?? ()
  #7 0x00017fe21238 in ?? ()
  #8 0x7bcd5320 in ?? ()
  #9 0x7fe21250 in ?? ()
  #10 0x in ?? ()
  ```

  Based on grub_mm_dump, we can see the memory fragment (some parts seem
  likely be used because of 4K resolution?) and doesn’t have available
  contiguous memory for larger file as:

  ```
  grub_real_malloc(...)
  ...
  if (cur->size >= n + extra)
  ```

  Based on UEFI Specification Section 7.2[1] and UEFI driver writers’
  guide 4.2.3[2], we can ask 32bits+ on AllocatePages().

  As most X86_64 platforms should support 64 bits addressing, we should
  extend GRUB_EFI_MAX_USABLE_ADDRESS to 64 bits to get more available
  memory.

   * When users grown the initramfs, then probably will get initramfs
  not found which really annoyed and impact the user experience (system
  not able to boot).

  [Test Plan]

   * detailed instructions how to reproduce the bug:

  1. Any method to grow the initramfs, such as install nvidia-driver.

  2. If developers would like to reproduce, then could dd if=/dev/random
  of=... bs=1M count=500, something like:

  ```
  $ cat /usr/share/initramfs-tools/hooks/zzz-touch-a-file
  #!/bin/sh

  PREREQ=""

  prereqs()
  {
  echo "$PREREQ"
  }

  case $1 in
  # get pre-requisites
  prereqs)
  prereqs
  exit 0
  ;;
  esac

  . /usr/share/initramfs-tools/hook-functions
  dd if=/dev/random of=${DESTDIR}/test-500M bs=1M count=500
  ```

  And then update-initramfs

   * After applying my patches, the issue is gone.

   * I did also test my test grubx64.efi in:

  1. X86_64 qemu with
  1.1. 60M initramfs + 5.15.0-37-generic kernel
  1.2. 565M initramfs + 5.17.0-1011-oem kernel

  2. Amd64 HP mobile workstation with
  2.1. 65M initramfs + 5.15.0-39-generic kernel
  2.2. 771M initramfs + 5.17.0-1011-oem kernel

  All working well.

  [Where problems could occur]

  * The changes almost in i386/efi, thus the impact will be in the i386 / 
x86_64 EFI system.
  The other change is to modify the “grub-core/kern/efi/mm.c” but I use the 
original addressing for “arm/arm64/ia64/riscv32/riscv64”.
  Thus it should not impact them.

  * There is a “#if defined(__x86_64__)” which intent to limit 

[Kernel-packages] [Bug 1705000] Re: ASUS G752VM: headphones and microphone not working (Ubuntu 16.04)

2018-12-27 Thread IMarvinTPA
I haven't tested the microphone or SPDIF capabilities.  But this is a
workable pinout for most uses.

[codec]
0x10ec0668 0x10431ced 0

[pincfg]
#Pin 12 is Internal Mic
0x12 0x90a60160
#Pin 14 is Internal "front" speakers
0x14 0x90170110
#Pin 15 is "Line Out" according to the manual, But Pin 15 won't let me pick 
that in HDA Jack Retask.
#Trying to use this as an output will have a constant tone too.
#Using this as an output breaks the front speakers working correctly with 
headphone detection.
0x15 0x40f000f0
#Pin 16 is the headphone jack.
0x16 0x0321403f
#Pin 18 is the external Microphone jack.
0x18 0x03a19020
#Pin 19 is nothing.
0x19 0x41f0
#Pin 1a is the internal subwoofer.  (Set the sound system to Stereo 2.1)
0x1a 0x90170151
#Pin 1b is nothing.
0x1b 0x41f0
#Pin 1d is nothing.
0x1d 0x40c6852d
#Pin 1e is the internal SPDIF out.
0x1e 0x014b1180
#Pin 1f is nothing.
0x1f 0x41f0

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1705000

Title:
  ASUS G752VM: headphones and microphone not working (Ubuntu 16.04)

Status in linux package in Ubuntu:
  Expired

Bug description:
  
  Hello I have an ASUS ROG-G752VM computer with Ubuntu 16.04 installed with and 
new kernel 4.12.0-041200-generic.

  I'm having problems when I plug in the headphones and microphone, they
  don't work.

  What I need to do?
  --- 
  ApportVersion: 2.20.1-0ubuntu2.9
  Architecture: amd64
  CurrentDesktop: Unity
  DistroRelease: Ubuntu 16.04
  InstallationDate: Installed on 2017-01-24 (174 days ago)
  InstallationMedia: Ubuntu 14.04.5 LTS "Trusty Tahr" - Release amd64 (20160803)
  NonfreeKernelModules: nvidia_uvm nvidia_drm nvidia_modeset nvidia
  Package: linux (not installed)
  Tags:  xenial
  Uname: Linux 4.12.0-041200-generic x86_64
  UnreportableReason: The running kernel is not an Ubuntu kernel
  UpgradeStatus: Upgraded to xenial on 2017-01-25 (173 days ago)
  UserGroups: adm cdrom dip lpadmin plugdev sambashare sudo
  _MarkForUpload: True

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1705000/+subscriptions

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp