Compare commits
No commits in common. "12209c84fa810d927dc696b3ad47a7c1386e85f0" and "5889e81f04925b3214313b4096817c8bd085877d" have entirely different histories.
12209c84fa
...
5889e81f04
|
@ -253,27 +253,6 @@ END2
|
||||||
END
|
END
|
||||||
)"
|
)"
|
||||||
|
|
||||||
|
|
||||||
# thanks https://wiki.debian.org/Keyboard
|
|
||||||
chroot_kbd_conf_str="$(cat<<END
|
|
||||||
chroot_kbd_conf() {
|
|
||||||
###################
|
|
||||||
# configure keyboard
|
|
||||||
cat > /etc/default/keyboard <<END2
|
|
||||||
# KEYBOARD CONFIGURATION FILE
|
|
||||||
# generated by deploy-workbench.sh
|
|
||||||
|
|
||||||
# Consult the keyboard(5) manual page.
|
|
||||||
|
|
||||||
XKBMODEL="pc105"
|
|
||||||
XKBLAYOUT="\${CUSTOM_LANG}"
|
|
||||||
|
|
||||||
BACKSPACE="guess"
|
|
||||||
END2
|
|
||||||
}
|
|
||||||
END
|
|
||||||
)"
|
|
||||||
|
|
||||||
prepare_app() {
|
prepare_app() {
|
||||||
# prepare app during prepare_chroot_env
|
# prepare app during prepare_chroot_env
|
||||||
workbench_dir="${ISO_PATH}/chroot/opt/workbench"
|
workbench_dir="${ISO_PATH}/chroot/opt/workbench"
|
||||||
|
@ -307,9 +286,7 @@ if [ "\${nfs_host}" ]; then
|
||||||
fi
|
fi
|
||||||
# clearly specify the right working directory, used in the python script as os.getcwd()
|
# clearly specify the right working directory, used in the python script as os.getcwd()
|
||||||
cd /mnt
|
cd /mnt
|
||||||
#pipenv run python /opt/workbench/workbench-script.py --config /mnt/settings.ini
|
pipenv run python /opt/workbench/workbench-script.py --config /mnt/settings.ini
|
||||||
# works meanwhile this project is vanilla python
|
|
||||||
python /opt/workbench/workbench-script.py --config /mnt/settings.ini
|
|
||||||
|
|
||||||
stty echo
|
stty echo
|
||||||
set +x
|
set +x
|
||||||
|
@ -325,7 +302,7 @@ echo 'Install requirements'
|
||||||
|
|
||||||
# Install debian requirements
|
# Install debian requirements
|
||||||
apt-get install -y --no-install-recommends \
|
apt-get install -y --no-install-recommends \
|
||||||
sudo locales keyboard-configuration console-setup \
|
sudo locales \
|
||||||
python-is-python3 python3 python3-dev python3-pip pipenv \
|
python-is-python3 python3 python3-dev python3-pip pipenv \
|
||||||
dmidecode smartmontools hwinfo pciutils lshw nfs-common < /dev/null
|
dmidecode smartmontools hwinfo pciutils lshw nfs-common < /dev/null
|
||||||
|
|
||||||
|
@ -383,14 +360,8 @@ ${install_app_str}
|
||||||
# thanks src https://serverfault.com/questions/362903/how-do-you-set-a-locale-non-interactively-on-debian-ubuntu
|
# thanks src https://serverfault.com/questions/362903/how-do-you-set-a-locale-non-interactively-on-debian-ubuntu
|
||||||
export LANG=${LANG}
|
export LANG=${LANG}
|
||||||
export LC_ALL=${LANG}
|
export LC_ALL=${LANG}
|
||||||
echo "${MYLOCALE}" > /etc/locale.gen
|
|
||||||
# Generate the locale
|
|
||||||
locale-gen
|
|
||||||
# feeds /etc/default/locale for the shell env var
|
|
||||||
update-locale LANG=${LANG} LC_ALL=${LANG}
|
|
||||||
# this is a high level command that does locale-gen and update-locale altogether
|
# this is a high level command that does locale-gen and update-locale altogether
|
||||||
# but it is too interactive
|
dpkg-reconfigure --frontend=noninteractive locales
|
||||||
#dpkg-reconfigure --frontend=noninteractive locales
|
|
||||||
# DEBUG
|
# DEBUG
|
||||||
locale -a
|
locale -a
|
||||||
|
|
||||||
|
@ -416,9 +387,6 @@ apt-get install -y --no-install-recommends \
|
||||||
< /dev/null
|
< /dev/null
|
||||||
|
|
||||||
${chroot_netdns_conf_str}
|
${chroot_netdns_conf_str}
|
||||||
CUSTOM_LANG=${CUSTOM_LANG}
|
|
||||||
${chroot_kbd_conf_str}
|
|
||||||
chroot_kbd_conf
|
|
||||||
|
|
||||||
# Set up root user
|
# Set up root user
|
||||||
# this is the root password
|
# this is the root password
|
||||||
|
@ -438,19 +406,7 @@ CHROOT
|
||||||
}
|
}
|
||||||
|
|
||||||
prepare_chroot_env() {
|
prepare_chroot_env() {
|
||||||
CUSTOM_LANG="${CUSTOM_LANG:-es}"
|
LANG="${CUSTOM_LANG:-es_ES.UTF-8}"
|
||||||
case "${CUSTOM_LANG}" in
|
|
||||||
es)
|
|
||||||
export LANG="es_ES.UTF-8"
|
|
||||||
export MYLOCALE="${LANG} UTF-8"
|
|
||||||
;;
|
|
||||||
en)
|
|
||||||
export LANG="en_US.UTF-8"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "ERROR: CUSTOM_LANG not supported. Available: es"
|
|
||||||
exit 1
|
|
||||||
esac
|
|
||||||
# version of debian the bootstrap is going to build
|
# version of debian the bootstrap is going to build
|
||||||
# if no VERSION_CODENAME is specified we assume that the bootstrap is going to
|
# if no VERSION_CODENAME is specified we assume that the bootstrap is going to
|
||||||
# be build with the same version of debian being executed because some files
|
# be build with the same version of debian being executed because some files
|
||||||
|
@ -474,7 +430,6 @@ prepare_chroot_env() {
|
||||||
prepare_app
|
prepare_app
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# thanks https://willhaley.com/blog/custom-debian-live-environment/
|
# thanks https://willhaley.com/blog/custom-debian-live-environment/
|
||||||
install_requirements() {
|
install_requirements() {
|
||||||
# Install requirements
|
# Install requirements
|
||||||
|
|
|
@ -298,7 +298,7 @@ def save_snapshot_in_disk(snapshot, path):
|
||||||
def send_snapshot_to_devicehub(snapshot, token, url, legacy):
|
def send_snapshot_to_devicehub(snapshot, token, url, legacy):
|
||||||
url_components = urllib.parse.urlparse(url)
|
url_components = urllib.parse.urlparse(url)
|
||||||
ev_path = "evidence/{}".format(snapshot["uuid"])
|
ev_path = "evidence/{}".format(snapshot["uuid"])
|
||||||
components = (url_components.scheme, url_components.netloc, ev_path, '', '', '')
|
components = (url_components.schema, url_components.netloc, ev_path, '', '', '')
|
||||||
ev_url = urllib.parse.urlunparse(components)
|
ev_url = urllib.parse.urlunparse(components)
|
||||||
# apt install qrencode
|
# apt install qrencode
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue