Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Getting Debian on Acer C7 Chromebook

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
User avatar
rayquaza
Posts: 7
Joined: 2012-12-08 23:29

Getting Debian on Acer C7 Chromebook

#1 Post by rayquaza »

So I found these commands on the web and I was curious about what exactly they do, I tried googling cgpt but there's nothing out there in the web......

Code: Select all

cgpt create /dev/mmcblk0
cgpt show /dev/mmcblk0
       start        size    part  contents
           0           1          PMBR
           1           1          Pri GPT header
           2          32          Pri GPT table
    31537119          32          Sec GPT table
    31537151           1          Sec GPT header
cgpt add /dev/mmcblk0 -i 6 -b 34 -s 32768 -t kernel -l KERN-C -P 1 -T 1
Last edited by rayquaza on 2013-05-09 17:32, edited 3 times in total.

User avatar
saulgoode
Posts: 1445
Joined: 2007-10-22 11:34
Been thanked: 4 times

Re: Cgpt Man Help.....

#2 Post by saulgoode »

Are you installing Debian on a chromebook? Could you provide the source where you "picked up" that tidbit? It seems to be missing some steps. My understanding is that cgpt is used for creating uboot-recognizable partitions. The steps you show do this, but they do not appear to copy a kernel to the created partition (despite the last command marking the partition as containing a valid kernel).
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -- Brian Kernighan

User avatar
rayquaza
Posts: 7
Joined: 2012-12-08 23:29

Re: Cgpt Man Help.....

#3 Post by rayquaza »

saulgoode wrote:Are you installing Debian on a chromebook? Could you provide the source where you "picked up" that tidbit? It seems to be missing some steps. My understanding is that cgpt is used for creating uboot-recognizable partitions. The steps you show do this, but they do not appear to copy a kernel to the created partition (despite the last command marking the partition as containing a valid kernel).
Yes!!! That is exactly what I was trying to do I just didn't want to mention it, to embarrassed that my expertise is not at the level required to install Debian on an Acer C7 Chromebook :( the information I found is located on this blog at http://chromebooklinux.blogspot.com/...but instead of using an sd card like the tutorial.....I am trying to use an 8 g.b. thumbdrive....none of the following is my work it all belongs to the original author...

Installation Method

Here's a rather verbose & needlessly complex explanation of how I test Linux Distros on the Acer C7. However, I think it should work with any Chromebook capable of booting from USB, but might require some modification in some cases. It is and will always be a "work-in-progress", so please let me know if something isn't clear.

Requirements
  • 1. A Chromebook in "Developer Mode."
    2. Same Chromebook running Developer Firmware.
    3. Same Chromebook with USB Boot enabled.
    4. USB bootable media (thumb drive or SD card). From 4 - 16 GB will suffice. 16 GB will match the internal storage of every Chromebook prior to the Pixel, except for the Acer C7. So, you could duplicate your SSD for development purposes. See Tips #1 & #3 for relevant info.
The Method
A. From ChromeOS, use cgpt to create a GPT partition table on your media (I'm using a 16GB SD card in the reader slot), add a kernel partition #6 which is 16 MB in size, and add a rootfs partition #7 using the remaining space. Something like this:

Code: Select all

cgpt create /dev/mmcblk0
cgpt show /dev/mmcblk0
       start        size    part  contents
           0           1          PMBR
           1           1          Pri GPT header
           2          32          Pri GPT table
    31537119          32          Sec GPT table
    31537151           1          Sec GPT header
cgpt add /dev/mmcblk0 -i 6 -b 34 -s 32768 -t kernel -l KERN-C -P 1 -T 1
The size of partition #7 here is the beginning sector of "Sec GPT table" (31537119) MINUS the beginning sector of partition #7 (32802). Yes, the font is very tiny, but it preserves the appearance of the output.

Code: Select all

cgpt add /dev/mmcblk0 -i 7 -b 32802 -s 31504317 -t rootfs -l ROOT-C
cgpt show /dev/mmcblk0
       start        size    part  contents
           0           1          PMBR
           1           1          Pri GPT header
           2          32          Pri GPT table
          34       32768       6  Label: "KERN-C"
                                  Type: ChromeOS kernel
                                  UUID: B6BF18B8-5B01-384F-AA69-7AD61AB56646
                                  Attr: priority=1 tries=1 successful=0
       32802    31504317       7  Label: "ROOT-C"
                                  Type: ChromeOS rootfs
                                  UUID: F33BC249-4577-D94A-8B7B-5B13D68DE423
    31537119          32          Sec GPT table
    31537151           1          Sec GPT header
Please note that (at least on the C7) although you can use the built-in card reader to create such media, you may be unable to boot from it without an external USB card reader. At least, I haven't been able to. So, it may be more practical to simply use a thumb drive. See Tip #3 for a theory.

B. Create a debugging-enabled kernel from the current kernel, copy it to partition #6 and prioritize it to boot once. See tip below for an explanation here.

Code: Select all

 To identify the current rootfs & kernel partitions: 

    $ rootdev -s

will return the partition mounted as / like this:

    /dev/sda#

where # is 3, 5, or 7. So, just subtract 1 from # to identify the current kernel partition.

Code: Select all

rootdev -s
    /dev/sda3
dd if=/dev/sda2 of=kernel_2.blob
dump_kernel_config kernel_2.blob > kernel_2.cfg
cp kernel_2.cfg kernel_debug.cfg
Now, replace the contents of kernel_debug.cfg with the following:

Code: Select all

add_efi_memmap 
boot=local 
console=tty1 
disablevmx=off 
i915.modeset=1 
init=/sbin/init 
kern_guid=%U 
loglevel=7 
lsm.module_locking=0 
ro 
root=PARTUUID=%U/PARTNROFF=1 
rootwait 
tpm_tis.force=1 
tpm_tis.interrupts=0
These are commandline arguments passed to the kernel, so they should only be separated by spaces. Here, I've alphabetized them on separate lines for clarity. Now, wrap the new kernel with the verified block and the new config:

Code: Select all

vbutil_kernel --repack kernel_debug.blob \
  --keyblock /usr/share/vboot/devkeys/kernel.keyblock \
  --version 1 \
  --signprivate /usr/share/vboot/devkeys/kernel_data_key.vbprivk \
  --config=kernel_debug.cfg \
  --oldblob kernel_2.blob
Make sure the new kernel verifies OK and finally copy it to partition #6 and prioritize it.

Code: Select all

vbutil_kernel --verify kernel_debug.blob
dd if=/kernel_debug.blob of=/dev/mmcblk0p6
cgpt add /dev/mmcblk0 -i 6 -P 1 -T 1
C. Boot your chosen distro on another machine (real or virtual) and install it onto partition #7 of your bootable media. In some cases, you may need to create a filesystem on partition #7 prior to the installation, so I do just in case. I've used both Ext2 and Ext4 successfully. Either skip installing a bootloader or attempt to place the bootloader on partition #7. I assume the distro must support GPT disks in order for this to work.

D. Double check the GPT partition table for any changes that might prevent booting.

E. Copy the necessary stuff from the current Chrome OS rootfs to partition #7. Include the following complete folders:

Code: Select all

/lib/firmware
/lib/modules
/usr/share/vboot
And these files as well:

Code: Select all

/usr/bin/cgpt
/usr/bin/dump_kernel_config
/usr/bin/vbutil_*
Overkill perhaps, but handy for working on kernels from Linux too.

F. Cross your fingers, reboot & attempt to boot from USB. If it boots, reprioritize partition #6 and mark it as having booted successfully.

Code: Select all

cgpt add /dev/sdb -i 6 -P 1 -T 0 -S 1

I adapted this method from the technique published by Olof Johannson, a member of the Chrome OS development team.
Last edited by rayquaza on 2013-05-07 04:49, edited 4 times in total.

User avatar
saulgoode
Posts: 1445
Joined: 2007-10-22 11:34
Been thanked: 4 times

Re: Cgpt Man Help.....

#4 Post by saulgoode »

rayquaza wrote:the information I found is located on this blog at http://chromebooklinux.blogspot.com/...but instead of using an sd card like the tutorial.....I am trying to use an 8 g.b. thumbdrive....
According to the comments posted in response to this blog posting (which appears to comprise the same steps as in your tutorial), the procedure for booting from a USB device should be identical, except for the name of the block device (/dev/sd#).
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -- Brian Kernighan

User avatar
rayquaza
Posts: 7
Joined: 2012-12-08 23:29

Re: Cgpt Man Help.....

#5 Post by rayquaza »

saulgoode wrote:
rayquaza wrote:the information I found is located on this blog at http://chromebooklinux.blogspot.com/...but instead of using an sd card like the tutorial.....I am trying to use an 8 g.b. thumbdrive....
According to the comments posted in response to this blog posting (which appears to comprise the same steps as in your tutorial), the procedure for booting from a USB device should be identical, except for the name of the block device (/dev/sd#).
Do you have a Chromebook.......
Last edited by rayquaza on 2013-05-07 04:45, edited 1 time in total.

User avatar
saulgoode
Posts: 1445
Joined: 2007-10-22 11:34
Been thanked: 4 times

Re: Cgpt Man Help.....

#6 Post by saulgoode »

No, I do not. I've been considering getting one; and I'm not at all interested in running Google's OS so I've been reading a little bit about installing GNU/Linux on one. There doesn't seem to be any tutorials about installing Debian specifically so you may be entering new territory. There have been success stories published about installing Arch and Ubuntu, and I suspect that Debian hackers will get around to it Real Soon Now.

I doubt that I will be able to offer any help, but I am interested in hearing all about your adventures. :)
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -- Brian Kernighan

User avatar
rayquaza
Posts: 7
Joined: 2012-12-08 23:29

Re: Cgpt Man Help.....

#7 Post by rayquaza »

saulgoode wrote:No, I do not. I've been considering getting one; and I'm not at all interested in running Google's OS so I've been reading a little bit about installing GNU/Linux on one. There doesn't seem to be any tutorials about installing Debian specifically so you may be entering new territory. There have been success stories published about installing Arch and Ubuntu, and I suspect that Debian hackers will get around to it Real Soon Now.

I doubt that I will be able to offer any help, but I am interested in hearing all about your adventures. :)
You should definitely get one my friend, I'll keep on posting on this thread, I am going attempt to see how far I can get in creating the installation media.....if I need help i hope you can help me....i would really like to have a guru standby... I promise to ask as few questions as possible and do research....I'm gonna Rename this thread Getting Debian on Acer C7 Chromebook....

Post Reply