This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
samsung_chromebook_plus_xe513c24 [2024/02/02 01:46] – created austin | samsung_chromebook_plus_xe513c24 [2024/09/22 22:08] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Samsung Chromebook Plus XE513C24 ====== | ====== Samsung Chromebook Plus XE513C24 ====== | ||
+ | |||
+ | {{ : | ||
=== Developer Mode === | === Developer Mode === | ||
Line 22: | Line 24: | ||
=== First Attempt Gentoo SD Image === | === First Attempt Gentoo SD Image === | ||
+ | Note: I'm doing the build from my Orange Pi 800 with the same RK3399 so no cross compile environment is required. | ||
+ | |||
+ | == Preparing SD Card == | ||
+ | |||
+ | Install the required tools onto the build system: | ||
+ | < | ||
+ | emerge --ask dev-embedded/ | ||
+ | </ | ||
+ | |||
+ | Partion the sd card. | ||
+ | < | ||
+ | root #parted /dev/sdc mklabel gpt | ||
+ | root #parted -a optimal /dev/sdc unit mib mkpart Kernel 1 65 | ||
+ | root #parted -a optimal /dev/sdc unit mib mkpart Root 65 100% | ||
+ | </ | ||
+ | |||
+ | Depthcharge requires some specific parameters to be set. These signal the bootloader the presence of a valid kernel partition: | ||
+ | |||
+ | < | ||
+ | root #cgpt add -i 1 -t kernel -S 1 -T 5 -P 15 /dev/sdc | ||
+ | </ | ||
+ | |||
+ | Create a filesystem on the root partition and mount it: | ||
+ | |||
+ | < | ||
+ | root #mkfs.ext4 /dev/sdc2 | ||
+ | root #mount /dev/sdc2 /mnt/sdcard | ||
+ | </ | ||
+ | |||
+ | Grabbed latest arm64 stage3 and extracted to / | ||
+ | |||
+ | Also grabbed the latest portage snapshot as it doesn' | ||
+ | |||
+ | I copied my make.conf from my Orange Pi 800 as they both have the same rk3399 SOC. | ||
+ | < | ||
+ | # These settings were set by the catalyst build script that automatically | ||
+ | # built this stage. | ||
+ | # Please consult / | ||
+ | # detailed example. | ||
+ | COMMON_FLAGS=" | ||
+ | CFLAGS=" | ||
+ | CXXFLAGS=" | ||
+ | FCFLAGS=" | ||
+ | FFLAGS=" | ||
+ | |||
+ | # WARNING: Changing your CHOST is not something that should be done lightly. | ||
+ | # Please consult https:// | ||
+ | CHOST=" | ||
+ | |||
+ | # NOTE: This stage was built with the bindist Use flag enabled | ||
+ | |||
+ | # This sets the language of build output to English. | ||
+ | # Please keep this setting intact when reporting bugs. | ||
+ | LC_MESSAGES=C.utf8 | ||
+ | USE=" | ||
+ | ACCEPT_LICENSE=" | ||
+ | LLVM_TARGETS=" | ||
+ | VIDEO_CARDS=" | ||
+ | </ | ||
+ | |||
+ | == Getting ready to Chroot == | ||
+ | Copy over resolv.conf: | ||
+ | < | ||
+ | cp --dereference / | ||
+ | </ | ||
+ | |||
+ | Setup binds: | ||
+ | < | ||
+ | root #mount --types proc /proc / | ||
+ | root #mount --rbind /sys / | ||
+ | root #mount --make-rslave / | ||
+ | root #mount --rbind /dev / | ||
+ | root #mount --make-rslave / | ||
+ | root #mount --bind /run / | ||
+ | root #mount --make-slave / | ||
+ | </ | ||
+ | |||
+ | Chroot in: | ||
+ | < | ||
+ | root #chroot /mnt/sdcard /bin/bash | ||
+ | root #source / | ||
+ | root #export PS1=" | ||
+ | </ | ||
+ | |||
+ | == Get sources and configure kernel == | ||
+ | < | ||
+ | emerge --ask gentoo-sources | ||
+ | </ | ||
+ | |||
+ | I stole the config from [[https:// | ||
+ | I edited the config text and added the gentoo specific options required: | ||
+ | < | ||
+ | < # Linux/arm64 6.6.2 Kernel Configuration | ||
+ | --- | ||
+ | > # Linux/arm64 6.6.13-gentoo Kernel Configuration | ||
+ | 5c5 | ||
+ | < CONFIG_CC_VERSION_TEXT=" | ||
+ | --- | ||
+ | > CONFIG_CC_VERSION_TEXT=" | ||
+ | 7294a7295, | ||
+ | > | ||
+ | > # | ||
+ | > # Gentoo Linux | ||
+ | > # | ||
+ | > CONFIG_GENTOO_LINUX=y | ||
+ | > CONFIG_GENTOO_LINUX_UDEV=y | ||
+ | > CONFIG_GENTOO_LINUX_PORTAGE=y | ||
+ | > | ||
+ | > # | ||
+ | > # Support for init systems, system and service managers | ||
+ | > # | ||
+ | > CONFIG_GENTOO_LINUX_INIT_SCRIPT=y | ||
+ | > # CONFIG_GENTOO_LINUX_INIT_SYSTEMD is not set | ||
+ | > # end of Support for init systems, system and service managers | ||
+ | > | ||
+ | > # CONFIG_GENTOO_KERNEL_SELF_PROTECTION is not set | ||
+ | > CONFIG_GENTOO_PRINT_FIRMWARE_INFO=y | ||
+ | > # end of Gentoo Linux | ||
+ | </ | ||
+ | |||
+ | I manually applied both patch files found here: [[https:// | ||
+ | |||
+ | Compiling the kernel: | ||
+ | < | ||
+ | make | ||
+ | make dtbs | ||
+ | </ | ||
+ | |||
+ | Set the root password with passwd. | ||
+ | |||
+ | Set the timezone: | ||
+ | < | ||
+ | root #echo " | ||
+ | root #emerge --config sys-libs/ | ||
+ | </ | ||
+ | |||
+ | Setup locale: | ||
+ | < | ||
+ | vim / | ||
+ | locale-gen | ||
+ | eselect locale list | ||
+ | eselect locale set | ||
+ | </ | ||
+ | |||
+ | Install some system tools and firmware (required for wireless): | ||
+ | < | ||
+ | emerge --ask linux-firmware wpa_supplicant dhcpcd syslog-ng cronie chrony e2fsprogs | ||
+ | rc-update add dhcpcd default | ||
+ | rc-update add syslog-ng default | ||
+ | rc-update add cronie default | ||
+ | rc-update add sshd default | ||
+ | rc-update add chronyd default | ||
+ | </ | ||
+ | |||
+ | Configure hostname: | ||
+ | < | ||
+ | echo " | ||
+ | vim /etc/hosts | ||
+ | 127.0.0.1 | ||
+ | ::1 | ||
+ | </ | ||
+ | |||
+ | Set clock=" | ||
+ | |||
+ | Setup a normal user: | ||
+ | < | ||
+ | useradd -m -G users, | ||
+ | passwd johndoe | ||
+ | </ | ||
+ | |||
+ | Exit the chroot. | ||
+ | |||
+ | Create a swapfile (ensure you've exited the chroot): | ||
+ | < | ||
+ | fallocate -l 4G / | ||
+ | mkswap / | ||
+ | </ | ||
+ | |||
+ | Use blkid to get UUID of the sdcard root partition. | ||
+ | Configure fstab: | ||
+ | < | ||
+ | vim / | ||
+ | UUID=" | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | Create / | ||
+ | < | ||
+ | /dts-v1/; | ||
+ | |||
+ | / { | ||
+ | description = " | ||
+ | images { | ||
+ | kernel-1{ | ||
+ | description = " | ||
+ | data = / | ||
+ | type = " | ||
+ | arch = " | ||
+ | os = " | ||
+ | compression = " | ||
+ | load = <0>; | ||
+ | entry = <0>; | ||
+ | }; | ||
+ | fdt-1{ | ||
+ | description = " | ||
+ | data = / | ||
+ | type = " | ||
+ | arch = " | ||
+ | compression = " | ||
+ | hash-1{ | ||
+ | algo = " | ||
+ | }; | ||
+ | }; | ||
+ | }; | ||
+ | configurations { | ||
+ | default = " | ||
+ | conf-1{ | ||
+ | kernel = " | ||
+ | fdt = " | ||
+ | }; | ||
+ | }; | ||
+ | }; | ||
+ | </ | ||
+ | |||
+ | Package and sign the image and write it to boot partition: | ||
+ | < | ||
+ | lucy / | ||
+ | FIT description: | ||
+ | Created: | ||
+ | Image 0 (kernel-1) | ||
+ | Description: | ||
+ | Created: | ||
+ | Type: | ||
+ | Compression: | ||
+ | Data Size: 17617408 Bytes = 17204.50 KiB = 16.80 MiB | ||
+ | Image 1 (fdt-1) | ||
+ | Description: | ||
+ | Created: | ||
+ | Type: Flat Device Tree | ||
+ | Compression: | ||
+ | Data Size: 69134 Bytes = 67.51 KiB = 0.07 MiB | ||
+ | Architecture: | ||
+ | Hash algo: sha1 | ||
+ | Hash value: | ||
+ | | ||
+ | | ||
+ | Description: | ||
+ | Kernel: | ||
+ | FDT: fdt-1 | ||
+ | lucy / | ||
+ | lucy / | ||
+ | console=tty1 root=/ | ||
+ | lucy / | ||
+ | lucy / | ||
+ | DEBUG: run_command: | ||
+ | DEBUG: run_command: | ||
+ | DEBUG: run_command: | ||
+ | DEBUG: run_command: | ||
+ | DEBUG: run_command: | ||
+ | DEBUG: run_command: | ||
+ | DEBUG: run_command: | ||
+ | DEBUG: run_command: | ||
+ | DEBUG: run_command: | ||
+ | DEBUG: run_command: | ||
+ | DEBUG: run_command: | ||
+ | DEBUG: run_command: | ||
+ | DEBUG: run_command: | ||
+ | DEBUG: run_command: | ||
+ | DEBUG: run_command: | ||
+ | DEBUG: run_command: | ||
+ | DEBUG: run_command: | ||
+ | DEBUG: run_command: | ||
+ | DEBUG: do_vbutil_kernel: | ||
+ | DEBUG: ReadConfigFile: | ||
+ | DEBUG: do_vbutil_kernel: | ||
+ | DEBUG: do_vbutil_kernel: | ||
+ | DEBUG: do_vbutil_kernel: | ||
+ | DEBUG: do_vbutil_kernel: | ||
+ | DEBUG: CreateKernelBlob: | ||
+ | DEBUG: CreateKernelBlob: | ||
+ | DEBUG: CreateKernelBlob: | ||
+ | DEBUG: CreateKernelBlob: | ||
+ | DEBUG: CreateKernelBlob: | ||
+ | DEBUG: CreateKernelBlob: | ||
+ | DEBUG: CreateKernelBlob: | ||
+ | DEBUG: PickApartVmlinuz: | ||
+ | DEBUG: PickApartVmlinuz: | ||
+ | DEBUG: do_vbutil_kernel: | ||
+ | DEBUG: do_vbutil_kernel: | ||
+ | DEBUG: WriteSomeParts: | ||
+ | lucy / | ||
+ | 34704+0 records in | ||
+ | 34704+0 records out | ||
+ | 17768448 bytes (18 MB, 17 MiB) copied, 3.95567 s, 4.5 MB/s | ||
+ | </ | ||
+ | |||
+ | Umount everything you can eject the sd card and install it in the chromebook. | ||
+ | Use Ctrl+U to boot from external media. | ||
+ | |||
+ | After reboot I noticed it was trying to spawn a serial session so I commented out f0 at the bottom of / | ||
+ | |||
+ | I also forgot to build the kernel modules... | ||
+ | < | ||
+ | cd / | ||
+ | make modules_install | ||
+ | reboot | ||
+ | </ | ||
+ | |||
+ | Then I had wlp1s0 to configure the normal way. | ||
+ | |||
+ | === Tweaks === | ||
+ | I didn't want my screen to go black in X with a timeout. | ||
+ | < | ||
+ | Section " | ||
+ | | ||
+ | EndSection | ||
+ | </ | ||
+ | |||
+ | I kept bumping the power button and shutting of the machine due to a default settings in elogind. | ||
+ | < | ||
+ | [Login] | ||
+ | HandlePowerKey=ignore | ||
+ | </ | ||
+ | |||
+ | === Conky === | ||
+ | < | ||
+ | -- Conky, a system monitor https:// | ||
+ | -- | ||
+ | -- This configuration file is Lua code. You can write code in here, and it will | ||
+ | -- execute when Conky loads. You can use it to generate your own advanced | ||
+ | -- configurations. | ||
+ | -- | ||
+ | -- Try this (remove the `--`): | ||
+ | -- | ||
+ | -- | ||
+ | -- | ||
+ | -- For more on Lua, see: | ||
+ | -- https:// | ||
+ | |||
+ | conky.config = { | ||
+ | alignment = " | ||
+ | use_xft = true, | ||
+ | font = 'GE Inspira: | ||
+ | xftalpha = 0.8, | ||
+ | text_buffer_size = 2048, | ||
+ | max_text_width = 0, | ||
+ | override_utf8_locale = true, | ||
+ | uppercase = false, | ||
+ | no_buffers = true, | ||
+ | short_units = true, | ||
+ | format_human_readable = true, | ||
+ | |||
+ | update_interval = 1, | ||
+ | total_run_times = 0, | ||
+ | |||
+ | own_window = true, | ||
+ | own_window_transparent = false, | ||
+ | own_window_type = ' | ||
+ | own_window_hints = ' | ||
+ | own_window_argb_visual = true, | ||
+ | own_window_argb_value = 128, | ||
+ | background = true, | ||
+ | use_spacer = ' | ||
+ | |||
+ | double_buffer = true, | ||
+ | minimum_width = 215, minimum_height = 215, | ||
+ | |||
+ | draw_shades = false, | ||
+ | default_shade_color = '# | ||
+ | |||
+ | draw_outline = false, | ||
+ | default_outline_color = '# | ||
+ | |||
+ | default_color = ' | ||
+ | color0 = ' | ||
+ | color1 = ' | ||
+ | |||
+ | draw_borders = false, | ||
+ | stippled_borders = 0, | ||
+ | border_inner_margin = 10, | ||
+ | border_outer_margin = 0, | ||
+ | border_width = 1, | ||
+ | draw_graph_borders = false,--no | ||
+ | |||
+ | gap_x = 50, | ||
+ | gap_y = 50, | ||
+ | |||
+ | imlib_cache_size = 0, | ||
+ | } | ||
+ | |||
+ | conky.text = [[ | ||
+ | ${color grey}Info: | ||
+ | $hr | ||
+ | ${color grey}Uptime: | ||
+ | ${color grey}Frequency (in MHz):$color $freq | ||
+ | ${color grey}Frequency (in GHz):$color $freq_g | ||
+ | ${color grey}RAM Usage: | ||
+ | ${color grey}Swap Usage: | ||
+ | ${color grey}CPU Usage: | ||
+ | ${color grey}Processes: | ||
+ | $hr | ||
+ | ${color grey}File systems: | ||
+ | / $color${fs_used / | ||
+ | ${color grey}Networking: | ||
+ | Up:$color ${upspeed wlp1s0} ${color grey} - Down:$color ${downspeed wlp1s0} | ||
+ | ${color grey}Battery: | ||
+ | $hr | ||
+ | ${color grey}Name | ||
+ | ${color lightgrey} ${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1} | ||
+ | ${color lightgrey} ${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2} | ||
+ | ${color lightgrey} ${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3} | ||
+ | ${color lightgrey} ${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4} | ||
+ | # | ||
+ | #REFRESH LOCATION & WEATHER INFO CACHE | ||
+ | ${execi 600 curl -so ~/ | ||
+ | |||
+ | # | ||
+ | #REFRESH ICON CACHE | ||
+ | ${execi 600 sleep 2 && jq -r ' | ||
+ | ${execi 600 sleep 2 && jq -r ' | ||
+ | ${execi 600 sleep 2 && jq -r ' | ||
+ | ${execi 600 sleep 2 && jq -r ' | ||
+ | ${execi 600 sleep 2 && jq -r ' | ||
+ | ${execi 600 sleep 2 && jq -r ' | ||
+ | # | ||
+ | #WEATHER NOW | ||
+ | ${voffset -40}${color1}Kenton, | ||
+ | ${color0}${execi 1 jq -r ' | ||
+ | |||
+ | #WEATHER TODAY | ||
+ | ${color1}Today${goto 100}${color0}${execi 1 jq -r ' | ||
+ | # | ||
+ | #WEATHER +1 DAY | ||
+ | ${color1}${execi 1 jq -r ' | ||
+ | {print " | ||
+ | # | ||
+ | #WEATHER +2 DAYS | ||
+ | ${color1}${execi 1 jq -r ' | ||
+ | {print " | ||
+ | # | ||
+ | #WEATHER +3 DAYS | ||
+ | ${color1}${execi 1 jq -r ' | ||
+ | {print " | ||
+ | # | ||
+ | #WEATHER +4 DAYS | ||
+ | ${color1}${execi 1 jq -r ' | ||
+ | {print " | ||
+ | ]] | ||
+ | | ||
+ | </ | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | === Docker === | ||
+ | |||
+ | When attempted to emerge docker I got errors about circular deps with dev-lang/ | ||
+ | < | ||
+ | sys-devel/ | ||
+ | </ | ||
+ | Then I emerged dev-lang/go by itself. | ||
+ | < | ||
+ | emerge --ask devlang/go | ||
+ | </ | ||
+ | Finally I emerged docker. | ||
+ | < | ||
+ | emerge --ask app-containers/ | ||
+ | </ | ||
+ | |||
+ | After that I found I couldn' | ||
+ | * I ran this [[https:// | ||
+ | * Then compile the kernel and modules as normal. | ||
+ | * Follow the steps above to recreate the image for p1. | ||
+ | * dd the image, ensure to take in account that the device is now probably / | ||
=== Refrences === | === Refrences === |