initial
This commit is contained in:
commit
74ae93a96e
7 changed files with 94691 additions and 0 deletions
351
joplin notion extension/linux/Arch/Installation.md
Normal file
351
joplin notion extension/linux/Arch/Installation.md
Normal file
|
|
@ -0,0 +1,351 @@
|
|||
Installation
|
||||
|
||||
https://wiki.archlinux.org/title/installation_guide
|
||||
offline installation : https://medium.com/@elohash/how-to-install-arch-linux-without-internet-no-pacman-9314836949de
|
||||
|
||||
https://docs345.surge.sh/arch_installation/
|
||||
|
||||
|
||||
This video is used for the following steps: https://www.youtube.com/watch?v=DPLnBPM4DhI
|
||||
https://files.catbox.moe/u3tkye.mp4
|
||||
|
||||
- `iwctl`
|
||||
- https://m.youtube.com/watch?v=3czrHtFHteY
|
||||
`device list`
|
||||
`station wlan0 scan` then `station wlan0 get-networks`
|
||||
then connect to internet using
|
||||
`station <device_name> connect <ssid>`
|
||||
Eg: `station wlan0 connect Comcast-50`
|
||||
and `quit`. then ping it by to check if internet is working
|
||||
`ping x.org`.
|
||||
- Update time with `timedatectl`
|
||||
- Partitioning disk
|
||||
- Check partition using `fdisk -l` or `lsblk` or `cfdisk`
|
||||
- Then `fdisk <partition>`
|
||||
eg: `fdisk /dev/sda`
|
||||
- Type these commands in sequence:
|
||||
`p` to print information
|
||||
`o` to create new label
|
||||
`n` to add new partition. So many prompts will come just press enter to select default.
|
||||
|
||||
- Press `t` and Choose lvm by typing `8E` then type `a` to make partition active.
|
||||
- Finalize change type `w` then enter
|
||||
- Then create physical volume using
|
||||
`pvcreate --dataalignment 1m /dev/sda1`
|
||||
- Now create volume group
|
||||
`vgcreate volgroup0 /dev/sda1` . Here `volgroup0` is a group name.
|
||||
- Now create 2 logical volumes ie lv_root and lv_home
|
||||
`lvcreate -L 30GB volgroup0 -n lv_root`
|
||||
and
|
||||
`lvcreate -l 100%FREE volgroup0 -n lv_home`
|
||||
- Load new volume group into memory
|
||||
`modprobe dm_mod`
|
||||
- Scan system for volume groups
|
||||
`vgscan` and activate it
|
||||
`vgchange -ay`
|
||||
- Formatting volumes
|
||||
- Now format these parttions. For root one , format it with ext4 and for swap one format with swap
|
||||
Ext4 formatting
|
||||
`mkfs.ext4 /dev/volgroup0/lv_root`
|
||||
Mounting
|
||||
`mount /dev/volgroup0/lv_root /mnt`
|
||||
|
||||
Now format 2nd logical volume and mount it
|
||||
`mkfs.ext4 /dev/volgroup0/lv_home`
|
||||
Mounting
|
||||
`mkdir /mnt/home`
|
||||
`mount /dev/volgroup0/lv_home /mnt/home`
|
||||
|
||||
If there r swap partitions then
|
||||
Format the Swap Partition (if created): If you created a swap partition, format it as swap:
|
||||
`mkswap /dev/sdX2` # Replace /dev/sdX2 with your swap partition
|
||||
`swapon /dev/sdX2` # Activate the swap partition
|
||||
|
||||
`mkdir /mnt/etc`
|
||||
Saving partition layout by:
|
||||
`genfstab -U -p /mnt >> /mnt/etc/fstab`
|
||||
|
||||
|
||||
- For UEFI
|
||||
Difference here is that we need to create efi partition
|
||||
After typing `fdisk /dev/sda` type these commands:
|
||||
`p` and `g`(for new GPT) , `n` then
|
||||
- Partition number and First sector is default but for last sector we need to change it So type `+500M` as 500mb is enough for efi
|
||||
|
||||
Now type `t` and and partition type is `1` which means efi
|
||||
- Now one more partition for rest
|
||||
So type `n` and just select defaults and set the type with `t` and set to lvm
|
||||
- Partition number would be 2 which is default
|
||||
- Type `30` for lvm
|
||||
- Finally verify it by `p` and type `w` to make changes
|
||||
|
||||
For parttion 1 ie efi , it have to be formatted with fat32
|
||||
`mkfs.fat -F32 /dev/sda1`
|
||||
Here `-F32` represents fat32
|
||||
Now instead of creating and volume and setting other steps for lvm use sda2 instead of sda1 .
|
||||
|
||||
- For UEFI with encryption
|
||||
|
||||
|
||||

|
||||
this should be. 1st to efi,2nd to linux filesystem and 3rd to linux lvm
|
||||
|
||||
Do same for efi and set ext4 for partition 2 but before formatting 4rd we need to encrypt it
|
||||
- Setting encryption
|
||||
`cryptsetup luksFormat /dev/sda3`
|
||||
Now u need to type passphrase. This passphrase should be available else all data will remain encrypted and inaccessible. After typing passphrase it will get locked so type
|
||||
`cryptsetup open --type luks /dev/sda3 lvm`
|
||||
|
||||
Now just create volume , format and mount
|
||||
`pvcreate --dataalignment 1m /dev/mapper/lvm`
|
||||
|
||||
- Installing components
|
||||
- Using pacstrap command
|
||||
`pacstrap -i /mnt base`
|
||||
There mey be a error related to keyring hell so to fix it use
|
||||
https://wiki.archlinux.org/title/Pacman/Package_signing#Resetting_all_the_keys
|
||||
In `/etc/pacman.conf`
|
||||
```text
|
||||
SigLevel = Never
|
||||
#LocalFileSigLevel = Optional
|
||||
#RemoteFileSigLevel = Required
|
||||
```
|
||||
|
||||
- Configure our installation
|
||||
`arch-chroot /mnt` Using in chroot environment. arch-chroot is like a fake-root which change to new directory so that u can make changes af if they r live but all those changes will take place in future.
|
||||
- Inside chroot, install 4 packages ie linux, linux-headers and linux-lts, linux-lts-headers. 2 versions bcz if one dont work then other may work. lts means here 'long term support' hence stable. Use
|
||||
`pacman -S linux linux-headers linux-lts linux-lts-headers linux-firmware`
|
||||
Then few more packages like nano, base-devel(basic development tools), openssh(remote access)
|
||||
To use openssh make sure to enable sshd
|
||||
`systemctl enable sshd`
|
||||
|
||||
Install packages for network working
|
||||
`pacman -S networkmanager wpa_supplicant wireless_tools netctl`
|
||||
|
||||
installing dialog if gui network interface not working
|
||||
`pacman -S dialog`
|
||||
Then finally enable NetworkManager so it will be started when booted
|
||||
`systemctl enable NetworkManager`
|
||||
|
||||
Installing lvm support
|
||||
`pacman -S lvm2`
|
||||
|
||||
To ensure boot process support our configuration, we have to modify a config file
|
||||
`nano /etc/mkinitcpio.conf`
|
||||
now using Ctrl+W find the `HOOKS` which is not commented. Between block and filesystems word,
|
||||
add `lvm2` . if used encryption then add `encrypt lvm2`.
|
||||
|
||||
|
||||
- Resizing partition
|
||||
`lvdisplay` and `vgdisplay`
|
||||
|
||||
Shrink LV
|
||||
If something goes wrong with length of partition then u need to resize it
|
||||
`umount /dev/VG_NAME/lv_home` # Unmount the LV (replace VG_NAME with your volume group)
|
||||
`e2fsck -f /dev/volgroup0/lv_home` # to check file system consistency and check for errors,bad block.
|
||||
`resize2fs /dev/VG_NAME/lv_home NEW_SIZE` # Shrink the filesystem
|
||||
`lvreduce -L NEW_SIZE /dev/VG_NAME/lv_home` # Shrink the logical volume
|
||||
|
||||
Extend LV
|
||||
`lvextend -L +NEW_SIZE /dev/VG_NAME/lv_root` # Extend the logical volume
|
||||
or
|
||||
`lvextend -l +100%FREE /dev/VG_NAME/lv_root`
|
||||
`e2fsck -f /dev/volgroup0/lv_root`
|
||||
`resize2fs /dev/VG_NAME/lv_root` # Resize the filesystem to use the new space
|
||||
|
||||
- Initramfs
|
||||
To take all these setups and option take effect use this
|
||||
`mkinitcpio -p linux`
|
||||
`mkinitcpio -p linux-lts`(As this was also installed)
|
||||
Then set the locale by
|
||||
`nano /etc/locale.gen`
|
||||
Then choose en us and uncomment it
|
||||
`locale-gen`
|
||||
|
||||
Updating password
|
||||
`passwd` then type password to set it
|
||||
|
||||
Creating standard user
|
||||
`useradd -m -g users -G wheel hvm`
|
||||
`-m` means creating home directory for the user, `-g` represents initial login group, `-G` are other supplementary groups. `hvm` is user name.
|
||||
Then set password for this user
|
||||
`passwd hvm` and set password.
|
||||
After this we dont have to use root account always, instead we can use sudo
|
||||
|
||||
Now we need to associate wheel group with sudo
|
||||
`EDITOR=nano visudo`
|
||||
`visudo` is a dedicated command to modify sudo priviledges
|
||||
Scroll down and search for `%wheel ALL=(ALL:ALL) ALL` and uncomment it and save the file.
|
||||
Now user can use sudo to run administrative task.
|
||||
|
||||
- Installing GRUB
|
||||
Its purpose is to boot the OS without bootable media like USB or CD.
|
||||
- For non-UEFI(BIOS)
|
||||
Install this:
|
||||
`pacman -S grub dosfstools os-prober mtools`
|
||||
and finally
|
||||
`grub-install --target=i386-pc --recheck /dev/sda`
|
||||
|
||||
- For UEFI install these
|
||||
`pacman -S grub efibootmgr dosfstools os-prober mtools`
|
||||
|
||||
`mkdir /boot/EFI`
|
||||
`mount /dev/sda1 /boot/EFI`
|
||||
and finally
|
||||
`grub-install --target=x86_64-efi --bootloader-id=grub_uefi --recheck`
|
||||
|
||||
Check if grub exists by this:
|
||||
`ls -l /boot/grub`
|
||||
|
||||
- Others
|
||||
`cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo`
|
||||
- With encryption
|
||||
`nano /etc.default/grub` then uncomment `GRUB_ENABLE_CRYPTODISK=y`
|
||||
and edit the line
|
||||
#add this GRUB_CMDLINE_LINUX_DEFAULT="cryptodevice=/dev/sda3:volgroup0:allow-discards loglevel=3 quiet"
|
||||
|
||||
- Generate grub config file
|
||||
`grub-mkconfig -o /boot/grub/grub.cfg`
|
||||
Finally
|
||||
`exit` and `umount -a` (to unmount everything)
|
||||
Finally `reboot`
|
||||
|
||||
### Post install tweeks
|
||||
- Creating swap file(not partition)
|
||||
`su`
|
||||
`cd /root`
|
||||
The dd command in Linux is a versatile utility used for copying and converting files, including data from files, devices, partitions, or even raw disk images. The command's name, "dd," stands for "data duplicator."
|
||||
`dd if=/dev/zero of=/swapfile bs=1M count=1024 status=progress`
|
||||
Changing permissions of swapfile
|
||||
`chmod 600 /swapfile`
|
||||
Formatting it to swap
|
||||
`mkswap /swapfile`
|
||||
Backing up copy of fstab file as we going to edit it
|
||||
`cp /etc/fstab /etc/fstab.bak`
|
||||
Editing it
|
||||
`echo '/swapfile none swap sw 0 0' | tee -a /etc/fstab`
|
||||
It will add the line
|
||||
|
||||
`free -m` to check is swap is there
|
||||
`mount -a`(if it runs means no error)
|
||||
|
||||
To activate swap
|
||||
`swapon -a` and check it with `free -m`
|
||||
|
||||
- Setting time zone
|
||||
Listing it
|
||||
`timedatectl list-timezones`
|
||||
Setting it
|
||||
`timedatectl set-timezone <from_list>`
|
||||
Enabling it
|
||||
`systemctl enable systemd-timesyncd`
|
||||
|
||||
Setting host name
|
||||
`hostnamectl set-hostname archhost` here 'archhost' is host name
|
||||
Editing hosts file
|
||||
`nano /etc/hosts`
|
||||
and add
|
||||
```
|
||||
127.0.0.1 localhost
|
||||
127.0.1.1 archhost
|
||||
```
|
||||
and save it
|
||||
To check it
|
||||
`hostnamectl`
|
||||
This image will be the output
|
||||
|
||||
|
||||

|
||||
|
||||
**Installing micro code for CPU**(optional)
|
||||
AMD CPU
|
||||
`pacman -S amd-ucode`
|
||||
or
|
||||
Intel CPU
|
||||
`pacman -S intel-ucode`
|
||||
|
||||
- **GUI**
|
||||
- Installing xorg
|
||||
`pacman -S xorg-server`
|
||||
- Installing video driver
|
||||
For Intel or AMD GPU
|
||||
`pacman -S mesa`
|
||||
For NVIDIA GPU
|
||||
`pacman -S nvidia-lts nvidia`
|
||||
For VBox
|
||||
`pacman -S virtualbox-guest-utils xf86-video-vmware`
|
||||
and enable vbox extension
|
||||
`systemctl enable vboxservice`
|
||||
For QEMU, this might improve performance
|
||||
`sudo pacman -S xf86-video-qxl
|
||||
`
|
||||
And configure it too
|
||||
`sudo mkdir -p /etc/X11/xorg.conf.d`
|
||||
`sudo nano /etc/X11/xorg.conf.d/20-qxl.conf
|
||||
`
|
||||
Type this
|
||||
```
|
||||
Section "Device"
|
||||
Identifier "qxl"
|
||||
Driver "qxl"
|
||||
Option "AccelMethod" "glamor"
|
||||
EndSection
|
||||
|
||||
```
|
||||
and save it
|
||||
|
||||
|
||||
- Installing Desktop Environment
|
||||
- GNOME
|
||||
`pacman -S GNOME`
|
||||
it will store many dependencies as its a package group
|
||||
Some other optional
|
||||
`pacman -S gnome-tweaks` this will give more control over the environment
|
||||
|
||||
Enable display manager
|
||||
`systemctl enable gdm`
|
||||
This will enable login screen
|
||||
Specify the language in Region and Language section else terminal wont open
|
||||
- Plasma
|
||||
`pacman -S plasma-meta kde-applications`
|
||||
Enable display manager
|
||||
`systemctl enable sddm`
|
||||
- Xfce
|
||||
`pacman -S xfce4 xfce4-goodies`
|
||||
Install display manager
|
||||
`pacman -S lightdm lightdm-gtk-greeter`
|
||||
Enabling it
|
||||
`systemctl enable lightdm`
|
||||
- Packages in xfce
|
||||
: There are 15 members in group xfce4:
|
||||
:: Repository extra
|
||||
```
|
||||
1) exo 2) garcon 3) thunar 4) thunar-volman 5) tumbler
|
||||
6) xfce4-appfinder 7) xfce4-panel 8) xfce4-power-manager 9) xfce4-session
|
||||
10) xfce4-settings 11) xfce4-terminal 12) xfconf 13) xfdesktop 14) xfwm4
|
||||
15) xfwm4-themes
|
||||
Enter a selection (default=all):
|
||||
:: There are 36 members in group xfce4-goodies:
|
||||
:: Repository extra
|
||||
|
||||
1) mousepad 2) parole 3) ristretto 4) thunar-archive-plugin
|
||||
5) thunar-media-tags-plugin 6) xfburn 7) xfce4-artwork
|
||||
8) xfce4-battery-plugin 9) xfce4-clipman-plugin 10) xfce4-cpufreq-plugin
|
||||
11) xfce4-cpugraph-plugin 12) xfce4-dict 13) xfce4-diskperf-plugin
|
||||
14) xfce4-eyes-plugin 15) xfce4-fsguard-plugin 16) xfce4-genmon-plugin
|
||||
17) xfce4-mailwatch-plugin 18) xfce4-mount-plugin 19) xfce4-mpc-plugin
|
||||
20) xfce4-netload-plugin 21) xfce4-notes-plugin 22) xfce4-notifyd
|
||||
23) xfce4-pulseaudio-plugin 24) xfce4-screensaver 25) xfce4-screenshooter
|
||||
26) xfce4-sensors-plugin 27) xfce4-smartbookmark-plugin
|
||||
28) xfce4-systemload-plugin 29) xfce4-taskmanager
|
||||
30) xfce4-time-out-plugin 31) xfce4-timer-plugin 32) xfce4-verve-plugin
|
||||
33) xfce4-wavelan-plugin 34) xfce4-weather-plugin
|
||||
35) xfce4-whiskermenu-plugin 36) xfce4-xkb-plugin
|
||||
```
|
||||
|
||||
as
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
35
joplin notion extension/linux/Arch/Issues and VM.md
Normal file
35
joplin notion extension/linux/Arch/Issues and VM.md
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
Issues and VM
|
||||
|
||||
- GUI not working and get stuck
|
||||
go to other tty using `Ctrl+alt+F2` or `Ctrl+alt+F3`.... and access the shell and undo changes which caused such issue
|
||||
- Stuck with low resolution
|
||||
With virtio as graphic driver, change resolution is display settings of guest os itself
|
||||
- Screen tearing
|
||||
Try 3 cases
|
||||
1. Enable 3d acceleration in 'video virtio' section which can be found in view and change console to details
|
||||
2. Enable opengl which in 'display splice'
|
||||
3. Do both
|
||||
|
||||
- Enable Clipboard sharing
|
||||
1. Make sure splice protocol is enabled
|
||||
2. Install `splice-vdagent` via pacman.
|
||||
3. Reboot it
|
||||
|
||||
- Enable File sharing
|
||||
https://www.debugpoint.com/share-folder-virt-manager/
|
||||
1. In Details section of current VM go to 'Add Hardware' and add filesystem with source path like `home/user/shared` and target path `shared`. Here shared is random name to be used later for mount. Make sure `vitiofs` is there as driver
|
||||
2. Then restart VM and make any specific directory like `home/user/shared` and make it as mount point by following command
|
||||
`sudo mount -t virtiofs shared /home/hvm/shared`
|
||||
|
||||
- video driver not working
|
||||
it may be possible that we forget to install linux firmware or video driver is missing so we can use `nomodeset` to atleast have access to cli. When in grub navigate to arch linux, dont click enter, type `e` there and at end of line starting with linux add `nomodeset` after word `quiet`.
|
||||
- Wifi Manager not available
|
||||
`sudo pacman -Sy network-manager-applet`
|
||||
- package repo out of date
|
||||
Neither
|
||||
Your database is outdated and has a link to an old version
|
||||
the mirror doesn't cache every old version
|
||||
if you want to do that you can set up your own mirror that just doesn't delete any packages lol
|
||||

|
||||
u can use this
|
||||
https://archive.archlinux.org to download old packages
|
||||
28
joplin notion extension/linux/Arch/connect wifi.md
Normal file
28
joplin notion extension/linux/Arch/connect wifi.md
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
connect wifi
|
||||
|
||||
https://www.makeuseof.com/connect-to-wifi-with-nmcli/
|
||||
https://wiki.archlinux.org/title/Network_configuration/Wireless
|
||||
|
||||
- Check network status by
|
||||
`nmcli dev status`
|
||||
- Also make sure that services NetworkManager,wpa_supplicant is started and enabled
|
||||
`sudo systemctl enable --now NetworkManager`
|
||||
- Check if wifi is enabled or not by
|
||||
`nmcli radio wifi`. if not enabled then type `nmcli radio wifi on` .
|
||||
- Check available wifi networks using
|
||||
`nmcli dev wifi list`
|
||||
- Connecting to specific network
|
||||
To connect with no password
|
||||
`sudo nmcli dev wifi connect network-ssid`
|
||||
Eg: `sudo nmcli dev wifi connect fiber-2`
|
||||
To connect with password
|
||||
`sudo nmcli dev wifi connect network-ssid password <password>`
|
||||
Eg : if password is pass then
|
||||
`sudo nmcli dev wifi connect network-ssid password pass`
|
||||
For interactive password typing ie taking input in order to hide it
|
||||
`sudo nmcli --ask dev wifi connect network-ssid`
|
||||
|
||||
- View saved connections
|
||||
`nmcli con show`
|
||||
- Connect another saved connection
|
||||
`nmcli con up ssid/uuid`
|
||||
60
joplin notion extension/linux/Arch/grub.md
Normal file
60
joplin notion extension/linux/Arch/grub.md
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
grub
|
||||
|
||||
old hp
|
||||
Partition name: archcraft │
|
||||
│ Partition UUID: 29EF9697-4189-48F2-830A-2A4DCC8AEE40 │
|
||||
│ Partition type: Linux filesystem (0FC63DAF-8483-4772-8E79-3
|
||||
|
||||
Partition UUID: 67570847-3D7F-421F-9C04-13BBE306F866 │
|
||||
│ Partition type: Linux swap (0657FD6D-A4AB-43C4-84E5-0933C84B4F4F) │
|
||||
│Filesystem UUID: 0c9b4784-84b0-437a-b50a-8544cc569e18 │
|
||||
└─────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
Ubuntu
|
||||
Partition UUID: 945D0C81-1B6A-42F7-B517-6FD37E8EA9DA │
|
||||
│ Partition type: Linux filesystem (0FC63DAF-8483-4772-8E79-3D69D8477DE4) │
|
||||
│Filesystem UUID: eee3ebe8-2bcc-43c1-b8db-5e627635417b
|
||||
|
||||
|
||||
Arch
|
||||
Partition UUID: C604A90F-30C0-4C55-933C-FF51320B83EC │
|
||||
│ Partition type: Linux root (x86) (44479540-F297-41B2-9AF7-D131D5F0458A) │
|
||||
│Filesystem UUID: b0425c17-5b5e-49cf-bbbc-f2d959fac780
|
||||
|
||||
|
||||
|
||||
Learning:
|
||||
|
||||
- add distro to grub
|
||||
https://www.youtube.com/watch?v=okYxL7f1VYs
|
||||
make sure that os-prober is enabled in `/etc/default/grub`
|
||||
uncomment following line yo enable it
|
||||
`GRUB_DISABLE_OS_PROBER=false`
|
||||
Now run `sudo os-prober`
|
||||
it will list other distro but not the current one. Make sire that other distros are mounted
|
||||
finally use
|
||||
`sudo grub-mkconfig -o /boot/grub/grub/cfg` to update grub menu
|
||||
|
||||
|
||||
|
||||
- remove systemd-boot
|
||||
`bootctl remove`
|
||||
|
||||
|
||||
- `lsblk -o name,type,uuid`
|
||||
https://www.reddit.com/r/archlinux/comments/tqzodn/other_distros_not_detect_after_fresh_installation/
|
||||
manual way
|
||||
```
|
||||
menuentry "Ubuntu" {
|
||||
# assuming that UUID is 763A-9CB6
|
||||
search --no-floppy --set=root --fs-uuid eee3ebe8-2bcc-43c1-b8db-5e627635417b
|
||||
|
||||
# search by label OTHER_LINUX (make sure that partition label is unambiguous)
|
||||
#search --no-floppy --set=root --label OTHER_LINUX
|
||||
|
||||
linux /boot/vmlinuz root=UUID=eee3ebe8-2bcc-43c1-b8db-5e627635417b
|
||||
#initrd /boot/initrd.img (if the other kernel uses/needs one)
|
||||
initrd /boot/amd-ucode.img /boot/initramfs-linux-lts.img
|
||||
}
|
||||
```
|
||||
|
|
@ -0,0 +1,136 @@
|
|||
offline installation of arch
|
||||
To bundle packages in an Arch ISO file, modify pacstrap to install packages from the bundled version of the ISO rather than the Arch repositories, and to run a script that is also bundled in the ISO, you'll need to follow several steps. This process involves creating a custom Arch Linux ISO that includes your desired packages and scripts, then modifying the installation scripts to use these bundled resources. Below is an outline of how you can achieve this. Keep in mind, this is a high-level overview and certain steps might require deeper knowledge of Arch Linux, bash scripting, and the inner workings of the Arch ISO.
|
||||
|
||||
### Step 1: Download the Arch ISO
|
||||
|
||||
Download the latest Arch ISO from the official Arch Linux website.
|
||||
|
||||
### Step 2: Extract the ISO
|
||||
|
||||
Mount the ISO to a directory or extract its contents using tools like `7z` or `bsdtar` to a working directory.
|
||||
|
||||
```bash
|
||||
mkdir archiso
|
||||
bsdtar -xpf archlinux.iso -C archiso
|
||||
```
|
||||
|
||||
### Step 3: Customize the AIROOTFS (Arch ISO Root File System)
|
||||
|
||||
This section includes adding your packages and scripts.
|
||||
|
||||
#### Adding Packages:
|
||||
1. Custom packages that are not in the official repositories (or any AUR packages) should be built into `.pkg.tar.zst` files.
|
||||
2. Copy these package files into the `archiso/airootfs/root/` directory (or a subdirectory). This way, they will be available on the live filesystem.
|
||||
|
||||
#### Adding Scripts:
|
||||
1. Write your custom script that performs the desired tasks (e.g., post-installation setup).
|
||||
2. Add this script to the `archiso/airootfs/root/` directory so that you can run it after booting into your custom ISO.
|
||||
|
||||
### Step 4: Modify Pacstrap (Optional)
|
||||
|
||||
Modifying `pacstrap` itself might not be necessary. Instead, consider using a script to manually install the packages using `pacman -U` command from your bundled packages:
|
||||
|
||||
1. Inside your custom script added in the previous step, navigate to where you've stored your packages (e.g., `/root/your_packages/`).
|
||||
2. Install them using `pacman -U /path/to/package.pkg.tar.zst`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Customizing an Arch Linux ISO to include additional packages and modify the `pacstrap` script can be quite involved but entirely feasible. To add packages directly into your ISO and change how `pacstrap` operates to install these packages, you'll need to work with the Arch ISO build system and the `airootfs` (Arch ISO root filesystem) environment. Moreover, to run a custom script bundled in the ISO, you'll need to modify the system's startup process.
|
||||
|
||||
Here are the broad steps you'd follow to achieve your goals:
|
||||
|
||||
### 1. Prepare the Environment
|
||||
|
||||
First, ensure you have all the necessary tools and dependencies. You'll need the `archiso` package, which gives you the tools to create custom live CDs.
|
||||
|
||||
```bash
|
||||
sudo pacman -S archiso
|
||||
```
|
||||
|
||||
### 2. Create Your Working Directory
|
||||
|
||||
Copy the `archiso` profile to create your own customizable profile.
|
||||
|
||||
```bash
|
||||
cp -r /usr/share/archiso/configs/releng/ ~/customiso
|
||||
cd ~/customiso
|
||||
```
|
||||
|
||||
### 3. Bundle Packages
|
||||
|
||||
To add packages directly to the ISO, modify the `packages.x86_64` file located in your custom ISO directory. Just add the names of the packages you wish to include. Note that these packages must be available in the regular Arch repositories or on your custom repository.
|
||||
|
||||
### 4. Modify the Pacstrap Script
|
||||
|
||||
The `pacstrap` script is part of the `arch-install-scripts` package, and it's not directly included in your ISO. `pacstrap` pulls packages from the official repositories during system installation. To change this functionality, you have several options:
|
||||
|
||||
- **Pre-install Packages**: Instead of modifying `pacstrap`, you could pre-install your desired packages into the `airootfs` root file system using the `mkarchiso` command. You can do this by specifying additional packages in the `packages.x86_64` file, as mentioned before, and they'll be installed when you build your ISO.
|
||||
|
||||
- If you insist on modifying `pacstrap` behavior, consider this: When `pacstrap` is run in the Arch ISO environment, it's actually pulling from the live environment (including any modifications you've made). If you want `pacstrap` to pull packages from a specific source, such as packages bundled within the ISO, you would likely need to create a local repository within your ISO and modify the `pacstrap` script (or a custom script called from `airootfs/root/.automated_script.sh`) to prioritize or exclusively use this repository.
|
||||
|
||||
### 5. Include and Run a Custom Script
|
||||
|
||||
To run a custom script from the ISO:
|
||||
|
||||
1. **Place Your Script**: Put your custom script in the `airootfs/root/` directory of your custom ISO project. This ensures it is part of the filesystem that is built into the ISO.
|
||||
|
||||
2. **Autostart Your Script**: Modify the `airootfs/root/customize_airootfs.sh` file to call your script upon boot. This script runs as the last step of the ISO customization process.
|
||||
|
||||
```bash
|
||||
echo "/root/mycustomscript.sh" >> airootfs/root/.zlogin
|
||||
```
|
||||
|
||||
Or, directly invoke your script from `airootfs/root/.automated_script.sh` if you are aiming for an automated installation.
|
||||
|
||||
### 6. Build Your ISO
|
||||
|
||||
Follow the `archiso` instructions to build your ISO. This typically involves running the `mkarchiso` command in your custom ISO directory.
|
||||
|
||||
```bash
|
||||
sudo mkarchiso -v ~/customiso
|
||||
```
|
||||
|
||||
### Final Notes
|
||||
|
||||
- **Handling Repositories**: Bundling packages inside the ISO for `pacstrap` to use is unconventional. Instead, consider either pre-installing packages or setting up a local repository within your ISO and having `pacstrap` use it. Handling dependencies correctly is crucial here.
|
||||
- **Testing**: Always test your custom ISO in a safe environment (like a VM) before using it in a production context.
|
||||
- **Custom `pacstrap` Logic**: If you modify how `pacstrap` operates (e.g., to use a local repository), you might need to also ensure that the mirrorlist or `pacman` configuration used respects this customization.
|
||||
- **Resolution**: Depending on your precise use case (specific packages or scripts execution), there might be simpler or more straightforward approaches to achieving your goals, such as scripting post-install actions instead of deeply customizing the install process.
|
||||
|
||||
Customizing Arch Linux and automating installations can be a powerful way to create a tailored environment, but it requires careful planning and testing to ensure system stability and security.
|
||||
|
||||
|
||||
|
||||
```bash
|
||||
# 1. Prepare your packages
|
||||
# Download packages or use pacman to download them along with dependencies
|
||||
|
||||
# 2. Create a custom repository
|
||||
# Create a directory to store your packages
|
||||
mkdir custom_repo
|
||||
# Add packages to your custom repository
|
||||
repo-add custom_repo/custom.db.tar.gz <package1>.pkg.tar.zst <package2>.pkg.tar.zst ...
|
||||
|
||||
# 3. Modify the Arch Linux ISO
|
||||
# Extract the Arch Linux ISO
|
||||
mkdir arch_iso
|
||||
bsdtar -xf archlinux.iso -C arch_iso
|
||||
# Add your custom repository to the Arch Linux ISO
|
||||
cp -r custom_repo arch_iso
|
||||
|
||||
# 4. Modify pacstrap
|
||||
# Edit the pacstrap script in the arch_iso directory to use your custom repository
|
||||
|
||||
# 5. Create a script
|
||||
# Create your script and make it executable
|
||||
chmod +x your_script.sh
|
||||
|
||||
# 6. Bundle everything into a new ISO
|
||||
# Create a new ISO with your modifications
|
||||
xorriso -as mkisofs -iso-level 3 -full-iso9660-filenames -volid "Custom Arch Linux" -o custom_archlinux.iso arch_iso
|
||||
|
||||
# Clean up temporary files if necessary
|
||||
|
||||
```
|
||||
|
|
@ -0,0 +1,266 @@
|
|||
sway compositor installation
|
||||
https://wiki.garudalinux.org/en/sway-cheatsheet
|
||||
|
||||
Make sure to have these list of tools that are alternative of x11 ones
|
||||
https://soyuka.me/make-screen-sharing-wayland-sway-work/
|
||||
|
||||
todo
|
||||
- network stats on waybar
|
||||
- sleep/power button
|
||||
- wifi manager
|
||||
|
||||
|
||||
- Installing packages
|
||||
sudo pacman -S sway swaybg foot polkit
|
||||
- Type `sway` after opening it with `Super + Enter`
|
||||
- Fixing resolution
|
||||
First copy the config of sway to config of user directroy
|
||||
```bash
|
||||
mkdir -p ~/.config/sway
|
||||
cp /etc/sway/config ~/.config/sway/
|
||||
$EDITOR ~/.config/sway/config
|
||||
```
|
||||
In order to get device name and other availableresolutions and info type
|
||||
`swaymsg -t get_outputs`
|
||||
Then enabling it with
|
||||
`output HDMI-A-1 mode 1920x1080@60Hz`
|
||||
|
||||
|
||||
### more shotcuts
|
||||
for tabbed mode : mod+D
|
||||
launcher : mod + d
|
||||
to escape tabbed mode : mod + e
|
||||
for fullscreen : mod+f
|
||||
closing focused wndow : mod+shift+q
|
||||
|
||||
to make current window appear on top of others : mod+shift+space
|
||||
and then switch between floating and tiling window : mod + space
|
||||
to change size of floating window : mod + drag with right click (resize mode need to be enabled with win + r to move or resize)
|
||||
- config files
|
||||
main config file is in `/etc/sway` which can be copied to `~/.config` for customization
|
||||
and to load this changed config
|
||||
`swaymsg reload`
|
||||
- to kill kde session use
|
||||
`qdbus org.kde.ksmserver /KSMServer logout 0 0 0`
|
||||
`loginctl terminate-session`
|
||||
`qdbus org.kde.KWin /Session org.kde.KWin.Session.quit `
|
||||
- about audio
|
||||
`pavucontrol` is important for audio output and configuration
|
||||
```sh
|
||||
systemctl --user status pipewire
|
||||
systemctl --user status pipewire-pulse
|
||||
# Sometimes, you may also need:
|
||||
systemctl --user status wireplumber
|
||||
```
|
||||
These are necessary for audio
|
||||
for inspecting
|
||||
```sh
|
||||
pactl list short sinks
|
||||
pactl list short sources
|
||||
```
|
||||
- configuting volume
|
||||
```txt
|
||||
# in config file
|
||||
# Increase volume
|
||||
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%
|
||||
|
||||
# Decrease volume
|
||||
bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%
|
||||
|
||||
# Mute/unmute volume
|
||||
bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
|
||||
```
|
||||
if using alsa then
|
||||
```txt
|
||||
# Increase volume
|
||||
bindsym XF86AudioRaiseVolume exec amixer set Master 5%+
|
||||
|
||||
# Decrease volume
|
||||
bindsym XF86AudioLowerVolume exec amixer set Master 5%-
|
||||
|
||||
# Mute/unmute volume
|
||||
bindsym XF86AudioMute exec amixer set Master toggle
|
||||
```
|
||||
- waybar
|
||||
it a tray at top which display stats like ram used, volume, brightness and all
|
||||
download it with `yay -S waybar` and start waybar in terminal
|
||||
Also install `ttf-font-awesome` for icons
|
||||
- brighness(2 ways)
|
||||
- install `light` then
|
||||
```yaml
|
||||
# Increase brightness
|
||||
bindsym XF86MonBrightnessUp exec light -A 10
|
||||
|
||||
# Decrease brightness
|
||||
bindsym XF86MonBrightnessDown exec light -U 10
|
||||
```
|
||||
or
|
||||
- install `brightnessctl` then
|
||||
```yaml
|
||||
# Increase brightness
|
||||
bindsym XF86MonBrightnessUp exec brightnessctl set +10%
|
||||
|
||||
# Decrease brightness
|
||||
bindsym XF86MonBrightnessDown exec brightnessctl set 10%-
|
||||
```
|
||||
|
||||
- Touchpad configurations
|
||||
- Make sure `libinput` is installed
|
||||
- list devices too see device name and find device name of touchpad
|
||||
`libinput list-devices` eg : `1267:12448:ELAN0708:00_04F3:30A0_Touchpad`
|
||||
if identifier property isnt there then use
|
||||
`swaymsg -rt get_inputs`
|
||||
- type this in config
|
||||
```yaml
|
||||
# input "your-device-name"
|
||||
input "1267:12448:ELAN0708:00_04F3:30A0_Touchpad" {
|
||||
# Enable natural (reverse) scrolling
|
||||
natural_scroll enabled
|
||||
|
||||
# Enable tap to click
|
||||
tap enabled
|
||||
}
|
||||
```
|
||||
Instead of `input <DEVICE_IDENTIFIER>` this can can be used to `input type:touchpad`
|
||||
|
||||
|
||||
**Clipboard manager**
|
||||
- make sure wofi is installed and so is wl-clipboard is installed
|
||||
- Create this script
|
||||
```bash
|
||||
#!/bin/bash
|
||||
HISTFILE=~/.clipboard_history
|
||||
|
||||
# Check and create history file if it doesn't exist
|
||||
if [ ! -f $HISTFILE ]; then
|
||||
touch $HISTFILE
|
||||
fi
|
||||
|
||||
# Append new clipboard items to the history
|
||||
wl-paste -n | tee -a $HISTFILE
|
||||
|
||||
# Display history using wofi and copy the selection back
|
||||
selection=$(sort -u $HISTFILE | wofi --show=dmenu)
|
||||
[[ -n "$selection" ]] && echo -n "$selection" | wl-copy
|
||||
```
|
||||
- Bind this with key mod+d
|
||||
`chmod +x ~/scripts/clipboard_history.sh`
|
||||
- Alternatively use copyq
|
||||
|
||||
|
||||
Screenshot
|
||||
- Make sure grimshot and swappy is installed. This command is used to take screenshot
|
||||
`grimshot save area - | swappy -f -`
|
||||
or
|
||||
`grim -g "$(slurp)" - | swappy -f -`
|
||||
- Then add this in config
|
||||
`bindsym $mod+p exec grimshot save area - | swappy -f -`
|
||||
|
||||
|
||||
Network stats
|
||||
- we need to setup a toolkit it involvfes making changes into config so copy its default config from `/etc/xdg/wayland` to `~/.config/wayland`
|
||||
- In `config.jsonc`, make sure to have following in network module
|
||||
```json
|
||||
"network": {
|
||||
// "interface": "wlp2*", // (Optional) To force the use of this interface
|
||||
"format-wifi": "{essid} ({signalStrength}%) ",
|
||||
"format-ethernet": "{ipaddr}/{cidr} ",
|
||||
"tooltip-format": "{ifname} via {gwaddr} ",
|
||||
"format-linked": "{ifname} (No IP) ",
|
||||
"format-disconnected": "Disconnected ⚠",
|
||||
"format-alt": "{ifname}: {ipaddr}/{cidr}",
|
||||
//"format-alt": "{icon} {ifname}: {ipaddr}/{cidr}", // overridden by on-click below (click also toggles format/format-alt)
|
||||
"tooltip-format": "{ifname}\t{ipaddr}/{cidr}\ngateway\t{gwaddr}",
|
||||
"tooltip-format": "{ifname}\t{ipaddr}/{cidr}\ngateway\t{gwaddr}\n\t{essid}\n{icon} ⇣{bandwidthDownBytes} ⇡{bandwidthUpBytes}",
|
||||
"interval" : 2
|
||||
|
||||
},
|
||||
```
|
||||
- then restart waybar
|
||||
|
||||
|
||||
Automatic sleep
|
||||
- main command for sleep is `systemctl suspend`
|
||||
https://askubuntu.com/questions/885936/how-to-properly-suspend-via-command
|
||||
- command for automatic sleep after interval of time
|
||||
`swayidle -w timeout 10 'systemctl suspend'` this will start a daemon
|
||||
means if left idle for 10s system will sleep
|
||||
|
||||
|
||||
obs studio (screen recording)
|
||||
https://www.reddit.com/r/swaywm/comments/w6gca6/comment/ihh86vj/
|
||||
- install `v4l2loopback` and restart your system
|
||||
- wf-recorder can also do screen recording
|
||||
for specific section of screen use this?
|
||||
`wf-recorder -a -g "$(slurp)" -f filename.mp4`
|
||||
`-a` : audio flag
|
||||
also use this to bind with any command for recording
|
||||
`bindsym $mod+o exec wf-recorder -g "$(slurp)" -f ~/Downloads/wfRecorder/$(date +%Y-%m-%d_%H:%M:%S).mp4`
|
||||
and to stop this use
|
||||
`bindsym $mod+ctrl+o exec pkill -SIGINT wf-recorder`
|
||||
or for not including mic and computer audio use this
|
||||
`wf-recorder -g "$(slurp)" --audio=alsa_output.pci-0000_04_00.6.analog-stereo.monitor -f ~/Downloads/wfRecorder/$(date +%Y-%m-%d_%H:%M:%S).mp4`
|
||||
audio sources can be listed by
|
||||
`pactl list short sources`
|
||||
|
||||
- some portals like `xdg-desktop-portal-gtk` and `xdg-desktop-portal-wlr` is recommended to be installed
|
||||
- with obs-studio in order to record potion of screen use alt too when resizing.
|
||||
|
||||
|
||||
wifi applet
|
||||
- install network-manager-applet for arch and use command `nm-applet` to start it in waybar
|
||||
|
||||
|
||||
bluetooth setup
|
||||
- first make sure to enable bluetooth service with `systemctl enable --now bluetooth.service`
|
||||
- Then install blueman which is a gui took which needs to be open through launcher
|
||||
|
||||
|
||||
**Complex keybinding support**
|
||||
In Sway, you can define complex keybindings using the bindsym directive to combine multiple key presses, but creating a "chained" key sequence directly (like keya+keyb followed by keyc) requires a workaround because sway does not natively support multi-key sequences that wait for a subsequent keypress.
|
||||
|
||||
However, you can achieve similar functionality using the bindsym directives along with exec commands that track the state of a key press. Here's a basic approach:
|
||||
|
||||
Define a variable to keep track of your sequence. You can use swaymsg to set environment variables (though this gets tricky and might require additional scripting if you want to create a more complex state machine).
|
||||
|
||||
Use combinations of bindsym. Here’s an example of how you could set up your keybindings in Sway config:
|
||||
```
|
||||
# Reset sequence variable
|
||||
set $sequence ""
|
||||
|
||||
# First key combination
|
||||
bindsym --release $mod+a exec swaymsg set-option persistent_layout "set $sequence a"
|
||||
bindsym --release $mod+b exec swaymsg set-option persistent_layout "set $sequence $sequence b"
|
||||
bindsym --release $mod+c exec swaymsg set-option persistent_layout "set $sequence $sequence c"
|
||||
|
||||
# Action on sequence completion
|
||||
bindsym --released $mod+c exec sh -c 'if [ "$$sequence" = "ab" ]; then <your-action>; fi; set $sequence ""'
|
||||
```
|
||||
This is a simplified illustration; you would need to adapt it to your environment and ensure that you have the proper way to reset the variable after executing your desired action.
|
||||
|
||||
Use a separate script for multi-key functionality (if necessary): Sometimes, handling this with a more robust solution such as a script might be easier. You could use a shell script to read key input and execute an action once a specific sequence is detected.
|
||||
```
|
||||
#!/bin/bash
|
||||
|
||||
# Sample script that waits for a sequence
|
||||
case $1 in
|
||||
"ab")
|
||||
# Run your command here for keya + keyb
|
||||
echo "Action triggered for a + b"
|
||||
;;
|
||||
"c")
|
||||
if [ "$PREV_KEYS" == "ab" ]; then
|
||||
# Run your command for a + b + c
|
||||
echo "Action triggered for a + b + c"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
```
|
||||
Make sure to include this script in your keybinding:
|
||||
|
||||
`bindsym --release $mod+a exec /path/to/your/script.sh "ab"`
|
||||
`bindsym --release $mod+c exec /path/to/your/script.sh "c"`
|
||||
|
||||
Make sure to modify these samples to fit your specific needs. Managing sequences of keys can be complex, so a thorough understanding of how Sway handles input and executing external commands will help you create the solution that works best for you.
|
||||
|
||||
For the best practices and limitations, be sure to check the Sway documentation and community resources as well.
|
||||
27
joplin notion extension/linux/Arch/waydroid.md
Normal file
27
joplin notion extension/linux/Arch/waydroid.md
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
waydroid
|
||||
https://github.com/n1lby73/waydroid-installer
|
||||
https://wiki.archlinux.org/title/Waydroid
|
||||
|
||||
- Installation
|
||||
`yay -S waydroid` (AUR package)
|
||||
- Prerequisite
|
||||
As arch linux default kernel arent supported by waydroid so install another one ie `linux-zen` and its headers
|
||||
`yay -Ss linux-zen linux-zen-headers`
|
||||
Now create initrd by (in arch it is mkinitcpio)
|
||||
`mkinitcpio -p linux-zen`
|
||||
Then finally include it in grub file by
|
||||
`grub-mkconfig -o /boot/grub/grub.cfg` and `reboot`
|
||||
and in `Advanced options for arch linux` select `linux-zen` kernel
|
||||
- Initialization
|
||||
Run `sudo waydroid init`
|
||||
It will check in the directory `/usr/images/waydroid-extra/images` if image and vendors are installed or not. If not installed then it will install them of lineageOS in the directory `var/lib/waydroid/images`
|
||||
Make sure that `waydroid-container.service` is started
|
||||
`sudo systemctl enable --now waydroid-container`
|
||||
- Usage
|
||||
Starting waydroid session
|
||||
`waydroid session start`
|
||||
Then in another terminal type
|
||||
`waydroid show-full-ui`
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in a new issue