commit 2f86331720339b57b466da0822cc0e8414805352 Author: Penelope Gwen Date: Mon Jun 9 23:18:48 2025 -0700 first big push diff --git a/README.md b/README.md new file mode 100644 index 0000000..fce1b30 --- /dev/null +++ b/README.md @@ -0,0 +1,80 @@ +# Linux Server Setup for Nintendo Wii + +## Requirements: + +- A Nintendo Wii (RVL-001 or RVL-101) +- A computer running Linux natively +- An SD card greater than 8GB in size +- Probably other stuff i can't think of right now + +## Suggestionments: + +- A USB NIC that is compatible with linux kernel 4.19 +- The kind of autism that makes you inclined to run a web server on a Nintendo Wii using Linux + +# Instructions (VERY WIP): + +## Setting up arch linux on your wii + +1. Follow the instructions at https://wii.hacks.guide to mod your Wii. You only need to get the to the point that you have priiloader installed +2. Follow the instructions at https://wiki.wii-linux.org/wiki/Installation_Guide to install Arch Linux btw. +3. Plug a keyboard into the Wii's USB port. If you have one, you should also plug in a compatible USB NIC. + - Not all USB NICs will work, however more seem to work than do on the Wii normally. +4. Enable automatically booting to linux (this can be skipped if you installed BootMii as boot2 when modding the Wii) + 1. Power on the Wii while holding the reset button to display the priiloader menu + 2. Use the up/down arrow keys on your USB keyboard to select "options", then press enter + 3. User the left/right arrow keys on your USB keyboard to change the autoboot setting to "BootMii IOS" + 4. Use the up/down arrow keys to select "save settings", press enter. Then select "Exit menu" and press enter again. + 5. Use the up/down arrow keys on your USB keyboard to select "BootMii IOS", then press enter +5. The first time Arch Linux boots, it may automatically reboot itself +6. Once Arch Linux has finished booting, login using the credentials printed at the top of the screen + - you should absolutely change this password with `passwd` after logging in. +7. If you do not have a compatible USB NIC, connect to a 2.4GHz wireless network using `nmtui` +8. Once a network connection is established, perform a full system upgrade using `pacman -Syu`. + - In my experience, this is much more stable on a wireless connection. Couldn't tell you why. + - this will take a long time. Go play Wii Sports while you wait. + +## Setting up the web server on your wii + +9. Install nginx, sudo, and git using `pacman -S nginx sudo git` +10. Create a new non-root user with `useradd --create-home [your username]` +11. Set a password for your user with `passwd [your username]` +12. Run the command `echo '%wheel ALL=(ALL:ALL) ALL' > /etc/sudoers.d/wheel` to enable give sudo access to all users in the wheel group +13. Run the command `usermod -aG wheel [your username]` to add your user to the wheel group +14. Enable the ssh server systemd service with the command `systemctl enable --now sshd`. It should now start automatically upon boot. +15. From your primary linux machine, run `ssh-copy-id -i [your ssh key] [your linux wii's username]@[your linux wii's IP address]` and enter the password you set in step 11 + - `[your ssh key]` is your ssh identity file, likely found in `~/.ssh/`, ending in `.pub` + - `[your linux wii's username]` is the username you set in step 10 + - `[your linux wii's IP address]` is the network address of your wii. You can find this by entering the command `ip address show | grep "inet "` + - The address will probably look something like `192.168.1.130`. It will not be the one starting with `127` nor will it be the one ending with `255` +16. Attempt to log in over ssh from your primary linux machine using the command `ssh [your linux wii's username]@[your linux wii's IP address]` +17. Once connected to a shell over ssh, run `sudo whoami` and enter your user password when prompted + - If the output after entering your passwrd is `root` then your user has successfully been given sudo priveleges + - you may now log the wii's `root` user out of any active shells +18. Enable the nginx server systemd service with the command `systemctl enable --now nginx`. It should now start automatically upon boot. +19. Navigate to `http://[your linux wii's IP address]` in a web browser on a device connected to the same network as the Wii. You should be greeted with the nginx splash page. +20. Open the nginx config with `sudo nano /etc/nginx/nginx.conf`. In the `http` block, locate the first `server` block, and change `/usr/share/nginx/html` to `/usr/local/share/nginx/html` +21. Press ctrl+x to close the file, press y to confirm saving changes, then press enter to confirm the filename +22. Run the command `sudo mkdir -p /usr/local/share/nginx/html` to create the local nginx resource directory +23. Run the command `sudo systemctl restart nginx` to reload the modified config +24. run the command `echo 'hi' | sudo tee /usr/local/share/nginx/html/index.html` to create a text file at the root of your server. +25. Reload the webpage you navigated to in step 19 and you should see the word 'hi' appear in the browser window. +26. Update the files at `/usr/local/share/nginx/html/` with static web content and it will become available at your wii's IP address + +## Periodically updating the web server's contents (using the config you see here) + +27. clone this repository to your user's home directory `cd;git clone 'https://git.pogmom.me/pogmommy/wii-server-setup.git'` +28. cd into the newly-cloned repository and run the setup script `cd wii-server-setup;./setup.sh`. Provide your password when prompted. + +## Finishing touches +XX. Make any remaining configuration changes as desired (change system hostname, etc.) + +## Current issues: +- Probably a lot but what do you really have to complain about + +# Special thanks to: + +- **Techflash** and the cool folk listed at https://wii-linux.org/ for making this project possible in the first place. These people are wizards. +- **Bringus Studios** for reminding me that you don't need to know how to use linux to have a good time with it. +- **Nintendo** for threatening to kill emulator developers. +- **Nic** for selling me this specific Wii. diff --git a/pagecontents.sh b/pagecontents.sh new file mode 100755 index 0000000..360c914 --- /dev/null +++ b/pagecontents.sh @@ -0,0 +1,6 @@ +#!/usr/bin/bash + +script -qc 'hyfetch -p transgender --distro wii-linux-ngx' | sed 's|'"${USER}"'|\r'"${USER}"'|' | grep -v 'Local IP' +printf '\n%s\n' 'The above output is actually generated by hyfetch on my Wii! It updates every 15 minutes.' +printf '%s\n\n' "last updated: $(date)" +cat ${HOME}/wii-server-setup/readme.txt diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..647a1e7 --- /dev/null +++ b/setup.sh @@ -0,0 +1,13 @@ +#!/usr/bin/bash + +sudo setfacl -R -m u:${USER}:rwx /usr/local/share/nginx/html +sudo pacman -S expect cronie +sudo systemctl enable --now cronie.service +python3 -m venv ${HOME}/venv +${HOME}/venv/bin/pip install rich-cli + +#this is probably horrificly poorly done but oh well +#script -qc '~/venv/bin/rich README.md 2> /dev/null' | unbuffer -p cat | tee readme.txt +~/wii-server-setup/update-readme.sh +echo '*/15 * * * * '"${HOME}"'/wii-server-setup/update-webpage.sh' | tee ./newcrontab +crontab ./newcrontab diff --git a/update-readme.sh b/update-readme.sh new file mode 100755 index 0000000..72a5138 --- /dev/null +++ b/update-readme.sh @@ -0,0 +1,4 @@ +#!/usr/bin/bash + +#sudo mkdir -p /etc/wii-server +script -qc '~/venv/bin/rich README.md 2> /dev/null' | unbuffer -p cat | tee readme.txt diff --git a/update-webpage.sh b/update-webpage.sh new file mode 100755 index 0000000..a4335a4 --- /dev/null +++ b/update-webpage.sh @@ -0,0 +1,3 @@ +#!/usr/bin/bash + +~/wii-server-setup/pagecontents.sh | aha -b -t 'Wii Linux Static Webpage Demo' | sed 's|'"$USER"'\@|
'$USER'\@|' | tee /usr/local/share/nginx/html/index.html