From 2697d52cbb1fab5821a573f8847146538dfe0f40 Mon Sep 17 00:00:00 2001 From: nagumii Date: Mon, 30 Dec 2024 14:13:18 +0200 Subject: [PATCH] Default password for femto is now femto. Must be changed on first login. qrencode also added to dev env --- environment-setup/foxbunto_env_setup.sh | 72 ++++++++++++++++++- .../sysdrv/out/rootfs_uclibc_rv1106/etc/issue | 2 +- .../etc/pam.d/common-password | 33 +++++++++ 3 files changed, 103 insertions(+), 4 deletions(-) create mode 100644 foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/pam.d/common-password diff --git a/environment-setup/foxbunto_env_setup.sh b/environment-setup/foxbunto_env_setup.sh index d358f71..758d549 100755 --- a/environment-setup/foxbunto_env_setup.sh +++ b/environment-setup/foxbunto_env_setup.sh @@ -22,7 +22,7 @@ sudoer=$(echo $SUDO_USER) install_prerequisites() { echo “Setting up Foxbuntu build environment…” apt update - apt install -y git ssh make gcc gcc-multilib g++-multilib module-assistant expect g++ gawk texinfo libssl-dev bison flex fakeroot cmake unzip gperf autoconf device-tree-compiler libncurses5-dev pkg-config bc python-is-python3 passwd openssl openssh-server openssh-client vim file cpio rsync qemu-user-static binfmt-support + apt install -y git ssh make gcc gcc-multilib g++-multilib module-assistant expect g++ gawk texinfo libssl-dev bison flex fakeroot cmake unzip gperf autoconf device-tree-compiler libncurses5-dev pkg-config bc python-is-python3 passwd openssl openssh-server openssh-client vim file cpio rsync qemu-user-static binfmt-support dialog } clone_repos() { @@ -190,7 +190,7 @@ ln -sf /usr/share/zoneinfo/UTC /etc/localtime echo "Installing packages..." apt update -DEBIAN_FRONTEND=noninteractive apt install -y --option Dpkg::Options::="--force-confold" linux-firmware wireless-tools git python3.10-venv libgpiod-dev libyaml-cpp-dev libbluetooth-dev openssl libssl-dev libulfius-dev liborcania-dev evtest screen avahi-daemon protobuf-compiler telnet fonts-noto-color-emoji ninja-build chrony +DEBIAN_FRONTEND=noninteractive apt install -y --option Dpkg::Options::="--force-confold" linux-firmware wireless-tools git python3.10-venv libgpiod-dev libyaml-cpp-dev libbluetooth-dev openssl libssl-dev libulfius-dev liborcania-dev evtest screen avahi-daemon protobuf-compiler telnet fonts-noto-color-emoji ninja-build chrony qrencode if [[ $? -eq 2 ]]; then echo "Error, step failed..."; fi DEBIAN_FRONTEND=noninteractive apt upgrade -y --option Dpkg::Options::="--force-confold" @@ -248,7 +248,8 @@ find / -group pico -exec chgrp femto {} \ find / -user pico -exec chown femto {} \ usermod -d /home/femto -m femto ls -ld /home/femto -echo 'femto:fox' | chpasswd +echo 'femto:femto' | chpasswd +sudo chage -d 0 femto usermod -a -G tty femto usermod -a -G dialout femto @@ -289,6 +290,71 @@ usage() { exit 0 } +################### MENU SYSTEM ################### + +while true; do + CHOICE=$(dialog --clear --backtitle "Foxbuntu SDK Builder" \ + --title "Main Menu" \ + --menu "Choose an action:" 20 60 12 \ + 1 "Update Image" \ + 2 "Modify Chroot" \ + 3 "Modify Kernel" \ + 4 "Install Prerequisites" \ + 5 "Clone Repositories" \ + 6 "Build Environment" \ + 7 "Build SysDrv" \ + 8 "Build U-Boot" \ + 9 "Build RootFS" \ + 10 "Create Final Image" \ + 11 "Install (Run All Steps)" \ + 12 "Exit" \ + 2>&1 >/dev/tty) + + clear + + case $CHOICE in + 1) + update_image + ;; + 2) + modify_chroot + ;; + 3) + modify_kernel + ;; + 4) + install_prerequisites + ;; + 5) + clone_repos + ;; + 6) + build_env + ;; + 7) + build_sysdrv + ;; + 8) + build_uboot + ;; + 9) + build_rootfs + ;; + 10) + create_image + ;; + 11) + install + ;; + 12) + echo "Exiting..." + break + ;; + *) + echo "Invalid option, please try again." + ;; + esac +done ### Run all functions. Broken out so any individual step can be performed if failed. # Should add clean functions... diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/issue b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/issue index 2b85869..0f52a0a 100644 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/issue +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/issue @@ -1,4 +1,4 @@ Ubuntu 22.04.3 LTS \n \l -[username:password] root:root femto:fox +[username:password] root:root femto:femto (default) diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/pam.d/common-password b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/pam.d/common-password new file mode 100644 index 0000000..aad381d --- /dev/null +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/pam.d/common-password @@ -0,0 +1,33 @@ +# +# /etc/pam.d/common-password - password-related modules common to all services +# +# This file is included from other service-specific PAM config files, +# and should contain a list of modules that define the services to be +# used to change user passwords. The default is pam_unix. + +# Explanation of pam_unix options: +# The "yescrypt" option enables +#hashed passwords using the yescrypt algorithm, introduced in Debian +#11. Without this option, the default is Unix crypt. Prior releases +#used the option "sha512"; if a shadow password hash will be shared +#between Debian 11 and older releases replace "yescrypt" with "sha512" +#for compatibility . The "obscure" option replaces the old +#`OBSCURE_CHECKS_ENAB' option in login.defs. See the pam_unix manpage +#for other options. + +# As of pam 1.0.1-6, this file is managed by pam-auth-update by default. +# To take advantage of this, it is recommended that you configure any +# local modules either before or after the default block, and use +# pam-auth-update to manage selection of other modules. See +# pam-auth-update(8) for details. + +# here are the per-package modules (the "Primary" block) +password [success=1 default=ignore] pam_unix.so obscure yescrypt minlen=0 +# here's the fallback if no module succeeds +password requisite pam_deny.so +# prime the stack with a positive return value if there isn't one already; +# this avoids us returning an error just because nothing sets a success code +# since the modules above will each just jump around +password required pam_permit.so +# and here are more per-package modules (the "Additional" block) +# end of pam-auth-update config