apk add debootstrap arch-install-scripts
prepare partition
doas mkfs.ext4 -O ^has_journal /dev/nvme0n1p3
doas mount /dev/nvme0n1p3 /mnt
bootstrap using debootstrap
--print-debs for listing pkg to be installed
debootstrap --variant=minbase stable /mnt http://deb.debian.org/debian/
debootstrap --include=apt,bash,dpkg stable
/mnt http://deb.debian.org/debian/
CHROOT into /mnt
doas arch-chroot /mnt
export TERM=linux
source /etc/profile
custom chroot script if no arch-install-scripts
nano arch-chroot
mount --rbind /dev /mnt/dev && mount --make-rslave /mnt/dev
mount --rbind /dev/pts /mnt/dev/pts && mount --make-rslave /mnt/dev/pts
mount --rbind /proc /mnt/proc && mount --make-rslave /mnt/proc
mount --rbind /sys /mnt/sys && mount --make-rslave /mnt/sys
cp --dereference /etc/resolv.conf /mnt/etc
chroot /mnt /bin/bash
sudo bash arch-chroot
Repo config and add security,update repo
source list generator
https://debgen.simplylinux.ch/
apt install neofetch --no-install-recommends
apt install nano --no-install-recommends
nano /etc/apt/sources.list
deb http://deb.debian.org/debian/ stable main
deb http://deb.debian.org/debian/ stable-updates main
deb http://security.debian.org/debian-security stable-security main
https://www.debian.org/security/#keeping-secure
multimedia repo
read first https://www.deb-multimedia.org/ mat have problem in upding due to pkg conflicts
apt install curl wget apt-transport-https dirmngr
###### 3rd Party Binary Repos
###Debian Multimedia
deb [arch=amd64,i386] https://www.deb-multimedia.org buster main non-free
remove some files from dpkg
cat /etc/dpkg/dpkg.cfg.d/excludes
# Drop locales except English
path-exclude=/usr/share/locale/*
path-include=/usr/share/locale/en/*
path-include=/usr/share/locale/[email protected]/*
path-include=/usr/share/locale/[email protected]/*
path-include=/usr/share/locale/[email protected]/*
path-include=/usr/share/locale/en_US/*
path-include=/usr/share/locale/locale.alias
# Drop translated manual pages except French
path-exclude=/usr/share/man/*
path-include=/usr/share/man/man[1-9]/*
path-include=/usr/share/man/en*/*
apt install nnn -no-install-recommends
run nnn as root and remove residue dir in /usr/share/locale,man
nnn /usr/share/locale
space on folder to keep and shift a to reverse selection and x and s and y to delete
nnn /usr/share/man
apt disable recommend package
sudo nano /etc/apt/apt.conf.d/90recommend
APT::Install-Recommends "0";
APT::Install-Suggests "0";
/etc/apt/apt.conf.d/99translations
Acquire::Languages "none";
ignore some package
cat /etc/apt/preferences.d/ignored-packages
Package: grub-common grub2-common grub-pc grub-pc-bin grub-gfxpayload-lists
Pin: release *
Pin-Priority: -1
testing using systemd as block
remove residual config files ( dpkg -l shows ^rc)
dpkg --list |grep "^rc" | cut -d " " -f 3 | xargs sudo dpkg --purge
install some package
apt install bash-completion
. /etc/bash_completion
apt install xserver-xorg-core
apt install xserver-xorg-input-libinput
for runit
runit still use sysv at 0 and 1 stage
apt install runit-init
readlink -f /sbin/init
/usr/lib/runit/runit-init
for sysv
sudo apt install initscripts sysv-rc-conf sysvinit-core sysvinit-utils
pstree -Ap
id:runlevels:action:process
nano /etc/inittab
Default runlevel
# The default runlevel.
id:2:initdefault:
Main Bootscript
# Boot-time system configuration/initialization script.
# This is run first except when booting in emergency (-b) mode.
si::sysinit:/etc/init.d/rcS
cat
/etc/init.d/rcS
#!/bin/sh
# Call all S??* scripts in /etc/rcS.d/ in numerical/alphabetical order
exec /etc/init.d/rc S
Runlevels
# /etc/init.d executes the S and K scripts upon change
# of runlevel.
#
# Runlevel 0 is halt.
# Runlevel 1 S is single-user.
# Runlevels 2-5 are multi-user.
# Runlevel 6 is reboot.
l0:0:wait:/etc/init.d/rc 0
l1:1:wait:/etc/init.d/rc 1
l2:2:wait:/etc/init.d/rc 2
l3:3:wait:/etc/init.d/rc 3
l4:4:wait:/etc/init.d/rc 4
l5:5:wait:/etc/init.d/rc 5
l6:6:wait:/etc/init.d/rc 6
Getty and logins
# /sbin/getty invocations for the runlevels.
#
# The "id" field MUST be the same as the last
# characters of the device (after "tty").
#
# Format:
# <id>:<runlevels>:<action>:<process>
#
# Note that on most Debian systems tty7 is used by the X Window System,
# so if you want to add more getty's go ahead but skip tty7 if you run X.
#
1:2345:respawn:/sbin/getty --noclear 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2
#3:23:respawn:/sbin/getty 38400 tty3
#4:23:respawn:/sbin/getty 38400 tty4
#5:23:respawn:/sbin/getty 38400 tty5
#6:23:respawn:/sbin/getty 38400 tty6
Single-user boot
# What to do in single-user mode.
~~:S:wait:/sbin/sulogin --force
# Normally not reached, but fallthrough in case of emergency.
z6:6:respawn:/sbin/sulogin --force
Ctrl+Alt+Del
# What to do when CTRL-ALT-DEL is pressed.
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
Power-sensing scripts
Init can communicate with your UPS device and execute processes based on the status of the UPS. Here are some examples:
# What to do when the power fails/returns.
pf::powerwait:/etc/init.d/powerfail start
pn::powerfailnow:/etc/init.d/powerfail now
po::powerokwait:/etc/init.d/powerfail stop
switching runlevel
passing n to kernel parameter
/sbin/
telinit n
telinit q
causes init to re-examine inittab but not switch runlevel.
Warning: Always test a modified/etc/inittab
withtelinit q
before you reboot,
or a small syntax error can prevent your system from booting.
man 5 inittab
man 8 init
Disable an init script
/sbin/update-rc.d <script name> remove
https://web.archive.org/web/20181019155813/http://www.linux-tutorial.info/modules.php?name=MContent&pageid=65
https://rs1.es/tutorials/2022/03/06/sysvinit.html#openrc
enable an init script
Create a symbolic link to /etc/rc<runlevel>.d/
update-rc.d test-init defaults
remove extra tty
rm /etc/runit/runsvdir/current/getty-tty[3-6]
boot loader
#using systemd-boot
#sudo apt install systemd-boot
sudo apt install tiny-initramfs
sudo apt install linux-image-amd64
blkid to get uuid of root
cat /etc/fstab
UUID=9dc57367-b107-4c9f-9a76-150dc47ae249 / btrfs rw,noatime,compress=zstd:3,ssd,space_cache=v2,subvolid=5,subvol=/ 0 0
UUID=e0eeee06-09f6-41cc-a7ac-b0ff3f48fc9e /home ext4 rw,noatime 0 0
with arch-install-scripts run as root user
genfstab -U /mnt >> /mnt/etc/fstab
cat /mnt/loader/entries/debian.conf
title Kali
linux /vmlinuz-kali
initrd /initramfs-kali
options rootfstype=btrfs root=UUID=9dc57367-b107-4c9f-9a76-150dc47ae249 rootflags=rw,noatime,compress=zstd:3,ssd,space_cache=v2,subvolid=5,subvol=/ quiet
options rootfstype=ext4 root=UUID=9dc57367-b107-4c9f-9a76-150dc47ae249 rootflags=rw,noatime quiet loglevel=3 systemd.show_status=auto rd.udev.log_level=3
##with this as kernel parameter you can remove fstab root entry to avoid wasting time remounting rootfs
noauto,x-systemd.automount for /home partition to fsck and mount on first access at fstab
https://wiki.archlinux.org/title/Improving_performance/Boot_process
cat /etc/tmpfiles.d/home.conf
silent boot
touch ~/.hushlogin
rootflag in kernel
quiet loglevel=3 systemd.show_status=auto rd.udev.log_level=3
Note that if you often receive
Core temperature above threshold, cpu clock throttled
messages in the kernel log, you need to use log level 2 to silence these at boot time.
/etc/sysctl.d/20-quiet-printk.conf
kernel.printk = 3 3 3 3
agetty
/etc/systemd/system/[email protected]/skip-prompt.conf [Service] ExecStart= ExecStart=-/usr/bin/agetty --skip-login --nonewline --noissue --autologin username --noclear %I $TERM
https://wiki.archlinux.org/title/Silent_boot
https://github.com/RobertCsordas/arch-efiboot
apt install firmware-realtek sudo neofetch debsecan wpasupplicant linux-image-amd64
apt search linux-image
Timezone
dpkg-reconfigure tzdata
Localization
apt install locales
dpkg-reconfigure locales
locale -a
cat /etc/default/locale
LANG=en_US.UTF-8
https://wiki.debian.org/Locale
apt install dialog
dpkg-reconfigure locale
keyboard
apt install console-setup
dpkg-reconfigure keyboard-configuration
Hostname
/etc/hostname
name
/etc/hosts
::1 localhost
127.0.1.1 name
Network
apt install iwd openresolv dbus
User accounts
passwd
adduser kai
passwd kai
adduser username wheel
apt install sudo
cat /etc/doas.d/doas.conf
doas ([email protected](none)) password:
permit persist kai
permit nopass kai as root cmd brightnessctl
permit nopass kai as root cmd ntfs-3g
permit nopass kai as root cmd umount
#for non systemd or no polkit reboot
#permit nopass kai as root cmd reboot
#permit nopass kai as root cmd poweroff
for wifi
sudo apt install iwd systemd-resolved
cat /etc/iwd/main.conf
[General]
EnableNetworkConfiguration=true
#AddressRandomization=network
#RoamThreshold=-70
#RoamThreshold5G=-76
[Network]
#EnableIPv6=true
systemctl enable iwd
systemctl enable systemd-resolved
ls -la /etc/resolv.conf
lrwxrwxrwx 1 root root 39 Feb 27 14:30 /etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf
if its file/static fix it
ln -rsf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
apt install systemd-sysv apt install sway foot wofi alsa-utils apulse dbus-glib-1-2 libxtst6
apt install htop
xorg only setup
for iwctl without root
cat /usr/share/dbus-1/system.d/iwd-dbus.conf<policy group="kai">
<allow send_destination="net.connman.iwd"/>
</policy>
download firefox
mkdir ~/opt cd ~/opt https://download-installer.cdn.mozilla.net/pub/firefox/releases/110.0/linux-x86_64/en-US/firefox-110.0.tar.bz2 extract to ~/opt apt install lbzip2 tar xf firefox-110.0.tar.bz2cat .bashrc export PATH=$HOME/.bin:$PATHexport NNN_OPENER=$HOME/.bin/nuke cat .bin/firefox
apulse $HOME/opt/firefox/firefox [email protected]
firmwares manual install
blutooth fw
put in /lib/firmware/qca
wifi fw
download and
cd hw1.0
mkdir -p /lib/firmware/ath10k/QCA9377/hw1.0
mv * /lib/firmware/ath10k/QCA9377/hw1.0
intel graphics fw
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/i915
icl firmware put in /lib/firmware/i915
sudo apt remove firmware-linux-free
intel tuning
https://gist.github.com/Brainiarc7/aa43570f512906e882ad6cdd835efe57?permalink_comment_id=3036915
https://wiki.archlinux.org/title/intel_graphics#Enable_early_KMS
https://wiki.archlinux.org/title/Intel_graphics#Fastboot
cat /etc/modprobe.d/i915.conf
options i915 fastboot=1 enable_fbc=1 enable_guc=3
list obsolete package
apt list ?obsolete
apt list --installed | awk -F/ '/\[installed,local\]/{print $1}'
nnn mimetype instead of file
sudo apt install libfile-mimeinfo-perl
mimetype -b build_kernel.sh
application/x-shellscript
nano .bashrc
export NNN_OPENER=nuke
nano nuke
MIMETYPE="$( mimetype -b "${FPATH}" )"
Sensors
get temp
cat /sys/class/thermal/thermal_zone*/type
INT3400 Thermal
TSKN
TMEM
B0D4
x86_pkg_temp
sed 's/000$/°C/' /sys/class/thermal/thermal_zone*/temp
20°C
43050
45050
61050
61°C
hwmon devices
readlink -f /sys/class/hwmon/hwmon*
/sys/devices/pci0000:00/0000:00:1d.4/0000:02:00.0/nvme/nvme0/hwmon0
/sys/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0003:00/power_supply/AC/hwmon1
/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0A:00/power_supply/BAT0/hwmon2
/sys/devices/platform/dell_smm_hwmon/hwmon/hwmon3
/sys/devices/platform/coretemp.0/hwmon/hwmon4
cat /sys/class/hwmon/hwmon*/name
nvme
AC
BAT0
dell_smm
coretemp
for fan speed
here hwmon3 has dell_smm so it has fan speed
cat /sys/class/hwmon/hwmon3/fan1_input
legacy /depreciated i8k
cat /proc/i8k 1.0 A17 2J59L02 52 2 1 8040 6420 1 2 1 2 3 4 5 6 7 8 9 10 1.0 1.1 -1 59 -22 0 -22 0 -1 -22The fields read from ``/proc/i8k`` are:: 1.0 A17 2J59L02 52 2 1 8040 6420 1 2 | | | | | | | | | | | | | | | | | | | +------- 10. buttons status | | | | | | | | +--------- 9. AC status | | | | | | | +-------------- 8. fan0 RPM | | | | | | +------------------- 7. fan1 RPM | | | | | +--------------------- 6. fan0 status | | | | +----------------------- 5. fan1 status | | | +-------------------------- 4. temp0 reading (Celsius) | | +---------------------------------- 3. Dell service tag (later known as 'serial number') | +-------------------------------------- 2. BIOS version +------------------------------------------ 1. /proc/i8k format version
https://www.kernel.org/doc/Documentation/hwmon/dell-smm-hwmon.rst
pretty format
https://www.kernel.org/doc/html/next/hwmon/dell-smm-hwmon.html
bios version
cat /sys/class/dmi/id/bios_version
serial no
sudo cat /sys/class/dmi/id/board_serial
Comments
Post a Comment