I managed to set up debian 11 on a Toshiba Chromebook2, model CB35-B3340 and a Dell Chromebook 11 3120 P22T00
WIFI/Sound/HDMI all work well, which satisfies me.
-
Firstly, switch Chromebook into developer mode
- Visit Debian and use dd command to create a bootable usb stick with a minimal iso
-
Visit MrChromebox
- Install/Update UEFI (Full ROM) firmware (the Sea bios)
-
Boot from the usb stick and setup the minimal system
- Allow debian use all 15G space with LVM, no separate partitions
- Skip wifi setup as we don't have the firmware at that moment
-
Boot from the chromebook into debian without GUI, without network
-
Plug a usb realteck 8139 ethernet card and so I get internet connection:
- add non-free and main contrib source line to
/etc/apt/sources.list
file:
deb http://mirror.fsmg.org.nz/debian bullseye main contrib non-free
-
apt install firmware-iwlwifi, firmware-intel-sound
-
apt install gnome-core (wifi works from now)
-
plug off the usb ethernet card and reboot
-
Other settings
- Remove old kernels to save space, Help Reference
- Settings => Power => Disable auto suspend when plug in
- Run
sudo apt clean
- Restrict journal log max size by
vim /etc/systemd/journald.conf
and uncomment the SystemMaxUser=50M
line, and then systemctl restart systemd-journald
You must have known that I just migrated this blog site to a VPS hosted on oracle cloud, while this wiki page is too brief to get a workable environment easily.
Here is the note for this migration.
- sudo -i
- Install packages that chyrp will need
apt install php8.1 php8.1-xml php8.1-fpm php8.1-mysql php8.1-mbstring mysql-server nginx certbot python3-certbot-nginx
- Set a password for 'root'@'localhost' account on this new mysql server
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_new_password';
FLUSH PRIVILEGES;
- Run mysql_secure_installation to
- Remove anonymous users
- Disallow root login remotely
- Remove test database and access to it
- Create a common user for the blog database, and the blog database
CREATE USER 'blog'@'localhost' IDENTIFIED BY 'superdifficultpassword';
GRANT ALL PRIVILEGES ON blog.* To 'blog'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
CREATE DATABASE `blog` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
- Put
.my.cnf
with the following content in home directory
[client]
user=blog
password=yoursuperdifficultpassword
host=localhost
- Restore the database backup
mysql blog < blog_20230408-030501.sql
- Setup nginx and https certificate with certbot
- Setup renew the certificate by crontab
SHELL=/usr/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
15 0 * * * /usr/bin/certbot --nginx renew > /dev/null
- Restore previous installation, overwrite with the latest version, do the upgrade, that's it!
In short,
sudo vim /etc/systemd/logind.conf
Find and uncomment the following lines, and change the values
HandleLidSwitch=lock
HandleLidSwitchExternalPower=lock
HandleLidSwitchDocked=ignore
Save and exit, and
sudo systemctl restart systemd-logind
You might be surprised why I am using MSYS2 so much these days. In short, my new job doesn't allow me to use Linux at work. I cannot bear the CMD.EXE and PWSH.EXE, they might be great tools for someone else, but definitely not for me.
- If you visit a shared folder like
/c/vagrant
, you will get the infamous Too many levels of symbolic links
error message. Fortunately, we have a solution: add a new user Environment variable MSYS=nonativeinnerlinks
. I assume you know how to add a user environment to the windows system. If it doesn't take effect, save your current work and reboot. I didn't reboot my Windows 11 VM, but I did have restarted the Windows terminal application to ensure the new MSYS2 terminal will work with the links!
- If you prefer using Git for windows in MSYS2 but don't want to install GitBash because GitBash is also built on MSYS2, Install Git for windows inside MSYS2 will help you! BTW, git_bash_for_windows_is_based_on_msys2_why_not is another very good reference for this topic. I actually got the previous link from the latter article.
- Change the home directory to
/c/Users/your-name
. If you copy from the following, don't forget to change david.wei
to your Windows username.
$ cat /etc/nsswitch.conf
# Begin /etc/nsswitch.conf
passwd: db
group: db
db_enum: cache builtin
#db_home: cygwin desc
db_home: env windows /c/Users/david.wei
db_shell: cygwin desc
db_gecos: cygwin desc
# End /etc/nsswitch.conf
- If you run
cmd.exe
in a msys2 terminal, that %PATH% environment will inherit from the PATH environment in the current bash session.
- put
export MSYS="winsymlinks:lnk"
into your .bashrc
to get a similar behaviour when you do ln -s
Reference