Advertisement
Guest User

Untitled

a guest
Oct 20th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.32 KB | None | 0 0
  1. ## login to live boot and start a bash session
  2.  
  3. # login
  4.  
  5. username: root
  6.  
  7. password: voidlinux
  8.  
  9. # start a bash session
  10.  
  11. bash
  12.  
  13. ## setup wifi for installation
  14.  
  15. wpa_passphrase 'My SSID' >> /etc/wpa_supplicant/wpa_supllicant.conf Password
  16.  
  17. sv restart dhcpcd
  18.  
  19. # test that wifi is working
  20.  
  21. ping voidlinux.org
  22.  
  23.  
  24. ## disk partitioning
  25.  
  26. # create the partitions
  27.  
  28. /dev/sda1 of size 1G to mount as /boot, with boot flag activated
  29.  
  30. /dev/sda2 of all remaining free space to mount as /
  31.  
  32. # add filesystems and extra options
  33.  
  34. mkfs.ext2 -L boot /dev/sda1
  35.  
  36. cryptsetup luksFormat /dev/sda2
  37.  
  38. cryptsetup luksOpen /dev/sda2 crypt-pool
  39.  
  40. vgcreate pool /dev/mapper/crypt-pool
  41.  
  42. lvcreate --name swap -L 3G pool
  43.  
  44. mkswap -L swap /dev/mapper/pool-swap
  45.  
  46. lvcreate --name root -l 100%FREE pool
  47.  
  48. mkfs.ext4 -L root /dev/mapper/pool-root
  49.  
  50. ## mount the partitions
  51.  
  52. mount /dev/mapper/pool-root /mnt
  53.  
  54. mkdir /mnt/{boot,dev,proc,sys}
  55.  
  56. mount /dev/sda1 /mnt/boot
  57.  
  58. mount --rbind /dev /mnt/dev
  59.  
  60. mount --rbind /proc /mnt/proc
  61.  
  62. mount --rbind /sys /mnt/sys
  63.  
  64. ## install and configure the system
  65.  
  66. xbps-install -S -R https://repo.voidlinux.eu/current -r /mnt base-system lvm2 cryptsetup grub-x86_64-efi efibootmgr
  67.  
  68. chroot /mnt /bin/bash
  69.  
  70. passwd root
  71.  
  72. chown root:root /
  73.  
  74. chmod 755 /
  75.  
  76. echo host > /etc/hostname
  77.  
  78. # setup fstab
  79.  
  80. vi /etc/fstab:
  81.  
  82. # <filesystem> <dir> <type> <options> <dump> <pass>
  83.  
  84. tmpfs /tmp tmpfs defaults,nosuid,nodev 0 0
  85.  
  86. /dev/crypt-pool/root / ext4 defaults 0 0
  87.  
  88. /dev/sda1 /boot ext2 defaults 0 0
  89.  
  90. /dev/mapper/pool-swap swap swap defaults 0 0
  91.  
  92. ## setup grub
  93.  
  94. grub-install /dev/sda
  95.  
  96. echo "LANG=en_US.UTF-8" > /etc/locale.conf
  97.  
  98. echo "en_US.UTF-8 UTF-8" >> /etc/default/libc-locales
  99.  
  100. xbps-reconfigure -f glibc-locales
  101.  
  102. lsblk -f *get UUID for Luks*
  103.  
  104. Add rd.auto=1 then UUID:lvm to the GRUB_CMDLINE_LINUX_DEFAULT variable in /etc/default/grub:
  105.  
  106. GRUB_CMDLINE_LINUX_DEFAULT="loglevel=4 slub_debug=P page_poison=1 rd.auto=1 cryptdevice=UUID=*UUID*:lvm"
  107.  
  108. grub-mkconfig -o /boot/grub/grub.cfg
  109.  
  110. grub-install /dev/sda
  111.  
  112. xbps-reconfigure -f linux
  113.  
  114. ## leave the chrooted enviroment and reboot
  115.  
  116. ctr + d (^d)
  117.  
  118. reboot
  119.  
  120. ## setup temporary WiFi, install a few packages and add a user
  121.  
  122. # setup WiFi temporarily
  123.  
  124. wpa_passphrase 'My SSID' >> /etc/wpa_supplicant/wpa_supllicant.conf Password
  125.  
  126. dhcpcd
  127.  
  128. # if WiFi fails runs this:
  129.  
  130. ip link set *interface* down
  131.  
  132. ip link set *interfcae* up
  133.  
  134. # test that wifi is working
  135.  
  136. ping voidlinux.org
  137.  
  138.  
  139. # update the system
  140.  
  141. xbps-install -Suv
  142.  
  143. # install packages
  144.  
  145. xbps-install -S:
  146.  
  147. # shell:
  148.  
  149. zsh
  150.  
  151. # audio:
  152.  
  153. pulseaudio
  154.  
  155. # editor:
  156.  
  157. neovim
  158.  
  159. python-neovim
  160.  
  161. # multiplexsion:
  162.  
  163. tmux
  164.  
  165. # terminal:
  166.  
  167. rxvt-unicode
  168.  
  169. urxvt-perls
  170.  
  171. # desktop/window manager:
  172.  
  173. i3-gaps
  174.  
  175. i3status
  176.  
  177. i3lock-color
  178.  
  179. # lockscreen:
  180.  
  181. lightdm
  182.  
  183. lightdm-gtk3-greeter
  184.  
  185. lightdm-gtk-greeter-settings
  186.  
  187. # music and video:
  188.  
  189. mpd
  190.  
  191. mpc
  192.  
  193. ncmpcpp
  194.  
  195. ncmpc
  196.  
  197. mpv
  198.  
  199. # network:
  200.  
  201. NetworkManager
  202.  
  203. network-manager-applet
  204.  
  205. tor
  206.  
  207. # file management:
  208.  
  209. ranger
  210.  
  211. Thunar
  212.  
  213. # application menu:
  214.  
  215. dmenu
  216.  
  217. # customuization tools:
  218.  
  219. lxappearance
  220.  
  221. feh
  222.  
  223. dunst
  224.  
  225. compton
  226.  
  227. # utilities:
  228.  
  229. udiskie
  230.  
  231. light
  232.  
  233. tree
  234.  
  235. scrot
  236.  
  237. rkhunter
  238.  
  239. neofetch
  240.  
  241. htop
  242.  
  243. gotop
  244.  
  245. grub-customizer
  246.  
  247. firejail
  248.  
  249. wget
  250.  
  251. git
  252.  
  253. cmake
  254.  
  255. cronie
  256.  
  257. cronutils
  258.  
  259. gnome-disk-utility
  260.  
  261. gimp
  262.  
  263. kid3
  264.  
  265. make
  266.  
  267. man-db
  268.  
  269. qemu
  270.  
  271. time
  272.  
  273. transmission
  274.  
  275. unzip
  276.  
  277. virt-manager
  278.  
  279. xev
  280.  
  281. xrdb
  282.  
  283. ctags
  284.  
  285. # social media:
  286.  
  287. pidgin
  288.  
  289. pidgin-otr
  290.  
  291. pidgin-libnotify
  292.  
  293. irssi
  294.  
  295. qtox
  296.  
  297. # web browsing
  298.  
  299. w3m
  300.  
  301. waterfox:
  302.  
  303. # move to /opt/:
  304.  
  305. cd /opt/
  306.  
  307. # get the bz2 file:
  308.  
  309. wget https://storage-waterfox.netdna-ssl.com/releases/linux64/installer/waterfox-56.2.3.en-US.linux-x86_64.tar.bz2
  310.  
  311. # unzip the files:
  312.  
  313. bzip2 -d waterfox-56.2.3.en-US.linux-x86_64.tar.bz2
  314.  
  315. tar -xvf waterfox-56.2.3.en-US.linux-x86_64.tar
  316.  
  317. rm waterfox-56.2.3.en-US.linux-x86_64.tar
  318.  
  319. cd waterfox
  320.  
  321. # add a symlink to launch waterfox from an application menu:
  322.  
  323. ln -s /opt/waterfox/waterfox /usr/bin/waterfox
  324.  
  325.  
  326. tor browser:
  327.  
  328. # you'll need to install xz:
  329.  
  330. xbps-install -S xz
  331.  
  332. # move to /opt/:
  333.  
  334. # get the .xz file:
  335.  
  336. wget https://www.torproject.org/dist/torbrowser/8.0.2/tor-browser-linux64-8.0.2_en-US.tar.xz
  337.  
  338. # unzip the files:
  339.  
  340. tar -xf tor-browser-linux64-8.0.2_en-US.tar.xz
  341.  
  342. rm tor-browser-linux64-8.0.2_en-US.tar.xz
  343.  
  344. # move into the directory and make a script to launch the tor browser:
  345.  
  346. cd tor-browser
  347.  
  348. nvim start-tor-browser.sh:
  349.  
  350. sh -c '"/opt/tor-browser_en-US/Browser/start-tor-browser" --detach || ([ ! -x "/opt/tor-browser_en-US/Browser/start-tor-browser" ] && "$(dirname "$*")"/Browser/start-tor-browser --detach)' dummy %k
  351.  
  352. chmod +x start-tor-browser.sh
  353.  
  354. # add a symlink to launch the tor browser from an application menu:
  355.  
  356. ln -s /opt/tor_browser/start-tor-browser.sh /usr/bin/tor_browser
  357.  
  358. # programming
  359.  
  360. python-ipython
  361.  
  362. python-pip
  363.  
  364. python-virtualenv
  365.  
  366. # other:
  367.  
  368. xautolock
  369.  
  370. xorg-server
  371.  
  372. xorg-server-xvfb
  373.  
  374. xset
  375.  
  376. linux-firmware
  377.  
  378. noto-fonts-ttf
  379.  
  380. liberation-fonts-ttf
  381.  
  382. ## add user account and change shell
  383.  
  384. # add a user
  385.  
  386. useradd -m -s /bin/zsh -U -G wheel,users,audio,video,cdrom,input user
  387.  
  388. passwd user
  389.  
  390. # change shell
  391.  
  392. chsh -s /bin/zsh
  393.  
  394. ## setup sudo: reboot, etc without sudo password and enable insults
  395.  
  396. # edit the file
  397. visudo
  398.  
  399. # enable insults:
  400.  
  401. ## sudoers file.
  402. ##
  403. ## This file MUST be edited with the 'visudo' command as root.
  404. ## Failure to use 'visudo' may result in syntax or file permission errors
  405. ## that prevent sudo from running.
  406. ##
  407. ## See the sudoers man page for the details on how to write a sudoers file.
  408. ##
  409.  
  410. Defaults insults
  411.  
  412. # let user sudo
  413.  
  414. # uncomment the following line:
  415.  
  416. %wheel ALL=(ALL) ALL
  417.  
  418. # enable reboot (etc) without password
  419.  
  420. %wheel ALL=(ALL) NOPASSWD: /usr/bin/halt, /usr/bin/poweroff, /usr/bin/reboot, \
  421. /usr/bin/shutdown, /usr/bin/zzz, /usr/bin/ZZZ
  422.  
  423.  
  424. ## enable the proper services
  425.  
  426. # enable services
  427.  
  428. ln -s /etc/sv/dbus /var/service/dbus
  429.  
  430. ln -s /etc/sv/tor /var/service/tor
  431.  
  432. ln -s /etc/sv/NetworkManager /var/serivce/NetworkManager
  433.  
  434. ln -s /etc/lightdm /var/service/lightdm
  435.  
  436. ## reboot and login as user
  437.  
  438. reboot
  439.  
  440. login
  441.  
  442. ## disable login as root
  443.  
  444. sudo passwd -l root
  445.  
  446. ## setup network
  447.  
  448. launch nm-applet from demnu or the terminal. Left click and select your wifi, then exit the pop up menu and right click on it, go to edit connection. Select your wifi, go to general and enable the all users can use this network option, then go to wifi security and add your wifi password. Then save and exit nm-applet.
  449.  
  450. ## create directories in home folder then mount usb and move files to proper location
  451.  
  452. # create directories in home folder and /usr/share/
  453.  
  454. mkdir Documents Downloads Pictures Music Videos .build
  455.  
  456. # create directories in /usr/share/
  457.  
  458. mkdir backgrounds
  459.  
  460. # move files from USB to proper locations
  461.  
  462. # open a terminal and run: udiskie, then open Thunar and start moving files
  463.  
  464. 1) move fonts to /usr/share/fonts
  465.  
  466. 2) move files in Zsh to ~/
  467.  
  468. 3) move void install folder to ~/Documents
  469.  
  470. 4) move images in Pictures to ~/Pictures
  471.  
  472. 5) move dunst to ~/.config
  473.  
  474. 6) move tox to ~/.config
  475.  
  476. 7) move neofetch to ~/.config
  477.  
  478. 8) move vis to ~/.config
  479.  
  480. 9) move ncmpcpp to ~/.config
  481.  
  482. 10) move .tmux.conf to ~/
  483.  
  484. 11) move nvim to ~/.config
  485.  
  486. 12) move i3 and i3status to ~/.config
  487.  
  488. 13) move mpd to ~/.config
  489.  
  490. 14) move .mpd and .ncmcpp to ~/
  491.  
  492. 15) move bash.command-not-found to /etc/
  493.  
  494. 16) move wallpapers to /usr/share/backgrounds/
  495.  
  496. 17) move scripts to ~/Documents/
  497.  
  498. 18) move python to ~/Documents/
  499.  
  500. 19) move .Xresources to ~/
  501.  
  502. ## find hardware (use if moving the HDD or SSD to another computer to detect the hardware: WiFi, etc)
  503.  
  504. lspci
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement