Project

General

Profile

Bug #2161

[linux-libre-chromebook]trying to flash kernel image to root partition

Time4Tea - about 5 years ago - . Updated over 4 years ago.

Status:
info needed
Priority:
bug
Assignee:
% Done:

0%


Description

I recently installed linux-libre-chromebook (arm Chromebook C201). During the installation, it was by default going to 'dd' the kernel image to my root partition (/dev/mmcblk0p4), as opposed to the correct kernel partition (/dev/mmcblk0p3). This seems like quite a serious issue, as potentially people just have to type 'y' to overwrite their root system.

History

#1

Updated by bill-auger about 5 years ago

  • Assignee set to Megver83
#2

Updated by Megver83 about 5 years ago

The post_intall script linux-libre-chromebook uses is the same as of ALARM. Idk really how could I check it if I do not own a C201, sorry

#3

Updated by bill-auger about 5 years ago

  • Assignee changed from Megver83 to oaken-source
  • Status changed from open to info needed
  • Project changed from Documentation to Packages

i think oaken-source has one - i dont know how much time he has these days to devote to parabola; but i will assign this issue to him - maybe someday he can try installing this kernel and confirm this as a bug

#4

Updated by Megver83 about 5 years ago

bill-auger wrote:

i think oaken-source has one - i dont know how much time he has these days to devote to parabola; but i will assign this issue to him - maybe someday he can try installing this kernel and confirm this as a bug

and hopefully he (or we) can solve it

#5

Updated by Time4Tea about 5 years ago

I just re-installed the linux-armv7-chromebook package on ALARM and it seems to be flashing the kernel to the correct partition. So, looks like maybe they have already fixed it upstream?

#6

Updated by Time4Tea about 5 years ago

Actually no, I just installed and ran linux-armv7-chromebook in Parabola and it did the same thing as linux-libre-chromebook. I think it's to do with the way I have my SD partitioned. I have ALARM on partitions 1 (kernel) & 2 (root) and Parabola on partitions 3 (kernel) & 4 (root). When I run it in ALARM, it tries to flash to p1, which is correct; however, in Parabola it tries to flash to p4, which is not.

Perhaps I should report this one upstream to ALARM?

#7

Updated by Megver83 over 4 years ago

any progress on this? I've some ideas that could work. You've /boot in a different partition, right? could you share you lsblk output?

Time4Tea, try creating and running (as root) the following function in your shell

flash_kernel() {
  if mountpoint -q /boot; then
    major=$(mountpoint -d /boot | cut -f 1 -d ':')
    minor=$(mountpoint -d /boot | cut -f 2 -d ':')
  else
    major=$(mountpoint -d / | cut -f 1 -d ':')
    minor=$(mountpoint -d / | cut -f 2 -d ':')
  fi
  device=$(awk {'if ($1 == "'${major}'" && $2 == "'${minor}'") print $4 '} /proc/partitions)
  device="/dev/${device/%2/1}" 

  echo "A new kernel version needs to be flashed onto ${device}." 
  read -rp "Do you want to do this now? [y|N] " shouldwe
  if [[ $shouldwe =~ ^([yY][eE][sS]|[yY])$ ]]; then
    dd if=/boot/vmlinux.kpart of=${device}
    sync
  else
    echo "You can do this later by running:" 
    echo "# dd if=/boot/vmlinux.kpart of=${device}" 
  fi
}

then just run sudo flash_kernel

Also available in: Atom PDF