Merge remote-tracking branch 'upstream/dev' into dev
This commit is contained in:
commit
47b4ab6636
12 changed files with 1317 additions and 1271 deletions
|
|
@ -83,17 +83,17 @@ if ($MyInvocation.InvocationName -ne ".") {
|
||||||
DownloadFile -Path $Path -Name "7z-extra.7z" -Url "https://www.7-zip.org/a/7z1900-extra.7z"
|
DownloadFile -Path $Path -Name "7z-extra.7z" -Url "https://www.7-zip.org/a/7z1900-extra.7z"
|
||||||
|
|
||||||
# ConEmu
|
# ConEmu
|
||||||
$Url = "https://github.com/Maximus5/ConEmu/releases/download/v19.06.23/ConEmuPack.190623.7z"
|
$Url = "https://github.com/Maximus5/ConEmu/releases/download/v19.03.10/ConEmuPack.190310.7z"
|
||||||
DownloadFile -Path $Path -Name "ConEmuPack.7z" -Url $Url
|
DownloadFile -Path $Path -Name "ConEmuPack.7z" -Url $Url
|
||||||
|
|
||||||
# Notepad++
|
# Notepad++
|
||||||
$Url = "https://notepad-plus-plus.org/repository/7.x/7.7.1/npp.7.7.1.bin.minimalist.7z"
|
$Url = "https://notepad-plus-plus.org/repository/7.x/7.6.4/npp.7.6.4.bin.minimalist.7z"
|
||||||
DownloadFile -Path $Path -Name "npp.7z" -Url $Url
|
DownloadFile -Path $Path -Name "npp.7z" -Url $Url
|
||||||
|
|
||||||
# Python
|
# Python
|
||||||
$Url = "https://www.python.org/ftp/python/3.7.4/python-3.7.4-embed-win32.zip"
|
$Url = "https://www.python.org/ftp/python/3.7.2/python-3.7.2.post1-embed-win32.zip"
|
||||||
DownloadFile -Path $Path -Name "python32.zip" -Url $Url
|
DownloadFile -Path $Path -Name "python32.zip" -Url $Url
|
||||||
$Url = "https://www.python.org/ftp/python/3.7.4/python-3.7.4-embed-amd64.zip"
|
$Url = "https://www.python.org/ftp/python/3.7.2/python-3.7.2.post1-embed-amd64.zip"
|
||||||
DownloadFile -Path $Path -Name "python64.zip" -Url $Url
|
DownloadFile -Path $Path -Name "python64.zip" -Url $Url
|
||||||
|
|
||||||
# Python: psutil
|
# Python: psutil
|
||||||
|
|
|
||||||
|
|
@ -641,7 +641,7 @@ def check_self_test_results(test_obj, aborted=False):
|
||||||
# known progress instead of just "was aborted buy host"
|
# known progress instead of just "was aborted buy host"
|
||||||
test_details = test_obj.dev.get_smart_self_test_details()
|
test_details = test_obj.dev.get_smart_self_test_details()
|
||||||
test_result = test_details.get('status', {}).get('string', 'Unknown')
|
test_result = test_details.get('status', {}).get('string', 'Unknown')
|
||||||
test_obj.report.append(f' {test_result}')
|
test_obj.report.append(f' {test_result.capitalize()}')
|
||||||
if aborted and not (test_obj.passed or test_obj.failed):
|
if aborted and not (test_obj.passed or test_obj.failed):
|
||||||
test_obj.report.append(std.color_string(' Aborted', 'YELLOW'))
|
test_obj.report.append(std.color_string(' Aborted', 'YELLOW'))
|
||||||
test_obj.set_status('Aborted')
|
test_obj.set_status('Aborted')
|
||||||
|
|
|
||||||
|
|
@ -163,6 +163,11 @@ class Disk(BaseObj):
|
||||||
self.get_details()
|
self.get_details()
|
||||||
self.enable_smart()
|
self.enable_smart()
|
||||||
self.update_smart_details()
|
self.update_smart_details()
|
||||||
|
if self.details['bus'] == 'USB' and not self.attributes:
|
||||||
|
# Try using SAT
|
||||||
|
LOG.warning('Using SAT for smartctl for %s', self.path)
|
||||||
|
self.enable_smart(use_sat=True)
|
||||||
|
self.update_smart_details(use_sat=True)
|
||||||
if not self.is_4k_aligned():
|
if not self.is_4k_aligned():
|
||||||
self.add_note('One or more partitions are not 4K aligned', 'YELLOW')
|
self.add_note('One or more partitions are not 4K aligned', 'YELLOW')
|
||||||
|
|
||||||
|
|
@ -218,11 +223,12 @@ class Disk(BaseObj):
|
||||||
test.set_status('Denied')
|
test.set_status('Denied')
|
||||||
test.disabled = True
|
test.disabled = True
|
||||||
|
|
||||||
def enable_smart(self):
|
def enable_smart(self, use_sat=False):
|
||||||
"""Try enabling SMART for this disk."""
|
"""Try enabling SMART for this disk."""
|
||||||
cmd = [
|
cmd = [
|
||||||
'sudo',
|
'sudo',
|
||||||
'smartctl',
|
'smartctl',
|
||||||
|
f'--device={"sat,auto" if use_sat else "auto"}',
|
||||||
'--tolerance=permissive',
|
'--tolerance=permissive',
|
||||||
'--smart=on',
|
'--smart=on',
|
||||||
self.path,
|
self.path,
|
||||||
|
|
@ -500,12 +506,23 @@ class Disk(BaseObj):
|
||||||
# Done
|
# Done
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def update_smart_details(self):
|
def update_smart_details(self, use_sat=False):
|
||||||
"""Update SMART details via smartctl."""
|
"""Update SMART details via smartctl."""
|
||||||
self.attributes = {}
|
self.attributes = {}
|
||||||
|
|
||||||
|
# Check if SAT is needed
|
||||||
|
if not use_sat:
|
||||||
|
# use_sat not set, check previous run (if possible)
|
||||||
|
for arg in self.smartctl.get('smartctl', {}).get('argv', []):
|
||||||
|
if arg == '--device=sat,auto':
|
||||||
|
use_sat = True
|
||||||
|
break
|
||||||
|
|
||||||
|
# Get SMART data
|
||||||
cmd = [
|
cmd = [
|
||||||
'sudo',
|
'sudo',
|
||||||
'smartctl',
|
'smartctl',
|
||||||
|
f'--device={"sat,auto" if use_sat else "auto"}',
|
||||||
'--tolerance=verypermissive',
|
'--tolerance=verypermissive',
|
||||||
'--all',
|
'--all',
|
||||||
'--json',
|
'--json',
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ from wk import io, log, std
|
||||||
from wk.cfg.main import KIT_NAME_FULL, KIT_NAME_SHORT
|
from wk.cfg.main import KIT_NAME_FULL, KIT_NAME_SHORT
|
||||||
from wk.cfg.ufd import BOOT_ENTRIES, BOOT_FILES, ITEMS, ITEMS_HIDDEN, SOURCES
|
from wk.cfg.ufd import BOOT_ENTRIES, BOOT_FILES, ITEMS, ITEMS_HIDDEN, SOURCES
|
||||||
from wk.exe import run_program
|
from wk.exe import run_program
|
||||||
|
from wk.hw.obj import Disk
|
||||||
from wk.os import linux
|
from wk.os import linux
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -395,6 +396,8 @@ def show_selections(args, sources, ufd_dev, ufd_sources):
|
||||||
def update_boot_entries():
|
def update_boot_entries():
|
||||||
"""Update boot files for UFD usage"""
|
"""Update boot files for UFD usage"""
|
||||||
configs = []
|
configs = []
|
||||||
|
ufd = Disk('/mnt/UFD')
|
||||||
|
uuid = ufd.details.get('uuid')
|
||||||
|
|
||||||
# Find config files
|
# Find config files
|
||||||
for c_path, c_ext in BOOT_FILES.items():
|
for c_path, c_ext in BOOT_FILES.items():
|
||||||
|
|
@ -403,12 +406,12 @@ def update_boot_entries():
|
||||||
if item.name.lower().endswith(c_ext.lower()):
|
if item.name.lower().endswith(c_ext.lower()):
|
||||||
configs.append(item.path)
|
configs.append(item.path)
|
||||||
|
|
||||||
# Update Linux labels
|
# Use UUID instead of label
|
||||||
cmd = [
|
cmd = [
|
||||||
'sed',
|
'sed',
|
||||||
'--in-place',
|
'--in-place',
|
||||||
'--regexp-extended',
|
'--regexp-extended',
|
||||||
f's/(eSysRescueLiveCD|{ISO_LABEL})/{UFD_LABEL}/',
|
f's#archisolabel={ISO_LABEL}#archisodevice=/dev/disk/by-uuid/{uuid}#',
|
||||||
*configs,
|
*configs,
|
||||||
]
|
]
|
||||||
run_program(cmd)
|
run_program(cmd)
|
||||||
|
|
|
||||||
|
|
@ -333,6 +333,39 @@ function install_deps() {
|
||||||
run_elevated pacman -Syu --needed --noconfirm $packages
|
run_elevated pacman -Syu --needed --noconfirm $packages
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function build_all() {
|
||||||
|
if [[ "$EUID" -ne 0 ]]; then
|
||||||
|
echo "This section is meant to be run as root."
|
||||||
|
echo "Aborted."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Prep for build
|
||||||
|
cleanup
|
||||||
|
fix_kit_permissions
|
||||||
|
install_deps
|
||||||
|
load_settings --edit
|
||||||
|
update_repo
|
||||||
|
|
||||||
|
# Build (full)
|
||||||
|
copy_live_env
|
||||||
|
update_live_env
|
||||||
|
# Rerun script as root to start Archiso build process
|
||||||
|
run_elevated "$(realpath "$0")" --build-iso
|
||||||
|
# Cleanup
|
||||||
|
mv -nv "$LIVE_DIR" "${LIVE_DIR}.full"
|
||||||
|
perl-rename -v "s/(${KIT_NAME_SHORT}-Linux)-(${DATE}.*)/\1-Full-\2/" "$OUT_DIR"/*
|
||||||
|
|
||||||
|
# Build (minimal)
|
||||||
|
copy_live_env --minimal
|
||||||
|
update_live_env --minimal
|
||||||
|
# Rerun script as root to start Archiso build process
|
||||||
|
run_elevated "$(realpath "$0")" --build-iso
|
||||||
|
# Cleanup
|
||||||
|
mv -nv "$LIVE_DIR" "${LIVE_DIR}.minimal"
|
||||||
|
perl-rename -v "s/(${KIT_NAME_SHORT}-Linux)-(${DATE}.*)/\1-Minimal-\2/" "$OUT_DIR"/*
|
||||||
|
}
|
||||||
|
|
||||||
function build_iso() {
|
function build_iso() {
|
||||||
if [[ "$EUID" -ne 0 ]]; then
|
if [[ "$EUID" -ne 0 ]]; then
|
||||||
echo "This section is meant to be run as root."
|
echo "This section is meant to be run as root."
|
||||||
|
|
@ -369,37 +402,6 @@ function build_iso() {
|
||||||
chown $REAL_USER:$REAL_USER "$OUT_DIR" -R
|
chown $REAL_USER:$REAL_USER "$OUT_DIR" -R
|
||||||
}
|
}
|
||||||
|
|
||||||
function build_all() {
|
|
||||||
if [[ "$EUID" -eq 0 ]]; then
|
|
||||||
echo "This section not meant to be run as root."
|
|
||||||
echo "Aborted."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Prep for build (full)
|
|
||||||
cleanup
|
|
||||||
fix_kit_permissions
|
|
||||||
install_deps
|
|
||||||
load_settings --edit
|
|
||||||
update_repo
|
|
||||||
copy_live_env
|
|
||||||
update_live_env
|
|
||||||
# Rerun script as root to start Archiso build process
|
|
||||||
run_elevated "$(realpath "$0")" --build-iso
|
|
||||||
# Cleanup
|
|
||||||
mv -nv "$LIVE_DIR" "${LIVE_DIR}.full"
|
|
||||||
perl-rename -v "s/(${KIT_NAME_SHORT}-Linux)-(${DATE}.*)/\1-Full-\2/" "$OUT_DIR"/*
|
|
||||||
|
|
||||||
# Prep for build (minimal)
|
|
||||||
copy_live_env --minimal
|
|
||||||
update_live_env --minimal
|
|
||||||
# Rerun script as root to start Archiso build process
|
|
||||||
run_elevated "$(realpath "$0")" --build-iso
|
|
||||||
# Cleanup
|
|
||||||
mv -nv "$LIVE_DIR" "${LIVE_DIR}.minimal"
|
|
||||||
perl-rename -v "s/(${KIT_NAME_SHORT}-Linux)-(${DATE}.*)/\1-Minimal-\2/" "$OUT_DIR"/*
|
|
||||||
}
|
|
||||||
|
|
||||||
function build_full() {
|
function build_full() {
|
||||||
if [[ "$EUID" -eq 0 ]]; then
|
if [[ "$EUID" -eq 0 ]]; then
|
||||||
echo "This section not meant to be run as root."
|
echo "This section not meant to be run as root."
|
||||||
|
|
@ -417,6 +419,29 @@ function build_full() {
|
||||||
update_live_env
|
update_live_env
|
||||||
# Rerun script as root to start Archiso build process
|
# Rerun script as root to start Archiso build process
|
||||||
run_elevated "$(realpath "$0")" --build-iso
|
run_elevated "$(realpath "$0")" --build-iso
|
||||||
|
# Cleanup
|
||||||
|
perl-rename -v "s/(${KIT_NAME_SHORT}-Linux)-(${DATE}.*)/\1-Full-\2/" "$OUT_DIR"/*
|
||||||
|
}
|
||||||
|
|
||||||
|
function build_minimal() {
|
||||||
|
if [[ "$EUID" -eq 0 ]]; then
|
||||||
|
echo "This section not meant to be run as root."
|
||||||
|
echo "Aborted."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Prep for build
|
||||||
|
cleanup
|
||||||
|
fix_kit_permissions
|
||||||
|
install_deps
|
||||||
|
load_settings --edit
|
||||||
|
update_repo
|
||||||
|
copy_live_env --minimal
|
||||||
|
update_live_env --minimal
|
||||||
|
# Rerun script as root to start Archiso build process
|
||||||
|
run_elevated "$(realpath "$0")" --build-iso
|
||||||
|
# Cleanup
|
||||||
|
perl-rename -v "s/(${KIT_NAME_SHORT}-Linux)-(${DATE}.*)/\1-Minimal-\2/" "$OUT_DIR"/*
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check input
|
# Check input
|
||||||
|
|
@ -472,12 +497,13 @@ case ${1:-} in
|
||||||
echo "Options:"
|
echo "Options:"
|
||||||
echo " -a --build-all Perform all tasks to build all isos"
|
echo " -a --build-all Perform all tasks to build all isos"
|
||||||
echo " -b --build-full Perform all tasks to build the full iso"
|
echo " -b --build-full Perform all tasks to build the full iso"
|
||||||
|
echo " -m --build-minimal Perform all tasks to build the minimal iso"
|
||||||
echo " -h --help Show usage"
|
echo " -h --help Show usage"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Advanced options:"
|
echo "Advanced options:"
|
||||||
echo " -f --fix-perms Fix folder permissions"
|
echo " -f --fix-perms Fix folder permissions"
|
||||||
echo " -i --install-deps Install build dependencies"
|
echo " -i --install-deps Install build dependencies"
|
||||||
echo " -m --prep-minimal-env Prep live & airootfs folders (minimal packages)"
|
echo " -n --prep-minimal-env Prep live & airootfs folders (minimal packages)"
|
||||||
echo " -o --build-iso Build ISO (using current setup)"
|
echo " -o --build-iso Build ISO (using current setup)"
|
||||||
echo " -p --prep-live-env Prep live & airootfs folders"
|
echo " -p --prep-live-env Prep live & airootfs folders"
|
||||||
echo " -u --update-repo Update custom pacman repo"
|
echo " -u --update-repo Update custom pacman repo"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue