Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into disk-config-submenu
Browse files Browse the repository at this point in the history
  • Loading branch information
svartkanin committed Oct 2, 2023
2 parents cefad27 + 5c903df commit 7539326
Show file tree
Hide file tree
Showing 59 changed files with 2,514 additions and 719 deletions.
51 changes: 28 additions & 23 deletions .github/workflows/translation-check.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
on:
push:
paths:
- 'archinstall/locales/**'
pull_request:
paths:
- 'archinstall/locales/**'
name: Verify local_generate script was run on translation changes
jobs:
translation-check:
runs-on: ubuntu-latest
container:
image: archlinux:latest
steps:
- uses: actions/checkout@v4
- run: pacman --noconfirm -Syu python git diffutils
- run: |
cd ..
cp -r archinstall archinstall_orig
cd archinstall/archinstall/locales
bash locales_generator.sh
cd ../../..
git diff --no-index --name-only archinstall_orig archinstall
#on:
# push:
# paths:
# - 'archinstall/locales/**'
# pull_request:
# paths:
# - 'archinstall/locales/**'
#name: Verify local_generate script was run on translation changes
#jobs:
# translation-check:
# runs-on: ubuntu-latest
# container:
# image: archlinux:latest
# steps:
# - uses: actions/checkout@v4
# - run: pacman --noconfirm -Syu python git diffutils
# - name: Verify all translation scripts are up to date
# run: |
# cd ..
# cp -r archinstall archinstall_orig
# cd archinstall/archinstall/locales
# bash locales_generator.sh 1> /dev/null
# cd ../../..
# git diff \
# --quiet --no-index --name-only \
# archinstall_orig/archinstall/locales \
# archinstall/archinstall/locales \
# || (echo "Translation files have not been updated after translation, please run ./locales_generator.sh once more and commit" && exit 1)
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ how much has been translated.
Any contributions to the translations are more than welcome,
to get started please follow [the guide](https://github.com/archlinux/archinstall/blob/master/archinstall/locales/README.md)

## Fonts
The ISO does not ship with ship with all fonts needed for different languages.
Fonts that are using a different character set than Latin will not be displayed correctly. If those languages
want to be selected than a proper font has to be set manually in the console.

All available console fonts can be found in `/usr/share/kbd/consolefonts` and can be set with `setfont LatGrkCyr-8x16`.


# Scripting your own installation

## Scripting interactive installation
Expand Down Expand Up @@ -196,13 +204,10 @@ To test this without a live ISO, the simplest approach is to use a local image a
This can be done by installing `pacman -S arch-install-scripts util-linux` locally and doing the following:

# truncate -s 20G testimage.img
# losetup -fP ./testimage.img
# losetup -a | grep "testimage.img" | awk -F ":" '{print $1}'
# losetup --partscan --show --find ./testimage.img
# pip install --upgrade archinstall
# python -m archinstall --script guided
# qemu-system-x86_64 -enable-kvm -machine q35,accel=kvm -device intel-iommu -cpu host -m 4096 -boot order=d -drive
file=./testimage.img,format=raw -drive if=pflash,format=raw,readonly,file=/usr/share/ovmf/x64/OVMF_CODE.fd
-drive if=pflash,format=raw,readonly,file=/usr/share/ovmf/x64/OVMF_VARS.fd
# qemu-system-x86_64 -enable-kvm -machine q35,accel=kvm -device intel-iommu -cpu host -m 4096 -boot order=d -drive file=./testimage.img,format=raw -drive if=pflash,format=raw,readonly,file=/usr/share/ovmf/x64/OVMF_CODE.fd -drive if=pflash,format=raw,readonly,file=/usr/share/ovmf/x64/OVMF_VARS.fd

This will create a *20 GB* `testimage.img` and create a loop device which we can use to format and install to.<br>
`archinstall` is installed and executed in [guided mode](#docs-todo). Once the installation is complete, ~~you can use qemu/kvm to boot the test media.~~<br>
Expand Down
2 changes: 1 addition & 1 deletion archinstall/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
_: Any


__version__ = "2.6.1"
__version__ = "2.6.3"
storage['__version__'] = __version__


Expand Down
1 change: 1 addition & 0 deletions archinstall/lib/disk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
PartitionTable,
Unit,
Size,
SectorSize,
SubvolumeModification,
DeviceGeometry,
PartitionType,
Expand Down
47 changes: 29 additions & 18 deletions archinstall/lib/disk/device_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,11 @@ def load_devices(self):

try:
loop_devices = SysCommand(['losetup', '-a'])
except SysCallError as err:
debug(f'Failed to get loop devices: {err}')
else:
for ld_info in str(loop_devices).splitlines():
loop_device = getDevice(ld_info.split(':', maxsplit=1)[0])
devices.append(loop_device)
except Exception as err:
debug(f'Failed to get loop devices: {err}')

for device in devices:
if get_lsblk_info(device.path).type == 'rom':
Expand Down Expand Up @@ -84,7 +83,9 @@ def load_devices(self):
_PartitionInfo.from_partition(
partition,
fs_type,
lsblk_info.partn,
lsblk_info.partuuid,
lsblk_info.uuid,
lsblk_info.mountpoints,
subvol_infos
)
Expand Down Expand Up @@ -153,20 +154,19 @@ def get_btrfs_info(self, dev_path: Path) -> List[_BtrfsSubvolumeInfo]:
mountpoint = Path(common_prefix)

try:
result = SysCommand(f'btrfs subvolume list {mountpoint}')
result = SysCommand(f'btrfs subvolume list {mountpoint}').decode()
except SysCallError as err:
debug(f'Failed to read btrfs subvolume information: {err}')
return subvol_infos

try:
if decoded := result.decode('utf-8'):
# ID 256 gen 16 top level 5 path @
for line in decoded.splitlines():
# expected output format:
# ID 257 gen 8 top level 5 path @home
name = Path(line.split(' ')[-1])
sub_vol_mountpoint = lsblk_info.btrfs_subvol_info.get(name, None)
subvol_infos.append(_BtrfsSubvolumeInfo(name, sub_vol_mountpoint))
# ID 256 gen 16 top level 5 path @
for line in result.splitlines():
# expected output format:
# ID 257 gen 8 top level 5 path @home
name = Path(line.split(' ')[-1])
sub_vol_mountpoint = lsblk_info.btrfs_subvol_info.get(name, None)
subvol_infos.append(_BtrfsSubvolumeInfo(name, sub_vol_mountpoint))
except json.decoder.JSONDecodeError as err:
error(f"Could not decode lsblk JSON: {result}")
raise err
Expand Down Expand Up @@ -547,14 +547,18 @@ def mount(
info(f'Device already mounted at {target_mountpoint}')
return

str_options = ','.join(options)
str_options = f'-o {str_options}' if str_options else ''
cmd = ['mount']

if len(options):
cmd.extend(('-o', ','.join(options)))
if mount_fs:
cmd.extend(('-t', mount_fs))

mount_fs = f'-t {mount_fs}' if mount_fs else ''
cmd.extend((str(dev_path), str(target_mountpoint)))

command = f'mount {mount_fs} {str_options} {dev_path} {target_mountpoint}'
command = ' '.join(cmd)

debug(f'Mounting {dev_path}: command')
debug(f'Mounting {dev_path}: {command}')

try:
SysCommand(command)
Expand Down Expand Up @@ -594,7 +598,14 @@ def detect_pre_mounted_mods(self, base_mountpoint: Path) -> List[DeviceModificat
if is_subpath(mountpoint, base_mountpoint):
path = Path(part_info.disk.device.path)
part_mods.setdefault(path, [])
part_mods[path].append(PartitionModification.from_existing_partition(part_info))
part_mod = PartitionModification.from_existing_partition(part_info)
if part_mod.mountpoint:
part_mod.mountpoint = mountpoint.root / mountpoint.relative_to(base_mountpoint)
else:
for subvol in part_mod.btrfs_subvols:
if sm := subvol.mountpoint:
subvol.mountpoint = sm.root / sm.relative_to(base_mountpoint)
part_mods[path].append(part_mod)
break

device_mods: List[DeviceModification] = []
Expand Down
Loading

0 comments on commit 7539326

Please sign in to comment.