v1.4.2 - Goodbye Snow
Main Kit * Fixed issues #21 & #22 * Open speedtest during User Checklist (fixes #24) * Tool version updates * Various Bugfixes WinPE * Various Bugfixes Linux * `build-ufd` now uses a GPT layout with a protective MBR by default * Can still build MBR (Legacy) with the `--use-mbr` flag * (Hopefully) fixes #20 * `hw-diags` * Re-added keyboard test (fixes #25) * Add drive I/O benchmark test (fixes #23) * All results are in MB/s * Various Bugfixes
This commit is contained in:
commit
8f0393d173
18 changed files with 212 additions and 42 deletions
|
|
@ -15,7 +15,7 @@ rem Set variables using settings\main.py file
|
|||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for %%v in (ARCHIVE_PASSWORD KIT_NAME_FULL) do (
|
||||
set "var=%%v"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr "!var!=" %SETTINGS%`) do (
|
||||
for /f "tokens=* usebackq" %%f in (`findstr "!var!=" "%SETTINGS%"`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "%%v=!_v:~0,-1!"
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ rem Set variables using settings\main.py file
|
|||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for %%v in (ARCHIVE_PASSWORD KIT_NAME_FULL OFFICE_SERVER_IP QUICKBOOKS_SERVER_IP) do (
|
||||
set "var=%%v"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr "!var!=" %SETTINGS%`) do (
|
||||
for /f "tokens=* usebackq" %%f in (`findstr "!var!=" "%SETTINGS%"`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "%%v=!_v:~0,-1!"
|
||||
|
|
@ -280,9 +280,9 @@ rem Create VB script
|
|||
mkdir "%bin%\tmp" 2>nul
|
||||
echo Set UAC = CreateObject^("Shell.Application"^) > "%bin%\tmp\Elevate.vbs"
|
||||
if defined L_NCMD (
|
||||
echo UAC.ShellExecute "%PYTHON%", "%script%", "", "runas", 3 >> "%bin%\tmp\Elevate.vbs"
|
||||
echo UAC.ShellExecute "%PYTHON%", """%script%""", "", "runas", 3 >> "%bin%\tmp\Elevate.vbs"
|
||||
) else (
|
||||
echo UAC.ShellExecute "%CON%", "-run %PYTHON% %script% -new_console:n", "", "runas", 1 >> "%bin%\tmp\Elevate.vbs"
|
||||
echo UAC.ShellExecute "%CON%", "-run ""%PYTHON%"" ""%script%"" -new_console:n", "", "runas", 1 >> "%bin%\tmp\Elevate.vbs"
|
||||
)
|
||||
|
||||
rem Run
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ popd
|
|||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL "%SETTINGS%"`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
|
|
|
|||
|
|
@ -153,6 +153,7 @@ function help () {
|
|||
ADVANCED:
|
||||
-d --debug Enable debug mode
|
||||
-v --verbose Enable verbose mode
|
||||
-M --use-mbr Use real MBR instead of GPT w/ Protective MBR
|
||||
-F --force Bypass all confirmation messages. USE WITH EXTREME CAUTION!
|
||||
EOF
|
||||
|
||||
|
|
@ -378,6 +379,11 @@ if [[ "${arg_F:?}" == 1 ]]; then
|
|||
else
|
||||
SILENT="False"
|
||||
fi
|
||||
if [[ "${arg_M:?}" == 1 ]]; then
|
||||
USE_MBR="True"
|
||||
else
|
||||
USE_MBR="False"
|
||||
fi
|
||||
|
||||
if [[ "${arg_h:?}" == 1 ]]; then
|
||||
help "${__usage_example}"
|
||||
|
|
@ -499,6 +505,9 @@ echo "Extra Dir: ${EXTRA_DIR:-(Not Specified)}"
|
|||
echo ""
|
||||
echo -e "${BLUE}Destination${CLEAR}"
|
||||
lsblk -n -o NAME,LABEL,SIZE,MODEL,SERIAL "${DEST_DEV}"
|
||||
if [[ "${USE_MBR}" == "True" ]]; then
|
||||
echo -e "${YELLOW}Formatting using legacy MBR${CLEAR}"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
# Ask before starting job
|
||||
|
|
@ -523,8 +532,15 @@ tmux split-window -dl 10 tail -f "${LOG_FILE}"
|
|||
|
||||
# Format
|
||||
echo "Formatting drive..."
|
||||
parted "${DEST_DEV}" -s -- mklabel msdos mkpart primary fat32 1MiB -1s >> "${LOG_FILE}" 2>&1
|
||||
parted "${DEST_DEV}" set 1 boot on >> "${LOG_FILE}" 2>&1
|
||||
if [[ "${USE_MBR}" == "True" ]]; then
|
||||
parted "${DEST_DEV}" --script -- mklabel msdos mkpart primary fat32 4MiB -1s >> "${LOG_FILE}" 2>&1
|
||||
parted "${DEST_DEV}" set 1 boot on >> "${LOG_FILE}" 2>&1
|
||||
else
|
||||
parted "${DEST_DEV}" --script -- mklabel gpt mkpart primary fat32 4MiB -4MiB >> "${LOG_FILE}" 2>&1
|
||||
parted "${DEST_DEV}" set 1 legacy_boot on >> "${LOG_FILE}" 2>&1
|
||||
#parted "${DEST_DEV}" disk_set pmbr_boot on >> "${LOG_FILE}" 2>&1
|
||||
# pmbr_boot breaks detection on some UEFI MOBOs
|
||||
fi
|
||||
mkfs.vfat -F 32 -n "${UFD_LABEL}" "${DEST_PAR}" >> "${LOG_FILE}" 2>&1
|
||||
|
||||
# Mount sources and dest
|
||||
|
|
@ -549,7 +565,7 @@ rsync ${RSYNC_ARGS} "${MAIN_KIT}/" "/mnt/Dest/${KIT_NAME_FULL}/" >> "${LOG_FILE}
|
|||
|
||||
if [[ ! -z "${EXTRA_DIR:-}" ]]; then
|
||||
echo "Copying Extra files..."
|
||||
rsync ${RSYNC_ARGS} "${EXTRA_DIR}"/* /mnt/Dest/ >> "${LOG_FILE}" 2>&1
|
||||
rsync ${RSYNC_ARGS} "${EXTRA_DIR}"/ /mnt/Dest/ >> "${LOG_FILE}" 2>&1
|
||||
fi
|
||||
|
||||
# Install syslinux
|
||||
|
|
@ -563,7 +579,11 @@ rmdir /mnt/Dest >> "${LOG_FILE}" 2>&1
|
|||
sync
|
||||
|
||||
echo "Installing Syslinux MBR..."
|
||||
dd bs=440 count=1 if=/usr/lib/syslinux/bios/mbr.bin of=${DEST_DEV} >> "${LOG_FILE}" 2>&1
|
||||
if [[ "${USE_MBR}" == "True" ]]; then
|
||||
dd bs=440 count=1 if=/usr/lib/syslinux/bios/mbr.bin of=${DEST_DEV} >> "${LOG_FILE}" 2>&1
|
||||
else
|
||||
dd bs=440 count=1 if=/usr/lib/syslinux/bios/gptmbr.bin of=${DEST_DEV} >> "${LOG_FILE}" 2>&1
|
||||
fi
|
||||
sync
|
||||
|
||||
# Cleanup
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ if ($MyInvocation.InvocationName -ne ".") {
|
|||
DownloadFile -Path $Path -Name "ConEmuPack.7z" -Url $Url
|
||||
|
||||
# Notepad++
|
||||
$Url = "https://notepad-plus-plus.org/repository/7.x/7.5.5/npp.7.5.5.bin.minimalist.7z"
|
||||
$Url = "https://notepad-plus-plus.org/repository/7.x/7.5.6/npp.7.5.6.bin.minimalist.7z"
|
||||
DownloadFile -Path $Path -Name "npp.7z" -Url $Url
|
||||
|
||||
# Python
|
||||
|
|
@ -96,7 +96,7 @@ if ($MyInvocation.InvocationName -ne ".") {
|
|||
DownloadFile -Path $Path -Name "python64.zip" -Url $Url
|
||||
|
||||
# Python: psutil
|
||||
$DownloadPage = "https://pypi.python.org/pypi/psutil"
|
||||
$DownloadPage = "https://pypi.org/project/psutil/"
|
||||
$RegEx = "href=.*-cp36-cp36m-win32.whl"
|
||||
$Url = FindDynamicUrl $DownloadPage $RegEx
|
||||
DownloadFile -Path $Path -Name "psutil32.whl" -Url $Url
|
||||
|
|
@ -107,7 +107,7 @@ if ($MyInvocation.InvocationName -ne ".") {
|
|||
# Python: requests & dependancies
|
||||
$RegEx = "href=.*.py3-none-any.whl"
|
||||
foreach ($Module in @("chardet", "certifi", "idna", "urllib3", "requests")) {
|
||||
$DownloadPage = "https://pypi.python.org/pypi/$Module"
|
||||
$DownloadPage = "https://pypi.org/project/$Module/"
|
||||
$Name = "$Module.whl"
|
||||
$Url = FindDynamicUrl -SourcePage $DownloadPage -RegEx $RegEx
|
||||
DownloadFile -Path $Path -Name $Name -Url $Url
|
||||
|
|
|
|||
|
|
@ -141,15 +141,15 @@ if ($MyInvocation.InvocationName -ne ".") {
|
|||
@("fastcopy64.zip", "http://ftp.vector.co.jp/69/93/2323/FastCopy341_x64.zip"),
|
||||
@("fastcopy32.zip", "http://ftp.vector.co.jp/69/93/2323/FastCopy341.zip"),
|
||||
# HWiNFO
|
||||
@("hwinfo.zip", "http://app.oldfoss.com:81/download/HWiNFO/hwi_574.zip"),
|
||||
@("hwinfo.zip", "http://app.oldfoss.com:81/download/HWiNFO/hwi_582.zip"),
|
||||
# Killer Network Drivers
|
||||
@(
|
||||
"killerinf.zip",
|
||||
("http://www.killernetworking.com"+(FindDynamicUrl "http://www.killernetworking.com/driver-downloads/item/killer-drivers-inf" "Download Killer-Ethernet").replace('&', '&'))
|
||||
),
|
||||
# Notepad++
|
||||
@("npp_amd64.7z", "https://notepad-plus-plus.org/repository/7.x/7.5.5/npp.7.5.5.bin.minimalist.x64.7z"),
|
||||
@("npp_x86.7z", "https://notepad-plus-plus.org/repository/7.x/7.5.5/npp.7.5.5.bin.minimalist.7z"),
|
||||
@("npp_amd64.7z", "https://notepad-plus-plus.org/repository/7.x/7.5.6/npp.7.5.6.bin.minimalist.x64.7z"),
|
||||
@("npp_x86.7z", "https://notepad-plus-plus.org/repository/7.x/7.5.6/npp.7.5.6.bin.minimalist.7z"),
|
||||
# NT Password Editor
|
||||
@("ntpwed.zip", "http://cdslow.org.ru/files/ntpwedit/ntpwed07.zip"),
|
||||
# Prime95
|
||||
|
|
@ -164,11 +164,11 @@ if ($MyInvocation.InvocationName -ne ".") {
|
|||
# Python: psutil
|
||||
@(
|
||||
"psutil64.whl",
|
||||
(FindDynamicUrl "https://pypi.python.org/pypi/psutil" "href=.*-cp36-cp36m-win_amd64.whl")
|
||||
(FindDynamicUrl "https://pypi.org/project/psutil/" "href=.*-cp36-cp36m-win_amd64.whl")
|
||||
),
|
||||
@(
|
||||
"psutil32.whl",
|
||||
(FindDynamicUrl "https://pypi.python.org/pypi/psutil" "href=.*-cp36-cp36m-win32.whl")
|
||||
(FindDynamicUrl "https://pypi.org/project/psutil/" "href=.*-cp36-cp36m-win32.whl")
|
||||
),
|
||||
# Q-Dir
|
||||
@("qdir64.zip", "https://www.softwareok.com/Download/Q-Dir_Portable_x64.zip"),
|
||||
|
|
@ -451,6 +451,7 @@ if ($MyInvocation.InvocationName -ne ".") {
|
|||
"x", "$Temp\qdir64.zip", "-o$Build\bin\amd64",
|
||||
"-aoa", "-bso0", "-bse0", "-bsp0")
|
||||
Start-Process -FilePath $SevenZip -ArgumentList $ArgumentList -NoNewWindow -Wait
|
||||
Move-Item "$Build\bin\amd64\Q-Dir\Q-Dir_x64.exe" "$Build\bin\amd64\Q-Dir\Q-Dir.exe" -Force
|
||||
$ArgumentList = @(
|
||||
"x", "$Temp\qdir32.zip", "-o$Build\bin\x86",
|
||||
"-aoa", "-bso0", "-bse0", "-bsp0")
|
||||
|
|
|
|||
|
|
@ -131,9 +131,9 @@ def clear_screen():
|
|||
def convert_to_bytes(size):
|
||||
"""Convert human-readable size str to bytes and return an int."""
|
||||
size = str(size)
|
||||
tmp = re.search(r'(\d+)\s+([KMGT]B)', size.upper())
|
||||
tmp = re.search(r'(\d+\.?\d*)\s+([KMGT]B)', size.upper())
|
||||
if tmp:
|
||||
size = int(tmp.group(1))
|
||||
size = float(tmp.group(1))
|
||||
units = tmp.group(2)
|
||||
if units == 'TB':
|
||||
size *= 1099511627776
|
||||
|
|
@ -143,6 +143,7 @@ def convert_to_bytes(size):
|
|||
size *= 1048576
|
||||
elif units == 'KB':
|
||||
size *= 1024
|
||||
size = int(size)
|
||||
else:
|
||||
return -1
|
||||
|
||||
|
|
|
|||
|
|
@ -39,8 +39,21 @@ TESTS = {
|
|||
'Results': {},
|
||||
'Status': {},
|
||||
},
|
||||
'iobenchmark': {
|
||||
'Enabled': False,
|
||||
'Results': {},
|
||||
'Status': {},
|
||||
},
|
||||
}
|
||||
|
||||
def get_read_rate(s):
|
||||
"""Get read rate in bytes/s from dd progress output."""
|
||||
real_rate = None
|
||||
if re.search(r'[KMGT]B/s', s):
|
||||
human_rate = re.sub(r'^.*\s+(\d+\.?\d*)\s+(.B)/s\s*$', r'\1 \2', s)
|
||||
real_rate = convert_to_bytes(human_rate)
|
||||
return real_rate
|
||||
|
||||
def get_smart_details(dev):
|
||||
"""Get SMART data for dev if possible, returns dict."""
|
||||
cmd = 'sudo smartctl --all --json /dev/{}'.format(dev).split()
|
||||
|
|
@ -66,20 +79,23 @@ def menu_diags(*args):
|
|||
"""Main HW-Diagnostic menu."""
|
||||
diag_modes = [
|
||||
{'Name': 'All tests',
|
||||
'Tests': ['Prime95', 'NVMe/SMART', 'badblocks']},
|
||||
'Tests': ['Prime95', 'NVMe/SMART', 'badblocks', 'iobenchmark']},
|
||||
{'Name': 'Prime95',
|
||||
'Tests': ['Prime95']},
|
||||
{'Name': 'NVMe/SMART & badblocks',
|
||||
'Tests': ['NVMe/SMART', 'badblocks']},
|
||||
{'Name': 'All drive tests',
|
||||
'Tests': ['NVMe/SMART', 'badblocks', 'iobenchmark']},
|
||||
{'Name': 'NVMe/SMART',
|
||||
'Tests': ['NVMe/SMART']},
|
||||
{'Name': 'badblocks',
|
||||
'Tests': ['badblocks']},
|
||||
{'Name': 'I/O Benchmark',
|
||||
'Tests': ['iobenchmark']},
|
||||
{'Name': 'Quick drive test',
|
||||
'Tests': ['Quick', 'NVMe/SMART']},
|
||||
]
|
||||
actions = [
|
||||
{'Letter': 'A', 'Name': 'Audio test'},
|
||||
{'Letter': 'K', 'Name': 'Keyboard test'},
|
||||
{'Letter': 'N', 'Name': 'Network test'},
|
||||
{'Letter': 'M', 'Name': 'Screen Saver - Matrix', 'CRLF': True},
|
||||
{'Letter': 'P', 'Name': 'Screen Saver - Pipes'},
|
||||
|
|
@ -119,6 +135,8 @@ def menu_diags(*args):
|
|||
elif selection == 'A':
|
||||
run_program(['hw-diags-audio'], check=False, pipe=False)
|
||||
pause('Press Enter to return to main menu... ')
|
||||
elif selection == 'K':
|
||||
run_program(['xev', '-event', 'keyboard'], check=False, pipe=False)
|
||||
elif selection == 'N':
|
||||
run_program(['hw-diags-network'], check=False, pipe=False)
|
||||
pause('Press Enter to return to main menu... ')
|
||||
|
|
@ -194,6 +212,75 @@ def run_badblocks():
|
|||
run_program('tmux kill-pane -a'.split(), check=False)
|
||||
pass
|
||||
|
||||
def run_iobenchmark():
|
||||
"""Run a read-only test for all detected disks."""
|
||||
aborted = False
|
||||
clear_screen()
|
||||
print_log('\nStart I/O Benchmark test(s)\n')
|
||||
progress_file = '{}/iobenchmark_progress.out'.format(global_vars['LogDir'])
|
||||
update_progress()
|
||||
|
||||
# Set Window layout and start test
|
||||
run_program('tmux split-window -dhl 15 watch -c -n1 -t cat {}'.format(
|
||||
TESTS['Progress Out']).split())
|
||||
|
||||
# Show disk details
|
||||
for name, dev in sorted(TESTS['iobenchmark']['Devices'].items()):
|
||||
show_disk_details(dev)
|
||||
print_standard(' ')
|
||||
update_progress()
|
||||
|
||||
# Run
|
||||
print_standard('Running benchmark test(s):')
|
||||
for name, dev in sorted(TESTS['iobenchmark']['Devices'].items()):
|
||||
cur_status = TESTS['iobenchmark']['Status'][name]
|
||||
nvme_smart_status = TESTS['NVMe/SMART']['Status'].get(name, None)
|
||||
bb_status = TESTS['badblocks']['Status'].get(name, None)
|
||||
if cur_status == 'Denied':
|
||||
# Skip denied disks
|
||||
continue
|
||||
if nvme_smart_status == 'NS':
|
||||
TESTS['iobenchmark']['Status'][name] = 'Skipped'
|
||||
elif bb_status in ['NS', 'Skipped']:
|
||||
TESTS['iobenchmark']['Status'][name] = 'Skipped'
|
||||
else:
|
||||
# (SMART tests not run or CS/OVERRIDE)
|
||||
# AND (BADBLOCKS tests not run or CS)
|
||||
TESTS['iobenchmark']['Status'][name] = 'Working'
|
||||
update_progress()
|
||||
print_standard(' /dev/{:11} '.format(name+'...'), end='', flush=True)
|
||||
run_program('tmux split-window -dl 5 {} {} {}'.format(
|
||||
'hw-diags-iobenchmark',
|
||||
'/dev/{}'.format(name),
|
||||
progress_file).split())
|
||||
wait_for_process('dd')
|
||||
print_standard('Done', timestamp=False)
|
||||
|
||||
# Check results
|
||||
with open(progress_file, 'r') as f:
|
||||
text = f.read()
|
||||
io_stats = text.replace('\r', '\n').split('\n')
|
||||
try:
|
||||
io_stats = [get_read_rate(s) for s in io_stats]
|
||||
io_stats = [float(s/1048576) for s in io_stats if s]
|
||||
TESTS['iobenchmark']['Results'][name] = 'Read speed: {:3.1f} MB/s (Min: {:3.1f}, Max: {:3.1f})'.format(
|
||||
sum(io_stats) / len(io_stats),
|
||||
min(io_stats),
|
||||
max(io_stats))
|
||||
TESTS['iobenchmark']['Status'][name] = 'CS'
|
||||
except:
|
||||
# Requires manual testing
|
||||
TESTS['iobenchmark']['Status'][name] = 'NS'
|
||||
|
||||
# Move temp file
|
||||
shutil.move(progress_file, '{}/iobenchmark-{}.log'.format(
|
||||
global_vars['LogDir'], name))
|
||||
update_progress()
|
||||
|
||||
# Done
|
||||
run_program('tmux kill-pane -a'.split(), check=False)
|
||||
pass
|
||||
|
||||
def run_mprime():
|
||||
"""Run Prime95 for MPRIME_LIMIT minutes while showing the temps."""
|
||||
aborted = False
|
||||
|
|
@ -386,12 +473,12 @@ def run_tests(tests):
|
|||
print_log('Starting Hardware Diagnostics')
|
||||
print_log('\nRunning tests: {}'.format(', '.join(tests)))
|
||||
# Enable selected tests
|
||||
for t in ['Prime95', 'NVMe/SMART', 'badblocks']:
|
||||
for t in ['Prime95', 'NVMe/SMART', 'badblocks', 'iobenchmark']:
|
||||
TESTS[t]['Enabled'] = t in tests
|
||||
TESTS['NVMe/SMART']['Quick'] = 'Quick' in tests
|
||||
|
||||
# Initialize
|
||||
if TESTS['NVMe/SMART']['Enabled'] or TESTS['badblocks']['Enabled']:
|
||||
if TESTS['NVMe/SMART']['Enabled'] or TESTS['badblocks']['Enabled'] or TESTS['iobenchmark']['Enabled']:
|
||||
scan_disks()
|
||||
update_progress()
|
||||
|
||||
|
|
@ -407,6 +494,8 @@ def run_tests(tests):
|
|||
run_nvme_smart()
|
||||
if TESTS['badblocks']['Enabled']:
|
||||
run_badblocks()
|
||||
if TESTS['iobenchmark']['Enabled']:
|
||||
run_iobenchmark()
|
||||
|
||||
# Show results
|
||||
show_results()
|
||||
|
|
@ -434,13 +523,15 @@ def scan_disks():
|
|||
devs[d['name']] = {'lsblk': d}
|
||||
TESTS['NVMe/SMART']['Status'][d['name']] = 'Pending'
|
||||
TESTS['badblocks']['Status'][d['name']] = 'Pending'
|
||||
TESTS['iobenchmark']['Status'][d['name']] = 'Pending'
|
||||
else:
|
||||
# Skip WizardKit devices
|
||||
wk_label = '{}_LINUX'.format(KIT_NAME_SHORT)
|
||||
if wk_label not in [c.get('label', '') for c in d['children']]:
|
||||
if wk_label not in [c.get('label', '') for c in d.get('children', [])]:
|
||||
devs[d['name']] = {'lsblk': d}
|
||||
TESTS['NVMe/SMART']['Status'][d['name']] = 'Pending'
|
||||
TESTS['badblocks']['Status'][d['name']] = 'Pending'
|
||||
TESTS['iobenchmark']['Status'][d['name']] = 'Pending'
|
||||
|
||||
for dev, data in devs.items():
|
||||
# Get SMART attributes
|
||||
|
|
@ -480,21 +571,23 @@ def scan_disks():
|
|||
data['SMART Support'] = False
|
||||
|
||||
# Ask for manual overrides if necessary
|
||||
if not data['Quick Health OK'] and TESTS['badblocks']['Enabled']:
|
||||
if not data['Quick Health OK'] and (TESTS['badblocks']['Enabled'] or TESTS['iobenchmark']['Enabled']):
|
||||
show_disk_details(data)
|
||||
print_warning("WARNING: Health can't be confirmed for: {}".format(
|
||||
'/dev/{}'.format(dev)))
|
||||
dev_name = data['lsblk']['name']
|
||||
print_standard(' ')
|
||||
if ask('Run badblocks for this device anyway?'):
|
||||
if ask('Run tests on this device anyway?'):
|
||||
TESTS['NVMe/SMART']['Status'][dev_name] = 'OVERRIDE'
|
||||
else:
|
||||
TESTS['NVMe/SMART']['Status'][dev_name] = 'NS'
|
||||
TESTS['badblocks']['Status'][dev_name] = 'Denied'
|
||||
TESTS['iobenchmark']['Status'][dev_name] = 'Denied'
|
||||
print_standard(' ') # In case there's more than one "OVERRIDE" disk
|
||||
|
||||
TESTS['NVMe/SMART']['Devices'] = devs
|
||||
TESTS['badblocks']['Devices'] = devs
|
||||
TESTS['iobenchmark']['Devices'] = devs
|
||||
|
||||
def show_disk_details(dev):
|
||||
"""Display disk details."""
|
||||
|
|
@ -613,8 +706,8 @@ def show_results():
|
|||
print(' {}'.format(line.strip()))
|
||||
print_standard(' ')
|
||||
|
||||
# NVMe/SMART / badblocks
|
||||
if TESTS['NVMe/SMART']['Enabled'] or TESTS['badblocks']['Enabled']:
|
||||
# NVMe/SMART / badblocks / iobenchmark
|
||||
if TESTS['NVMe/SMART']['Enabled'] or TESTS['badblocks']['Enabled'] or TESTS['iobenchmark']['Enabled']:
|
||||
print_success('Disks:')
|
||||
for name, dev in sorted(TESTS['NVMe/SMART']['Devices'].items()):
|
||||
show_disk_details(dev)
|
||||
|
|
@ -632,6 +725,12 @@ def show_results():
|
|||
print_standard(' {}'.format(line))
|
||||
else:
|
||||
print_error(' {}'.format(line))
|
||||
io_status = TESTS['iobenchmark']['Status'].get(name, None)
|
||||
if (TESTS['iobenchmark']['Enabled']
|
||||
and io_status not in ['Denied', 'OVERRIDE', 'Skipped']):
|
||||
print_info('Benchmark:')
|
||||
result = TESTS['iobenchmark']['Results'].get(name, '')
|
||||
print_standard(' {}'.format(result))
|
||||
print_standard(' ')
|
||||
|
||||
# Done
|
||||
|
|
@ -673,6 +772,16 @@ def update_progress():
|
|||
s_color = get_status_color(status),
|
||||
status = status,
|
||||
**COLORS))
|
||||
if TESTS['iobenchmark']['Enabled']:
|
||||
output.append(' ')
|
||||
output.append('{BLUE}I/O Benchmark{CLEAR}'.format(**COLORS))
|
||||
for dev, status in sorted(TESTS['iobenchmark']['Status'].items()):
|
||||
output.append('{dev}{s_color}{status:>{pad}}{CLEAR}'.format(
|
||||
dev = dev,
|
||||
pad = 15-len(dev),
|
||||
s_color = get_status_color(status),
|
||||
status = status,
|
||||
**COLORS))
|
||||
|
||||
# Add line-endings
|
||||
output = ['{}\n'.format(line) for line in output]
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ def backup_registry():
|
|||
def get_folder_size(path):
|
||||
"""Get (human-readable) size of folder passed, returns str."""
|
||||
size = 'Unknown'
|
||||
cmd = [global_vars['Tools']['Du'], '-nobanner', '-q', path]
|
||||
cmd = [global_vars['Tools']['Du'], '-c', '-nobanner', '-q', path]
|
||||
try:
|
||||
out = run_program(cmd)
|
||||
except FileNotFoundError:
|
||||
|
|
@ -107,10 +107,13 @@ def get_folder_size(path):
|
|||
# Failed to get folder size
|
||||
pass
|
||||
else:
|
||||
size = out.stdout.decode().splitlines()[4]
|
||||
size = re.sub(r'Size:\s+([\d,]+)\sbytes$', r'\1', size)
|
||||
size = size.replace(',', '')
|
||||
size = human_readable_size(size)
|
||||
try:
|
||||
size = out.stdout.decode().split(',')[-2]
|
||||
except IndexError:
|
||||
# Failed to parse csv data
|
||||
pass
|
||||
else:
|
||||
size = human_readable_size(size)
|
||||
return size
|
||||
|
||||
def get_installed_office():
|
||||
|
|
@ -442,6 +445,11 @@ def show_user_data_summary(indent=8, width=32):
|
|||
users = [u for u in users if u['Active']]
|
||||
get_user_folder_sizes(users)
|
||||
for user in users:
|
||||
if ('Size' not in user['Profile']
|
||||
and not any(user['Shell Folders'])
|
||||
and not any(user['Extra Folders'])):
|
||||
# Skip empty users
|
||||
continue
|
||||
print_success('{indent}User: {user}'.format(
|
||||
indent = ' '*int(indent/2),
|
||||
user = user['Name']))
|
||||
|
|
|
|||
18
.bin/Scripts/hw-diags-iobenchmark
Executable file
18
.bin/Scripts/hw-diags-iobenchmark
Executable file
|
|
@ -0,0 +1,18 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
## Wizard Kit: HW Diagnostics - Benchmarks
|
||||
|
||||
function usage {
|
||||
echo "Usage: ${0} device log-file"
|
||||
echo " e.g. ${0} /dev/sda /tmp/tmp.XXXXXXX/benchmarks.log"
|
||||
}
|
||||
|
||||
# Bail early
|
||||
if [ ! -b "${1}" ]; then
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Run Benchmarks
|
||||
echo 3 | sudo tee -a /proc/sys/vm/drop_caches >/dev/null 2>&1
|
||||
sudo dd bs=4M if="${1}" of=/dev/null status=progress 2>&1 | tee -a "${2}"
|
||||
|
|
@ -27,7 +27,7 @@ set iso_date=%_yyyy%-%_mm%-%_dd%
|
|||
|
||||
:SetVars
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_SHORT %SETTINGS%`) do (
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_SHORT "%SETTINGS%"`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_SHORT=!_v:~0,-1!"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# Wizard Kit: Settings - Sources
|
||||
|
||||
SOURCE_URLS = {
|
||||
'AIDA64': 'http://download.aida64.com/aida64engineer595.zip',
|
||||
'AIDA64': 'http://download.aida64.com/aida64engineer597.zip',
|
||||
'Adobe Reader DC': 'http://ardownload.adobe.com/pub/adobe/reader/win/AcrobatDC/1801120035/AcroRdrDC1801120035_en_US.exe',
|
||||
'AdwCleaner': 'https://toolslib.net/downloads/finish/1-adwcleaner/',
|
||||
'Autoruns': 'https://download.sysinternals.com/files/Autoruns.zip',
|
||||
|
|
@ -17,13 +17,13 @@ SOURCE_URLS = {
|
|||
'FastCopy32': 'http://ftp.vector.co.jp/69/93/2323/FastCopy341.zip',
|
||||
'FastCopy64': 'http://ftp.vector.co.jp/69/93/2323/FastCopy341_x64.zip',
|
||||
'Firefox uBO': 'https://addons.cdn.mozilla.net/user-media/addons/607454/ublock_origin-1.15.10-an+fx.xpi?filehash=sha256%3A30b258803fd6cd988c5ba479f2f6ff5b4e9b40110c81e3421a6867b20ec718a6',
|
||||
'HWiNFO': 'http://app.oldfoss.com:81/download/HWiNFO/hwi_574.zip',
|
||||
'HWiNFO': 'http://app.oldfoss.com:81/download/HWiNFO/hwi_582.zip',
|
||||
'HitmanPro32': 'https://dl.surfright.nl/HitmanPro.exe',
|
||||
'HitmanPro64': 'https://dl.surfright.nl/HitmanPro_x64.exe',
|
||||
'IOBit_Uninstaller': 'https://portableapps.com/redirect/?a=IObitUninstallerPortable&t=http%3A%2F%2Fdownloads.portableapps.com%2Fportableapps%2Fiobituninstallerportable%2FIObitUninstallerPortable_7.3.0.13.paf.exe',
|
||||
'Intel SSD Toolbox': r'https://downloadmirror.intel.com/27527/eng/Intel%20SSD%20Toolbox%20-%20v3.5.1.exe',
|
||||
'Intel SSD Toolbox': r'https://downloadmirror.intel.com/27656/eng/Intel%20SSD%20Toolbox%20-%20v3.5.2.exe',
|
||||
'KVRT': 'http://devbuilds.kaspersky-labs.com/devbuilds/KVRT/latest/full/KVRT.exe',
|
||||
'NotepadPlusPlus': 'https://notepad-plus-plus.org/repository/7.x/7.5.5/npp.7.5.5.bin.minimalist.7z',
|
||||
'NotepadPlusPlus': 'https://notepad-plus-plus.org/repository/7.x/7.5.6/npp.7.5.6.bin.minimalist.7z',
|
||||
'Office Deployment Tool 2013': 'https://download.microsoft.com/download/6/2/3/6230F7A2-D8A9-478B-AC5C-57091B632FCF/officedeploymenttool_x86_4827-1000.exe',
|
||||
'Office Deployment Tool 2016': 'https://download.microsoft.com/download/2/7/A/27AF1BE6-DD20-4CB4-B154-EBAB8A7D4A7E/officedeploymenttool_8529.3600.exe',
|
||||
'ProduKey32': 'http://www.nirsoft.net/utils/produkey.zip',
|
||||
|
|
|
|||
|
|
@ -72,6 +72,9 @@ if __name__ == '__main__':
|
|||
else:
|
||||
if not answer_config_browsers:
|
||||
print_warning(' Skipped')
|
||||
|
||||
# Run speedtest
|
||||
popen_program(['start', '', 'https://fast.com'], shell=True)
|
||||
|
||||
# Done
|
||||
print_standard('\nDone.')
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ xset s off
|
|||
xset -dpms
|
||||
eval $(ssh-agent)
|
||||
export SSH_AUTH_SOCK
|
||||
compton &
|
||||
compton --backend xrender &
|
||||
sleep 1s
|
||||
conky -d
|
||||
nm-applet &
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ aic94xx-firmware
|
|||
bash-pipes
|
||||
hfsprogs
|
||||
i3lock-fancy-git
|
||||
inxi
|
||||
mprime
|
||||
nvme-cli
|
||||
openbox-patched
|
||||
|
|
|
|||
|
|
@ -5,9 +5,16 @@ curl
|
|||
dos2unix
|
||||
git
|
||||
hwloc
|
||||
imlib2
|
||||
lhasa
|
||||
libbsd
|
||||
libewf
|
||||
librsvg
|
||||
libsm
|
||||
libxcursor
|
||||
libxinerama
|
||||
libxml2
|
||||
libxrandr
|
||||
ntfs-3g
|
||||
openssh
|
||||
p7zip
|
||||
|
|
@ -15,5 +22,6 @@ pango
|
|||
progsreiserfs
|
||||
refind-efi
|
||||
rsync
|
||||
startup-notification
|
||||
subversion
|
||||
syslinux
|
||||
|
|
|
|||
|
|
@ -47,6 +47,8 @@ mupdf
|
|||
ncdu
|
||||
network-manager-applet
|
||||
networkmanager
|
||||
noto-fonts
|
||||
noto-fonts-cjk
|
||||
nvme-cli
|
||||
oblogout
|
||||
openbox-patched
|
||||
|
|
@ -90,7 +92,6 @@ wimlib
|
|||
xf86-input-libinput
|
||||
xf86-video-amdgpu
|
||||
xf86-video-fbdev
|
||||
xf86-video-intel
|
||||
xf86-video-nouveau
|
||||
xf86-video-vesa
|
||||
xorg-server
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ function run_elevated() {
|
|||
|
||||
function update_live_env() {
|
||||
hostname="$(echo "${KIT_NAME_SHORT}-linux" | tr "[:upper:]" "[:lower:]")"
|
||||
username="$(echo "${KIT_NAME_SHORT}tech" | tr "[:upper:]" "[:lower:]")"
|
||||
username="tech"
|
||||
label="${KIT_NAME_SHORT}_LINUX"
|
||||
|
||||
# Boot config (legacy)
|
||||
|
|
|
|||
Loading…
Reference in a new issue