aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--2/makefile3
-rw-r--r--2/readme.md11
-rwxr-xr-x2/rice.sh131
-rw-r--r--readme.md2
4 files changed, 143 insertions, 4 deletions
diff --git a/2/makefile b/2/makefile
index 8cb774d..6275dd2 100644
--- a/2/makefile
+++ b/2/makefile
@@ -1,4 +1,5 @@
-DEB_URL = https://repos.rcn-ee.com/debian/pool/main/l/linux-upstream/linux-headers-5.10.168-ti-r71_1bullseye_armhf.deb
+DEB_URL = https://repos.rcn-ee.com/debian/pool/main/l/linux-upstream/linux-headers-6.1.69-ti-rt-r22_1sid_armhf.deb
kernel-headers.deb:
curl -sLo- $(DEB_URL) > $@
+
diff --git a/2/readme.md b/2/readme.md
index 333e8f1..97acd9a 100644
--- a/2/readme.md
+++ b/2/readme.md
@@ -1,7 +1,12 @@
-I used [this][img] image, and stripped it down by removing xfce, x11, lightdm,
-plymouth, etc.
+I used [this][img] image as a base, and stripped it down using the steps
+recorded in [rice.sh](./rice.sh). This script can be run from the above image
+by doing the following:
-BeagleBone is on kernel `5.10.168-ti-r71`.
+```
+ (login as `debian` with password `temppwd`)
+
+$ curl -sLo- https://git.pipeframe.xyz/school/drvo/plain/2/rice.sh | sudo sh -s
+```
[img]: https://www.beagleboard.org/distros/am335x-11-7-2023-09-02-4gb-emmc-xfce-flasher
diff --git a/2/rice.sh b/2/rice.sh
new file mode 100755
index 0000000..fe63cbb
--- /dev/null
+++ b/2/rice.sh
@@ -0,0 +1,131 @@
+#!/bin/sh
+if [ $(id -u) -ne 0 ] ; then
+ echo 'this script should be run as root instead!'
+ exit 1
+fi
+
+USER_NAME='loek'
+HOST_NAME='drvo'
+KERNEL_VERSION='6.1.69-ti-rt-r22'
+
+# fail ok
+fok() { "$@" 1> /dev/null 2> /dev/null ; }
+
+echo "setting hostname to $HOST_NAME..."
+hostname $HOST_NAME
+hostname > /etc/hostname
+sed -i 's/\<BeagleBone\>/'"$HOST_NAME"'/g' /etc/hosts
+
+echo "creating user $USER_NAME..."
+fok userdel debian
+rm -rf /home/debian
+fok id -u $USER_NAME || fok adduser $USER_NAME
+
+echo "removing all security..."
+rm -f /etc/sudoers.d/admin
+cat << "EOF" > /etc/sudoers.d/nopasswd
+%sudo ALL=(ALL:ALL) NOPASSWD: ALL
+EOF
+usermod -aG sudo $USER_NAME
+cat << "EOF" > /etc/ssh/sshd_config.d/rice.conf
+PasswordAuthentication yes
+PermitEmptyPasswords yes
+PermitRootLogin yes
+PrintLastLog no
+EOF
+systemctl restart ssh
+fok passwd -d root
+fok passwd -d $USER_NAME
+
+echo "fixing terminal colors & default editor..."
+cat << "EOF" > /etc/profile.d/rice.sh
+export TERM="xterm-256color"
+export EDITOR="nvim"
+EOF
+
+echo "removing bloatware..."
+fok apt remove -y --allow-change-held-packages \
+ libruby2.7 libgl1-mesa-dri python3-numpy mesa-vulkan-drivers \
+ bb-beagle-config libflite1 firmware-libertas python3-mypy libgtk-3-common \
+ adwaita-icon-theme firmware-atheros firmware-misc-nonfree \
+ pocketsphinx-en-us scratch libwebkit2gtk-4.0-37 firmware-iwlwifi \
+ bb-node-red-installer firefox-esr bb-code-server plymouth xserver-xorg-core \
+ xserver-xorg xserver-xorg-legacy x11-common x11-server-utils x11-utils \
+ lightdm-gtk-greeter lightdm xfce4-session xfce4-panel xfce4-settings \
+ xfce4-helpers fonts-dejavu-core nodejs nodejs-doc nginx-core nginx-common \
+ nginx mesa-va-drivers bluetooth bluez pipewire-bin pipewire pulseaudio-utils \
+ pulseaudio gtk-update-icon-cache wpasupplicant fontconfig-config fontconfig \
+ hostapd adwaita-icon-theme hicolor-icon-theme polkitd whiptail
+echo "removing more bloatware..."
+fok apt autoremove -y
+echo "cleaning up trash..."
+fok apt clean -y
+
+echo "updating system..."
+fok apt-get update
+fok apt-get upgrade -y
+
+echo "preparing for debian sid update..."
+export DEBIAN_FRONTEND=noninteractive
+echo "usrmerge usrmerge/autoconvert boolean true" | debconf-set-selections
+fok apt-get install usrmerge -y
+cat << "EOF" > /etc/apt/sources.list
+deb http://deb.debian.org/debian sid main contrib non-free
+deb [arch=armhf signed-by=/usr/share/keyrings/rcn-ee-archive-keyring.gpg] http://repos.rcn-ee.com/debian/ sid main
+EOF
+fok apt-get update
+echo "updating to debian sid..."
+apt-get dist-upgrade -y
+
+echo "removing noisy banners..."
+rm -f /etc/motd /etc/issue /etc/issue.net /etc/dogtag
+
+echo "install newer linux kernel..."
+fok apt-get install -y linux-image-$KERNEL_VERSION linux-headers-$KERNEL_VERSION
+
+echo "install based software..."
+fok apt-get install -y neovim zsh
+fok chsh -s /bin/zsh $USER_NAME
+fok chsh -s /bin/zsh root
+
+cp /etc/zsh/newuser.zshrc.recommended "/home/$USER_NAME/.zshrc"
+chown "$USER_NAME:$USER_NAME" "/home/$USER_NAME/.zshrc"
+cat << "EOF" > /root/.zshrc
+# Set up the prompt
+autoload -Uz promptinit
+promptinit
+prompt redhat
+
+setopt histignorealldups sharehistory
+
+# Use emacs keybindings even if our EDITOR is set to vi
+bindkey -e
+
+# Keep 1000 lines of history within the shell and save it to ~/.zsh_history:
+HISTSIZE=1000
+SAVEHIST=1000
+HISTFILE=~/.zsh_history
+
+# Use modern completion system
+autoload -Uz compinit
+compinit
+
+zstyle ':completion:*' auto-description 'specify: %d'
+zstyle ':completion:*' completer _expand _complete _correct _approximate
+zstyle ':completion:*' format 'Completing %d'
+zstyle ':completion:*' group-name ''
+zstyle ':completion:*' menu select=2
+zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
+zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*'
+zstyle ':completion:*' menu select=long
+zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
+zstyle ':completion:*' use-compctl false
+zstyle ':completion:*' verbose true
+
+zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'
+EOF
+
+echo "cleaning up trash..."
+fok apt clean -y
+
+echo "all done!"
diff --git a/readme.md b/readme.md
index c21b853..3326740 100644
--- a/readme.md
+++ b/readme.md
@@ -32,6 +32,8 @@
system calls), you should append the number between brackets to the `man`
command, i.e. to read 'write(2)' use the command `man 2 write`.
- Use `dmesg` with the `-w` or `-W` option (see man dmesg(1))
+- Start writing a kernel module that targets the kernel version of the
+ BeagleBone image you're planning on using.
# direct ethernet setup