# Chromebook Transformation Project: Master Manual
*A comprehensive guide to running Lubuntu Linux, custom audio drivers, and Android emulation on an AMD Chromebook.*

---

## Phase 1: Upgrading the System Packages
Before setting up any emulation software or custom engines, run a massive update sweep to patch the underlying Linux system files, repository links, and core graphics libraries:
```bash
sudo apt update && sudo apt upgrade -y
```

---

## Phase 2: Installing the Display Engine (Weston)
Because Lubuntu runs on a traditional X11 desktop and modern Android emulation via Waydroid requires a Wayland-based display compositor environment, install Weston to bridge the gap:
```bash
sudo apt install weston -y
```

---

## Phase 3: Unlocking the Network & Permanent Firewall Rules
To ensure the internal Android virtual container can securely pass traffic through the Linux host firewall and share the Chromebook's Wi-Fi connection, apply these traffic routing permissions:
```bash
sudo ufw route allow in on way0
sudo ufw allow in on waydroid
sudo ufw default allow routing
```

---

## Phase 4: Patching the Laptop Speakers
Budget AMD Chromebooks use specialized audio hardware routings that vanilla Linux distributions cannot unmute natively. Download the community hardware-specific repository using Git, enter its directory, and execute the automated audio driver patch script:
```bash
git clone https://github.com/WeirdTreeThing/chromebook-linux-audio.git
cd chromebook-linux-audio
sudo ./setup-audio
```
*Note: A system reboot (`sudo reboot`) is required after running this script to initialize the internal speakers.*

---

## Phase 5: Troubleshooting & Session Clears
During active configuration or in the event of memory lockups (`wayland-0 lockfile errors`), use these system intervention commands to instantly force-clear lingering background processes, remove crashed system sockets, and reset the graphics engine state:
```bash
killall weston
killall -9 weston
waydroid session stop
sudo systemctl restart waydroid-container
sudo rm -rf /run/user/1000/wayland-*
```

---

## Phase 6: Pushing the App into the System
Once the background servers are clear, pivot directly into your default local storage directory to physically inject the acquired educational application package into the Android environment:
```bash
cd ~/Downloads
waydroid app install Acellus_2.035_APKPure.apk
```

---

## Phase 7: Building the Automated Desktop Launcher
To save you from ever having to manually type complex terminal arguments again, generate an automated desktop initialization script directly onto your desktop wallpaper layer:

```bash
cat << 'EOF' > ~/Desktop/Acellus-Classroom.desktop
[Desktop Entry]
Version=1.0
Type=Application
Name=Acellus Classroom
Comment=Launch Android Environment for Acellus
Exec=bash -c "killall -9 weston; waydroid session stop; weston --socket=wayland-9 --width=1024 --height=768 & sleep 1.5 && WAYLAND_DISPLAY=wayland-9 waydroid show-full-ui"
Icon=application-x-applix-spreadsheet
Terminal=false
Categories=Education;
EOF
chmod +x ~/Desktop/Acellus-Classroom.desktop
```

---

## Daily Operational Steps for the Student
To boot into class every morning, simply:
1. Power on the Chromebook and sign into the **Lubuntu** desktop workspace.
2. **Double-click** the newly created **Acellus Classroom** shortcut icon directly on the desktop background.
3. Once the gray window initializes the layout interface, swipe up to open the Android application drawer, launch **Acellus**, and attend classes with complete audio and visual functionality!
