@@ -451,7 +451,7 @@ def add_swapfile(self, size: str = '4G', enable_resume: bool = True, file: str =
451451 if enable_resume :
452452 resume_uuid = SysCommand (f'findmnt -no UUID -T { self .target } { file } ' ).decode ()
453453 resume_offset = SysCommand (
454- f'/usr/bin/ filefrag -v { self .target } { file } '
454+ f'filefrag -v { self .target } { file } '
455455 ).decode ().split ('0:' , 1 )[1 ].split (":" , 1 )[1 ].split (".." , 1 )[0 ].strip ()
456456
457457 self ._hooks .append ('resume' )
@@ -499,7 +499,7 @@ def genfstab(self, flags: str = '-pU') -> None:
499499 info (f"Updating { fstab_path } " )
500500
501501 try :
502- gen_fstab = SysCommand (f'/usr/bin/ genfstab { flags } { self .target } ' ).output ()
502+ gen_fstab = SysCommand (f'genfstab { flags } { self .target } ' ).output ()
503503 except SysCallError as err :
504504 raise RequirementError (
505505 f'Could not generate fstab, strapping in packages most likely failed (disk out of space?)\n Error: { err } ' )
@@ -561,7 +561,7 @@ def set_locale(self, locale_config: LocaleConfiguration) -> bool:
561561 return False
562562
563563 try :
564- SysCommand (f'/usr/bin/ arch-chroot { self .target } locale-gen' )
564+ SysCommand (f'arch-chroot { self .target } locale-gen' )
565565 except SysCallError as e :
566566 error (f'Failed to run locale-gen on target: { e } ' )
567567 return False
@@ -582,7 +582,7 @@ def set_timezone(self, zone: str) -> bool:
582582
583583 if (Path ("/usr" ) / "share" / "zoneinfo" / zone ).exists ():
584584 (Path (self .target ) / "etc" / "localtime" ).unlink (missing_ok = True )
585- SysCommand (f'/usr/bin/ arch-chroot { self .target } ln -s /usr/share/zoneinfo/{ zone } /etc/localtime' )
585+ SysCommand (f'arch-chroot { self .target } ln -s /usr/share/zoneinfo/{ zone } /etc/localtime' )
586586 return True
587587
588588 else :
@@ -620,7 +620,7 @@ def enable_service(self, services: str | list[str]) -> None:
620620 plugin .on_service (service )
621621
622622 def run_command (self , cmd : str , * args : str , ** kwargs : str ) -> SysCommand :
623- return SysCommand (f'/usr/bin/ arch-chroot { self .target } { cmd } ' )
623+ return SysCommand (f'arch-chroot { self .target } { cmd } ' )
624624
625625 def arch_chroot (self , cmd : str , run_as : str | None = None ) -> SysCommand :
626626 if run_as :
@@ -629,7 +629,7 @@ def arch_chroot(self, cmd: str, run_as: str | None = None) -> SysCommand:
629629 return self .run_command (cmd )
630630
631631 def drop_to_shell (self ) -> None :
632- subprocess .check_call (f"/usr/bin/ arch-chroot { self .target } " , shell = True )
632+ subprocess .check_call (f"arch-chroot { self .target } " , shell = True )
633633
634634 def configure_nic (self , nic : Nic ) -> None :
635635 conf = nic .as_systemd_config ()
@@ -723,7 +723,7 @@ def mkinitcpio(self, flags: list[str]) -> bool:
723723 mkinit .write (content )
724724
725725 try :
726- SysCommand (f'/usr/bin/ arch-chroot { self .target } mkinitcpio { " " .join (flags )} ' , peek_output = True )
726+ SysCommand (f'arch-chroot { self .target } mkinitcpio { " " .join (flags )} ' , peek_output = True )
727727 return True
728728 except SysCallError as e :
729729 if e .worker :
@@ -865,16 +865,16 @@ def minimal_installation(
865865
866866 # TODO: Support locale and timezone
867867 # os.remove(f'{self.target}/etc/localtime')
868- # sys_command(f'/usr/bin/ arch-chroot {self.target} ln -s /usr/share/zoneinfo/{localtime} /etc/localtime')
869- # sys_command('/usr/bin/ arch-chroot /mnt hwclock --hctosys --localtime')
868+ # sys_command(f'arch-chroot {self.target} ln -s /usr/share/zoneinfo/{localtime} /etc/localtime')
869+ # sys_command('arch-chroot /mnt hwclock --hctosys --localtime')
870870 if hostname :
871871 self .set_hostname (hostname )
872872
873873 self .set_locale (locale_config )
874874 self .set_keyboard_language (locale_config .kb_layout )
875875
876876 # TODO: Use python functions for this
877- SysCommand (f'/usr/bin/ arch-chroot { self .target } chmod 700 /root' )
877+ SysCommand (f'arch-chroot { self .target } chmod 700 /root' )
878878
879879 if mkinitcpio and not self .mkinitcpio (['-P' ]):
880880 error ('Error generating initramfs (continuing anyway)' )
@@ -1071,10 +1071,10 @@ def _add_systemd_bootloader(
10711071
10721072 # Install the boot loader
10731073 try :
1074- SysCommand (f"/usr/bin/ arch-chroot { self .target } bootctl { ' ' .join (bootctl_options )} install" )
1074+ SysCommand (f"arch-chroot { self .target } bootctl { ' ' .join (bootctl_options )} install" )
10751075 except SysCallError :
10761076 # Fallback, try creating the boot loader without touching the EFI variables
1077- SysCommand (f"/usr/bin/ arch-chroot { self .target } bootctl --no-variables { ' ' .join (bootctl_options )} install" )
1077+ SysCommand (f"arch-chroot { self .target } bootctl --no-variables { ' ' .join (bootctl_options )} install" )
10781078
10791079 # Ensure that the $BOOT/loader/ directory exists before we try to create files in it.
10801080 #
@@ -1168,7 +1168,7 @@ def _add_grub_bootloader(
11681168 boot_dir = Path ('/boot' )
11691169
11701170 command = [
1171- '/usr/bin/ arch-chroot' ,
1171+ 'arch-chroot' ,
11721172 str (self .target ),
11731173 'grub-install' ,
11741174 '--debug'
@@ -1222,7 +1222,7 @@ def _add_grub_bootloader(
12221222
12231223 try :
12241224 SysCommand (
1225- f'/usr/bin/ arch-chroot { self .target } '
1225+ f'arch-chroot { self .target } '
12261226 f'grub-mkconfig -o { boot_dir } /grub/grub.cfg'
12271227 )
12281228 except SysCallError as err :
@@ -1277,7 +1277,7 @@ def _add_limine_bootloader(
12771277 shutil .copy (limine_path / 'limine-bios.sys' , self .target / 'boot' )
12781278
12791279 # `limine bios-install` deploys the stage 1 and 2 to the disk.
1280- SysCommand (f'/usr/bin/ arch-chroot { self .target } limine bios-install { parent_dev_path } ' , peek_output = True )
1280+ SysCommand (f'arch-chroot { self .target } limine bios-install { parent_dev_path } ' , peek_output = True )
12811281 except Exception as err :
12821282 raise DiskError (f'Failed to install Limine on { parent_dev_path } : { err } ' )
12831283
@@ -1523,7 +1523,7 @@ def user_create(self, user: str, password: str | None = None, groups: list[str]
15231523 if not handled_by_plugin :
15241524 info (f'Creating user { user } ' )
15251525 try :
1526- SysCommand (f'/usr/bin/ arch-chroot { self .target } useradd -m -G wheel { user } ' )
1526+ SysCommand (f'arch-chroot { self .target } useradd -m -G wheel { user } ' )
15271527 except SysCallError as err :
15281528 raise SystemError (f"Could not create user inside installation: { err } " )
15291529
@@ -1537,7 +1537,7 @@ def user_create(self, user: str, password: str | None = None, groups: list[str]
15371537
15381538 if groups :
15391539 for group in groups :
1540- SysCommand (f'/usr/bin/ arch-chroot { self .target } gpasswd -a { user } { group } ' )
1540+ SysCommand (f'arch-chroot { self .target } gpasswd -a { user } { group } ' )
15411541
15421542 if sudo and self .enable_sudo (user ):
15431543 self .helper_flags ['user' ] = True
@@ -1554,7 +1554,7 @@ def user_set_pw(self, user: str, password: str) -> bool:
15541554 sh = shlex .join (['sh' , '-c' , echo ])
15551555
15561556 try :
1557- SysCommand (f"/usr/bin/ arch-chroot { self .target } " + sh [:- 1 ] + " | chpasswd'" )
1557+ SysCommand (f"arch-chroot { self .target } " + sh [:- 1 ] + " | chpasswd'" )
15581558 return True
15591559 except SysCallError :
15601560 return False
@@ -1563,15 +1563,15 @@ def user_set_shell(self, user: str, shell: str) -> bool:
15631563 info (f'Setting shell for { user } to { shell } ' )
15641564
15651565 try :
1566- SysCommand (f"/usr/bin/ arch-chroot { self .target } sh -c \" chsh -s { shell } { user } \" " )
1566+ SysCommand (f"arch-chroot { self .target } sh -c \" chsh -s { shell } { user } \" " )
15671567 return True
15681568 except SysCallError :
15691569 return False
15701570
15711571 def chown (self , owner : str , path : str , options : list [str ] = []) -> bool :
15721572 cleaned_path = path .replace ('\' ' , '\\ \' ' )
15731573 try :
1574- SysCommand (f"/usr/bin/ arch-chroot { self .target } sh -c 'chown { ' ' .join (options )} { owner } { cleaned_path } '" )
1574+ SysCommand (f"arch-chroot { self .target } sh -c 'chown { ' ' .join (options )} { owner } { cleaned_path } '" )
15751575 return True
15761576 except SysCallError :
15771577 return False
@@ -1588,7 +1588,7 @@ def set_keyboard_language(self, language: str) -> bool:
15881588 # Setting an empty keymap first, allows the subsequent call to set layout for both console and x11.
15891589 from .boot import Boot
15901590 with Boot (self ) as session :
1591- os .system ('/usr/bin/ systemd-run --machine=archinstall --pty localectl set-keymap ""' )
1591+ os .system ('systemd-run --machine=archinstall --pty localectl set-keymap ""' )
15921592
15931593 try :
15941594 session .SysCommand (["localectl" , "set-keymap" , language ])
0 commit comments