Reorganized utilities, fixed stupid typo, timestamp now uses start

Timestamps in the build now grab the time at the beginning of the build,
instead of the end

Sudoers file didn't use chroot path

Rearranged octo-config into first-time folder and renamed first-time
folder to utils
This commit is contained in:
Logan G 2020-08-12 15:08:19 -06:00
parent df8da13de0
commit 23c608198b
Signed by: logan
GPG key ID: E328528C921E7A7A
6 changed files with 13 additions and 14 deletions

View file

@ -153,11 +153,12 @@ fi
export USE_QEMU="${USE_QEMU:-0}"
export IMG_DATE="${IMG_DATE:-"$(date +%Y-%m-%d)"}"
export IMG_FILENAME="${IMG_FILENAME:-"${IMG_DATE}-$(date +%s)-${IMG_NAME}"}"
export ZIP_FILENAME="${ZIP_FILENAME:-"image_${IMG_DATE}-${IMG_NAME}"}"
export IMG_TIME="${IMG_TIME:-"$(date +%s)"}"
export IMG_FILENAME="${IMG_FILENAME:-"${IMG_DATE}-${IMG_TIME}-${IMG_NAME}"}"
export ZIP_FILENAME="${ZIP_FILENAME:-"image_${IMG_DATE}-${IMG_TIME}-${IMG_NAME}"}"
export SCRIPT_DIR="${BASE_DIR}/scripts"
export WORK_DIR="${WORK_DIR:-"${BASE_DIR}/work/${IMG_DATE}-${IMG_NAME}"}"
export WORK_DIR="${WORK_DIR:-"${BASE_DIR}/work/${IMG_DATE}-${IMG_TIME}-${IMG_NAME}"}"
export DEPLOY_DIR=${DEPLOY_DIR:-"${BASE_DIR}/deploy"}
export DEPLOY_ZIP="${DEPLOY_ZIP:-2}"
export LOG_FILE="${WORK_DIR}/build.log"

View file

@ -1,4 +0,0 @@
#!/bin/bash -e
mkdir -p "${ROOTFS_DIR}/usr/local/bin/"
install -m 755 files/octo-config "${ROOTFS_DIR}/usr/local/bin/octo-config"

View file

@ -59,4 +59,4 @@ EOF
rm -f "${ROOTFS_DIR}/etc/ssh/"ssh_host_*_key*
rm -f "${ROOTFS_DIR}/etc/sudoers.d/010_pi-nopasswd" # Fuck you :)
echo "%sudo ALL=(ALL:ALL) ALL" > /etc/sudoers.d/group
echo "%sudo ALL=(ALL:ALL) ALL" > ${ROOTFS_DIR}/etc/sudoers.d/group

View file

@ -1,5 +1,8 @@
#!/bin/bash -e
mkdir -p "${ROOTFS_DIR}/usr/local/bin/"
install -m 755 files/octo-config "${ROOTFS_DIR}/usr/local/bin/octo-config"
install -m 755 files/first-time.sh ${ROOTFS_DIR}/etc/profile.d/first-time.sh
mkdir -p ${ROOTFS_DIR}/etc/systemd/system/getty@tty1.service.d/

View file

@ -43,13 +43,13 @@ service_select () {
"2") systemctl set-default graphical.target ;;
"3")
ssh-keygen -A
systemctl enable sshd ;;
systemctl enable ssh ;;
esac
done
}
screen_timeout() {
local TIMEOUT=$(whiptail --nocancel --title "Screen Timeout" --inputbox "Input your desired screen timeout in seconds.\nEnter \"off\" to disable the screen timeout." "0" 10 50 "0" 3>&1 1>&2 2>&3)
local TIMEOUT=$(whiptail --nocancel --title "Screen Timeout" --inputbox "Input your desired screen timeout in seconds.\nEnter \"off\" to disable the screen timeout.\n\nAdding a screen timeout can reduce screen burn in." 11 60 "0" 3>&1 1>&2 2>&3)
cat > /home/pi/.xprofile << EOF
xset s ${TIMEOUT}
xset -dpms
@ -74,12 +74,11 @@ main_menu () {
}
EOF
change_password || exit 1
change_password || return 1
whiptail --title "Network Configuration" --nocancel --msgbox "Setup will now open nmtui, a program to help configure your ethernet/wireless interfaces. Hit Quit when you are done." 10 50
nmtui
service_select || exit 1
screen_timeout || exit 1
service_select || return 1
screen_timeout || return 1
rm /etc/systemd/system/getty@tty1.service.d/override.conf
rm /etc/profile.d/first-time.sh
reboot