From a35be6878013488a20a8e5c8139b34f5baa6ad03 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Tue, 4 Sep 2018 22:22:21 -0600 Subject: [PATCH 01/39] Add net devices to Conky before starting --- .../include/airootfs/etc/skel/.update_conky | 20 ++++++++++--------- .../include/airootfs/etc/skel/.xinitrc | 1 - .../include/airootfs/etc/skel/.zlogin | 6 ++++++ 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/.linux_items/include/airootfs/etc/skel/.update_conky b/.linux_items/include/airootfs/etc/skel/.update_conky index f67dc893..79801d8b 100755 --- a/.linux_items/include/airootfs/etc/skel/.update_conky +++ b/.linux_items/include/airootfs/etc/skel/.update_conky @@ -3,14 +3,16 @@ IF_LIST=($(ip l | egrep '^[0-9]+:\s+(eth|en|wl)' | sed -r 's/^[0-9]+:\s+(\w+):.*/\1/' | sort)) # Add interfaces to conkyrc -for i in "${IF_LIST[@]}"; do - if [[ "${i:0:1}" == "e" ]]; then - sed -i -r "s/#Network/Wired:\${alignr}\${addr $i}\n#Network/" ~/.conkyrc - else - sed -i -r "s/#Network/Wireless:\${alignr}\${addr $i}\n#Network/" ~/.conkyrc - fi -done +if fgrep '#Network' $HOME/.conkyrc; then + for i in "${IF_LIST[@]}"; do + if [[ "${i:0:1}" == "e" ]]; then + sed -i -r "s/#Network/Wired:\${alignr}\${addr $i}\n#Network/" $HOME/.conkyrc + else + sed -i -r "s/#Network/Wireless:\${alignr}\${addr $i}\n#Network/" $HOME/.conkyrc + fi + done -# Remove '#Network' line to prevent duplicating lines if this script is re-run -sed -i -r "s/#Network//" ~/.conkyrc + # Remove '#Network' line to prevent duplicating lines if this script is re-run + sed -i -r "s/#Network//" $HOME/.conkyrc +fi diff --git a/.linux_items/include/airootfs/etc/skel/.xinitrc b/.linux_items/include/airootfs/etc/skel/.xinitrc index 78bddfe7..2827fe58 100755 --- a/.linux_items/include/airootfs/etc/skel/.xinitrc +++ b/.linux_items/include/airootfs/etc/skel/.xinitrc @@ -16,5 +16,4 @@ connect-to-network & (sleep 5s && killall dunst) & $HOME/.urxvt_default_res & $HOME/.update_wallpaper & -$HOME/.update_conky & exec openbox-session diff --git a/.linux_items/include/airootfs/etc/skel/.zlogin b/.linux_items/include/airootfs/etc/skel/.zlogin index 26463919..0898d1e2 100644 --- a/.linux_items/include/airootfs/etc/skel/.zlogin +++ b/.linux_items/include/airootfs/etc/skel/.zlogin @@ -1,9 +1,15 @@ setterm -blank 0 -powerdown 0 if [ "$(fgconsole 2>/dev/null)" -eq "1" ]; then + # Update settings if using i3 if fgrep -q "i3" /proc/cmdline; then sed -i -r 's/#(own_window_type override)/\1/' ~/.conkyrc sed -i -r 's/openbox-session/i3/' ~/.xinitrc fi + + # Update Conky + $HOME/.update_conky + + # Start X or HW-diags if ! fgrep -q "nox" /proc/cmdline; then startx >/dev/null else From 5ef7c9b16e61b5610754558d8ee70f911e19af60 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Tue, 4 Sep 2018 22:35:39 -0600 Subject: [PATCH 02/39] Updated functions/network.py --- .bin/Scripts/functions/network.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.bin/Scripts/functions/network.py b/.bin/Scripts/functions/network.py index 0d6beb3a..3f3480f5 100644 --- a/.bin/Scripts/functions/network.py +++ b/.bin/Scripts/functions/network.py @@ -3,6 +3,7 @@ ## Wizard Kit: Functions - Network import os +import shutil import sys # Init @@ -26,13 +27,8 @@ def connect_to_network(): if is_connected(): return - # LAN - if 'en' in net_ifs: - # Reload the tg3/broadcom driver (known fix for some Dell systems) - try_and_print(message='Reloading drivers...', function=reload_tg3) - # WiFi - if not is_connected() and 'wl' in net_ifs: + if 'wl' in net_ifs: cmd = [ 'nmcli', 'dev', 'wifi', 'connect', WIFI_SSID, @@ -42,6 +38,18 @@ def connect_to_network(): function = run_program, cmd = cmd) + # LAN + if not is_connected(): + # Reload the tg3/broadcom driver (known fix for some Dell systems) + try_and_print(message='Reloading drivers...', function=reload_tg3) + + # Rebuild conkyrc + shutil.copyfile( + '/etc/skel/.conkyrc', + '{HOME}/.conkyrc'.format(**global_vars['Env'])) + cmd = ['{HOME}/.update_conky'.format(**global_vars['Env'])] + run_program(cmd, check=False) + def is_connected(): """Check for a valid private IP.""" devs = psutil.net_if_addrs() From 793581ac22af7116d2cff03076b5db09f64b2eea Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sun, 9 Sep 2018 19:41:46 -0600 Subject: [PATCH 03/39] Rewrote I/O benchmark sections * Displays graph during test and in summary * Reduce test area to speedup the benchmark * Addresses issues #48 & #49 --- .bin/Scripts/functions/hw_diags.py | 216 ++++++++++++++++++++++++++--- 1 file changed, 195 insertions(+), 21 deletions(-) diff --git a/.bin/Scripts/functions/hw_diags.py b/.bin/Scripts/functions/hw_diags.py index dce6f140..f173b6f6 100644 --- a/.bin/Scripts/functions/hw_diags.py +++ b/.bin/Scripts/functions/hw_diags.py @@ -27,6 +27,30 @@ ATTRIBUTES = { 201: {'Warning': 1}, }, } +IO_VARS = { + 'Block Size': 512*1024, + 'Chunk Size': 16*1024**2, + 'Minimum Dev Size': 8*1024**3, + 'Minimum Test Size': 10*1024**3, + 'Alt Test Size Factor': 0.01, + 'Progress Refresh Rate': 5, + 'Scale 16': [2**(0.6*x)+(16*x) for x in range(1,17)], + 'Scale 32': [2**(0.6*x/2)+(16*x/2) for x in range(1,33)], + 'Threshold Fail': 65*1024**2, + 'Threshold Warn': 135*1024**2, + 'Threshold Great': 750*1024**2, + 'Graph Horizontal': ('▁', '▂', '▃', '▄', '▅', '▆', '▇', '█'), + 'Graph Horizontal Width': 40, + 'Graph Vertical': ( + '▏', '▎', '▍', '▌', + '▋', '▊', '▉', '█', + '█▏', '█▎', '█▍', '█▌', + '█▋', '█▊', '█▉', '██', + '██▏', '██▎', '██▍', '██▌', + '██▋', '██▊', '██▉', '███', + '███▏', '███▎', '███▍', '███▌', + '███▋', '███▊', '███▉', '████'), + } TESTS = { 'Prime95': { 'Enabled': False, @@ -49,6 +73,45 @@ TESTS = { }, } +def generate_horizontal_graph(rates): + """Generate two-line horizontal graph from rates, returns str.""" + line_top = '' + line_bottom = '' + for r in rates: + step = get_graph_step(r, scale=16) + + # Set color + r_color = COLORS['CLEAR'] + if r < IO_VARS['Threshold Fail']: + r_color = COLORS['RED'] + elif r < IO_VARS['Threshold Warn']: + r_color = COLORS['YELLOW'] + elif r > IO_VARS['Threshold Great']: + r_color = COLORS['GREEN'] + + # Build graph + if step < 8: + line_top += ' ' + line_bottom += '{}{}'.format(r_color, IO_VARS['Graph Horizontal'][step]) + else: + line_top += '{}{}'.format(r_color, IO_VARS['Graph Horizontal'][step-8]) + line_bottom += '{}{}'.format(r_color, IO_VARS['Graph Horizontal'][-1]) + line_top += COLORS['CLEAR'] + line_bottom += COLORS['CLEAR'] + return '{}\n{}'.format(line_top, line_bottom) + +def get_graph_step(rate, scale=16): + """Get graph step based on rate and scale, returns int.""" + m_rate = rate / (1024**2) + step = 0 + scale_name = 'Scale {}'.format(scale) + for x in range(scale-1, -1, -1): + # Iterate over scale backwards + if m_rate >= IO_VARS[scale_name][x]: + step = x + break + return step + def get_read_rate(s): """Get read rate in bytes/s from dd progress output.""" real_rate = None @@ -254,28 +317,113 @@ def run_iobenchmark(): 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') + + # Get dev size + cmd = 'sudo lsblk -bdno size /dev/{}'.format(name) + try: + result = run_program(cmd.split()) + dev_size = result.stdout.decode().strip() + dev_size = int(dev_size) + except: + # Failed to get dev size, requires manual testing instead + TESTS['iobenchmark']['Status'][name] = 'Unknown' + continue + if dev_size < IO_VARS['Minimum Dev Size']: + TESTS['iobenchmark']['Status'][name] = 'Unknown' + continue + + # Calculate dd values + ## test_size is the area to be read in bytes + ## If the dev is < 10Gb then it's the whole dev + ## Otherwise it's the smaller of 10Gb and 1% of the dev + ## + ## test_chunks is the number of groups of "Chunk Size" in test_size + ## This number is reduced to a multiple of the graph width in + ## order to allow for the data to be condensed cleanly + ## + ## skip_blocks is the number of "Block Size" groups not tested + ## skip_count is the number of blocks to skip per test_chunk + ## skip_extra is how often to add an additional skip block + ## This is needed to ensure an even testing across the dev + ## This is calculated by using the fractional amount left off + ## of the skip_count variable + test_size = min(IO_VARS['Minimum Test Size'], dev_size) + test_size = max( + test_size, dev_size*IO_VARS['Alt Test Size Factor']) + test_chunks = int(test_size // IO_VARS['Chunk Size']) + test_chunks -= test_chunks % IO_VARS['Graph Horizontal Width'] + test_size = test_chunks * IO_VARS['Chunk Size'] + skip_blocks = int((dev_size - test_size) // IO_VARS['Block Size']) + skip_count = int((skip_blocks / test_chunks) // 1) + skip_extra = 0 + try: + skip_extra = 1 + int(1 / ((skip_blocks / test_chunks) % 1)) + except ZeroDivisionError: + # skip_extra == 0 is fine + pass + + # Open dd progress pane after initializing file + with open(progress_file, 'w') as f: + f.write('') + sleep(1) + cmd = 'tmux split-window -dp 75 -PF #D tail -f {}'.format( + progress_file) + result = run_program(cmd.split()) + bottom_pane = result.stdout.decode().strip() + + # Run dd read tests + offset = 0 + read_rates = [] + for i in range(test_chunks): + i += 1 + s = skip_count + c = int(IO_VARS['Chunk Size'] / IO_VARS['Block Size']) + if skip_extra and i % skip_extra == 0: + s += 1 + cmd = 'sudo dd bs={b} skip={s} count={c} if=/dev/{n} of={o}'.format( + b=IO_VARS['Block Size'], + s=offset+s, + c=c, + n=name, + o='/dev/null') + result = run_program(cmd.split()) + result_str = result.stderr.decode().replace('\n', '') + read_rates.append(get_read_rate(result_str)) + if i % IO_VARS['Progress Refresh Rate'] == 0: + # Update vertical graph + update_io_progress( + percent=i/test_chunks*100, + rate=read_rates[-1], + progress_file=progress_file) + # Update offset + offset += s + c 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' + # Close bottom pane + run_program(['tmux', 'kill-pane', '-t', bottom_pane]) + + # Build report + h_graph_rates = [] + pos = 0 + width = int(test_chunks / IO_VARS['Graph Horizontal Width']) + for i in range(IO_VARS['Graph Horizontal Width']): + # Append average rate for WIDTH number of rates to new array + h_graph_rates.append(sum(read_rates[pos:pos+width])/width) + pos += width + report = generate_horizontal_graph(h_graph_rates) + report += '\nRead speed: {:3.1f} MB/s (Min: {:3.1f}, Max: {:3.1f})'.format( + sum(read_rates)/len(read_rates)/1024**2, + min(read_rates)/1024**2, + max(read_rates)/1024**2) + TESTS['iobenchmark']['Results'][name] = report + + # Set CS/NS + if min(read_rates) <= IO_VARS['Threshold Fail']: + TESTS['iobenchmark']['Status'][name] = 'NS' + elif min(read_rates) <= IO_VARS['Threshold Warn']: + TESTS['iobenchmark']['Status'][name] = 'Unknown' + else: + TESTS['iobenchmark']['Status'][name] = 'CS' # Move temp file shutil.move(progress_file, '{}/iobenchmark-{}.log'.format( @@ -759,13 +907,38 @@ def show_results(): and io_status not in ['Denied', 'OVERRIDE', 'Skipped']): print_info('Benchmark:') result = TESTS['iobenchmark']['Results'].get(name, '') - print_standard(' {}'.format(result)) + for line in result.split('\n'): + print_standard(' {}'.format(line)) print_standard(' ') # Done pause('Press Enter to return to main menu... ') run_program('tmux kill-pane -a'.split()) +def update_io_progress(percent, rate, progress_file): + """Update I/O progress file.""" + bar_color = COLORS['CLEAR'] + rate_color = COLORS['CLEAR'] + step = get_graph_step(rate, scale=32) + if rate < IO_VARS['Threshold Fail']: + bar_color = COLORS['RED'] + rate_color = COLORS['YELLOW'] + elif rate < IO_VARS['Threshold Warn']: + bar_color = COLORS['YELLOW'] + rate_color = COLORS['YELLOW'] + elif rate > IO_VARS['Threshold Great']: + bar_color = COLORS['GREEN'] + rate_color = COLORS['GREEN'] + line = ' {p:5.1f}% {b_color}{b:<4} {r_color}{r:6.1f} Mb/s{c}\n'.format( + p=percent, + b_color=bar_color, + b=IO_VARS['Graph Vertical'][step], + r_color=rate_color, + r=rate/(1024**2), + c=COLORS['CLEAR']) + with open(progress_file, 'a') as f: + f.write(line) + def update_progress(): """Update progress file.""" if 'Progress Out' not in TESTS: @@ -821,3 +994,4 @@ def update_progress(): if __name__ == '__main__': print("This file is not meant to be called directly.") +# vim: sts=4 sw=4 ts=4 From 8fec6fc5b9a825ffa99dc649aa3c775818bb7b2d Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Wed, 12 Sep 2018 14:46:04 -0600 Subject: [PATCH 04/39] Save raw I/O read rates in log --- .bin/Scripts/functions/hw_diags.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.bin/Scripts/functions/hw_diags.py b/.bin/Scripts/functions/hw_diags.py index f173b6f6..8898c79c 100644 --- a/.bin/Scripts/functions/hw_diags.py +++ b/.bin/Scripts/functions/hw_diags.py @@ -135,9 +135,9 @@ def get_smart_details(dev): def get_status_color(s): """Get color based on status, returns str.""" color = COLORS['CLEAR'] - if s in ['Denied', 'NS', 'OVERRIDE', 'Unknown']: + if s in ['Denied', 'NS', 'OVERRIDE']: color = COLORS['RED'] - elif s in ['Aborted', 'Working', 'Skipped']: + elif s in ['Aborted', 'Unknown', 'Working', 'Skipped']: color = COLORS['YELLOW'] elif s in ['CS']: color = COLORS['GREEN'] @@ -335,7 +335,7 @@ def run_iobenchmark(): # Calculate dd values ## test_size is the area to be read in bytes ## If the dev is < 10Gb then it's the whole dev - ## Otherwise it's the smaller of 10Gb and 1% of the dev + ## Otherwise it's the larger of 10Gb or 1% of the dev ## ## test_chunks is the number of groups of "Chunk Size" in test_size ## This number is reduced to a multiple of the graph width in @@ -412,9 +412,9 @@ def run_iobenchmark(): pos += width report = generate_horizontal_graph(h_graph_rates) report += '\nRead speed: {:3.1f} MB/s (Min: {:3.1f}, Max: {:3.1f})'.format( - sum(read_rates)/len(read_rates)/1024**2, - min(read_rates)/1024**2, - max(read_rates)/1024**2) + sum(read_rates)/len(read_rates)/(1024**2), + min(read_rates)/(1024**2), + max(read_rates)/(1024**2)) TESTS['iobenchmark']['Results'][name] = report # Set CS/NS @@ -425,9 +425,12 @@ def run_iobenchmark(): else: TESTS['iobenchmark']['Status'][name] = 'CS' - # Move temp file - shutil.move(progress_file, '{}/iobenchmark-{}.log'.format( - global_vars['LogDir'], name)) + # Save logs + dest_filename = '{}/iobenchmark-{}.log'.format(global_vars['LogDir'], name) + shutil.move(progress_file, dest_filename) + with open(dest_filename.replace('.', '-raw.'), 'a') as f: + for rate in read_rates: + f.write('{} MB/s\n'.format(rate/(1024**2))) update_progress() # Done From 9f12f2c8560f2449123a380a19caf264a733bdf9 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Wed, 12 Sep 2018 15:39:28 -0600 Subject: [PATCH 05/39] Added SMART 199/C7 warning/override to HW-Diags --- .bin/Scripts/functions/hw_diags.py | 43 +++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/.bin/Scripts/functions/hw_diags.py b/.bin/Scripts/functions/hw_diags.py index 8898c79c..586efbd6 100644 --- a/.bin/Scripts/functions/hw_diags.py +++ b/.bin/Scripts/functions/hw_diags.py @@ -132,6 +132,15 @@ def get_smart_details(dev): # Let other sections deal with the missing data return {} +def get_smart_value(smart_data, smart_id): + """Get SMART value from table, returns int or None.""" + value = None + table = smart_data.get('ata_smart_attributes', {}).get('table', []) + for row in table: + if str(row.get('id', '?')) == str(smart_id): + value = row.get('raw', {}).get('value', None) + return value + def get_status_color(s): """Get color based on status, returns str.""" color = COLORS['CLEAR'] @@ -737,19 +746,29 @@ def scan_disks(full_paths=False, only_path=None): data['SMART Support'] = False # Ask for manual overrides if necessary - if not data['Quick Health OK'] and (TESTS['badblocks']['Enabled'] or TESTS['iobenchmark']['Enabled']): + if 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 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 + needs_override = False + if not data['Quick Health OK']: + needs_override = True + print_warning( + "WARNING: Health can't be confirmed for: /dev/{}".format(dev)) + if get_smart_value(data['smartctl'], '199'): + # SMART attribute present and it's value is non-zero + needs_override = True + print_warning( + 'WARNING: SMART 199/C7 error detected on /dev/{}'.format(dev)) + print_standard(' (Have you tried swapping the drive cable?)') + if needs_override: + dev_name = data['lsblk']['name'] + print_standard(' ') + 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 From 83064d7c9038c30f710d5de949be62276399a80f Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Wed, 12 Sep 2018 15:54:36 -0600 Subject: [PATCH 06/39] Fix issue #46 --- .bin/Scripts/functions/hw_diags.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.bin/Scripts/functions/hw_diags.py b/.bin/Scripts/functions/hw_diags.py index 586efbd6..91ebdef2 100644 --- a/.bin/Scripts/functions/hw_diags.py +++ b/.bin/Scripts/functions/hw_diags.py @@ -677,6 +677,8 @@ def run_tests(tests): def scan_disks(full_paths=False, only_path=None): """Scan for disks eligible for hardware testing.""" clear_screen() + print_standard(' ') + print_standard('Scanning disks...') # Get eligible disk list cmd = ['lsblk', '-J', '-O'] From 56e354f124b5aeeab8de0115e5156417dba5f8e5 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Wed, 12 Sep 2018 16:15:15 -0600 Subject: [PATCH 07/39] Avoid crash described in issue #39 --- .bin/Scripts/functions/hw_diags.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/.bin/Scripts/functions/hw_diags.py b/.bin/Scripts/functions/hw_diags.py index 91ebdef2..49f2960d 100644 --- a/.bin/Scripts/functions/hw_diags.py +++ b/.bin/Scripts/functions/hw_diags.py @@ -271,18 +271,21 @@ def run_badblocks(): print_standard('Done', timestamp=False) # Check results - with open(progress_file, 'r') as f: - text = f.read() - TESTS['badblocks']['Results'][name] = text - r = re.search(r'Pass completed.*0/0/0 errors', text) - if r: - TESTS['badblocks']['Status'][name] = 'CS' - else: - TESTS['badblocks']['Status'][name] = 'NS' + if os.path.exists(progress_file): + with open(progress_file, 'r') as f: + text = f.read() + TESTS['badblocks']['Results'][name] = text + r = re.search(r'Pass completed.*0/0/0 errors', text) + if r: + TESTS['badblocks']['Status'][name] = 'CS' + else: + TESTS['badblocks']['Status'][name] = 'NS' - # Move temp file - shutil.move(progress_file, '{}/badblocks-{}.log'.format( - global_vars['LogDir'], name)) + # Move temp file + shutil.move(progress_file, '{}/badblocks-{}.log'.format( + global_vars['LogDir'], name)) + else: + TESTS['badblocks']['Status'][name] = 'NS' update_progress() # Done From 34925a72c0c2b25db4b112cd6a97eede9afbef9c Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Wed, 12 Sep 2018 17:44:23 -0600 Subject: [PATCH 08/39] Update hostname via reverse DNS lookup Should help differentiate systems --- .../include/airootfs/etc/skel/.update_hostname | 15 +++++++++++++++ .linux_items/include/airootfs/etc/skel/.xinitrc | 1 + 2 files changed, 16 insertions(+) create mode 100755 .linux_items/include/airootfs/etc/skel/.update_hostname diff --git a/.linux_items/include/airootfs/etc/skel/.update_hostname b/.linux_items/include/airootfs/etc/skel/.update_hostname new file mode 100755 index 00000000..da563ab6 --- /dev/null +++ b/.linux_items/include/airootfs/etc/skel/.update_hostname @@ -0,0 +1,15 @@ +#!/bin/bash + +IP="$(ip a show scope global \ + | grep inet \ + | head -1 \ + | sed -r 's#.*inet ([0-9]+.[0-9]+.[0-9]+.[0-9]+.)/.*#\1#')" +HOSTNAME="$(dig +noall +answer +short -x "$IP" \ + | sed 's/\.$//')" + +# Set hostname and renew DHCP lease +sudo hostnamectl set-hostname "${HOSTNAME}" +sudo dhclient -r +sleep 1 +sudo dhclient + diff --git a/.linux_items/include/airootfs/etc/skel/.xinitrc b/.linux_items/include/airootfs/etc/skel/.xinitrc index 2827fe58..573aed1d 100755 --- a/.linux_items/include/airootfs/etc/skel/.xinitrc +++ b/.linux_items/include/airootfs/etc/skel/.xinitrc @@ -12,6 +12,7 @@ conky -d nm-applet & cbatticon & volumeicon & +$HOME/.update_hostname connect-to-network & (sleep 5s && killall dunst) & $HOME/.urxvt_default_res & From deec1746e42637d5c1251452785bfe7c15f4dbba Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Wed, 12 Sep 2018 18:20:16 -0600 Subject: [PATCH 09/39] Removed pydf to fix issue #44 --- .linux_items/include/airootfs/etc/skel/.aliases | 1 - .linux_items/packages/live_add | 1 - 2 files changed, 2 deletions(-) diff --git a/.linux_items/include/airootfs/etc/skel/.aliases b/.linux_items/include/airootfs/etc/skel/.aliases index 7566e42c..03d15315 100644 --- a/.linux_items/include/airootfs/etc/skel/.aliases +++ b/.linux_items/include/airootfs/etc/skel/.aliases @@ -4,7 +4,6 @@ alias 7z3='7z a -t7z -mx=3' alias 7z5='7z a -t7z -mx=5' alias 7z7='7z a -t7z -mx=7' alias 7z9='7z a -t7z -mx=9' -alias df='pydf' alias ddrescue='sudo ddrescue --ask --min-read-rate=64k -vvvv' alias diff='colordiff -ur' alias du='du -sch --apparent-size' diff --git a/.linux_items/packages/live_add b/.linux_items/packages/live_add index ade34eb5..a297ca05 100644 --- a/.linux_items/packages/live_add +++ b/.linux_items/packages/live_add @@ -61,7 +61,6 @@ otf-font-awesome-4 p7zip papirus-icon-theme progsreiserfs -pydf python python-psutil python-requests From d9a9ce0a86e76184ea6d9b19a1b8d2bef6f33e51 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Wed, 12 Sep 2018 18:56:39 -0600 Subject: [PATCH 10/39] Allow hw-diags to reattach to the tmux session * The option to kill the current session and start a new was left in place --- .bin/Scripts/hw-diags | 9 ++++++--- .linux_items/packages/live_add | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.bin/Scripts/hw-diags b/.bin/Scripts/hw-diags index e8d838df..d3a1cb21 100755 --- a/.bin/Scripts/hw-diags +++ b/.bin/Scripts/hw-diags @@ -8,7 +8,7 @@ MENU="hw-diags-menu" function ask() { while :; do - read -p "$1 " -r answer + read -p "$1 [Y/N] " -r answer if echo "$answer" | egrep -iq '^(y|yes|sure)$'; then return 0 elif echo "$answer" | egrep -iq '^(n|no|nope)$'; then @@ -26,7 +26,10 @@ die () { if tmux list-session | grep -q "$SESSION_NAME"; then echo "WARNING: tmux session $SESSION_NAME already exists." echo "" - if ask "Kill current session?"; then + if ask "Connect to current session?"; then + # Do nothing, the command below will attach/connect + echo "" + elif ask "Kill current session and start new session?"; then tmux kill-session -t "$SESSION_NAME" || \ die "Failed to kill session: $SESSION_NAME" else @@ -39,5 +42,5 @@ if tmux list-session | grep -q "$SESSION_NAME"; then fi # Start session -tmux new-session -s "$SESSION_NAME" -n "$WINDOW_NAME" "$MENU" $* +tmux new-session -A -s "$SESSION_NAME" -n "$WINDOW_NAME" "$MENU" $* diff --git a/.linux_items/packages/live_add b/.linux_items/packages/live_add index a297ca05..ea784699 100644 --- a/.linux_items/packages/live_add +++ b/.linux_items/packages/live_add @@ -76,6 +76,7 @@ spice-vdagent terminus-font testdisk-wip thunar +tigervnc tint2 tk tmux From cb5ff20378637e09c1f52ff68d121eebfcbf5d8d Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Wed, 12 Sep 2018 20:54:49 -0600 Subject: [PATCH 11/39] Start a VNC server during startup --- .linux_items/include/airootfs/etc/skel/.xinitrc | 1 + .linux_items/include/airootfs/etc/ufw/user.rules | 3 +++ .linux_items/include/airootfs/etc/ufw/user6.rules | 3 +++ Build Linux | 4 ++++ 4 files changed, 11 insertions(+) diff --git a/.linux_items/include/airootfs/etc/skel/.xinitrc b/.linux_items/include/airootfs/etc/skel/.xinitrc index 573aed1d..fefe60f2 100755 --- a/.linux_items/include/airootfs/etc/skel/.xinitrc +++ b/.linux_items/include/airootfs/etc/skel/.xinitrc @@ -17,4 +17,5 @@ connect-to-network & (sleep 5s && killall dunst) & $HOME/.urxvt_default_res & $HOME/.update_wallpaper & +x0vncserver -display :0 -passwordfile $HOME/.vnc/passwd -AlwaysShared & exec openbox-session diff --git a/.linux_items/include/airootfs/etc/ufw/user.rules b/.linux_items/include/airootfs/etc/ufw/user.rules index aa30960c..3dbf5cf4 100644 --- a/.linux_items/include/airootfs/etc/ufw/user.rules +++ b/.linux_items/include/airootfs/etc/ufw/user.rules @@ -21,6 +21,9 @@ -A ufw-user-input -p tcp --dport 22 -j ACCEPT -A ufw-user-input -p udp --dport 22 -j ACCEPT +### tuple ### allow tcp 5900 0.0.0.0/0 any 0.0.0.0/0 VNC - in +-A ufw-user-input -p tcp --dport 5900 -j ACCEPT -m comment --comment 'dapp_VNC' + ### END RULES ### ### LOGGING ### diff --git a/.linux_items/include/airootfs/etc/ufw/user6.rules b/.linux_items/include/airootfs/etc/ufw/user6.rules index 47d96108..13084be4 100644 --- a/.linux_items/include/airootfs/etc/ufw/user6.rules +++ b/.linux_items/include/airootfs/etc/ufw/user6.rules @@ -21,6 +21,9 @@ -A ufw6-user-input -p tcp --dport 22 -j ACCEPT -A ufw6-user-input -p udp --dport 22 -j ACCEPT +### tuple ### allow tcp 5900 ::/0 any ::/0 VNC - in +-A ufw6-user-input -p tcp --dport 5900 -j ACCEPT -m comment --comment 'dapp_VNC' + ### END RULES ### ### LOGGING ### diff --git a/Build Linux b/Build Linux index 6ee0f169..2973174c 100755 --- a/Build Linux +++ b/Build Linux @@ -251,6 +251,10 @@ function update_live_env() { # udevil fix echo "mkdir /media" >> "$LIVE_DIR/airootfs/root/customize_airootfs.sh" + # VNC password + echo "mkdir '/home/$username/.vnc'" >> "$LIVE_DIR/airootfs/root/customize_airootfs.sh" + echo "echo '$TECH_PASSWORD' | vncpasswd -f > '/home/$username/.vnc/passwd'" >> "$LIVE_DIR/airootfs/root/customize_airootfs.sh" + # Wallpaper mkdir -p "$LIVE_DIR/airootfs/usr/share/wallpaper" cp "$ROOT_DIR/Images/Linux.png" "$LIVE_DIR/airootfs/usr/share/wallpaper/burned.in" From 821cb5cd462e90790f9ac2a728bbd303d2d2446e Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Wed, 12 Sep 2018 21:02:24 -0600 Subject: [PATCH 12/39] Super+t URxvt windows auto-connect to tmux session --- .linux_items/include/airootfs/etc/skel/.config/i3/config | 2 +- .linux_items/include/airootfs/etc/skel/.config/openbox/rc.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.linux_items/include/airootfs/etc/skel/.config/i3/config b/.linux_items/include/airootfs/etc/skel/.config/i3/config index de3c6fa8..cf09a2ca 100644 --- a/.linux_items/include/airootfs/etc/skel/.config/i3/config +++ b/.linux_items/include/airootfs/etc/skel/.config/i3/config @@ -73,7 +73,7 @@ bindsym $mod+f exec "thunar ~" bindsym $mod+i exec "hardinfo" bindsym $mod+m exec "urxvt -title 'Mount All Volumes' -e mount-all-volumes gui" bindsym $mod+s exec "urxvt -title 'Hardware Diagnostics' -e hw-diags quick" -bindsym $mod+t exec "urxvt" +bindsym $mod+t exec "urxvt -e zsh -c 'tmux new-session -A -t general; zsh'" bindsym $mod+v exec "urxvt -title 'Hardware Sensors' -e watch -c -n1 -t hw-sensors" bindsym $mod+w exec "firefox" diff --git a/.linux_items/include/airootfs/etc/skel/.config/openbox/rc.xml b/.linux_items/include/airootfs/etc/skel/.config/openbox/rc.xml index 43656613..90c7b0e0 100644 --- a/.linux_items/include/airootfs/etc/skel/.config/openbox/rc.xml +++ b/.linux_items/include/airootfs/etc/skel/.config/openbox/rc.xml @@ -329,7 +329,7 @@ - urxvt + urxvt -e zsh -c 'tmux new-session -A -t general; zsh' From 879927c37ca169b5ef45c55eaa63eb5807a45884 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Fri, 14 Sep 2018 17:53:35 -0600 Subject: [PATCH 13/39] Add CoreStorage support to mount-all-volumes * Checks for any CoreStorage partitions * If found scans partition with testdisk to find inner volume(s) * If found mapper devices are added with dmsetup * Then the device list is built in mount_volumes() --- .bin/Scripts/functions/data.py | 72 ++++++++++++++++++++++++++++++++-- 1 file changed, 68 insertions(+), 4 deletions(-) diff --git a/.bin/Scripts/functions/data.py b/.bin/Scripts/functions/data.py index 340dc529..63a19519 100644 --- a/.bin/Scripts/functions/data.py +++ b/.bin/Scripts/functions/data.py @@ -153,6 +153,67 @@ def cleanup_transfer(dest_path): except Exception: pass +def find_core_storage_volumes(): + """Try to create block devices for any Apple CoreStorage volumes.""" + corestorage_uuid = '53746f72-6167-11aa-aa11-00306543ecac' + dmsetup_cmd_file = '{TmpDir}/dmsetup_command' + + # Get CoreStorage devices + cmd = [ + 'lsblk', '--json', '--list', '--paths', + '--output', 'NAME,PARTTYPE'] + result = run_program(cmd) + json_data = json.loads(result.stdout.decode()) + devs = json_data.get('blockdevices', []) + devs = [d for d in devs if d.get('parttype', '') == corestorage_uuid] + if devs: + print_standard(' ') + print_standard('Detected CoreStorage partition{}'.format( + '' if len(devs) == 1 else 's')) + print_standard(' Scanning for inner volume(s)....') + + # Search for inner volumes and setup dev mappers + for dev in devs: + dev_path = dev.get('name', '') + if not dev_path: + # Can't setup block device without the dev path + continue + dev_name = re.sub(r'.*/', '', dev_path) + log_path = '{LogDir}/testdisk_{dev_name}.log'.format( + dev_name=dev_name, **global_vars) + + # Run TestDisk + cmd = [ + 'sudo', 'testdisk', + '/logname', log_path, '/debug', '/log', + '/cmd', dev_path, 'partition_none,analyze'] + result = run_program(cmd, check=False) + if result.returncode: + # i.e. return code is non-zero + continue + if not os.path.exists(log_path): + # TestDisk failed to write log + continue + + # Check log for found volumes + cs_vols = {} + with open(log_path, 'r') as f: + for line in f.readlines(): + r = re.match( + r'^.*echo "([^"]+)" . dmsetup create test(\d)$', + line.strip(), + re.IGNORECASE) + if r: + cs_name = 'CoreStorage_{}_{}'.format(dev_name, r.group(2)) + cs_vols[cs_name] = r.group(1) + + # Create mapper device(s) + for name, dm_cmd in sorted(cs_vols.items()): + with open(dmsetup_cmd_file, 'w') as f: + f.write(dm_cmd) + cmd = ['sudo', 'dmsetup', 'create', name, dmsetup_cmd_file] + run_program(cmd, check=False) + def fix_path_sep(path_str): """Replace non-native and duplicate dir separators, returns str.""" return re.sub(r'(\\|/)+', lambda s: os.sep, path_str) @@ -190,14 +251,17 @@ def get_mounted_volumes(): def mount_volumes(all_devices=True, device_path=None, read_write=False): """Mount all detected filesystems.""" report = {} - - # Get list of block devices cmd = [ - 'lsblk', '-J', '-p', - '-o', 'NAME,FSTYPE,LABEL,UUID,PARTTYPE,TYPE,SIZE'] + 'lsblk', '--json', '--paths', + '--output', 'NAME,FSTYPE,LABEL,UUID,PARTTYPE,TYPE,SIZE'] if not all_devices and device_path: # Only mount volumes for specific device cmd.append(device_path) + else: + # Check for Apple CoreStorage volumes first + find_core_storage_volumes() + + # Get list of block devices result = run_program(cmd) json_data = json.loads(result.stdout.decode()) devs = json_data.get('blockdevices', []) From cdef33d7743ff13998bc11c872d7872f194fcf99 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sat, 15 Sep 2018 12:38:27 -0600 Subject: [PATCH 14/39] cbatticon removed from i3, notifications disabled --- .linux_items/include/airootfs/etc/skel/.config/openbox/autostart | 1 + .linux_items/include/airootfs/etc/skel/.xinitrc | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.linux_items/include/airootfs/etc/skel/.config/openbox/autostart b/.linux_items/include/airootfs/etc/skel/.config/openbox/autostart index 21fd52e5..6eaa6cc3 100644 --- a/.linux_items/include/airootfs/etc/skel/.config/openbox/autostart +++ b/.linux_items/include/airootfs/etc/skel/.config/openbox/autostart @@ -17,3 +17,4 @@ #xfce-mcs-manager & tint2 & +cbatticon --hide-notification & diff --git a/.linux_items/include/airootfs/etc/skel/.xinitrc b/.linux_items/include/airootfs/etc/skel/.xinitrc index fefe60f2..ddc70863 100755 --- a/.linux_items/include/airootfs/etc/skel/.xinitrc +++ b/.linux_items/include/airootfs/etc/skel/.xinitrc @@ -10,7 +10,6 @@ compton --backend xrender --xrender-sync --xrender-sync-fence & sleep 1s conky -d nm-applet & -cbatticon & volumeicon & $HOME/.update_hostname connect-to-network & From 3a801ba72de1be2d56c4c8c383c874a0d89ee66f Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sat, 15 Sep 2018 15:08:47 -0600 Subject: [PATCH 15/39] Updated startup settings * Added support for HiDPI devices * Only affects devices with a DPI >= 192 * Most screen objects are doubled in size * Updated .conkyrc * Vertical offset now set to 24 or 48 (to match URxvt) * Removed extra line after network adapters * Updated .xinitrc * Removed dunst logic since `cbatticon` no longer sends notifications * Update .Xresources for all programs before `xrdb -merge` * Update hostname after `connect-to-network` * URxvt windows are now based on a 16:9 ratio (instead of 4:3) * Removed * .update_wallpaper (integrated with .xinitrc) * .urxvt_default_res (integrated with .update_dpi_settings) * Fixes issue #45 --- .../include/airootfs/etc/skel/.Xresources | 3 +- .../include/airootfs/etc/skel/.conkyrc | 9 ++- .../airootfs/etc/skel/.update_dpi_settings | 68 +++++++++++++++++++ .../airootfs/etc/skel/.update_hostname | 1 + .../airootfs/etc/skel/.update_wallpaper | 21 ------ .../airootfs/etc/skel/.urxvt_default_res | 10 --- .../include/airootfs/etc/skel/.wallpaper | 1 + .../include/airootfs/etc/skel/.xinitrc | 7 +- 8 files changed, 79 insertions(+), 41 deletions(-) create mode 100755 .linux_items/include/airootfs/etc/skel/.update_dpi_settings delete mode 100755 .linux_items/include/airootfs/etc/skel/.update_wallpaper delete mode 100755 .linux_items/include/airootfs/etc/skel/.urxvt_default_res create mode 120000 .linux_items/include/airootfs/etc/skel/.wallpaper diff --git a/.linux_items/include/airootfs/etc/skel/.Xresources b/.linux_items/include/airootfs/etc/skel/.Xresources index 68054af5..d659b735 100755 --- a/.linux_items/include/airootfs/etc/skel/.Xresources +++ b/.linux_items/include/airootfs/etc/skel/.Xresources @@ -21,7 +21,7 @@ URxvt*externalBorder: 0 !URxvt.colorIT: #87af5f !URxvt.colorBD: #c5c8c6 !URxvt.colorUL: #87afd7 -URxvt.geometry: 92x16 +URxvt.geometry: 92x16 URxvt.internalBorder: 8 URxvt.shading: 10 URxvt.transparent: true @@ -53,6 +53,7 @@ URxvt.transparent: true *.color15: #ffffff ! fonts +!Xft.dpi: 192 Xft.autohint: 0 Xft.antialias: 1 Xft.hinting: true diff --git a/.linux_items/include/airootfs/etc/skel/.conkyrc b/.linux_items/include/airootfs/etc/skel/.conkyrc index adfd5cbb..af09dd8f 100644 --- a/.linux_items/include/airootfs/etc/skel/.conkyrc +++ b/.linux_items/include/airootfs/etc/skel/.conkyrc @@ -37,7 +37,7 @@ minimum_size 180 0 ### width | height maximum_width 180 gap_x 20 ### left | right -gap_y 45 ### up | down +gap_y 24 ### up | down alignment tr ####################### End Window Settings ### @@ -143,15 +143,14 @@ Uptime:${alignr}${uptime_short} CPU: ${if_match ${cpu cpu0}<10} ${cpu cpu0}\ ${else}${if_match ${cpu cpu0}<100} ${cpu cpu0}\ ${else}${cpu cpu0}${endif}${endif}% Used${alignr}${freq_g} GHz -${cpugraph cpu0 20,180 ${color} ${color}} +${cpugraph cpu0 ${gap_x},${width} ${color} ${color}} RAM: ${mem} Used${alignr}${memmax} -${memgraph 20,180 ${color} ${color}} +${memgraph ${gap_x},${width} ${color} ${color}} Disk I/O: -${diskiograph 20,180 ${color} ${color}} +${diskiograph ${gap_x},${width} ${color} ${color}} Down: ${downspeed}${goto 115}Up:${alignr}${upspeed} #Network - ${alignc}S H O R T C U T K E Y S ${hr} [Super] + d${alignr}HW Diagnostics diff --git a/.linux_items/include/airootfs/etc/skel/.update_dpi_settings b/.linux_items/include/airootfs/etc/skel/.update_dpi_settings new file mode 100755 index 00000000..2287508c --- /dev/null +++ b/.linux_items/include/airootfs/etc/skel/.update_dpi_settings @@ -0,0 +1,68 @@ +#!/bin/env bash +# +## Calculate DPI and adjust display settings if necesary + +REGEX_XRANDR='^.* ([0-9]+)x([0-9]+)\+[0-9]+\+[0-9]+.* ([0-9]+)mm x ([0-9]+)mm.*$' +REGEX_URXVT='(URxvt.geometry:\s+).*' + +# Get screen data +xrandr_str="$(xrandr | grep mm | head -1)" +width_px="$(echo "${xrandr_str}" | sed -r "s/${REGEX_XRANDR}/\1/")" +height_px="$(echo "${xrandr_str}" | sed -r "s/${REGEX_XRANDR}/\2/")" +width_mm="$(echo "${xrandr_str}" | sed -r "s/${REGEX_XRANDR}/\3/")" +height_mm="$(echo "${xrandr_str}" | sed -r "s/${REGEX_XRANDR}/\4/")" + +# Convert to in +width_in="$(echo "${width_mm} * 0.03937" | bc)" +height_in="$(echo "${height_mm} * 0.03937" | bc)" + +# Calculate diagonals +diag_px="$(echo "sqrt(${width_px}^2 + ${height_px}^2)" | bc)" +diag_in="$(echo "sqrt(${width_in}^2 + ${height_in}^2)" | bc)" + +# Calculate DPI +dpi="$(echo "${diag_px} / ${diag_in}" | bc 2>/dev/null || True)" +dpi="${dpi:-0}" + +# Calculate URxvt default window size +width_urxvt="$(echo "${width_px} * 112/1280" | bc)" +height_urxvt="$(echo "${height_px} * 33/720" | bc)" +offset_urxvt="24" + +# Update settings if necessary +if [[ "${dpi}" -ge 192 ]]; then + # Conky + sed -i 's/minimum_size 180 0/minimum_size 360 0/' "${HOME}/.conkyrc" + sed -i 's/maximum_width 180/maximum_width 360/' "${HOME}/.conkyrc" + sed -i 's/gap_x 20/gap_x 40/' "${HOME}/.conkyrc" + sed -i 's/gap_y 24/gap_y 48/' "${HOME}/.conkyrc" + + # Fonts + sed -i 's/!Xft.dpi: 192/Xft.dpi: 192/' "${HOME}/.Xresources" + + # GDK + export GDK_SCALE=2 + export GDK_DPI_SCALE=0.5 + + # i3 + sed -i -r 's/(height\s+) 26/\1 52/' "${HOME}/.config/i3/config" + + # Tint2 + sed -i 's/panel_size = 100% 30/panel_size = 100% 60/' \ + "${HOME}/.config/tint2/tint2rc" + sed -i 's/Inconsolata 10/Inconsolata 20/g' \ + "${HOME}/.config/tint2/tint2rc" + sed -i 's/Inconsolata 12/Inconsolata 24/g' \ + "${HOME}/.config/tint2/tint2rc" + sed -i 's/systray_icon_size = 24/systray_icon_size = 48/' \ + "${HOME}/.config/tint2/tint2rc" + + # URxvt + width_urxvt="$(echo "${width_urxvt} / 2" | bc)" + height_urxvt="$(echo "${height_urxvt} / 2" | bc)" + offset_urxvt="$(echo "${offset_urxvt} * 2" | bc)" +fi + +# Update URxvt (Always) +urxvt_geometry="${width_urxvt}x${height_urxvt}+${offset_urxvt}+${offset_urxvt}" +sed -i -r "s/${REGEX_URXVT}/\1${urxvt_geometry}/" "${HOME}/.Xresources" diff --git a/.linux_items/include/airootfs/etc/skel/.update_hostname b/.linux_items/include/airootfs/etc/skel/.update_hostname index da563ab6..3c1bd7c2 100755 --- a/.linux_items/include/airootfs/etc/skel/.update_hostname +++ b/.linux_items/include/airootfs/etc/skel/.update_hostname @@ -5,6 +5,7 @@ IP="$(ip a show scope global \ | head -1 \ | sed -r 's#.*inet ([0-9]+.[0-9]+.[0-9]+.[0-9]+.)/.*#\1#')" HOSTNAME="$(dig +noall +answer +short -x "$IP" \ + | head -1 \ | sed 's/\.$//')" # Set hostname and renew DHCP lease diff --git a/.linux_items/include/airootfs/etc/skel/.update_wallpaper b/.linux_items/include/airootfs/etc/skel/.update_wallpaper deleted file mode 100755 index 7bffa12b..00000000 --- a/.linux_items/include/airootfs/etc/skel/.update_wallpaper +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -BOOT_PATH="/run/archiso/bootmnt/arch/" -BURNED_IN="/usr/share/wallpaper/burned.in" -WALLPAPER="$HOME/.wallpaper.png" - -function link_wall() { - sudo rm "$WALLPAPER" - sudo ln -s "$1" "$WALLPAPER" -} - -# Check for wallpaper -## Checks BOOT_PATH and uses the BURNED_IN file if nothing is found -for f in "$BOOT_PATH"/{Arch,arch}.{jpg,png} "$BURNED_IN"; do - if [[ -f "$f" ]]; then - link_wall "$f" - break - fi -done - -feh --bg-fill "$WALLPAPER" diff --git a/.linux_items/include/airootfs/etc/skel/.urxvt_default_res b/.linux_items/include/airootfs/etc/skel/.urxvt_default_res deleted file mode 100755 index 1e146090..00000000 --- a/.linux_items/include/airootfs/etc/skel/.urxvt_default_res +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -XWIDTH="$(xrandr 2>/dev/null | grep '*' | sed -r 's/^\s+([0-9]+)x.*/\1/')" -XHEIGHT="$(xrandr 2>/dev/null | grep '*' | sed -r 's/^\s+[0-9]+x([0-9]+).*/\1/')" - -WIDTH="$(echo "${XWIDTH}*92/1024" | bc)" -HEIGHT="$(echo "${XHEIGHT}*32/768" | bc)" - -sed -i -r "s/(URxvt.geometry:\s+).*/\1${WIDTH}x${HEIGHT}+24+24/" ~/.Xresources -xrdb -merge ~/.Xresources diff --git a/.linux_items/include/airootfs/etc/skel/.wallpaper b/.linux_items/include/airootfs/etc/skel/.wallpaper new file mode 120000 index 00000000..f2a3d5e1 --- /dev/null +++ b/.linux_items/include/airootfs/etc/skel/.wallpaper @@ -0,0 +1 @@ +/usr/share/wallpaper/burned.in \ No newline at end of file diff --git a/.linux_items/include/airootfs/etc/skel/.xinitrc b/.linux_items/include/airootfs/etc/skel/.xinitrc index ddc70863..abb71f45 100755 --- a/.linux_items/include/airootfs/etc/skel/.xinitrc +++ b/.linux_items/include/airootfs/etc/skel/.xinitrc @@ -1,6 +1,7 @@ #!/bin/sh dbus-update-activation-environment --systemd DISPLAY +$HOME/.update_dpi_settings xrdb -merge $HOME/.Xresources xset s off xset -dpms @@ -11,10 +12,8 @@ sleep 1s conky -d nm-applet & volumeicon & -$HOME/.update_hostname connect-to-network & -(sleep 5s && killall dunst) & -$HOME/.urxvt_default_res & -$HOME/.update_wallpaper & +$HOME/.update_hostname & +feh --bg-fill "$HOME/.wallpaper" & x0vncserver -display :0 -passwordfile $HOME/.vnc/passwd -AlwaysShared & exec openbox-session From d31991a67f16f9b371d239e1cfae2ac9941bce9d Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sat, 15 Sep 2018 15:24:59 -0600 Subject: [PATCH 16/39] Always load broadcom before tg3 * Hopefully won't cause any problems. --- .bin/Scripts/functions/network.py | 19 ------------------- .../airootfs/etc/modprobe.d/broadcom.conf | 1 + 2 files changed, 1 insertion(+), 19 deletions(-) create mode 100644 .linux_items/include/airootfs/etc/modprobe.d/broadcom.conf diff --git a/.bin/Scripts/functions/network.py b/.bin/Scripts/functions/network.py index 3f3480f5..d040e343 100644 --- a/.bin/Scripts/functions/network.py +++ b/.bin/Scripts/functions/network.py @@ -37,18 +37,6 @@ def connect_to_network(): message = 'Connecting to {}...'.format(WIFI_SSID), function = run_program, cmd = cmd) - - # LAN - if not is_connected(): - # Reload the tg3/broadcom driver (known fix for some Dell systems) - try_and_print(message='Reloading drivers...', function=reload_tg3) - - # Rebuild conkyrc - shutil.copyfile( - '/etc/skel/.conkyrc', - '{HOME}/.conkyrc'.format(**global_vars['Env'])) - cmd = ['{HOME}/.update_conky'.format(**global_vars['Env'])] - run_program(cmd, check=False) def is_connected(): """Check for a valid private IP.""" @@ -79,13 +67,6 @@ def speedtest(): output = [(a, float(b), c) for a, b, c in output] return ['{:10}{:6.2f} {}'.format(*line) for line in output] -def reload_tg3(): - """Reload tg3 module as a workaround for some Dell systems.""" - run_program(['sudo', 'modprobe', '-r', 'tg3']) - run_program(['sudo', 'modprobe', 'broadcom']) - run_program(['sudo', 'modprobe', 'tg3']) - sleep(5) - if __name__ == '__main__': print("This file is not meant to be called directly.") diff --git a/.linux_items/include/airootfs/etc/modprobe.d/broadcom.conf b/.linux_items/include/airootfs/etc/modprobe.d/broadcom.conf new file mode 100644 index 00000000..1c85cd7b --- /dev/null +++ b/.linux_items/include/airootfs/etc/modprobe.d/broadcom.conf @@ -0,0 +1 @@ +softdep tg3 pre: broadcom From 1ee4a611b9c76b5d5adeed8f3d5691b43c29f45a Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sat, 15 Sep 2018 15:42:40 -0600 Subject: [PATCH 17/39] Hide UFD-only boot options from Linux ISOs * Fixes issue #41 --- .bin/Scripts/build-ufd | 2 ++ .linux_items/include/EFI/boot/refind.conf | 10 +++++----- .linux_items/include/syslinux/wk_pxe.cfg | 2 +- .linux_items/include/syslinux/wk_pxe_extras.cfg | 2 +- .linux_items/include/syslinux/wk_sys.cfg | 2 +- .linux_items/include/syslinux/wk_sys_extras.cfg | 2 +- 6 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.bin/Scripts/build-ufd b/.bin/Scripts/build-ufd index faae7867..c606892b 100755 --- a/.bin/Scripts/build-ufd +++ b/.bin/Scripts/build-ufd @@ -557,7 +557,9 @@ mount "${WINPE_ISO}" /mnt/WinPE -r >> "${LOG_FILE}" 2>&1 echo "Copying Linux files..." rsync ${RSYNC_ARGS} /mnt/Linux/* /mnt/Dest/ >> "${LOG_FILE}" 2>&1 sed -i "s/${ISO_LABEL}/${UFD_LABEL}/" /mnt/Dest/EFI/boot/refind.conf +sed -i "s/#UFD#//" /mnt/Dest/EFI/boot/refind.conf sed -i "s/${ISO_LABEL}/${UFD_LABEL}/" /mnt/Dest/arch/boot/syslinux/*cfg +sed -i "s/#UFD#//" /mnt/Dest/arch/boot/syslinux/*cfg echo "Copying WinPE files..." rsync ${RSYNC_ARGS} /mnt/WinPE/{Boot,bootmgr{,.efi},en-us,sources} /mnt/Dest/ >> "${LOG_FILE}" 2>&1 diff --git a/.linux_items/include/EFI/boot/refind.conf b/.linux_items/include/EFI/boot/refind.conf index 075f6e46..de83e78c 100644 --- a/.linux_items/include/EFI/boot/refind.conf +++ b/.linux_items/include/EFI/boot/refind.conf @@ -32,8 +32,8 @@ menuentry "Linux" { add_options "nox" } } -menuentry "WindowsPE" { - ostype windows - icon /EFI/boot/icons/wk_win.png - loader /EFI/microsoft/bootx64.efi -} +#UFD#menuentry "WindowsPE" { +#UFD# ostype windows +#UFD# icon /EFI/boot/icons/wk_win.png +#UFD# loader /EFI/microsoft/bootx64.efi +#UFD#} diff --git a/.linux_items/include/syslinux/wk_pxe.cfg b/.linux_items/include/syslinux/wk_pxe.cfg index d5efabb4..92af00e3 100644 --- a/.linux_items/include/syslinux/wk_pxe.cfg +++ b/.linux_items/include/syslinux/wk_pxe.cfg @@ -2,7 +2,7 @@ INCLUDE boot/syslinux/wk_head.cfg MENU BACKGROUND pxelinux.png INCLUDE boot/syslinux/wk_pxe_linux.cfg -INCLUDE boot/syslinux/wk_pxe_winpe.cfg +#UFD#INCLUDE boot/syslinux/wk_pxe_winpe.cfg INCLUDE boot/syslinux/wk_pxe_extras_entry.cfg INCLUDE boot/syslinux/wk_tail.cfg diff --git a/.linux_items/include/syslinux/wk_pxe_extras.cfg b/.linux_items/include/syslinux/wk_pxe_extras.cfg index 04cd2ce1..d677b4b0 100644 --- a/.linux_items/include/syslinux/wk_pxe_extras.cfg +++ b/.linux_items/include/syslinux/wk_pxe_extras.cfg @@ -3,7 +3,7 @@ MENU BACKGROUND pxelinux.png INCLUDE boot/syslinux/wk_pxe_linux.cfg INCLUDE boot/syslinux/wk_pxe_linux_extras.cfg -INCLUDE boot/syslinux/wk_pxe_winpe.cfg +#UFD#INCLUDE boot/syslinux/wk_pxe_winpe.cfg INCLUDE boot/syslinux/wk_hdt.cfg INCLUDE boot/syslinux/wk_tail.cfg diff --git a/.linux_items/include/syslinux/wk_sys.cfg b/.linux_items/include/syslinux/wk_sys.cfg index beefb77d..0d375cf3 100644 --- a/.linux_items/include/syslinux/wk_sys.cfg +++ b/.linux_items/include/syslinux/wk_sys.cfg @@ -1,7 +1,7 @@ INCLUDE boot/syslinux/wk_head.cfg INCLUDE boot/syslinux/wk_sys_linux.cfg -INCLUDE boot/syslinux/wk_sys_winpe.cfg +#UFD#INCLUDE boot/syslinux/wk_sys_winpe.cfg INCLUDE boot/syslinux/wk_sys_extras_entry.cfg INCLUDE boot/syslinux/wk_tail.cfg diff --git a/.linux_items/include/syslinux/wk_sys_extras.cfg b/.linux_items/include/syslinux/wk_sys_extras.cfg index 422bd053..3e5af215 100644 --- a/.linux_items/include/syslinux/wk_sys_extras.cfg +++ b/.linux_items/include/syslinux/wk_sys_extras.cfg @@ -2,7 +2,7 @@ INCLUDE boot/syslinux/wk_head.cfg INCLUDE boot/syslinux/wk_sys_linux.cfg INCLUDE boot/syslinux/wk_sys_linux_extras.cfg -INCLUDE boot/syslinux/wk_sys_winpe.cfg +#UFD#INCLUDE boot/syslinux/wk_sys_winpe.cfg INCLUDE boot/syslinux/wk_hdt.cfg INCLUDE boot/syslinux/wk_tail.cfg From 9a093ace9ce763b112cd6517836dfc7fbab9f737 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sat, 15 Sep 2018 15:47:47 -0600 Subject: [PATCH 18/39] Moved 'Scanning disks...' message in hw_diags.py * (Re)fixes issue #46 --- .bin/Scripts/functions/hw_diags.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.bin/Scripts/functions/hw_diags.py b/.bin/Scripts/functions/hw_diags.py index 49f2960d..585bff0b 100644 --- a/.bin/Scripts/functions/hw_diags.py +++ b/.bin/Scripts/functions/hw_diags.py @@ -647,6 +647,8 @@ def run_tests(tests): # Initialize if TESTS['NVMe/SMART']['Enabled'] or TESTS['badblocks']['Enabled'] or TESTS['iobenchmark']['Enabled']: + print_standard(' ') + print_standard('Scanning disks...') scan_disks() update_progress() @@ -680,8 +682,6 @@ def run_tests(tests): def scan_disks(full_paths=False, only_path=None): """Scan for disks eligible for hardware testing.""" clear_screen() - print_standard(' ') - print_standard('Scanning disks...') # Get eligible disk list cmd = ['lsblk', '-J', '-O'] From da92cee33822f69bbd1e8e238e6eabfb2369d830 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sat, 15 Sep 2018 16:00:24 -0600 Subject: [PATCH 19/39] Fix issue #51 * The curly braces were being interpreted incorrectly by print_standard() --- .bin/Scripts/functions/browsers.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.bin/Scripts/functions/browsers.py b/.bin/Scripts/functions/browsers.py index b969a59c..c6d39db9 100644 --- a/.bin/Scripts/functions/browsers.py +++ b/.bin/Scripts/functions/browsers.py @@ -285,6 +285,9 @@ def get_ie_homepages(): homepages.append(main_page) if len(extra_pages) > 0: homepages.extend(extra_pages) + + # Remove all curly braces + homepages = [h.replace('{', '').replace('}', '') for h in homepages] return homepages def get_mozilla_homepages(prefs_path): From 1e21c04a3eff8fbb9d108f98e3c0a8ce37f9b96e Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sat, 15 Sep 2018 17:46:05 -0600 Subject: [PATCH 20/39] Address shutdown slowdowns * Unmount filesystem(s) and flush write cache before poweroff/reboot * Also adjusted timouts to maybe fix issue #52 --- .bin/Scripts/wk-power-command | 21 +++++++++++++++++++ .../include/airootfs/etc/oblogout.conf | 6 +++--- Build Linux | 4 ++++ 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100755 .bin/Scripts/wk-power-command diff --git a/.bin/Scripts/wk-power-command b/.bin/Scripts/wk-power-command new file mode 100755 index 00000000..92af02fb --- /dev/null +++ b/.bin/Scripts/wk-power-command @@ -0,0 +1,21 @@ +#!/bin/bash +# +## Wizard Kit: Wrapper for logout, reboot, & poweroff + +# Unmount filesystems +find /media -maxdepth 1 -mindepth 1 -type d \ + -exec udevil umount "{}" \; + +# Flush write cache +sudo sync + +# Perform requested action +case "${1:-x}" in + poweroff) + sudo systemctl poweroff;; + reboot) + sudo systemctl reboot;; + *) + openbox --exit;; +esac +exit 0 diff --git a/.linux_items/include/airootfs/etc/oblogout.conf b/.linux_items/include/airootfs/etc/oblogout.conf index 4595c766..ea5606ef 100644 --- a/.linux_items/include/airootfs/etc/oblogout.conf +++ b/.linux_items/include/airootfs/etc/oblogout.conf @@ -15,6 +15,6 @@ restart = R logout = L [commands] -shutdown = systemctl poweroff -restart = systemctl reboot -logout = openbox --exit +shutdown = /usr/local/bin/wk-power-command poweroff +restart = /usr/local/bin/wk-power-command reboot +logout = /usr/local/bin/wk-power-command logout diff --git a/Build Linux b/Build Linux index 2973174c..94556c2a 100755 --- a/Build Linux +++ b/Build Linux @@ -219,6 +219,10 @@ function update_live_env() { # Services sed -i -r 's/^(.*pacman-init.*)$/#NOPE#\1/' "$LIVE_DIR/airootfs/root/customize_airootfs.sh" sed -i -r 's/^(.*choose-mirror.*)$/#NOPE#\1/' "$LIVE_DIR/airootfs/root/customize_airootfs.sh" + + # Shutdown stall fix + echo "sed -i -r 's/^.*(DefaultTimeoutStartSec)=.*$/\1=15s/' /etc/systemd/system.conf" >> "$LIVE_DIR/airootfs/root/customize_airootfs.sh" + echo "sed -i -r 's/^.*(DefaultTimeoutStopSec)=.*$/\1=15s/' /etc/systemd/system.conf" >> "$LIVE_DIR/airootfs/root/customize_airootfs.sh" # SSH mkdir -p "$SKEL_DIR/.ssh" From 35fd50771cc27dd5b92b79171e50ce86b9da1ed3 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sat, 15 Sep 2018 17:50:54 -0600 Subject: [PATCH 21/39] Update hw_diags.py systemctl command syntax * Now it matches the wk-power-command style --- .bin/Scripts/functions/hw_diags.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.bin/Scripts/functions/hw_diags.py b/.bin/Scripts/functions/hw_diags.py index 585bff0b..61530e5b 100644 --- a/.bin/Scripts/functions/hw_diags.py +++ b/.bin/Scripts/functions/hw_diags.py @@ -224,9 +224,9 @@ def menu_diags(*args): 'pipes -t 0 -t 1 -t 2 -t 3 -p 5 -R -r 4000'.split(), check=False, pipe=False) elif selection == 'R': - run_program(['reboot']) + run_program(['systemctl', 'reboot']) elif selection == 'S': - run_program(['poweroff']) + run_program(['systemctl', 'poweroff']) elif selection == 'Q': break From 91f7628081c818849f18ce5463ce6ce261995a3a Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sat, 15 Sep 2018 18:17:58 -0600 Subject: [PATCH 22/39] Updated sources * Dropping 2008 --- .bin/Scripts/settings/sources.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.bin/Scripts/settings/sources.py b/.bin/Scripts/settings/sources.py index 3560b092..5ba2323e 100644 --- a/.bin/Scripts/settings/sources.py +++ b/.bin/Scripts/settings/sources.py @@ -48,10 +48,6 @@ SOURCE_URLS = { 'aria2': 'https://github.com/aria2/aria2/releases/download/release-1.33.1/aria2-1.33.1-win-32bit-build1.zip', } VCREDIST_SOURCES = { - '2008sp1': { - '32': 'https://download.microsoft.com/download/5/D/8/5D8C65CB-C849-4025-8E95-C3966CAFD8AE/vcredist_x86.exe', - '64': 'https://download.microsoft.com/download/5/D/8/5D8C65CB-C849-4025-8E95-C3966CAFD8AE/vcredist_x64.exe', - }, '2010sp1': { '32': 'https://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/vcredist_x86.exe', '64': 'https://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/vcredist_x64.exe', @@ -65,8 +61,8 @@ VCREDIST_SOURCES = { '64': 'https://download.microsoft.com/download/0/5/6/056dcda9-d667-4e27-8001-8a0c6971d6b1/vcredist_x64.exe', }, '2017': { - '32': 'https://download.visualstudio.microsoft.com/download/pr/100349138/88b50ce70017bf10f2d56d60fcba6ab1/VC_redist.x86.exe', - '64': 'https://download.visualstudio.microsoft.com/download/pr/100349091/2cd2dba5748dc95950a5c42c2d2d78e4/VC_redist.x64.exe', + '32': 'https://aka.ms/vs/15/release/vc_redist.x86.exe', + '64': 'https://aka.ms/vs/15/release/vc_redist.x64.exe', }, } NINITE_SOURCES = { From a213ba5d32534fbb1bc220826b5748badda785dc Mon Sep 17 00:00:00 2001 From: Alan Mason <2xShirt@gmail.com> Date: Sat, 15 Sep 2018 21:20:52 -0600 Subject: [PATCH 23/39] Bugfix for mount-all-volumes --- .bin/Scripts/functions/data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bin/Scripts/functions/data.py b/.bin/Scripts/functions/data.py index 63a19519..c8eec384 100644 --- a/.bin/Scripts/functions/data.py +++ b/.bin/Scripts/functions/data.py @@ -156,7 +156,7 @@ def cleanup_transfer(dest_path): def find_core_storage_volumes(): """Try to create block devices for any Apple CoreStorage volumes.""" corestorage_uuid = '53746f72-6167-11aa-aa11-00306543ecac' - dmsetup_cmd_file = '{TmpDir}/dmsetup_command' + dmsetup_cmd_file = '{TmpDir}/dmsetup_command'.format(**global_vars) # Get CoreStorage devices cmd = [ From 6cdf2a421168bec5d7b9bd72d22d344f931ec658 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sun, 16 Sep 2018 15:41:14 -0600 Subject: [PATCH 24/39] Added authorized_keys file for SSH connections --- .linux_items/authorized_keys | 1 + Build Linux | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 .linux_items/authorized_keys diff --git a/.linux_items/authorized_keys b/.linux_items/authorized_keys new file mode 100644 index 00000000..be79388e --- /dev/null +++ b/.linux_items/authorized_keys @@ -0,0 +1 @@ +#Put SSH keys here diff --git a/Build Linux b/Build Linux index 94556c2a..512aa982 100755 --- a/Build Linux +++ b/Build Linux @@ -229,7 +229,8 @@ function update_live_env() { ssh-keygen -b 4096 -C "$username@$hostname" -N "" -f "$SKEL_DIR/.ssh/id_rsa" echo 'rm /root/.ssh/id*' >> "$LIVE_DIR/airootfs/root/customize_airootfs.sh" echo 'rm /root/.zlogin' >> "$LIVE_DIR/airootfs/root/customize_airootfs.sh" - sed -i -r 's/^(.*PermitRootLogin.*)$/#NOPE#\1/' "$LIVE_DIR/airootfs/root/customize_airootfs.sh" + sed -i -r 's/^(.*PermitRootLogin.*)$/PermitRootLogin no/' "$LIVE_DIR/airootfs/root/customize_airootfs.sh" + cp "$ROOT_DIR/.linux_items/authorized_keys" "$SKEL_DIR/.ssh/authorized_keys" # Root user echo "echo 'root:$ROOT_PASSWORD' | chpasswd" >> "$LIVE_DIR/airootfs/root/customize_airootfs.sh" From a71f7648c29fd659d6c6217f74652119a088132e Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sun, 16 Sep 2018 18:45:10 -0600 Subject: [PATCH 25/39] Bugfixes for Build Linux script --- Build Linux | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Build Linux b/Build Linux index 512aa982..af01c928 100755 --- a/Build Linux +++ b/Build Linux @@ -190,9 +190,9 @@ function update_live_env() { # Live packages while read -r p; do - sed -i "/$p/d" "$LIVE_DIR/packages.both" + sed -i "/$p/d" "$LIVE_DIR/packages.x86_64" done < "$ROOT_DIR/.linux_items/packages/live_remove" - cat "$ROOT_DIR/.linux_items/packages/live_add" >> "$LIVE_DIR/packages.both" + cat "$ROOT_DIR/.linux_items/packages/live_add" >> "$LIVE_DIR/packages.x86_64" echo "[custom]" >> "$LIVE_DIR/pacman.conf" echo "SigLevel = Optional TrustAll" >> "$LIVE_DIR/pacman.conf" echo "Server = file://$REPO_DIR" >> "$LIVE_DIR/pacman.conf" @@ -229,7 +229,7 @@ function update_live_env() { ssh-keygen -b 4096 -C "$username@$hostname" -N "" -f "$SKEL_DIR/.ssh/id_rsa" echo 'rm /root/.ssh/id*' >> "$LIVE_DIR/airootfs/root/customize_airootfs.sh" echo 'rm /root/.zlogin' >> "$LIVE_DIR/airootfs/root/customize_airootfs.sh" - sed -i -r 's/^(.*PermitRootLogin.*)$/PermitRootLogin no/' "$LIVE_DIR/airootfs/root/customize_airootfs.sh" + sed -r '/.*PermitRootLogin.*/d' "$LIVE_DIR/airootfs/root/customize_airootfs.sh" cp "$ROOT_DIR/.linux_items/authorized_keys" "$SKEL_DIR/.ssh/authorized_keys" # Root user @@ -326,9 +326,11 @@ function build_iso() { # Removing cached (and possibly outdated) custom repo packages for package in $(cat "$ROOT_DIR/.linux_items/packages/aur"); do - if [[ -f /var/cache/pacman/pkg/${package}* ]]; then - rm /var/cache/pacman/pkg/${package}* - fi + for p in /var/cache/pacman/pkg/*${package}*; do + if [[ -f "${p}" ]]; then + rm "${p}" + fi + done done # Build ISO From b79cd5d65afac4fc30d79346c2199c414d61307a Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sun, 16 Sep 2018 18:46:02 -0600 Subject: [PATCH 26/39] Updated tool versions * Adjusted bundles * Dropped Office 2013 * Moved to Python 3.7 * Replaced TreeSizeFree with WizTree --- .bin/Scripts/build_kit.ps1 | 12 ++++----- .bin/Scripts/build_pe.ps1 | 19 +++++++------- .bin/Scripts/settings/sources.py | 44 +++++++++++++++----------------- 3 files changed, 36 insertions(+), 39 deletions(-) diff --git a/.bin/Scripts/build_kit.ps1 b/.bin/Scripts/build_kit.ps1 index dafaa2c8..bba52a66 100644 --- a/.bin/Scripts/build_kit.ps1 +++ b/.bin/Scripts/build_kit.ps1 @@ -82,25 +82,25 @@ if ($MyInvocation.InvocationName -ne ".") { DownloadFile -Path $Path -Name "7z-extra.7z" -Url "https://www.7-zip.org/a/7z1805-extra.7z" # ConEmu - $Url = "https://github.com/Maximus5/ConEmu/releases/download/v18.05.06/ConEmuPack.180506.7z" + $Url = "https://github.com/Maximus5/ConEmu/releases/download/v18.06.26/ConEmuPack.180626.7z" DownloadFile -Path $Path -Name "ConEmuPack.7z" -Url $Url # Notepad++ - $Url = "https://notepad-plus-plus.org/repository/7.x/7.5.6/npp.7.5.6.bin.minimalist.7z" + $Url = "https://notepad-plus-plus.org/repository/7.x/7.5.8/npp.7.5.8.bin.minimalist.7z" DownloadFile -Path $Path -Name "npp.7z" -Url $Url # Python - $Url = "https://www.python.org/ftp/python/3.6.5/python-3.6.5-embed-win32.zip" + $Url = "https://www.python.org/ftp/python/3.7.0/python-3.7.0-embed-win32.zip" DownloadFile -Path $Path -Name "python32.zip" -Url $Url - $Url = "https://www.python.org/ftp/python/3.6.5/python-3.6.5-embed-amd64.zip" + $Url = "https://www.python.org/ftp/python/3.7.0/python-3.7.0-embed-amd64.zip" DownloadFile -Path $Path -Name "python64.zip" -Url $Url # Python: psutil $DownloadPage = "https://pypi.org/project/psutil/" - $RegEx = "href=.*-cp36-cp36m-win32.whl" + $RegEx = "href=.*-cp37-cp37m-win32.whl" $Url = FindDynamicUrl $DownloadPage $RegEx DownloadFile -Path $Path -Name "psutil32.whl" -Url $Url - $RegEx = "href=.*-cp36-cp36m-win_amd64.whl" + $RegEx = "href=.*-cp37-cp37m-win_amd64.whl" $Url = FindDynamicUrl $DownloadPage $RegEx DownloadFile -Path $Path -Name "psutil64.whl" -Url $Url diff --git a/.bin/Scripts/build_pe.ps1 b/.bin/Scripts/build_pe.ps1 index 0e19050a..3fb1bcc9 100644 --- a/.bin/Scripts/build_pe.ps1 +++ b/.bin/Scripts/build_pe.ps1 @@ -136,20 +136,19 @@ if ($MyInvocation.InvocationName -ne ".") { @("bluescreenview32.zip", "http://www.nirsoft.net/utils/bluescreenview.zip"), @("bluescreenview64.zip", "http://www.nirsoft.net/utils/bluescreenview-x64.zip"), # ConEmu - @("ConEmuPack.7z", "https://github.com/Maximus5/ConEmu/releases/download/v18.05.06/ConEmuPack.180506.7z"), + @("ConEmuPack.7z", "https://github.com/Maximus5/ConEmu/releases/download/v18.06.26/ConEmuPack.180626.7z"), # Fast Copy - @("fastcopy32.zip", "http://ftp.vector.co.jp/69/93/2323/FastCopy341.zip"), - @("fastcopy64.zip", "http://ftp.vector.co.jp/69/93/2323/FastCopy341_x64.zip"), + @("fastcopy.zip", "http://ftp.vector.co.jp/70/64/2323/FastCopy354_installer.zip"), # HWiNFO - @("hwinfo.zip", "http://app.oldfoss.com:81/download/HWiNFO/hwi_582.zip"), + @("hwinfo.zip", "http://app.oldfoss.com:81/download/HWiNFO/hwi_588.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_x86.7z", "https://notepad-plus-plus.org/repository/7.x/7.5.6/npp.7.5.6.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.8/npp.7.5.8.bin.minimalist.7z"), + @("npp_amd64.7z", "https://notepad-plus-plus.org/repository/7.x/7.5.8/npp.7.5.8.bin.minimalist.x64.7z"), # NT Password Editor @("ntpwed.zip", "http://cdslow.org.ru/files/ntpwedit/ntpwed07.zip"), # Prime95 @@ -159,16 +158,16 @@ if ($MyInvocation.InvocationName -ne ".") { @("produkey32.zip", "http://www.nirsoft.net/utils/produkey.zip"), @("produkey64.zip", "http://www.nirsoft.net/utils/produkey-x64.zip"), # Python - @("python32.zip", "https://www.python.org/ftp/python/3.6.5/python-3.6.5-embed-win32.zip"), - @("python64.zip", "https://www.python.org/ftp/python/3.6.5/python-3.6.5-embed-amd64.zip"), + @("python32.zip", "https://www.python.org/ftp/python/3.7.0/python-3.7.0-embed-win32.zip"), + @("python64.zip", "https://www.python.org/ftp/python/3.7.0/python-3.7.0-embed-amd64.zip"), # Python: psutil @( "psutil64.whl", - (FindDynamicUrl "https://pypi.org/project/psutil/" "href=.*-cp36-cp36m-win_amd64.whl") + (FindDynamicUrl "https://pypi.org/project/psutil/" "href=.*-cp37-cp37m-win_amd64.whl") ), @( "psutil32.whl", - (FindDynamicUrl "https://pypi.org/project/psutil/" "href=.*-cp36-cp36m-win32.whl") + (FindDynamicUrl "https://pypi.org/project/psutil/" "href=.*-cp37-cp37m-win32.whl") ), # Q-Dir @("qdir32.zip", "https://www.softwareok.com/Download/Q-Dir_Portable.zip"), diff --git a/.bin/Scripts/settings/sources.py b/.bin/Scripts/settings/sources.py index 5ba2323e..903c46fb 100644 --- a/.bin/Scripts/settings/sources.py +++ b/.bin/Scripts/settings/sources.py @@ -1,9 +1,10 @@ # Wizard Kit: Settings - Sources SOURCE_URLS = { + 'Adobe Reader DC': 'http://ardownload.adobe.com/pub/adobe/reader/win/AcrobatDC/1801120058/AcroRdrDC1801120058_en_US.exe', + 'AdwCleaner': 'https://downloads.malwarebytes.com/file/adwcleaner', 'AIDA64': 'http://download.aida64.com/aida64engineer597.zip', - 'Adobe Reader DC': 'http://ardownload.adobe.com/pub/adobe/reader/win/AcrobatDC/1801120040/AcroRdrDC1801120040_en_US.exe', - 'AdwCleaner': 'https://toolslib.net/downloads/finish/1-adwcleaner/', + 'aria2': 'https://github.com/aria2/aria2/releases/download/release-1.34.0/aria2-1.34.0-win-32bit-build1.zip', 'Autoruns': 'https://download.sysinternals.com/files/Autoruns.zip', 'BleachBit': 'https://download.bleachbit.org/BleachBit-2.0-portable.zip', 'BlueScreenView32': 'http://www.nirsoft.net/utils/bluescreenview.zip', @@ -14,38 +15,35 @@ SOURCE_URLS = { 'ERUNT': 'http://www.aumha.org/downloads/erunt.zip', 'Everything32': 'https://www.voidtools.com/Everything-1.4.1.895.x86.zip', 'Everything64': 'https://www.voidtools.com/Everything-1.4.1.895.x64.zip', - '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.mozilla.org/firefox/downloads/file/956394/ublock_origin-1.16.6-an+fx.xpi', - 'HWiNFO': 'http://app.oldfoss.com:81/download/HWiNFO/hwi_582.zip', + 'FastCopy': 'http://ftp.vector.co.jp/70/64/2323/FastCopy354_installer.zip', + 'Firefox uBO': 'https://addons.mozilla.org/firefox/downloads/file/1056733/ublock_origin-1.16.20-an+fx.xpi', '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', + 'HWiNFO': 'http://app.oldfoss.com:81/download/HWiNFO/hwi_588.zip', 'Intel SSD Toolbox': r'https://downloadmirror.intel.com/27656/eng/Intel%20SSD%20Toolbox%20-%20v3.5.2.exe', + 'IOBit_Uninstaller': 'https://portableapps.duckduckgo.com/IObitUninstallerPortable_7.5.0.7.paf.exe', 'KVRT': 'http://devbuilds.kaspersky-labs.com/devbuilds/KVRT/latest/full/KVRT.exe', - '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_9326.3600.exe', + 'NotepadPlusPlus': 'https://notepad-plus-plus.org/repository/7.x/7.5.8/npp.7.5.8.bin.minimalist.7z', + 'Office Deployment Tool 2016': 'https://download.microsoft.com/download/2/7/A/27AF1BE6-DD20-4CB4-B154-EBAB8A7D4A7E/officedeploymenttool_10810.33603.exe', 'ProduKey32': 'http://www.nirsoft.net/utils/produkey.zip', 'ProduKey64': 'http://www.nirsoft.net/utils/produkey-x64.zip', 'PuTTY': 'https://the.earth.li/~sgtatham/putty/latest/w32/putty.zip', 'RKill': 'https://www.bleepingcomputer.com/download/rkill/dl/10/', + 'Samsung Magician': 'https://s3.ap-northeast-2.amazonaws.com/global.semi.static/SAMSUNG_SSD_v5_2_1_180523/CD0CFAC4675B9E502899B41BE00525C3909ECE3AD57CC1A2FB6B74A766B2A1EA/Samsung_Magician_Installer.zip', 'SDIO Themes': 'http://snappy-driver-installer.org/downloads/SDIO_Themes.zip', 'SDIO Torrent': 'http://snappy-driver-installer.org/downloads/SDIO_Update.torrent', - 'Samsung Magician': 'http://downloadcenter.samsung.com/content/SW/201801/20180123130636806/Samsung_Magician_Installer.exe', 'TDSSKiller': 'https://media.kaspersky.com/utilities/VirusUtilities/EN/tdsskiller.exe', 'TestDisk': 'https://www.cgsecurity.org/testdisk-7.1-WIP.win.zip', - 'TreeSizeFree': 'https://www.jam-software.com/treesize_free/TreeSizeFree-Portable.zip', 'wimlib32': 'https://wimlib.net/downloads/wimlib-1.12.0-windows-i686-bin.zip', 'wimlib64': 'https://wimlib.net/downloads/wimlib-1.12.0-windows-x86_64-bin.zip', 'Winapp2': 'https://github.com/MoscaDotTo/Winapp2/archive/master.zip', - 'XMPlay 7z': 'http://support.xmplay.com/files/16/xmp-7z.zip?v=800962', - 'XMPlay Game': 'http://support.xmplay.com/files/12/xmp-gme.zip?v=515637', - 'XMPlay RAR': 'http://support.xmplay.com/files/16/xmp-rar.zip?v=409646', - 'XMPlay WAModern': 'http://support.xmplay.com/files/10/WAModern.zip?v=207099', - 'XMPlay': 'http://support.xmplay.com/files/20/xmplay383.zip?v=298195', + 'WizTree': 'https://antibody-software.com/files/wiztree_3_26_portable.zip', + 'XMPlay 7z': 'https://support.xmplay.com/files/16/xmp-7z.zip?v=800962', + 'XMPlay Game': 'https://support.xmplay.com/files/12/xmp-gme.zip?v=515637', + 'XMPlay RAR': 'https://support.xmplay.com/files/16/xmp-rar.zip?v=409646', + 'XMPlay WAModern': 'https://support.xmplay.com/files/10/WAModern.zip?v=207099', + 'XMPlay': 'https://support.xmplay.com/files/20/xmplay383.zip?v=298195', 'XYplorerFree': 'https://www.xyplorer.com/download/xyplorer_free_noinstall.zip', - 'aria2': 'https://github.com/aria2/aria2/releases/download/release-1.33.1/aria2-1.33.1-win-32bit-build1.zip', } VCREDIST_SOURCES = { '2010sp1': { @@ -67,9 +65,8 @@ VCREDIST_SOURCES = { } NINITE_SOURCES = { 'Bundles': { - 'Runtimes.exe': '.net4.7.1-air-java8-silverlight', - 'Legacy.exe': '.net4.7.1-7zip-air-chrome-firefox-java8-silverlight-vlc', - 'Modern.exe': '.net4.7.1-7zip-air-chrome-classicstart-firefox-java8-silverlight-vlc', + 'Legacy.exe': '.net4.7.2-7zip-chrome-firefox-vlc', + 'Modern.exe': '.net4.7.2-7zip-chrome-classicstart-firefox-vlc', }, 'Audio-Video': { 'AIMP.exe': 'aimp', @@ -94,6 +91,7 @@ NINITE_SOURCES = { 'SugarSync.exe': 'sugarsync', }, 'Communication': { + 'Discord': 'discord', 'Pidgin.exe': 'pidgin', 'Skype.exe': 'skype', 'Trillian.exe': 'trillian', @@ -105,7 +103,6 @@ NINITE_SOURCES = { }, 'Developer': { 'Eclipse.exe': 'eclipse', - 'FileZilla.exe': 'filezilla', 'JDK 8.exe': 'jdk8', 'JDK 8 (x64).exe': 'jdkx8', 'Notepad++.exe': 'notepadplusplus', @@ -149,7 +146,7 @@ NINITE_SOURCES = { }, 'Runtimes': { 'Adobe Air.exe': 'air', - 'dotNET.exe': '.net4.7.1', + 'dotNET.exe': '.net4.7.2', 'Java 8.exe': 'java8', 'Shockwave.exe': 'shockwave', 'Silverlight.exe': 'silverlight', @@ -193,6 +190,7 @@ RST_SOURCES = { 'SetupRST_15.8.exe': 'https://downloadmirror.intel.com/27442/eng/SetupRST.exe', 'SetupRST_15.9.exe': 'https://downloadmirror.intel.com/27400/eng/SetupRST.exe', 'SetupRST_16.0.exe': 'https://downloadmirror.intel.com/27681/eng/SetupRST.exe', + 'SetupRST_16.5.exe': 'https://downloadmirror.intel.com/27984/eng/SetupRST.exe', } From 4e9cd1f1147c3d31389e0dab19074b934129c191 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sun, 16 Sep 2018 19:21:36 -0600 Subject: [PATCH 27/39] Update FastCopy using new installer --- .bin/Scripts/functions/update.py | 33 +++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/.bin/Scripts/functions/update.py b/.bin/Scripts/functions/update.py index 6825f9ba..9e1c3e34 100644 --- a/.bin/Scripts/functions/update.py +++ b/.bin/Scripts/functions/update.py @@ -235,19 +235,34 @@ def update_fastcopy(): remove_from_kit('FastCopy') # Download - download_to_temp('FastCopy32.zip', SOURCE_URLS['FastCopy32']) - download_to_temp('FastCopy64.zip', SOURCE_URLS['FastCopy64']) - - # Extract - extract_temp_to_bin('FastCopy64.zip', 'FastCopy', sz_args=['FastCopy.exe']) + download_to_temp('FastCopy.zip', SOURCE_URLS['FastCopy']) + + # Extract installer + extract_temp_to_bin('FastCopy.zip', 'FastCopy') + _path = r'{}\FastCopy'.format(global_vars['BinDir']) + _installer = 'FastCopy354_installer.exe' + + # Extract 64-bit + cmd = [ + r'{}\{}'.format(_path, _installer), + '/NOSUBDIR', '/DIR={}'.format(_path), + '/EXTRACT64'] + run_program(cmd) shutil.move( r'{}\FastCopy\FastCopy.exe'.format(global_vars['BinDir']), r'{}\FastCopy\FastCopy64.exe'.format(global_vars['BinDir'])) - extract_temp_to_bin('FastCopy32.zip', 'FastCopy', sz_args=[r'-x!setup.exe', r'-x!*.dll']) - + + # Extract 32-bit + cmd = [ + r'{}\{}'.format(_path, _installer), + '/NOSUBDIR', '/DIR={}'.format(_path), + '/EXTRACT32'] + run_program(cmd) + # Cleanup - remove_from_temp('FastCopy32.zip') - remove_from_temp('FastCopy64.zip') + os.remove(r'{}\{}'.format(_path, _installer)) + os.remove(r'{}\setup.exe'.format(_path, _installer)) + remove_from_temp('FastCopy.zip') def update_wimlib(): # Stop running processes From e4bcf88fe5596779efb1fbc05a41450e31f5ea0d Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sun, 16 Sep 2018 19:23:36 -0600 Subject: [PATCH 28/39] Update Intel RST (Current Release) --- .bin/Scripts/settings/launchers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.bin/Scripts/settings/launchers.py b/.bin/Scripts/settings/launchers.py index 6e011691..0e819553 100644 --- a/.bin/Scripts/settings/launchers.py +++ b/.bin/Scripts/settings/launchers.py @@ -282,8 +282,8 @@ LAUNCHERS = { 'Intel RST (Current Release)': { 'L_TYPE': 'Executable', 'L_PATH': '_Drivers\Intel RST', - 'L_ITEM': 'SetupRST_16.0.exe', - 'L_7ZIP': 'SetupRST_16.0.exe', + 'L_ITEM': 'SetupRST_16.5.exe', + 'L_7ZIP': 'SetupRST_16.5.exe', }, 'Intel RST (Previous Releases)': { 'L_TYPE': 'Folder', From f3885f25d67a5dd9ecd55ca3da780d41b986cf12 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sun, 16 Sep 2018 19:39:05 -0600 Subject: [PATCH 29/39] Update FastCopy using new installer --- .bin/Scripts/build_pe.ps1 | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/.bin/Scripts/build_pe.ps1 b/.bin/Scripts/build_pe.ps1 index 3fb1bcc9..a16edb03 100644 --- a/.bin/Scripts/build_pe.ps1 +++ b/.bin/Scripts/build_pe.ps1 @@ -254,20 +254,30 @@ if ($MyInvocation.InvocationName -ne ".") { # Fast Copy Write-Host "Extracting: FastCopy" try { + # Extract Installer $ArgumentList = @( - "x", "$Temp\fastcopy64.zip", "-o$Build\bin\amd64\FastCopy", - "-aoa", "-bso0", "-bse0", "-bsp0", - "-x!setup.exe", "-x!*.dll") + "e", "$Temp\fastcopy.zip", "-o$Temp", + "-aoa", "-bso0", "-bse0", "-bsp0") Start-Process -FilePath $SevenZip -ArgumentList $ArgumentList -NoNewWindow -Wait + + # Extract 64-bit $ArgumentList = @( - "e", "$Temp\fastcopy32.zip", "-o$Build\bin\x86\FastCopy", - "-aoa", "-bso0", "-bse0", "-bsp0", - "-x!setup.exe", "-x!*.dll") - Start-Process -FilePath $SevenZip -ArgumentList $ArgumentList -NoNewWindow -Wait + "/NOSUBDIR", "/DIR=$Build\bin\amd64\FastCopy", + "/EXTRACT64") + Start-Process -FilePath "$TEMP\FastCopy354_installer.exe" -ArgumentList $ArgumentList -NoNewWindow -Wait + Remove-Item "$Build\bin\amd64\FastCopy\setup.exe" -Force + + # Extract 32-bit + $ArgumentList = @( + "/NOSUBDIR", "/DIR=$Build\bin\x86\FastCopy", + "/EXTRACT32") + Start-Process -FilePath "$TEMP\FastCopy354_installer.exe" -ArgumentList $ArgumentList -NoNewWindow -Wait + Remove-Item "$Build\bin\x86\FastCopy\setup.exe" -Force } catch { Write-Host (" ERROR: Failed to extract files." ) -ForegroundColor "Red" } + # Killer Network Driver Write-Host "Extracting: Killer Network Driver" From bc572304186bf867f6c1b69313b9f77e0752e4e9 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sun, 16 Sep 2018 19:44:41 -0600 Subject: [PATCH 30/39] Replaced TreeSizeFree with WizTree --- .bin/Scripts/functions/update.py | 13 +++++++------ .bin/Scripts/settings/launchers.py | 6 +++--- .bin/Scripts/update_kit.py | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.bin/Scripts/functions/update.py b/.bin/Scripts/functions/update.py index 9e1c3e34..809f98e0 100644 --- a/.bin/Scripts/functions/update.py +++ b/.bin/Scripts/functions/update.py @@ -760,22 +760,23 @@ def update_putty(): # Cleanup remove_from_temp('putty.zip') -def update_treesizefree(): +def update_wiztree(): # Stop running processes - kill_process('TreeSizeFree.exe') + for process in ['WizTree.exe', 'WizTree64.exe']: + kill_process(process) # Remove existing folders - remove_from_kit('TreeSizeFree') + remove_from_kit('WizTree') # Download download_to_temp( - 'treesizefree.zip', SOURCE_URLS['TreeSizeFree']) + 'wiztree.zip', SOURCE_URLS['WizTree']) # Extract files - extract_temp_to_cbin('treesizefree.zip', 'TreeSizeFree') + extract_temp_to_cbin('wiztree.zip', 'WizTree') # Cleanup - remove_from_temp('treesizefree.zip') + remove_from_temp('wiztree.zip') def update_xmplay(): # Stop running processes diff --git a/.bin/Scripts/settings/launchers.py b/.bin/Scripts/settings/launchers.py index 0e819553..e2d74832 100644 --- a/.bin/Scripts/settings/launchers.py +++ b/.bin/Scripts/settings/launchers.py @@ -475,10 +475,10 @@ LAUNCHERS = { 'L_PATH': 'PuTTY', 'L_ITEM': 'PUTTY.EXE', }, - 'TreeSizeFree': { + 'WizTree': { 'L_TYPE': 'Executable', - 'L_PATH': 'TreeSizeFree', - 'L_ITEM': 'TreeSizeFree.exe', + 'L_PATH': 'WizTree', + 'L_ITEM': 'WizTree.exe', 'L_ELEV': 'True', }, 'Update Kit': { diff --git a/.bin/Scripts/update_kit.py b/.bin/Scripts/update_kit.py index 6a5cdf82..7f9b251d 100644 --- a/.bin/Scripts/update_kit.py +++ b/.bin/Scripts/update_kit.py @@ -70,7 +70,7 @@ if __name__ == '__main__': try_and_print(message='FirefoxExtensions...', function=update_firefox_ublock_origin, other_results=other_results, width=40) try_and_print(message='PuTTY...', function=update_putty, other_results=other_results, width=40) try_and_print(message='Notepad++...', function=update_notepadplusplus, other_results=other_results, width=40) - try_and_print(message='TreeSizeFree...', function=update_treesizefree, other_results=other_results, width=40) + try_and_print(message='WizTree...', function=update_wiztree, other_results=other_results, width=40) try_and_print(message='XMPlay...', function=update_xmplay, other_results=other_results, width=40) # Repairs From d502f769ea6154f1d438ad6b46696794374cd494 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sun, 16 Sep 2018 19:58:36 -0600 Subject: [PATCH 31/39] Updated update_samsung_magician() --- .bin/Scripts/functions/update.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.bin/Scripts/functions/update.py b/.bin/Scripts/functions/update.py index 809f98e0..54e64aad 100644 --- a/.bin/Scripts/functions/update.py +++ b/.bin/Scripts/functions/update.py @@ -489,10 +489,21 @@ def update_samsung_magician(): remove_from_kit('Samsung Magician.exe') # Download - download_generic( - r'{}\_Drivers\Samsung Magician'.format(global_vars['CBinDir']), - 'Samsung Magician.exe', - SOURCE_URLS['Samsung Magician']) + download_to_temp('Samsung Magician.zip', SOURCE_URLS['Samsung Magician']) + + # Extract + extract_generic( + source=r'{}\Samsung Magician.zip'.format(global_vars['TmpDir']), + dest=r'{}\_Drivers'.format(global_vars['CBinDir']), + mode='e') + shutil.move( + r'{}\_Drivers\Samsung_Magician_Installer.exe'.format( + global_vars['CBinDir']), + r'{}\_Drivers\Samsung Magician.exe'.format( + global_vars['CBinDir'])) + + # Cleanup + remove_from_temp('Samsung Magician.zip') def update_sdi_origin(): # Download aria2 From 1e6eb26c779c8e54a3e94fd216ccefe4c541e739 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sun, 16 Sep 2018 20:02:15 -0600 Subject: [PATCH 32/39] Removed Office 2013 sections --- .bin/Scripts/Launch.cmd | 3 +-- .bin/Scripts/functions/update.py | 9 ++++----- .bin/Scripts/settings/launchers.py | 26 -------------------------- 3 files changed, 5 insertions(+), 33 deletions(-) diff --git a/.bin/Scripts/Launch.cmd b/.bin/Scripts/Launch.cmd index 2364dcc8..f7080adb 100644 --- a/.bin/Scripts/Launch.cmd +++ b/.bin/Scripts/Launch.cmd @@ -150,7 +150,6 @@ goto Exit :LaunchOffice call "%bin%\Scripts\init_client_dir.cmd" /Office set "_odt=False" -if %L_PATH% equ 2013 (set "_odt=True") if %L_PATH% equ 2016 (set "_odt=True") if "%_odt%" == "True" ( goto LaunchOfficeODT @@ -493,4 +492,4 @@ goto Exit :Exit popd endlocal -exit /b %errorlevel% \ No newline at end of file +exit /b %errorlevel% diff --git a/.bin/Scripts/functions/update.py b/.bin/Scripts/functions/update.py index 54e64aad..3389d3f4 100644 --- a/.bin/Scripts/functions/update.py +++ b/.bin/Scripts/functions/update.py @@ -587,8 +587,8 @@ def update_office(): if os.path.exists(include_path): shutil.copytree(include_path, dest) - # Download and extract - for year in ['2013', '2016']: + for year in ['2016']: + # Download and extract name = 'odt{}.exe'.format(year) url = 'Office Deployment Tool {}'.format(year) download_to_temp(name, SOURCE_URLS[url]) @@ -602,9 +602,8 @@ def update_office(): r'{}\{}'.format(global_vars['TmpDir'], year), r'{}\_Office\{}'.format(global_vars['CBinDir'], year)) - # Cleanup - remove_from_temp('odt2013.exe') - remove_from_temp('odt2016.exe') + # Cleanup + remove_from_temp('odt{}.exe'.format(year)) def update_classic_start_skin(): # Remove existing folders diff --git a/.bin/Scripts/settings/launchers.py b/.bin/Scripts/settings/launchers.py index e2d74832..a125a1f8 100644 --- a/.bin/Scripts/settings/launchers.py +++ b/.bin/Scripts/settings/launchers.py @@ -356,32 +356,6 @@ LAUNCHERS = { 'L_ELEV': 'True', }, }, - r'Installers\Extras\Office\2013': { - 'Home and Business 2013 (x32)': { - 'L_TYPE': 'Office', - 'L_PATH': '2013', - 'L_ITEM': 'hb_32.xml', - 'L_NCMD': 'True', - }, - 'Home and Business 2013 (x64)': { - 'L_TYPE': 'Office', - 'L_PATH': '2013', - 'L_ITEM': 'hb_64.xml', - 'L_NCMD': 'True', - }, - 'Home and Student 2013 (x32)': { - 'L_TYPE': 'Office', - 'L_PATH': '2013', - 'L_ITEM': 'hs_32.xml', - 'L_NCMD': 'True', - }, - 'Home and Student 2013 (x64)': { - 'L_TYPE': 'Office', - 'L_PATH': '2013', - 'L_ITEM': 'hs_64.xml', - 'L_NCMD': 'True', - }, - }, r'Installers\Extras\Office\2016': { 'Home and Business 2016 (x32)': { 'L_TYPE': 'Office', From 902a6398caf37f3dd73a2af8d24d02e466634cef Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sun, 16 Sep 2018 20:58:25 -0600 Subject: [PATCH 33/39] Bugfix update_samsung_magician() --- .bin/Scripts/functions/update.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.bin/Scripts/functions/update.py b/.bin/Scripts/functions/update.py index 3389d3f4..ab2ffa80 100644 --- a/.bin/Scripts/functions/update.py +++ b/.bin/Scripts/functions/update.py @@ -492,14 +492,11 @@ def update_samsung_magician(): download_to_temp('Samsung Magician.zip', SOURCE_URLS['Samsung Magician']) # Extract - extract_generic( - source=r'{}\Samsung Magician.zip'.format(global_vars['TmpDir']), - dest=r'{}\_Drivers'.format(global_vars['CBinDir']), - mode='e') + extract_temp_to_cbin('Samsung Magician.zip', '_Drivers\Samsung Magician') shutil.move( - r'{}\_Drivers\Samsung_Magician_Installer.exe'.format( + r'{}\_Drivers\Samsung Magician\Samsung_Magician_Installer.exe'.format( global_vars['CBinDir']), - r'{}\_Drivers\Samsung Magician.exe'.format( + r'{}\_Drivers\Samsung Magician\Samsung Magician.exe'.format( global_vars['CBinDir'])) # Cleanup From 9c0262693777eda0b2c0e3e85dcb00a2162b7e25 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sun, 16 Sep 2018 21:03:49 -0600 Subject: [PATCH 34/39] Updated update_adwcleaner() --- .bin/Scripts/functions/update.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.bin/Scripts/functions/update.py b/.bin/Scripts/functions/update.py index ab2ffa80..50386673 100644 --- a/.bin/Scripts/functions/update.py +++ b/.bin/Scripts/functions/update.py @@ -849,11 +849,10 @@ def update_adwcleaner(): remove_from_kit('AdwCleaner') # Download - url = resolve_dynamic_url( - SOURCE_URLS['AdwCleaner'], - 'id="downloadLink"') download_generic( - r'{}\AdwCleaner'.format(global_vars['CBinDir']), 'AdwCleaner.exe', url) + r'{}\AdwCleaner'.format(global_vars['CBinDir']), + 'AdwCleaner.exe', + SOURCE_URLS['AdwCleaner']) def update_kvrt(): # Stop running processes From ae8993821f4cce16f61e25f9273e6a418f6861bc Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sun, 16 Sep 2018 21:05:09 -0600 Subject: [PATCH 35/39] Missed a VCR 2008 section --- .cbin/_include/_vcredists/InstallAll.bat | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.cbin/_include/_vcredists/InstallAll.bat b/.cbin/_include/_vcredists/InstallAll.bat index 597cd60e..5d935b34 100644 --- a/.cbin/_include/_vcredists/InstallAll.bat +++ b/.cbin/_include/_vcredists/InstallAll.bat @@ -1,9 +1,6 @@ @echo off setlocal -start "" /wait "2008sp1\x32\vcredist.exe" /qb! /norestart -start "" /wait "2008sp1\x64\vcredist.exe" /qb! /norestart - start "" /wait "2010\x32\vcredist.exe" /passive /norestart start "" /wait "2010\x64\vcredist.exe" /passive /norestart @@ -19,4 +16,4 @@ start "" /wait "2015u3\x64\vcredist.exe" /install /passive /norestart start "" /wait "2017\x32\vcredist.exe" /install /passive /norestart start "" /wait "2017\x64\vcredist.exe" /install /passive /norestart -endlocal \ No newline at end of file +endlocal From 50a503240d63d1e3350f8eddc3c95d0d57489ea3 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sun, 16 Sep 2018 23:08:11 -0600 Subject: [PATCH 36/39] Downgrading Python to 3.6 in WinPE * Python wouldn't load --- .bin/Scripts/build_pe.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.bin/Scripts/build_pe.ps1 b/.bin/Scripts/build_pe.ps1 index a16edb03..0476e8fe 100644 --- a/.bin/Scripts/build_pe.ps1 +++ b/.bin/Scripts/build_pe.ps1 @@ -158,16 +158,16 @@ if ($MyInvocation.InvocationName -ne ".") { @("produkey32.zip", "http://www.nirsoft.net/utils/produkey.zip"), @("produkey64.zip", "http://www.nirsoft.net/utils/produkey-x64.zip"), # Python - @("python32.zip", "https://www.python.org/ftp/python/3.7.0/python-3.7.0-embed-win32.zip"), - @("python64.zip", "https://www.python.org/ftp/python/3.7.0/python-3.7.0-embed-amd64.zip"), + @("python32.zip", "https://www.python.org/ftp/python/3.6.0/python-3.6.0-embed-win32.zip"), + @("python64.zip", "https://www.python.org/ftp/python/3.6.0/python-3.6.0-embed-amd64.zip"), # Python: psutil @( "psutil64.whl", - (FindDynamicUrl "https://pypi.org/project/psutil/" "href=.*-cp37-cp37m-win_amd64.whl") + (FindDynamicUrl "https://pypi.org/project/psutil/" "href=.*-cp36-cp36m-win_amd64.whl") ), @( "psutil32.whl", - (FindDynamicUrl "https://pypi.org/project/psutil/" "href=.*-cp37-cp37m-win32.whl") + (FindDynamicUrl "https://pypi.org/project/psutil/" "href=.*-cp36-cp36m-win32.whl") ), # Q-Dir @("qdir32.zip", "https://www.softwareok.com/Download/Q-Dir_Portable.zip"), From e3aaa887c53582dd9fadde783173bc54f935c4dd Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Mon, 17 Sep 2018 14:15:19 -0600 Subject: [PATCH 37/39] Countdown the minutes remaining during Prime95 * Fixes issue #54 --- .bin/Scripts/functions/hw_diags.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.bin/Scripts/functions/hw_diags.py b/.bin/Scripts/functions/hw_diags.py index 61530e5b..3b8bd354 100644 --- a/.bin/Scripts/functions/hw_diags.py +++ b/.bin/Scripts/functions/hw_diags.py @@ -452,7 +452,6 @@ def run_iobenchmark(): def run_mprime(): """Run Prime95 for MPRIME_LIMIT minutes while showing the temps.""" aborted = False - clear_screen() print_log('\nStart Prime95 test') TESTS['Prime95']['Status'] = 'Working' update_progress() @@ -467,12 +466,15 @@ def run_mprime(): # Start test run_program(['apple-fans', 'max']) - print_standard('Running Prime95 for {} minutes'.format(MPRIME_LIMIT)) - print_warning('If running too hot, press CTL+c to abort the test') try: - sleep(int(MPRIME_LIMIT)*60) + for i in range(int(MPRIME_LIMIT)): + clear_screen() + print_standard('Running Prime95 ({} minutes left)'.format( + int(MPRIME_LIMIT)-i)) + print_warning('If running too hot, press CTRL+c to abort the test') + sleep(60) except KeyboardInterrupt: - # Catch CTL+C + # Catch CTRL+C aborted = True # Save "final" temps From 79fc40e57a7596dbbf1d17d4509a6dcae2377848 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Mon, 17 Sep 2018 18:50:55 -0600 Subject: [PATCH 38/39] Fixed Python 3.7 dependencies * This re-upgrades Python to 3.7 in WinPE --- .bin/Scripts/build_kit.ps1 | 21 +++++++++++++++++++++ .bin/Scripts/build_pe.ps1 | 31 +++++++++++++++++++++++++++---- 2 files changed, 48 insertions(+), 4 deletions(-) diff --git a/.bin/Scripts/build_kit.ps1 b/.bin/Scripts/build_kit.ps1 index bba52a66..bd213578 100644 --- a/.bin/Scripts/build_kit.ps1 +++ b/.bin/Scripts/build_kit.ps1 @@ -11,6 +11,7 @@ $Bin = (Get-Item $WD).Parent.FullName $Root = (Get-Item $Bin -Force).Parent.FullName $Temp = "$Bin\tmp" $System32 = "{0}\System32" -f $Env:SystemRoot +$SysWOW64 = "{0}\SysWOW64" -f $Env:SystemRoot Push-Location "$WD" $Host.UI.RawUI.BackgroundColor = "black" $Host.UI.RawUI.ForegroundColor = "white" @@ -112,12 +113,25 @@ if ($MyInvocation.InvocationName -ne ".") { $Url = FindDynamicUrl -SourcePage $DownloadPage -RegEx $RegEx DownloadFile -Path $Path -Name $Name -Url $Url } + + # Visual C++ Runtimes + $Url = "https://aka.ms/vs/15/release/vc_redist.x86.exe" + DownloadFile -Path $Path -Name "vcredist_x86.exe" -Url $Url + $Url = "https://aka.ms/vs/15/release/vc_redist.x64.exe" + DownloadFile -Path $Path -Name "vcredist_x64.exe" -Url $Url ## Bail ## # If errors were encountered during downloads if ($DownloadErrors -gt 0) { Abort } + + ## Install ## + # Visual C++ Runtimes + $ArgumentList = @("/install", "/passive", "/norestart") + Start-Process -FilePath "$Temp\vcredist_x86.exe" -ArgumentList $ArgumentList -Wait + Start-Process -FilePath "$Temp\vcredist_x64.exe" -ArgumentList $ArgumentList -Wait + Remove-Item "$Temp\vcredist*.exe" ## Extract ## # 7-Zip @@ -192,6 +206,13 @@ if ($MyInvocation.InvocationName -ne ".") { Write-Host (" ERROR: Failed to extract files." ) -ForegroundColor "Red" } } + try { + Copy-Item -Path "$System32\vcruntime140.dll" -Destination "$Bin\Python\x64\vcruntime140.dll" -Force + Copy-Item -Path "$SysWOW64\vcruntime140.dll" -Destination "$Bin\Python\x32\vcruntime140.dll" -Force + } + catch { + Write-Host (" ERROR: Failed to copy Visual C++ Runtime DLLs." ) -ForegroundColor "Red" + } Remove-Item "$Temp\python*.zip" Remove-Item "$Temp\*.whl" diff --git a/.bin/Scripts/build_pe.ps1 b/.bin/Scripts/build_pe.ps1 index 0476e8fe..560d570d 100644 --- a/.bin/Scripts/build_pe.ps1 +++ b/.bin/Scripts/build_pe.ps1 @@ -17,6 +17,7 @@ $Date = Get-Date -UFormat "%Y-%m-%d" $Host.UI.RawUI.BackgroundColor = "Black" $Host.UI.RawUI.ForegroundColor = "White" $HostSystem32 = "{0}\System32" -f $Env:SystemRoot +$HostSysWOW64 = "{0}\SysWOW64" -f $Env:SystemRoot $DISM = "{0}\DISM.exe" -f $Env:DISMRoot #Enable TLS 1.2 [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 @@ -158,16 +159,16 @@ if ($MyInvocation.InvocationName -ne ".") { @("produkey32.zip", "http://www.nirsoft.net/utils/produkey.zip"), @("produkey64.zip", "http://www.nirsoft.net/utils/produkey-x64.zip"), # Python - @("python32.zip", "https://www.python.org/ftp/python/3.6.0/python-3.6.0-embed-win32.zip"), - @("python64.zip", "https://www.python.org/ftp/python/3.6.0/python-3.6.0-embed-amd64.zip"), + @("python32.zip", "https://www.python.org/ftp/python/3.7.0/python-3.7.0-embed-win32.zip"), + @("python64.zip", "https://www.python.org/ftp/python/3.7.0/python-3.7.0-embed-amd64.zip"), # Python: psutil @( "psutil64.whl", - (FindDynamicUrl "https://pypi.org/project/psutil/" "href=.*-cp36-cp36m-win_amd64.whl") + (FindDynamicUrl "https://pypi.org/project/psutil/" "href=.*-cp37-cp37m-win_amd64.whl") ), @( "psutil32.whl", - (FindDynamicUrl "https://pypi.org/project/psutil/" "href=.*-cp36-cp36m-win32.whl") + (FindDynamicUrl "https://pypi.org/project/psutil/" "href=.*-cp37-cp37m-win32.whl") ), # Q-Dir @("qdir32.zip", "https://www.softwareok.com/Download/Q-Dir_Portable.zip"), @@ -177,6 +178,9 @@ if ($MyInvocation.InvocationName -ne ".") { @("testdisk64.zip", "https://www.cgsecurity.org/testdisk-7.1-WIP.win64.zip"), # VirtIO drivers @("virtio-win.iso", "https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-virtio/virtio-win.iso"), + # Visual C++ Runtimes + @("vcredist_x86.exe", "https://aka.ms/vs/15/release/vc_redist.x86.exe"), + @("vcredist_x64.exe", "https://aka.ms/vs/15/release/vc_redist.x64.exe"), # wimlib-imagex @("wimlib32.zip", "https://wimlib.net/downloads/wimlib-1.12.0-windows-i686-bin.zip"), @("wimlib64.zip", "https://wimlib.net/downloads/wimlib-1.12.0-windows-x86_64-bin.zip") @@ -190,6 +194,13 @@ if ($MyInvocation.InvocationName -ne ".") { if ($DownloadErrors -gt 0) { Abort } + + ## Install ## + # Visual C++ Runtimes + Write-Host "Installing: Visual C++ Runtimes" + $ArgumentList = @("/install", "/passive", "/norestart") + Start-Process -FilePath "$Temp\vcredist_x86.exe" -ArgumentList $ArgumentList -Wait + Start-Process -FilePath "$Temp\vcredist_x64.exe" -ArgumentList $ArgumentList -Wait ## Extract ## # 7-Zip @@ -423,6 +434,12 @@ if ($MyInvocation.InvocationName -ne ".") { catch { Write-Host (" ERROR: Failed to extract files." ) -ForegroundColor "Red" } + try { + Copy-Item -Path "$HostSystem32\vcruntime140.dll" -Destination "$Build\bin\amd64\python\vcruntime140.dll" -Force + } + catch { + Write-Host (" ERROR: Failed to copy Visual C++ Runtime DLL." ) -ForegroundColor "Red" + } # Python (x32) Write-Host "Extracting: Python (x32)" @@ -440,6 +457,12 @@ if ($MyInvocation.InvocationName -ne ".") { catch { Write-Host (" ERROR: Failed to extract files." ) -ForegroundColor "Red" } + try { + Copy-Item -Path "$HostSysWOW64\vcruntime140.dll" -Destination "$Build\bin\x86\python\vcruntime140.dll" -Force + } + catch { + Write-Host (" ERROR: Failed to copy Visual C++ Runtime DLL." ) -ForegroundColor "Red" + } # Q-Dir Write-Host "Extracting: Q-Dir" From b34187b86a496998e6a7ef53599b056a718ed63d Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Mon, 17 Sep 2018 20:04:47 -0600 Subject: [PATCH 39/39] Use new Firefox 62 method to install uBlock Origin --- .bin/Scripts/functions/browsers.py | 20 +++++++++++++------- .bin/Scripts/functions/setup.py | 29 +++++++++++++++++++++++------ .bin/Scripts/functions/update.py | 14 ++++---------- 3 files changed, 40 insertions(+), 23 deletions(-) diff --git a/.bin/Scripts/functions/browsers.py b/.bin/Scripts/functions/browsers.py index c6d39db9..99086f18 100644 --- a/.bin/Scripts/functions/browsers.py +++ b/.bin/Scripts/functions/browsers.py @@ -46,6 +46,9 @@ UBO_CHROME_REG = r'Software\Wow6432Node\Google\Chrome\Extensions\cjpalhdl UBO_EXTRA_CHROME = 'https://chrome.google.com/webstore/detail/ublock-origin-extra/pgdnlhfefecpicbbihgmbmffkjpaplco?hl=en' UBO_EXTRA_CHROME_REG = r'Software\Wow6432Node\Google\Chrome\Extensions\pgdnlhfefecpicbbihgmbmffkjpaplco' UBO_MOZILLA = 'https://addons.mozilla.org/en-us/firefox/addon/ublock-origin/' +UBO_MOZZILA_PATH = r'{}\Mozilla Firefox\distribution\extensions\ublock_origin.xpi'.format(os.environ.get('PROGRAMFILES')) +UBO_MOZILLA_REG = r'Software\Mozilla\Firefox\Extensions' +UBO_MOZILLA_REG_NAME = 'uBlock0@raymondhill.net' UBO_OPERA = 'https://addons.opera.com/en/extensions/details/ublock/?display=en' SUPPORTED_BROWSERS = { 'Internet Explorer': { @@ -369,14 +372,17 @@ def install_adblock(indent=8, width=32): urls.append(UBO_EXTRA_CHROME) elif browser_data[browser]['base'] == 'mozilla': - # Assume UBO is not installed first and change if it is - urls.append(UBO_MOZILLA) - if browser == 'Mozilla Firefox': - ubo = browser_data[browser]['exe_path'].replace( - 'firefox.exe', - r'distribution\extensions\uBlock0@raymondhill.net') - if os.path.exists(ubo): + # Check for system extensions + try: + with winreg.OpenKey(HKLM, UBO_MOZILLA_REG) as key: + winreg.QueryValueEx(key, UBO_MOZILLA_REG_NAME) + except FileNotFoundError: + urls = [UBO_MOZILLA] + else: + if os.path.exists(UBO_MOZZILA_PATH): urls = ['about:addons'] + else: + urls = [UBO_MOZILLA] elif browser_data[browser]['base'] == 'ie': urls.append(IE_GALLERY) diff --git a/.bin/Scripts/functions/setup.py b/.bin/Scripts/functions/setup.py index d08692b5..4fca0303 100644 --- a/.bin/Scripts/functions/setup.py +++ b/.bin/Scripts/functions/setup.py @@ -5,6 +5,9 @@ from functions.common import * # STATIC VARIABLES HKCU = winreg.HKEY_CURRENT_USER HKLM = winreg.HKEY_LOCAL_MACHINE +MOZILLA_FIREFOX_UBO_PATH = r'{}\{}\ublock_origin.xpi'.format( + os.environ.get('PROGRAMFILES'), + r'Mozilla Firefox\distribution\extensions') OTHER_RESULTS = { 'Error': { 'CalledProcessError': 'Unknown Error', @@ -76,9 +79,6 @@ SETTINGS_EXPLORER_USER = { }, } SETTINGS_GOOGLE_CHROME = { - r'Software\Google\Chrome\Extensions': { - 'WOW64_32': True, - }, r'Software\Google\Chrome\Extensions\cjpalhdlnbpafiamejdnhcphjbkeiagm': { 'SZ Items': { 'update_url': 'https://clients2.google.com/service/update2/crx'}, @@ -90,6 +90,19 @@ SETTINGS_GOOGLE_CHROME = { 'WOW64_32': True, }, } +SETTINGS_MOZILLA_FIREFOX_32 = { + r'Software\Mozilla\Firefox\Extensions': { + 'SZ Items': { + 'uBlock0@raymondhill.net': MOZILLA_FIREFOX_UBO_PATH}, + 'WOW64_32': True, + }, + } +SETTINGS_MOZILLA_FIREFOX_64 = { + r'Software\Mozilla\Firefox\Extensions': { + 'SZ Items': { + 'uBlock0@raymondhill.net': MOZILLA_FIREFOX_UBO_PATH}, + }, + } VCR_REDISTS = [ {'Name': 'Visual C++ 2008 SP1 x32...', 'Cmd': [r'2008sp1\x32\vcredist.exe', '/qb! /norestart']}, @@ -221,7 +234,7 @@ def install_adobe_reader(): run_program(cmd) def install_chrome_extensions(): - """Update registry to 'install' Google Chrome extensions for all users.""" + """Update registry to install Google Chrome extensions for all users.""" write_registry_settings(SETTINGS_GOOGLE_CHROME, all_users=True) def install_classicstart_skin(): @@ -238,16 +251,20 @@ def install_classicstart_skin(): shutil.copy(source, dest) def install_firefox_extensions(): - """Extract Firefox extensions to installation folder.""" + """Update registry to install Firefox extensions for all users.""" dist_path = r'{PROGRAMFILES}\Mozilla Firefox\distribution\extensions'.format( **global_vars['Env']) source_path = r'{CBinDir}\FirefoxExtensions.7z'.format(**global_vars) if not os.path.exists(source_path): raise FileNotFoundError + + # Update registry + write_registry_settings(SETTINGS_MOZILLA_FIREFOX_32, all_users=True) + write_registry_settings(SETTINGS_MOZILLA_FIREFOX_64, all_users=True) # Extract extension(s) to distribution folder cmd = [ - global_vars['Tools']['SevenZip'], 'x', '-aos', '-bso0', '-bse0', + global_vars['Tools']['SevenZip'], 'e', '-aos', '-bso0', '-bse0', '-p{ArchivePassword}'.format(**global_vars), '-o{dist_path}'.format(dist_path=dist_path), source_path] diff --git a/.bin/Scripts/functions/update.py b/.bin/Scripts/functions/update.py index 50386673..9c9cfec0 100644 --- a/.bin/Scripts/functions/update.py +++ b/.bin/Scripts/functions/update.py @@ -720,16 +720,10 @@ def update_firefox_ublock_origin(): remove_from_kit('FirefoxExtensions') # Download - download_to_temp('ff-uBO.xpi', SOURCE_URLS['Firefox uBO']) - - # Extract files - extract_generic( - r'{}\ff-uBO.xpi'.format(global_vars['TmpDir']), - r'{}\FirefoxExtensions\uBlock0@raymondhill.net'.format( - global_vars['CBinDir'])) - - # Cleanup - remove_from_temp('ff-uBO.xpi') + download_generic( + r'{}\FirefoxExtensions'.format(global_vars['CBinDir']), + 'ublock_origin.xpi', + SOURCE_URLS['Firefox uBO']) def update_notepadplusplus(): # Stop running processes