Do not install any package during installation

This commit is contained in:
Rudra Saraswat 2023-05-08 18:24:11 +05:30
parent 7a6138414c
commit 8df9944284

View file

@ -45,10 +45,6 @@ def exec_chroot(cmd):
exec(chroot_cmd) exec(chroot_cmd)
def install_pkgs(*arg):
exec_chroot(['pacman', '--noconfirm', '-S', *arg])
def enable_service(service): def enable_service(service):
exec_chroot(['systemctl', 'enable', service]) exec_chroot(['systemctl', 'enable', service])
@ -220,33 +216,46 @@ def inst_setup_base(config):
exec_chroot(['bash', '-c', 'echo \'MODULES=""\' > /etc/mkinitcpio.conf']) exec_chroot(['bash', '-c', 'echo \'MODULES=""\' > /etc/mkinitcpio.conf'])
exec_chroot(['bash', '-c', 'echo \'BINARIES=""\' >> /etc/mkinitcpio.conf']) exec_chroot(['bash', '-c', 'echo \'BINARIES=""\' >> /etc/mkinitcpio.conf'])
exec_chroot(['bash', '-c', 'echo \'FILES=""\' >> /etc/mkinitcpio.conf']) exec_chroot(['bash', '-c', 'echo \'FILES=""\' >> /etc/mkinitcpio.conf'])
exec_chroot(['bash', '-c', 'echo \'HOOKS="base udev blend plymouth autodetect modconf block keyboard keymap consolefont filesystems fsck"\' >> /etc/mkinitcpio.conf']) exec_chroot(['bash', '-c', 'echo \'HOOKS="base udev akshara plymouth autodetect modconf block keyboard keymap consolefont filesystems fsck"\' >> /etc/mkinitcpio.conf'])
exec_chroot( exec_chroot(
['bash', '-c', 'echo \'COMPRESSION="zstd"\' >> /etc/mkinitcpio.conf']) ['bash', '-c', 'echo \'COMPRESSION="zstd"\' >> /etc/mkinitcpio.conf'])
# Generate fstab # Generate fstab
exec(['bash', '-c', 'genfstab -U /mnt > /mnt/etc/fstab']) exec(['bash', '-c', 'genfstab -U /mnt > /mnt/etc/fstab'])
# Refresh package lists, pacman-key --init # Refresh package lists, pacman-key --init
exec_chroot(['pacman', '-Syu', '--noconfirm'])
exec_chroot(['pacman-key', '--init']) exec_chroot(['pacman-key', '--init'])
exec_chroot(['pacman-key', '--populate', 'archlinux']) exec_chroot(['pacman-key', '--populate', 'archlinux', 'blend'])
exec_chroot(['pacman-key', '--populate', 'blend']) # Copy kernel
exec_chroot(['pacman-key', '--populate', 'chaotic']) if testing == False:
if config['flatpak']: airootfs_files = [os.path.join(dirpath, filename)
install_pkgs('flatpak') for (dirpath, dirs, files) in os.walk('/run/archiso')
# Install kernel for filename in (dirs + files)]
install_pkgs(config['kernel']) airootfs_kernel = 'none'
# Install binder airootfs_initramfs = 'none'
install_pkgs('linux-headers') airootfs_amd_ucode = 'none'
install_pkgs('binder_linux-dkms') airootfs_intel_ucode = 'none'
for f in airootfs_files:
if os.path.basename(f) == 'vmlinuz-linux-zen':
airootfs_kernel = f
elif os.path.basename(f) == 'initramfs-linux-zen.img':
airootfs_initramfs = f
elif os.path.basename(f) == 'amd-ucode.img':
airootfs_amd_ucode = f
elif os.path.basename(f) == 'intel-ucode.img':
airootfs_intel_ucode = f
if 'none' in (airootfs_kernel, airootfs_initramfs, airootfs_amd_ucode, airootfs_intel_ucode):
print("====================")
print("Failed installation.")
sys.exit(1)
exec(['cp', airootfs_kernel, airootfs_initramfs,
airootfs_amd_ucode, airootfs_intel_ucode, '/mnt/boot'])
else:
exec(['cp', 'airootfs_kernel', 'airootfs_initramfs',
'airootfs_amd_ucode', 'airootfs_intel_ucode', '/mnt/boot'])
# Remove jade-gui and blend-inst # Remove jade-gui and blend-inst
exec_chroot(['pacman', '-Rn', '--noconfirm', 'jade-gui', 'blend-inst-git']) exec_chroot(['pacman', '-Rn', '--noconfirm', 'jade-gui', 'blend-inst-git'])
# Install blendos-first-setup
install_pkgs('blendos-first-setup-git')
def inst_bootloader(config): def inst_bootloader(config):
# Install GRUB
install_pkgs('grub-blend', 'os-prober')
# Install bootloader # Install bootloader
if 'NVIDIA' in subprocess.check_output(['lspci']).decode('utf-8'): if 'NVIDIA' in subprocess.check_output(['lspci']).decode('utf-8'):
exec_chroot( exec_chroot(
@ -258,7 +267,6 @@ def inst_bootloader(config):
exec_chroot( exec_chroot(
['bash', '-c', 'echo -e \'\\nGRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_DEFAULT} splash"\' >> /etc/default/grub']) ['bash', '-c', 'echo -e \'\\nGRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_DEFAULT} splash"\' >> /etc/default/grub'])
if config['bootloader']['type'] == 'grub-efi': if config['bootloader']['type'] == 'grub-efi':
install_pkgs('efibootmgr')
exec_chroot(['grub-install', '--target=x86_64-efi', f'--efi-directory={config["bootloader"]["location"]}', exec_chroot(['grub-install', '--target=x86_64-efi', f'--efi-directory={config["bootloader"]["location"]}',
'--bootloader-id=blend', '--removable']) '--bootloader-id=blend', '--removable'])
exec_chroot(['grub-install', '--target=x86_64-efi', f'--efi-directory={config["bootloader"]["location"]}', exec_chroot(['grub-install', '--target=x86_64-efi', f'--efi-directory={config["bootloader"]["location"]}',
@ -280,9 +288,11 @@ def inst_locale(config):
first_locale = True first_locale = True
for locale in config['locale']['locale']: for locale in config['locale']['locale']:
if locale != 'en_US.UTF-8 UTF-8': if locale != 'en_US.UTF-8 UTF-8':
exec_chroot(['bash', '-c', f'echo \'{locale}\' >> /etc/locale.gen']) exec_chroot(
['bash', '-c', f'echo \'{locale}\' >> /etc/locale.gen'])
if first_locale: if first_locale:
exec_chroot(['bash', '-c', f'echo \'LANG={locale.split()[0]}\' > /etc/locale.conf']) exec_chroot(
['bash', '-c', f'echo \'LANG={locale.split()[0]}\' > /etc/locale.conf'])
first_locale = False first_locale = False
exec_chroot(['locale-gen']) exec_chroot(['locale-gen'])