forked from cimryan/teslausb
-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pi-gen-sources: simplify and update for building bookworm image
- Loading branch information
Showing
8 changed files
with
53 additions
and
97 deletions.
There are no files selected for viewing
5 changes: 0 additions & 5 deletions
5
pi-gen-sources/00-teslausb-tweaks/00-patches/01-cmdline-update.diff
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
pi-gen-sources/00-teslausb-tweaks/00-patches/02-config-update.diff
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,23 @@ | ||
#!/bin/bash -e | ||
touch "${ROOTFS_DIR}/boot/ssh" | ||
install -m 666 files/userconf.txt "${ROOTFS_DIR}/boot/" | ||
install -m 755 files/rc.local "${ROOTFS_DIR}/etc/" | ||
install -m 666 files/teslausb_setup_variables.conf.sample "${ROOTFS_DIR}/boot/teslausb_setup_variables.conf" | ||
install -m 666 files/wpa_supplicant.conf.sample "${ROOTFS_DIR}/boot/" | ||
install -m 666 files/run_once "${ROOTFS_DIR}/boot/" | ||
install -m 666 files/teslausb_setup_variables.conf.sample "${ROOTFS_DIR}/boot/firmware/teslausb_setup_variables.conf" | ||
install -m 666 files/wpa_supplicant.conf.sample "${ROOTFS_DIR}/boot/firmware" | ||
install -m 666 files/run_once "${ROOTFS_DIR}/boot/firmware" | ||
install -d "${ROOTFS_DIR}/root/bin" | ||
|
||
# work around shortcoming in pi-gen that causes ca-certificates to be | ||
# misconfigured | ||
on_chroot << EOF | ||
/usr/bin/c_rehash /etc/ssl/certs/ | ||
EOF | ||
# ensure dwc2 module is loaded | ||
echo "dtoverlay=dwc2" >> "${ROOTFS_DIR}/boot/firmware/config.txt" | ||
|
||
# remove unwanted packages, disable unwanted services, and disable swap | ||
on_chroot << EOF | ||
apt-get remove -y --force-yes --purge triggerhappy bluez alsa-utils | ||
rm -rf /boot/kernel8.img | ||
rm -rf /lib/modules/*-v8+ | ||
echo "pi ALL=(ALL:ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/pi-nopassword | ||
EOF | ||
|
||
# disable various interactive setup dialogs | ||
on_chroot << EOF | ||
apt-get remove -y --force-yes --purge triggerhappy bluez userconf-pi dphys-swapfile firmware-libertas firmware-realtek firmware-atheros mkvtoolnix | ||
apt-get -y --force-yes autoremove | ||
systemctl disable keyboard-setup | ||
systemctl disable userconfig | ||
systemctl disable resize2fs_once | ||
systemctl disable dpkg-db-backup | ||
update-rc.d resize2fs_once remove | ||
rm /etc/init.d/resize2fs_once | ||
rm /usr/share/initramfs-tools/scripts/local-premount/firstboot | ||
update-initramfs -u | ||
EOF | ||
|
||
# Below here is the rest of the stage2 (builds the Stretch lite image) | ||
# run script commented out just to give guidance on things that can be done. | ||
|
||
# install -m 755 files/teslausb_setup_scripts/bin/* "${ROOTFS_DIR}/root/bin/" | ||
# install -d "${ROOTFS_DIR}/root/bin/tmp" | ||
# install -m 755 files/teslausb_setup_scripts/tmp/* "${ROOTFS_DIR}/root/bin/tmp/" | ||
|
||
# on_chroot << EOF | ||
# systemctl disable hwclock.sh | ||
# systemctl disable nfs-common | ||
# systemctl disable rpcbind | ||
# systemctl disable ssh | ||
# systemctl enable regenerate_ssh_host_keys | ||
# EOF | ||
|
||
# if [ "${USE_QEMU}" = "1" ]; then | ||
# echo "enter QEMU mode" | ||
# install -m 644 files/90-qemu.rules "${ROOTFS_DIR}/etc/udev/rules.d/" | ||
# on_chroot << EOF | ||
# systemctl disable resize2fs_once | ||
# EOF | ||
# echo "leaving QEMU mode" | ||
# else | ||
# on_chroot << EOF | ||
# systemctl enable resize2fs_once | ||
# EOF | ||
# fi | ||
|
||
# on_chroot << \EOF | ||
# for GRP in input spi i2c gpio; do | ||
# groupadd -f -r "$GRP" | ||
# done | ||
# for GRP in adm dialout cdrom audio users sudo video games plugdev input gpio spi i2c netdev; do | ||
# adduser pi $GRP | ||
# done | ||
# EOF | ||
|
||
# on_chroot << EOF | ||
# setupcon --force --save-only -v | ||
# EOF | ||
|
||
# on_chroot << EOF | ||
# usermod --pass='*' root | ||
# EOF | ||
|
||
# rm -f "${ROOTFS_DIR}/etc/ssh/"ssh_host_*_key* |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
IMG_NAME=teslausb | ||
PI_GEN_RELEASE=teslausb-prebuilt | ||
LOCALE_DEFAULT=en_US.UTF-8 | ||
TARGET_HOSTNAME=teslausb | ||
KEYBOARD_KEYMAP=us | ||
KEYBOARD_LAYOUT="English (US)" | ||
TIMEZONE_DEFAULT="America/Los_Angeles" | ||
FIRST_USER_NAME=pi | ||
FIRST_USER_PASS=raspberry | ||
DISABLE_FIRST_BOOT_USER_RENAME=1 | ||
WPA_COUNTRY=US | ||
ENABLE_SSH=1 | ||
STAGE_LIST="stage0 stage1 stage2 stage_teslausb" | ||
RELEASE=bookworm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash -eu | ||
|
||
SRC=$(dirname $(readlink -f $0)) | ||
DEST=$(readlink -f .) | ||
|
||
if [[ "$DEST" != */pi-gen ]] | ||
then | ||
echo "$0 should be called from the RPi-Distro pi-gen folder" | ||
exit 1 | ||
fi | ||
|
||
cp "$SRC/pi-gen-config" config | ||
rm -rf stage2/EXPORT_NOOBS stage2/EXPORT_IMAGE export-image/01-user-rename/00-packages | ||
mkdir -p stage_teslausb | ||
touch stage_teslausb/EXPORT_IMAGE | ||
cp stage2/prerun.sh stage_teslausb/prerun.sh | ||
cp -r "$SRC/00-teslausb-tweaks" stage_teslausb | ||
|
||
echo 'Build config set. Now use "./build.sh" or "./build-docker.sh" to build the TeslaUSB image.' | ||
|
||
|