Skip to content

Instantly share code, notes, and snippets.

@supechicken
Created March 3, 2024 17:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save supechicken/de76c0c7c46f57dea1d05bfe23f93c46 to your computer and use it in GitHub Desktop.
Save supechicken/de76c0c7c46f57dea1d05bfe23f93c46 to your computer and use it in GitHub Desktop.
Script snippet for building ChromeOS Crostini/Termina kernel
RELEASE=release-R123-15786.B-chromeos-6.1
LLVM_VERSION=18
curl -L https://apt.llvm.org/llvm.sh | sudo bash -s "${LLVM_VERSION}"
for f in clang clang++ ld.lld llvm-objdump llvm-ar llvm-nm llvm-strip llvm-objcopy llvm-readelf; do
sudo ln -sf $f-$LLVM_VERSION /usr/bin/$f
done
git clone https://chromium.googlesource.com/chromiumos/third_party/kernel.git -b ${RELEASE} --depth=1
cd kernel
CHROMEOS_KERNEL_FAMILY=termina ./chromeos/scripts/prepareconfig container-vm-x86_64
make LLVM=1 LLVM_IAS=1 olddefconfig
make LLVM=1 LLVM_IAS=1 menuconfig
make LLVM=1 LLVM_IAS=1 bzImage -j8
make LLVM=1 LLVM_IAS=1 INSTALL_MOD_PATH="$PWD/out-modules" modules -j$(nproc)
make LLVM=1 LLVM_IAS=1 INSTALL_MOD_PATH="$PWD/out-modules" modules_install
sudo apt install rsync
make LLVM=1 LLVM_IAS=1 INSTALL_HDR_PATH="$PWD/out-headers" headers_install
@DarkevilPT
Copy link

DarkevilPT commented Mar 17, 2024

Need some help SuppeChicken666: https://community.fydeos.io/t/topic/24891/25 (last post)

How can I properly apply your script? I can run this script on penguin making its kernel and entering this on Crosh:

vmc start termina --kernel /home/chronos/#myuser/MyFiles/kernel

But then to login into your penguin from crosh im questioning the process because then u will either will be in root via lxc exec penguin -- bash or user via lxc container penguin which asks for user password of which we havent created (and we can define that but...) was that the plan?
If I Exitthen vmc container termina penguin --privileged true after done the kernel on crostini will that make waydroid work?

Its funny I'm trying this mostly for kernel 5.10 which (malior-droid) works but not for 6.1 fyde v18 is updating the system to google v120 so it will par to this script and chances of malior-droid will be reduced. But we could still play with waydroid and explore this window.

For openFyde I also believe this is the correct code (for rockchip arm64 rk3588/s):

RELEASE=release-R114-15437.B-chromeos-5.10
LLVM_VERSION=18

curl -L https://apt.llvm.org/llvm.sh | sudo bash -s "${LLVM_VERSION}"

for f in clang clang++ ld.lld llvm-objdump llvm-ar llvm-nm llvm-strip llvm-objcopy llvm-readelf; do
  sudo ln -sf $f-$LLVM_VERSION /usr/bin/$f
done

git clone https://chromium.googlesource.com/chromiumos/third_party/kernel.git -b ${RELEASE} --depth=1

cd kernel

CHROMEOS_KERNEL_FAMILY=termina ./chromeos/scripts/prepareconfig container-vm-aarch64
make LLVM=1 LLVM_IAS=1 olddefconfig
make LLVM=1 LLVM_IAS=1 menuconfig
make LLVM=1 LLVM_IAS=1 bzImage -j8

make LLVM=1 LLVM_IAS=1 INSTALL_MOD_PATH="$PWD/out-modules" modules -j$(nproc)
make LLVM=1 LLVM_IAS=1 INSTALL_MOD_PATH="$PWD/out-modules" modules_install

sudo apt install rsync
make LLVM=1 LLVM_IAS=1 INSTALL_HDR_PATH="$PWD/out-headers" headers_install

As for kernel 5.10 - Malior Droid would require this:

CONFIG_STAGING=y
CONFIG_ASHMEM=y
CONFIG_ANDROID_BINDER_IPC=y
# CONFIG_ANDROID_BINDERFS is not set
CONFIG_ANDROID_BINDER_DEVICES="binder,hwbinder,vndbinder"
# CONFIG_ANDROID_BINDER_IPC_SELFTEST is not set
CONFIG_ESD_FS=y

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment