yashsingh1/xdaforums huggingface dataset:
[Chromebooks] nabil2000:
Chrome OS Kernel 4.14.96 built with extra modules for ATB v72

It does generate .config after all as usual for Linux kernels - got some issues from enter-chroot - had to do it from Ubuntu bionic proper with (from kernel source folder):

$ sh ./chromeos/scripts/prepareconfig chromeos-intel-pineview

$ make oldconfig

$ make -j4

Just now...

Finished compiling Chrome OS 4.14.96 for ATB v72 (which has Kernel 4.14.83), got vmlinux & modules - now need to find out how to deploy them on a Chrome OS installation...

After some struggle, managed to boot the new kernel as 4.14.96-09859-ga5c3f2f0428a-dirty

installed extra modules

by doing in crosh shell (not chroot)

in kernel compiled source code folder:

$ sudo make modules_install

it creates a new folder /lib/modules/4.14.96-09859-ga5c3f2f0428a-dirty

to get the kernel I just overwrite vmlinuz.A in /dev/sdb12 by kernel/arch/x86/boot/bzImage

(backup vmlinuz.A as vmlinuz.C)

to get to this:

$ mkdir efi

$ sudo mount /dev/sdb12 efi

$ cd efi

$ cd syslinux

$ sudo cp vmlinuz.A vmlinuz.C

$ sudo cp bzImage vmlinuz.A

../..

It boots great on Acer Iconia W700 & MacBook Air mid-2011

the joke is despite modules still no WiFi & no trackpad for MacBook Air :(

other joke does not boot Acer Chromebook C720P

well at least I tinkered with building this darn Chrome OS kernel - not much documentation on it (apart from how to do this in arm architecture)

Linux localhost 4.14.96-09859-ga5c3f2f0428a-dirty #1 SMP PREEMPT Wed Feb 13 08:04:55 GMT 2019 x86_64 Intel(R) Core(TM) i3-2365M CPU @ 1.40GHz GenuineIntel GNU/Linux

As I do not know how to proceed from this due to lack of Google documentation - I will stop.

I think to get it working, I need to install Chromium OS from scratch, but documentation is unclear, & arnoldthebat has no instructions on how to do this.

So I am starting an effort to build a full Chromium OS from scratch - as

the best way to learn is to share know how.

New thread - https://xdaforums.com/hardware-hacking/chromebooks/chromium-os-building-t3900245

Chromium OS building effort here -

https://xdaforums.com/hardware-hacking/chromebooks/chromium-os-building-t3900245
[Chromebooks] nabil2000:
Rebuilding Chromium OS kernel - a little extra...

Small improvement - removing dirty label from kernel name -

in scripts/setlocalversion # comment out:

if git diff-index --name-only HEAD | grep -qv "^scripts/package"; then

printf '%s' -dirty

fi

will rebuild it again to see if this helps for deployment

Rebuilt successfully - works OK on Acer Iconia W700, including camera & camera migration...

Notes -

in chroot

sudo enter-chroot

in kernel/

sudo make modules_install

sudo make install

outside chroot

in kernel/

sudo mkdir /boot

sudo make modules_install

sudo make install

in ~/Downloads

sudo mount /dev/sdb12 efi

sudo cp efi/syslinux/vmlinuz.A efi/syslinux/vmlinuz.A.83

sudo cp kernel/arch/x86/boot/bzImage efi/syslinux/vmlinuz.A

& for backup

sudo cp efi/syslinux/vmlinuz.A efi/syslinux/vmlinuz.A .96

I think this wraps it up - sadly still not booting Acer CB C720P

Linux localhost 4.14.96-09859-ga5c3f2f0428a #4 SMP PREEMPT Sun Feb 17 11:02:41 GMT 2019 x86_64 Intel(R) Core(TM) i3-2365M CPU @ 1.40GHz GenuineIntel GNU/Linux

Not exactly... always something

Installing Chrome OS Kernel 4.1.4.96 removes crostini, wonder why that is...

solution might be flags - as new kernel, some flags might have been lost

chrome://flags

will check

crostini already there - must be some settings lost with new kernel, or dependencies unmet :(

NB - all previous commands presuppose you have r/w privilege as root, i.e. issue:

$ sudo mount -o remount,rw /

$ sudo mount -o remount,exec /mnt/stateful_partition

Note - my gripe after all this is that drivers I needed do not seem to load, or I did not select the proper entries in base.config / .config

What's the point of building a kernel if modules cannot be loaded :(

Google Chrome OS is well protected, & Chromium OS does not seem to bypass kernel protection.
[Chromebooks] Hello2Clans:
hi, how did you extracted fydeos base.config ? if possible, can you provide me with a dropbox link to fydeos 5.3.1 base.config. Thanks
[Chromebooks] nabil2000:
improving kernel 4.14.96

Here is the dropbox link

[dropbox.com/s/esr407ybr5tev1u/configs.zip?dl=0](https://www.dropbox.com/s/esr407ybr5tev1u/configs.zip?dl=0)

it has the FydeOS 5.3.1 base config I extracted & your ATB v72 which I merged Fydeos 5.3.1 entries into - it updates to 4.14.96 from your 4.14.83 (replace z.config by .config)

It does compile a kernel OK - I did this manually, still learning how to do it signed. As I said details in my XDA thread.

I added all LCD panels modules, maybe it will finally allow to boot Chromebook C720P to GUI.

Oddly, I lose crostini, maybe unsigned kernels do that.

Linux localhost 4.14.96-09859-ga5c3f2f0428a #4 SMP PREEMPT Sun Feb 17 11:02:41 GMT 2019 x86_64 Intel(R) Core(TM) i3-2365M CPU @ 1.40GHz GenuineIntel GNU/Linux

You are welcome to improve on it - it builds, but modules I thought added did not work on MacBook Air nor graphics of Acer CB C720P
[Chromebooks] nabil2000:
I show how to do it in a previous post - but you need to be in a running FydeOS box, same with ATB.

sudo modprobe configs; zless /proc/config.gz

cat /proc/config.gz | gunzip > ~/Downloads/base.config
[Chromebooks] nabil2000:
.config for Acer CB C720P

Still no luck with Acer Chromebook C720P - tried several changes to .config with make menuconfig & manually - boots to a blank screen still :(

Fydeos 5.3.1 does not have this problem.

Also tried just the .config of FydeOS on its own, & strangely no luck - there must be something else -

will now try this

# Display Panels

CONFIG_DRM_PANEL_LVDS=y
[Chromebooks] nabil2000:
scratch - learning about kernel blobs /dev/sdx2 & /dev/sdx4

Just building the kernel & forcing in vmlinuz.A in /dev/sdx12 syslinux using bzImage (& modules in /lib/modules)

is apparently not enough...

It seems I also need to generate a new blob for the kernel which is /dev/sdx2

From documentation -

https://chromium.googlesource.com/chromiumos/docs/+/master/kernel_faq.md

we have

Kernel	Root

pair A	/dev/sda2	/dev/sda3

pair B	/dev/sda4	/dev/sda5

in my case (as installed to usb)

Kernel	Root

pair A	/dev/sdb2	/dev/sdb3

pair B	/dev/sdb4	/dev/sdb5

Some pointers here:

https://groups.google.com/a/chromium.org/forum/#!topic/chromium-os-dev/zmaziTddu5E

Major learning curve for me here...

what I need to do is upgrade the Arnoldthebat kernel blob KERN-A (4.14.83) with a new one for the new kernel (4.14.96).

I would appreciate if someone knew how to do this - that might be the cause issue of losing crostini when loading the new 4.14.96 instead of the original ATB.v72 4.14.83 one.

Share knowledge if you know how to do this, thanks.

Cooking -

I just flashed FydeOS 5.3.1 ROOT-A /dev/sdx2 blob which is 16MB over ATB v72 ROOT-A /dev/sdx2 blob which is 64MB & it booted, might be the solution I was looking for...

FydeOS (v70) is more compatible than ATB (v72) for many things. If the blob is involved, then it could be good news, easier than producing a new blob from scratch (don't know how either).

If so, working on blobs is an addition to-do list for hacking Chrome OS.
[Chromebooks] lfom:
Hello. I am really glad someone is trying to build and install a custom kernel for ChromiumOS, as it will help fix *many* compatibility issues as well as it will make possible to add support for some hardware and features (for instance, audio over Bluetooth doesn't work as of now because the support library needed for BlueZ isn't included).

My computer isn't working properly and I don't have much space to build the kernel by my own, but I can help with testing and research. If you could share the binaries online (maybe a Git with releases?), this would be great.

What I have found and read about kernel on ChromiumOS so far:

1. Official documentation, it explains about the partition pairs:

http://www.chromium.org/chromium-os/chromiumos-design-docs/disk-format

2. More info (I think you have it already) but I think it is outdated as "console=tty1" doesn't work anymore (ChromiumOS now uses Frecon):

https://chromium.googlesource.com/chromiumos/docs/+/master/kernel_faq.md

3. This is a nice repo, it explains a lot, specially about kernel modules (drivers):

https://github.com/dnschneid/crouton/wiki/Build-chrome-os-kernel-and-kernel-modules

From what I have used and tested, you can use GRIB to either boot from the vmlinuz.A/B image or use the partition with the kernel, using the partition is much complicated as you found out because it would need some blobs/keys.
[Chromebooks] nabil2000:
Thanks for the resources, I am getting old, so rather hard to learn & deal with new stuff - tinkering OSes & software is a hobby for me, but I usually do test stuff, not create - I had nice experience with Hackintosh, before I owned my own Macbook Air, still use it from USB's & PC when needed.

So far, I find out blob does not improve matters, it just gets used, like above blob from ATB or FydeOS does same thing.

The way I started in this was just to get Acer Chromebook C720P to load Android, chromefy carried on better than where I started.

The most successful outcome for me is Acer Iconia W700 which works with eve 73 (leaked on Telegram)...

I have the resources to build the kernel - but it is not doing what I want, like booting ATB v72 in Acer CB C720P - it i not vital, C720P works well with FydeOS & cyan or eve 71, just a challenge - why is ATB v72 not booting properly - i's a graphics VESA or LVDS bios issue I believe (C720P board uses LVDS for graphics), but where does it get loaded, I believe it's before loading modules...
[Chromebooks] lfom:
FydeOS 5.31 boots to a black screen on my Miix320 but I have to wait until it loads everything then I must hit Ctrl+Alt+F2 then go back to main screen and then it works properly thereafter. Is your Acer the one bellow? Maybe it's related?

http://www.chromebookspecs.com/acer-c720p-chromebook

By the other hand, I cannot enable clicking for the detachable touchpad (+keyboard), what is almost a dealbreaker... Neither it goes to tablet mode when I detach it from the keyboard (not a big deal).

By the other hand, it boots correctly on a ThinkPad 8 tablet, but if freezes after a few seconds unless I use acpi=off or noacpi as kernel parameters, what makes it usesless since it only detects USB hardware.

From the text I linked it seems that the extra data added to the kernel before flashing it to a disk partition is both its signature and kernel paramenters, so you may want to check if there is any special paramenter needed for the kernel to boot correctly on your C720P.
[Chromebooks] nabil2000:
RFC - how to produce a blob for loading a new kernel?

If there is a way to find out how to produce a blob of an updated kernel for a genuine vanilla chromebook such as Acer Chromebook C720P - I will post it here...

Google open source documentation is very confusing about this - it might also be generated when setting up a Chromium OS from scratch (my thread on this is halted for now, but I have all the setup foundation to build)...

What I gather is that vmlinuz.A is the kernel, but for chromebooks, the kernel is also contained in the blob which is in partition /dev/sdx2 labelled KERN-A -

so I need to produce an image kern-a.bin which I then flash to /dev/sdx2 - with FydeOS 5.3.1 the KERN-A blob contains Kernel 4.14.67, with ATB v72 Kernel 4.14.83...

the dilemma is that KERN-A size for FydeOS 5.3.1 is 16 MB & for ATB v72 it is 64MB, so I cannot flash the latter onto the former.

I need to find out how to create a 64MB image for KERN-A from a given kernel, such as ATB v72 or my compiled one which is 4.14.96 -

Anyone who has a clue, & better has the correct instructions to do so, please help...
[Chromebooks] lfom:
Actually, you don't need to: you can use the compressed image with GRUB2, and it will boot using your system and state (data) partition.
[Chromebooks] nabil2000:
Using a modified FydeOS 5.3.1 as base, no matter I change the kernel, it boots its own 4.14.67 kernel on Acer CB C720P - however using non chromebook devices such as macbook, allow me to boot vmlinuz.A & its associated /lib/modules/...

Care to share how to use grub2 to override the above?
[Chromebooks] lfom:
I don't know what happens when you install it to a Chromebook device, but the USB disk created with Etcher for both ATB and FydeOS the 12th partition contains GRUB2 files as well as a /syslinux folder where both kernels (vmlinuz.A and vmlinuz.B) are. GRUB2 configuration files will load the kernel with some parameters that point to the ROOT partition. I was able to install them on an external disk but use the GRUB2 installed on the internal disk to start it, so you can move the files around.
[Chromebooks] nabil2000:
As I found out, this does not work for chromebooks - they load the kernel from the blob which is /dev/sda2 or /dev/sdb2 or /dev/sdc2 (KERN-A) depending on where the FydeOS is installed...

this contains the kernel too: /dev/sdb2: PARTLABEL="KERN-A" PARTUUID=...

So I wish to find out how to flash the blob for a new kernel...

They write about this here - http://www.chromium.org/chromium-os/chromiumos-design-docs/disk-format

but they do not give instructions on how to set it up.

Which kernel?

For any booting (x86) configuration, there are at least three separate kernels (along with their command lines) on the disk image.

Legacy BIOS will use syslinux, which uses its own copy of the chosen kernel that's kept in partition 12.

EFI BIOSes will use /boot/vmlinuz from the target rootfs.

ChromeOS BIOS uses the signed kernel embedded in its own partition.

Build and update process is carefully crafted to try to keep all three of these kernels in sync.

However, if fiddling with the kernel and commandline, you may find that your changes are being ignored.

This is usually an indication that you're modifying the wrong one.

In /proc/cmdline, you should see one of the strings "cros_legacy", "cros_efi", or "cros_secure".

These identify which method the kernel used to boot (and that's all they do - we don't use them for any run-time decisions AFAIK).

So on non chromebooks, these two are used:

Legacy BIOS for MBR.

EFI BIOS for EFI.

I am interested in the 3rd

ChromeOS BIOS uses the signed kernel embedded in its own partition. which is /dev/sdb2 ...
[Chromebooks] lfom:
I see... So Chromebook devices always use the KERNEL partition, to make sure it only runs signed stuff. It makes sense...

Creating and copying the kernel to a partition is explained in the "Quick Development" part. What didn't work for you (sorry, I cannot try it since I don't have a Chromebook device).

1. Check what partition was used to boot (pairs 2/3 or 4/5):

rootdev -s

2. Using vmlinuz and config.txt from your build, you must use this command:

vbutil_kernel --pack [I]new_kern.bin[/I] \
--keyblock /usr/share/vboot/devkeys/kernel.keyblock \
--signprivate /usr/share/vboot/devkeys/[U]kernel_data_key.vbprivk[/U] \
--version 1 \
--config [b]config.txt[/b] \
--bootloader /lib64/bootstub/bootstub.efi \
--vmlinuz /build/x86-generic/boot/[B]vmlinuz[/B]

3. Copy the new kernel to the current boot partition (if #1 showed /dev/sda4, for instance):

scp USER@SOMEWHERE:[I]new_kern.bin[/I] /tmp
sudo dd if=/tmp/new_kern.bin /dev/sda4

4. Reboot and check the kernel info:

uname -a

There is also additional information below that may help:

For the recovery kernel on a removeable device, <private_key> above is

recovery_kernel_data_key.vbprivk

and for the main kernel on the hard drive, the <private_key> is

kernel_data_key.vbprivk

. The full path to the key file is required, of course.

Then verify things look OK:

vbutil_kernel --verify /tmp/kernel.new --verbose
[Chromebooks] nabil2000:
Thanks - I was too lazy to figure this out through the docs - I think building the kernel provides the kernel.bin in a folder of the source... I will look for it :)

I do not have ATB v72 kernel.bin so cannot flash 4.14.83 blob, but if kernel.bin of 4.14.96 is available after building the kernel (which it should), then that will be good enough...

side note -

this is why it is better to include drivers as modules when building to evade having to reflash the blob every time other drivers are needed.

Update -

These are resources used for kernels from ATB v72, Fydeos 5.3.1 & the kernel I built 4.14.96 with respective modules - I will update this as I progress (file is ~150 MB) - https://www.dropbox.com/s/8v9d8dig0fxnpn8/cros-kernels.tar.xz?dl=0
[Chromebooks] nabil2000:
/dev/sdx2 blob - where is it?

I think this is the bin of the blob after successful compiling of the Chrome OS kernel:

kernel/arch/x86/boot/vmlinux.bin

it's of the same size of

kernel/arch/x86/boot/bzImage (which gives vmlinuz.A in /dev/sdx12 efi/syslinux)

maybe it's the same file with different name & .bin appended...

& if it is the same file, that will make flashing the blob of ATB v72 easy by just using its kernel (4.1.4.83).

*** it is not the same file, I checked with a hexed editor***

now will sort out the above commands to sign vmlinux.bin & flash it onto /dev/sdx2...

Latest -

FydeOS coders have pre-released FydeOS 6.0 with Chromium OS v72 - Android Pie 9 ready -

this might make my kernel efforts obsolete - still I will test for blob, at least learning something new...

FydeOS 6.0 Link (from telegram)

https://unofficial-fydeos-mirror.github.io/
[Chromebooks] lfom:
FydeOS 6.0 uses the same kernel as ATB v72: 4.14.83

If you have some free time or want to test some new stuff, you could try adding LPSS support as explained here:

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1783964

EDIT: I was willing to test your 4.14.96 build but I didn't find the vmlinuz file itself... I am downloading the file now.

NVM, I figured out they are in the EFI folder. I am going to try to boot with it using my test disk and report back.

UPDATE: your .96 build exhibits the same problem I have with ATB v72 builds (kernel .83): computer freezes after while and then it is not possible to boot anymore (it freezes really soon). Now I will try latest FydeOS kernel to see if it has the same problem.

PS: too bad there is no config.gz so there is no way to know how the kernels were built...

UPDATE2: No problems with FydeOS .83, but not visible improvements either: still not battery meter, backlight control nor trackpad click. I noticed your .96 also doesn't have the modules for my audio system.

PS: I have found that your builds supports configs.ko, but FydeOS kernels don't. :(
[Chromebooks] nabil2000:
You are welcome to change the .config as you wish, & I will compile the kernel based on it;

.96 is the latest clone released by Google.

https://www.dropbox.com/s/esr407ybr5tev1u/configs.zip?dl=0

Sorry I am currently not feeling great, so not doing much testing... need to image FydeOS 6.0 & see if it boots on Acer CB C720P
[Chromebooks] nabil2000:
Also blobs? related files -

vmlinux.bin in

https://www.dropbox.com/s/maaohi9j3jhbuzu/Archive-Kernel4.14.96.zip?dl=0

config.gz is in /proc

after doing this:

sudo modprobe configs; zless /proc/config.gz

cat /proc/config.gz | gunzip > ~/Downloads/base.config

Notes -

FydeOS 6.0 does not boot Acer Chromebook C720P

https://xdaforums.com/hardware-hacking/chromebooks
[Chromebooks] lfom:
I am sorry you are not feeling well. I wish I could help with the C720P, I will take a look at the configs you shared and try to find some info that might help. Thanks for your builds and info shared so far. Regards.
[Chromebooks] lfom:
z.config shows:

while base.config.fydeos shows:

There are many differences, it seems that fydeos is meant for a more generic build while z.config is oriented to some specific device.

For instance, fydeos does not explicitly enables LVDS (it is used for builtin video in some devices), while z.config enables "virtio", some Qualcomm SoC drivers as well as some UEFI and cypher features that are not enabled in fydeos (see pics). I hope this helps...
[Chromebooks] nabil2000:
z.config is my modified .config based on the one arnoldthebat made & the fydeos made - I tried to include as much drivers as I could, but it might be that not booting Acer CB C720P is not a kernel issue.
[Chromebooks] nabil2000:
Signing kernel - blob flashing to /dev/sdx2

The correct commands for me seem to be:

echo blah > dummy.txt

$ vbutil_kernel --pack kernelpart.bin \

--keyblock /usr/share/vboot/devkeys/kernel.keyblock \

--signprivate /usr/share/vboot/devkeys/kernel_data_key.vbprivk \

--version 1 \

--vmlinuz vmlinuz \

--bootloader dummy.txt \

--config dummy.txt

$ KPART=$(pwd)/kernelpart.bin

so the kernelpart.bin binary can now be flashed to /dev/sdx2

sudo dd if=/dev/sdx2 of=orig-kern.bin

sudo dd if=kernelpart.bin of=/dev/sdx2

So it seems no need to use the generated vmlinux.bin (unless it was a signed kernel provided automatically in the building process)

Not tried this yet - will report after soon...

anyway, verification succeeded:

$ vbutil_kernel --verify new_kern-4-14-96.bin --verbose

Key block:

Signature: ignored

Size: 0x4b8

Flags: 7 !DEV DEV !REC

Data key algorithm: 4 RSA2048 SHA256

Data key version: 1

Data key sha1sum: d6170aa480136f1f29cf339a5ab1b960585fa444

Preamble:

Size: 0xfb48

Header version: 2.2

Kernel version: 1

Body load address: 0x100000

Body size: 0x6cde00

Bootloader address: 0x7c9000

Bootloader size: 0x1000

Vmlinuz header address: 0x7ca000

Vmlinuz header size: 0x3e00

Flags : 0x0

Body verification succeeded.

Config:

blah

Remains to do:

sudo dd if=/dev/sdx2 of=orig-kern.bin

sudo dd if=new_kern-4-14-96.bin of=/dev/sdx2

Outcome - did not work - boots to blank screen, does not like the flashed 4.14.96 blob, or I am not using the proper signing commands...

Looks like upgrading the kernel is not as simple or straightforward for Chrome OS - something is missing, the blob needs something else so it allows the boot, the problem is with /dev/sdx2 (partition where kernel is flashed) & another issue, I believe /dev/sdx3 because it is unsigned.
[Chromebooks] nabil2000:
Restarting

I am flashing a new FydeOS 5.3.1 -

will not touch /dev/sdb3 keep it protected as released,

& see if this will allow my newer kernel 4.14.96 flashed on /dev/sdb2 to boot.

Analysis of the partitions -

/dev/sdb11 !RWFW - 8.00 MB

/dev/sdb2 !KERN-A - 16.00 MB

/dev/sdb4 !KERN-B - 16.00 MB

/dev/sdb8 !OEM - 16.00 MB

/dev/sdb12 !EFI-SYSTEM 32.00 MB

/dev/sdb5 !ROOT-B - 2.00 MB

/dev/sdb3 !ROOT-A - 2.66 GB

/dev/sdb11 !STATE - 12.10 GB (of a 16GB USB stick)

! means protected./dev/sdb11 is also encrypted.

the -B are not used in FydeOS so will be discarded.

I believe (flashed them together & it worked) these are the important partitions for a working system -

/dev/sdb11 !RWFW - 8.00 MB

/dev/sdb2 !KERN-A - 16.00 MB

/dev/sdb8 !OEM - 16.00 MB

/dev/sdb12 !EFI-SYSTEM 32.00 MB

so if

/dev/sdb2 !KERN-A - 16.00 MB is modified, by flashing a newer kernel,

the others might need to adapt

/dev/sdb11 !RWFW - 8.00 MB

dev/sdb8 !OEM - 16.00 MB

/dev/sdb12 !EFI-SYSTEM 32.00 MB

In building a full Chromium OS they all get built together so will be in sync...

however just tackling the kernel creates issues as I experienced with Acer Chromebook C720P which is not meant to have a higher kernel than 3.8

Until kernel 4.14.67 there was no issue booting it, but from kernel 4.14.83 with Chromebook images v72 & above, graphics get borked booting to a blank screen...

Well that is my analysis so far...

Ref. - https://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices/custom-firmware