Coder Social home page Coder Social logo

cbeley / beleyenv Goto Github PK

View Code? Open in Web Editor NEW
81.0 4.0 16.0 2.78 MB

A dev-focused, idempotent system bootstrap script for ChromeOS's officially supported Linux container. Designed for me, but flexible enough for you to use too!

License: MIT License

Shell 99.85% Lua 0.15%
crostini chromeos debian containers bash-script

beleyenv's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

beleyenv's Issues

Reports of broken flatpak/docker due to security.nesting

I have not experienced any issues and I don't remember doing this myself, but I recently saw some reports of people claiming flatpak wasn't working: https://www.reddit.com/r/Crostini/comments/r9gmp0/flatpak_broken_on_chrome_960466477 .

If this is true, it'd also impact docker if it's related to the security.nesting flag.

Can be fixed manually via crosh (Ctrl+Alt+T):

  • vsh termina
  • lxc config set penguin security.nesting true

Supposedly documented as an issue in https://bugs.chromium.org/p/chromium/issues/detail?id=1087937, but it's a rather old ticket and I have not had issues or seen people have issues lately until now.

I'll close this out once I do a clean re-install of everything or see more confirmation about what the default is for security.nesting.

Note for me, but may help someone else too. :)

parse error: Invalid numeric literal at line 2, column 0

Not sure what's wrong but encountered this...

wc@penguin:~/.beleyenv/beleyenv$ ./index.sh
Hit:1 https://deb.debian.org/debian buster InRelease
Hit:2 https://security.debian.org/debian-security buster/updates InRelease
Ign:3 https://storage.googleapis.com/cros-packages/94 buster InRelease
Hit:4 https://storage.googleapis.com/cros-packages/94 buster Release
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree
Reading state information... Done
jq is already the newest version (1.5+dfsg-2+b1).
libnotify-bin is already the newest version (0.7.7-4).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
parse error: Invalid numeric literal at line 2, column 0

⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤
Beleyenv install failed!
⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤

Kitty unable to start in Debian 11 (Buster)

Just installed this on debian 11 (fresh container) and found that kitty was unable to start due to a missing xdg-shell in the compositor. This can be fixed by changing linux_display_server to x11 in ~/.config/kitty/kitty.conf

I suspect this issue may re-occur for some other applications and they will similarly need to be forced to use x11 instead of wayland.

XPS 13 Plus Camera Support for Ubuntu 22.10

The camera works fine with Ubuntu 22.04 LTS, as tested by me and confirmed in https://bugs.launchpad.net/ubuntu/+source/linux-firmware/+bug/1955383 .

Unfortunately, Ubuntu 22.10 does not support it on Kernel 5.19.0-23-generic.

I believe once it is released on "linux-firmware" in https://bugs.launchpad.net/ubuntu/kinetic/+source/linux/+bug/1987595, it may work.

It is possible to get the camera working on Ubuntu 22.10 by switching back to 5.15.0-53-generic. However, using the older kernel with Ubuntu 22.04 results in occasional hard crashes, requiring a hard reset to reboot.

For my reference: The timing to get the grub menu to come up is borderline impossible by default. I changed the following temporarily:

in /etc/default/grub, add/modify the following for easy saving and ability to select:

GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true
#GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=-1

Kind of annoying. Gnome 43 is a huge upgrade, but not having a camera is also annoying...

/etc/dhcp/dhclient.conf should be updated for dnsmasq to work

Forgot to add prepend domain-name-servers 127.0.0.1; to /etc/dhcp/dhclient.conf in recent dnsmasq changes.

If you're using beleyenv and want to use the dnsmasq stuff I added recently, just add the above like described.

Will get to this a bit later. Just don't want to forget.

dnsmasq not binding to penguin container's external IP

A helpful reader found what may be a new issue with my write-up at https://chrisbeley.com/software-engineering/how-to-apply-chromeos's-linux-container's-etchosts-outside-of-the-container-in-chrome . This would also require some changes to beleyenv to fix.

TODO:

  • Investigate what changed/verify the fix.
  • Update beleyenv
  • Update the blog post and include a changelog at the bottom noting this change.

Issue sent:

I encountered some problems with this on the latest ChromeOS that you might be interested in. Presumably things have changed with crostini since you wrote that article,
I experienced the below issue on Buster and Bullseye (Version 100.0.4896.82 (Official Build) (64-bit))

The problem was essentially that the ip address returned by "dig +short penguin.lxd" is not the IP address which dnsmasq binds on by default.

The extra step required to make things work after installing dnsmasq is:

1. edit /etc/dnsmasq.conf as root
2. uncomment #listen_address and set it to the IP returned by "dig +short penguin.lxd"
3. sudo systemctl restart dnsmasq

Kitty installation on Lenovo Duet 3 (aarch64) ChromeOs incompatible

Hey,

I tried to install just kitty on my Lenovo Duet 3 with your script. The script downloads kitty in Version 0.27.1, but this version is incompatible with debian 11. It requires a newer glibc version of 2.33/2.34 while debian is on 2.31.

I could install kitty via apt-get install kitty, but now i have already installed the newer version via the script. Could you give me a hint, why the installer.sh did not autodetect the right version for debian 11 or how to remove the installed 0.27.1 version?

Instruction to use "sudo poweroff" is now problematic

This seems to confuse ChromeOS now annoyingly. I was in a weird state where ChromeOS thought the container was on, but it was not.

This feels like a bug, but I should update the scripts to say to right click terminal, then click shutdown, instead.

xps 13 plus screen blanking issue

Frequently, screen blanking does not work for me (screen turns off, then turns back on with a cursor on a black screen).

Could be related to https://gitlab.freedesktop.org/drm/amd/-/issues/662 I'm not on an amd GPU.

Issues mentions https://github.com/dwagelaar/enforce-dpms, which seems like it could fix my problem, but it is not ideal.

https://gitlab.freedesktop.org/drm/intel/-/issues/7581 suggests Kernel 6.1.0 may fix this issue. Ubuntu 23.04 ships with Kernel 6.2, so that may fix my issue. I'm delaying upgrading though right now since I can't risk disruption with my laptop.

MacOS Support

For better or worse, I'll likely have a Macbook at my next job. I'd like to share parts of the work I've done in here to bootstrap and maintain a work-focused MacOS dev setup. I started some of this way back, but I have not owned a macbook for a long time now.

Ideas/Things to think about:

  • Only want work-focused things in the MacOS configuration (may wish to generalize this idea of work/play).
  • Brew supports "casks" now, which is likely my best bet for installing non-terminal applications.
  • Will likely want some convention of shared scripts vs mac/chromeos specific scripts.
  • Current beleyenv stores it's manually installed stuff in /usr/local/beleyenv/, then symlinks to /usr/local/bin. /opt may be more appropriate.
  • A generic way to hook into configuration/scripts in a separate private repo. The encryption approach I use now is too risky in terms of accidentally pushing secrets for some things, so I'd like two ways of handling that.

Gnome freezing with GPU HANG: ecode 12:1:4c0452c8, in gnome-control-c [18002]

On my new XPS 13 plus with Ubuntu 22.10, I was noticing it freezing, requiring a hard reset. However, I later found out that while no keyboard or mouse input worked, if I ssh'ed into the machine, it was still alive. I could recover it by doing a killall -9 gnome-shell.

There's a recent thread about this in https://gitlab.freedesktop.org/drm/intel/-/issues/4825 .

After further investigation, I suspect this was not happening randomly, but only happening while I was playing in gnome settings (I also originally thought this was due to my experimentation with an older kernel).

I've narrowed it down to being able to be consistently reproduced by scrolling around the power settings screen for less than a minute. I'm going to keep seeing whether the issue ever is reproduceable in any other way.

This issue has been brought up in:

This is annoying, but easy to avoid. Switching power profiles is still possible too with the quick menu and even in settings if I don't linger long on the screen. Hopefully this is not a hardware issues with my machine.

When bug occurs, output of sudo journalctl -f /usr/bin/gnome-shell:

Nov 17 01:19:26 superlappy gnome-shell[32011]: See https://wayland.freedesktop.org/libinput/doc/1.21.0/touchpad-jumping-cursors.html for details
Nov 17 01:19:26 superlappy gnome-shell[32011]: libinput error: event12 - VEN_04F3:00 04F3:31D1 Touchpad: kernel bug: Touch jump detected and discarded.
Nov 17 01:19:26 superlappy gnome-shell[32011]: See https://wayland.freedesktop.org/libinput/doc/1.21.0/touchpad-jumping-cursors.html for details
Nov 17 01:19:26 superlappy gnome-shell[32011]: libinput error: event12 - VEN_04F3:00 04F3:31D1 Touchpad: WARNING: log rate limit exceeded (5 msgs per 24h). Discarding future messages.

There is a large thread that seems related in https://community.frame.work/t/hard-freezing-on-fedora-36-with-the-new-12th-gen-system/20675/171?page=3 . Things that didn't work:

  • Disabling enable_psr (ie: setting i915.enable_psr=0 for GRUB_CMDLINE_LINUX_DEFAULT.
  • Disabling automatic brightness.
  • sudo apt-get remove xserver-xorg-video-intel

Issue seems to pop up a lot: https://gitlab.freedesktop.org/drm/intel/-/issues/?search=gpu%20hang&sort=created_date&state=opened&first_page_size=20

Issue is not fixed in Kernel 6.0.9. Was looking a bit at https://www.reddit.com/r/linuxquestions/comments/yiiua7/does_anyone_know_what_the_status_is_on_the_i915/ .

mkdir: cannot create directory ‘/usr/local/beleyenv/bin’

Beleyenv failed during the Todo install on a fresh Linux beta host:

⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤
Sublime text plugins not under package control installed
⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   646  100   646    0     0   1814      0 --:--:-- --:--:-- --:--:--  1814
100 15924  100 15924    0     0  17537      0 --:--:-- --:--:-- --:--:-- 64209
todo.txt_cli-2.12.0/
todo.txt_cli-2.12.0/todo.sh
todo.txt_cli-2.12.0/._todo.cfg
todo.txt_cli-2.12.0/todo.cfg
todo.txt_cli-2.12.0/._todo_completion
todo.txt_cli-2.12.0/todo_completion
mkdir: cannot create directory ‘/usr/local/beleyenv/bin’: Permission denied

⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤
Beleyenv install failed!
⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤⬤

Manually creating the folder and rerunning index.sh fixed the issue

Ubuntu Support

The days of ChromeOS are coming to an end. My XPS 13 plus is on the way and will be running Ubuntu.

I'm using this issue to keep track of things I don't want to forget while I add the new setup to beleyenv.

Evaluate dconf serialization possibilities

It is really lame that dconf uses a binary format, which means I can't manage it like other configs in beleyenv unless I want to just be checking in binary blobs (not very useful).

All settings can be dumped via dconf dump / > dconf-settings.ini and imported via cat dconf-settings.ini | dconf load /. This is a bit problematic for a few reasons though:

  • It seems some things in the database may change often. The biggest example I see is the reminders-past that is a part of org/gnome/evolution-data-server/calendar.
  • It is possible there could be sensitive data in the database -- though I can encrypt it in this public repo if need be.

I'll have to decide how to handle these cases and filter them out. I'm thinking that coming up with a list of paths that make sense to backup is likely the best path forward.

As for auto-updating and loading, it should be pretty easily via systemd's pathModified -- https://zerokspot.com/weblog/2018/09/15/executing-jobs-on-filechanges-with-systemd/ .

Ubuntu borg backup to Google Drive

Currently, I have backups going to /home/backups. On ChromeOS, they go to the mounted google drive folder.

While I could mount google drive and or start backing up via a ssh mount to my vps, I'm going to continue backing up locally to /home/backups. This is similar to what I do on ChromeOS, since the backup folder on ChromeOS is set to always be available offline.

This will increase overall performance and allow backups and backup restores to occur quickly, without a network connection, and without potential issues that can arise from backing up to remote filesystems.

rclone mount support for gdrive is apparently good, but still not without flaws.

So, the end results will be:

  • Back up to /home/backups (compressed, but try to exclude large things)
  • Have another job that periodically runs rclone to sync to Google drive, one way. If it fails, no big deal, it'll pick itself up later.

I'll need to add a new user systemd timer and read up on rclone to do this. backing up to /home/backups already works and uses a separate config than chromeOS via config.json.

Add .tool-versions to global git ignore

On the fence if I actually want to make this consistent. If I do, following needs to happen:

  1. create ~/.gitignore with .tool-versions
  2. git config --global core.excludesFile ~/.gitignore

Same for MacOS and ChromeOS

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.