jobcore/jobo-setup/joborun-setup

391 lines
15 KiB
Text
Raw Normal View History

2022-09-12 00:07:03 +02:00
#!/bin/zsh
2022-09-13 23:32:48 +02:00
mkdir -p /tmp/jobo-subshell
cd /tmp/jobo-subshell
2022-09-12 00:07:03 +02:00
cat /etc/fstab >/tmp/state.0
cat /etc/locale.gen >>/tmp/state.0
cat /etc/timezone >>/tmp/state.0
ls -l /etc/localtime >>/tmp/state.0
cat /etc/hostname >>/tmp/state.0
grep -i hostname /etc/rc.conf >>/tmp/state.0
ls -l /boot >>/tmp/state.0
ls -l /boot/grub >>/tmp/state.0
ls -l /etc/runit/runsvdir/default >>/tmp/state.0
clear
cat /etc/motd | grep -v joborun
echo " "
echo " "
2022-09-13 23:32:48 +02:00
echo " As Obarun says, 'control you own data', do not let the system and those who create "
2022-10-25 05:03:02 +02:00
echo " or influence it control you through your data. We just bring you a step or two closer "
2022-09-13 23:32:48 +02:00
echo " to this goal!"
echo " "
2022-09-12 00:07:03 +02:00
echo " "
2022-09-13 23:32:48 +02:00
echo " You choose whether to build your own packages/software, you configure your system,"
echo " and then you get closer in being in control of your data. "
2022-09-12 00:07:03 +02:00
echo " "
echo " "
echo " "
2023-04-10 23:04:40 +02:00
echo " Enter to continue or Ctrl-C to abort the script at any stage"
echo " Run the script over and over again, it will affect nothing unless"
echo " you modify something withing the subshells triggered."
2022-09-12 00:07:03 +02:00
read
clear && cat /etc/motd | grep -v joborun
echo " "
echo " "
2022-09-13 23:32:48 +02:00
echo " Steps of the script "
echo " _________________________________________________ "
2022-09-12 00:07:03 +02:00
echo " 1 fstab"
echo " 2 locale"
echo " 3 timezone"
echo " 4 hostname"
echo " 5 password"
echo " 6 pacman --init and update/upgrade "
echo " 7 kernel and headers"
echo " 8 bootloader"
echo " 9 configure runit"
echo " 9.1 add s6 and 66"
2022-10-25 05:03:02 +02:00
echo " 10 configure .xinitrc"
echo " 11 reboot"
2022-09-12 00:07:03 +02:00
echo " "
2022-09-13 23:32:48 +02:00
echo " "
echo " Enter to continue or Ctrl-C to abort the script"
2022-09-12 00:07:03 +02:00
read
clear && cat /etc/motd | grep -v joborun
2022-09-13 23:32:48 +02:00
echo " This is a script so you can go from installing the minimal Joborun tarball image"
echo " to a complete bootable installation."
echo " "
echo " Hit enter to continue, hit Ctrl-C to abort script "
2022-09-12 00:07:03 +02:00
read
clear && cat /etc/motd | grep -v joborun
echo " "
echo " "
2022-09-13 23:32:48 +02:00
echo " This script should run as root so on each step where a subshell opens to give you"
echo " the chance to configure the system you will not have to use sudo on each command."
echo " The script itself makes no changes to the system at all, no matter how many times"
echo " it runs. It only takes you step by step to the minimal configurations you should"
echo " make to have a bootable system."
echo " "
echo " As we do not believe in handholding automation, we suggest and explain the minimal"
2023-04-10 23:04:40 +02:00
echo " necessary steps, but we do not make automatic/default choices for you, beyond what"
echo " comes from upstream and arch-linux."
2022-09-12 00:07:03 +02:00
echo " "
echo " "
echo "Enter to continue or Ctrl-C to abort the script"
read
clear && cat /etc/motd | grep -v joborun
echo " "
2022-09-13 23:32:48 +02:00
echo " First and most crucial step after chrooting into the installation (system partition),"
echo " is to create a good fstab map of mounted systems. We assume you have setup your /boot"
echo " efi partition if used, a swap partition, and all other mountable filesystems, like"
echo " /home /var or /var/cache, etc."
echo " "
echo " 1 fstab "
2022-09-12 00:07:03 +02:00
echo "cat /etc/fstab"
cat /etc/fstab
echo " "
2022-09-13 23:32:48 +02:00
echo " this is your current /etc/fstab and below is your current state of mounted filesystems"
2022-09-12 00:07:03 +02:00
echo " "
df
2022-09-13 23:32:48 +02:00
echo " "
echo " This is your current list of partition UUIDs and their labels, if they have any"
2022-09-12 00:07:03 +02:00
echo " "
2022-09-13 23:32:48 +02:00
echo " 'ls -lh /dev/disk/by-uuid'"
2022-09-12 00:07:03 +02:00
ls -lh /dev/disk/by-uuid
echo " "
echo "ls -lh /dev/disk/by-label"
ls -lh /dev/disk/by-label
echo " "
2022-09-13 23:32:48 +02:00
echo " '% mount /dev/sdc13 /home' will mount sdc13 partition to /home directory,"
echo " '% swapon /dev/sdd32 ' will begin swapping memmory at /dev/sdd32"
2022-10-25 05:03:02 +02:00
echo " You can do this within this sub-shell, enter exit when you are done to continue this script."
2022-09-12 00:07:03 +02:00
zsh
2022-09-13 23:32:48 +02:00
echo " .... to continue press enter "
2022-09-12 00:07:03 +02:00
read
2022-09-13 23:32:48 +02:00
echo " Now that you have mounted everything you wanted mounted at boot time, run the"
echo " following command: "
echo " "
echo " Note that if you are in a chroot session /etc/resolv.conf is mounted from the"
echo " host system, and this should not be included in your fstab. "
echo " "
echo " % genfstab -U / | grep -v resolv >/tmp/fstab"
echo " "
echo " you can point the output to /etc/fstab directly as you are running as root but"
echo " it is best to examine the output before you enter it. To make life easier "
echo " (without flipping from tty to tty or teminal tab to terminal tab), we created"
echo " /tmp/fstab for you"
echo " hit enter to see it!"
2022-09-12 00:07:03 +02:00
read
genfstab -U / | grep -v resolv >/tmp/fstab
echo " "
cat /tmp/fstab
echo " "
2022-09-13 23:32:48 +02:00
echo " you can edit and then as root 'cp /tmp/fstab /etc/fstab' but we are not going"
echo " to assume everything is well, since you know better. When done copy it from tmp"
echo " to etc and then enter ' % mount -a ' to verify you get no errors, '% df ' "
echo " afterwards to see what is mounted, ' % free ' to see that your swap memmory is working."
2022-09-12 00:07:03 +02:00
echo " "
2022-10-25 05:03:02 +02:00
echo " You can do this within this sub-shell, enter exit when you are done to continue this script."
2022-09-12 00:07:03 +02:00
zsh
2022-09-13 23:32:48 +02:00
echo " .... to continue press enter "
2022-09-12 00:07:03 +02:00
read
mount -a
df
free
2022-09-13 23:32:48 +02:00
echo " .... if everything seems ok to you and you get no errors after 'mount -a' press"
echo " enter or Ctrl-C to interrupt the script."
2022-09-12 00:07:03 +02:00
read
clear && cat /etc/motd | grep -v joborun
echo " "
2022-09-13 23:32:48 +02:00
echo " "
echo " 2 locale"
echo " "
2022-09-12 00:07:03 +02:00
echo " "
2022-09-13 23:32:48 +02:00
echo " Now we can set the locale of the system."
echo " edit the '/etc/locale.gen' and enter your choice as found in ' /etc/locale.gen.pacnew '"
echo " The current default value is 'cat /etc/locale.gen' :"
echo " "
2022-09-12 00:07:03 +02:00
cat /etc/locale.gen
echo " "
2022-09-13 23:32:48 +02:00
echo " Run /usr/bin/locale-gen to establish your choice into the system. You can do it within"
2022-10-25 05:03:02 +02:00
echo " this sub-shell, enter exit when you are done to continue this script."
2022-09-12 00:07:03 +02:00
zsh
2022-09-13 23:32:48 +02:00
echo " .... to continue press enter "
2022-09-12 00:07:03 +02:00
read
clear && cat /etc/motd | grep -v joborun
echo " "
2022-09-13 23:32:48 +02:00
echo " "
echo " 3 timezone "
echo " "
echo " We will now select the timezone of the system. Even though that both runit have a"
echo " boot rc configuration file to do so, and 66 has its boot module, it is good practice"
echo " to have the traditional unix timezone set before first boot, if runit or 66 miss doing so."
echo " "
echo " You will find a file in /etc/timezone where you can enter your choice."
echo " This is old-school, a practice eliminated by systemd-ish msWin-ish automation."
echo " The new fashion is to link /etc/localtime to a /usr/share/zoneinfo/ choice such as "
echo " the default below"
2022-09-12 00:07:03 +02:00
echo "/etc/localtime :"
ls -l /etc/localtime
2022-09-13 23:32:48 +02:00
echo " enter the sub-shell now and create the link by example root command:"
echo " ' # ln -sf /usr/share/zoneinfo/Europe/Madrid /etc/localtime ' "
echo " for example and verify the results by ' ls -l /etc/localtime ' "
echo " "
echo " Again, editing /etc/rc.conf or /etc/runit/rc.conf and filling the fields available"
echo " for runit should take care of all these, but we can t assume you are not trying "
2022-09-13 23:32:48 +02:00
echo " something else as init and service supervision, like minit or sinit. "
echo " "
echo " exit the shell to return to the script"
2022-09-12 00:07:03 +02:00
zsh
2022-09-13 23:32:48 +02:00
echo " Enter to continue or Ctrl-C to abort the script"
2022-09-12 00:07:03 +02:00
read
clear && cat /etc/motd | grep -v joborun
echo " "
2022-09-13 23:32:48 +02:00
echo " "
echo " 4 hostname"
echo " For Hostname, simply edit /etc/hostname, or fill the /etc/rc.conf, or enter the "
echo " following command ' # hostname <the systems hostname goes here> ' "
2022-09-13 23:32:48 +02:00
echo " Your current hostname is: "
2022-09-12 00:07:03 +02:00
hostname
2022-09-13 23:32:48 +02:00
echo " Enter to continue in a sub-shell or Ctrl-C to abort the script, or exit to exit"
echo " the sub-shell and return to the script."
2022-09-12 00:07:03 +02:00
read
zsh
clear && cat /etc/motd | grep -v joborun
2022-09-13 23:32:48 +02:00
echo " "
echo " "
echo " 5 passwords"
echo " "
echo " To set passwords you simply use the passwd command"
echo " ' % passwd ' as root to set roots password"
echo " ' % passwd make ' as root to set user makes password,"
echo " if you havent added other users or changed the name of 'make', do the same"
2022-09-13 23:32:48 +02:00
echo " for your other users."
echo " "
echo " To do so now, within this sub-shell enter, then execute the commands by entering"
echo " your password twice when asked, then exit to return to the script."
echo " You should get the output 'your password has been changed' each time"
echo " if you executed passwd correctly."
2022-09-12 00:07:03 +02:00
read
zsh
echo "Enter to continue or Ctrl-C to abort the script"
read
clear && cat /etc/motd | grep -v joborun
2022-09-13 23:32:48 +02:00
echo " "
echo " "
echo " 6 pacman"
echo " "
echo " Your system should be up to date, and to have this done as a first time setup you"
echo " need to initialize pacman"
echo " 1st command is ' % pacman-key --init ' "
echo " 2nd comman is ' % pacman -Suy ' "
2022-10-25 05:03:02 +02:00
echo " To do so, do it here, then type exit to continue this script."
2022-09-12 00:07:03 +02:00
zsh
2022-09-13 23:32:48 +02:00
echo " Enter to continue or Ctrl-C to abort the script"
2022-09-12 00:07:03 +02:00
read
clear && cat /etc/motd | grep -v joborun
2022-09-13 23:32:48 +02:00
echo " "
echo " "
echo " 7 Kernel choice"
echo " "
echo " Choose kernel from joboruns list or from arch by entering on of those as on the list"
2022-09-13 23:32:48 +02:00
echo " 'linux-lts' (5.10 joborun) recommended previous LTS"
echo " 'linux' (5.15 joborun) current linux LTS "
echo " 'linux-lts54' (5.4 joborun older LTS)"
echo " 'core/linux' (arch current) "
echo " 'core/linux-lts' (arch LTS 5.15)"
echo " 'extra/linux-hardened'"
echo " 'extra/linux-zen'"
echo " "
echo " The command to add one kernel and its corresponding header would be such as the 3 examples below: "
echo " 'pacman -S linux-lts54 linux-lts54-headers' "
echo " or "
echo " 'pacman -S extra/linux-zen extra/linux-zen-headers' "
echo " or for kernel and no headers"
echo " 'pacman -S linux-lts' "
2022-10-25 05:03:02 +02:00
echo " To do so, do it here, then type exit to continue this script."
2022-09-12 00:07:03 +02:00
zsh
2022-09-13 23:32:48 +02:00
echo " Enter to continue or Ctrl-C to abort the script"
2022-09-12 00:07:03 +02:00
clear && cat /etc/motd | grep -v joborun
echo " "
2022-09-13 23:32:48 +02:00
echo " "
echo " 8 Bootloader "
2023-04-10 23:04:40 +02:00
echo " First install the bootloader of choice syslinux, limine, or grub are on our repositories,"
2022-09-13 23:32:48 +02:00
echo " lilo and lilo-git are on AUR, you can use cower to download and build 'cower -d lilo-git'"
echo " We will describe a common legacy grub installation here, for anything else go to"
2023-04-10 23:04:40 +02:00
echo " wiki.archlinux.org and follow the instructions there."
echo " Note: if you are not using ext4 as a filesystem, (ie btrfs, xfs, ..), make sure the "
echo " bootloader of choice supports this filesystem. If not you may need an EFI solution."
2022-09-13 23:32:48 +02:00
echo " "
echo " '% pacman -S grub' "
echo " Make sure you have installed a kernel properly by looking at the contents of "
echo " /boot for an initrd image"
echo " "
echo " Edit /etc/default/grub if you want specialized configuration, os-prober is pre-installed"
echo " and configured via hook to run during grub configuration. OS-prober scans for other"
echo " installations on the same system, linux/unix or otherwise, and adds an entry on the "
2023-04-10 23:04:40 +02:00
echo " boot screen after Joborun. It is not 100% reliable but mostly works for other systems."
2022-09-13 23:32:48 +02:00
echo " "
echo " '% makedir -p /boot/grub ' "
echo " '% grub-mkconfig -o /boot/grub/grub.cfg' "
echo " To install grub s binary in the MBR of disk 'example: /dev/sda ' simply enter the command: "
2022-09-13 23:32:48 +02:00
echo " '% grub-install /dev/sda' "
2022-10-25 05:03:02 +02:00
echo " To do so, do it here, then type exit to continue this script."
2022-09-12 00:07:03 +02:00
zsh
2022-09-13 23:32:48 +02:00
echo " Enter to continue or Ctrl-C to abort the script"
2022-09-12 00:07:03 +02:00
read
clear && cat /etc/motd | grep -v joborun
echo " "
2022-09-13 23:32:48 +02:00
echo " "
echo " 9 Runit setup"
echo " It is best to follow the links on our wiki and the links to Void s wiki and/or "
2022-09-13 23:32:48 +02:00
echo " Artix to learn more about how runit works".
echo " For now, and for those that know runit, what is found linked to "
echo " /etc/runit/runsvdir/default directory will be initiated after boot (stage 1)."
echo " To deactivate/disable a service you simply remove the link, this stops supervision,"
echo " doesnt necesseraly end the service, but also look up runsv -d functionality."
2022-09-13 23:32:48 +02:00
echo " To start a service supervision other than an extra tty (/etc/runit/sv/) look up"
echo " the service scripts in /usr/lib/runit/sv. Link a service from there to the above"
echo " mentioned .../runsvdir/default/ directory and service supervision for this service"
echo " will immediately start."
echo " "
echo " For example:"
echo " ' % ln -s /usr/lib/runit/sv/ntpd /etc/runit/runsvdir/default' "
echo " This example shows how you activate/enable service supervision for"
echo " ntpd in runit."
echo " "
echo " Runit has a minimalist configuration boot script stored in /etc/rc/rc.conf"
echo " linked for ease of access to /etc/rc.conf. Simply edit /etc/rc.conf to customize"
2022-09-13 23:32:48 +02:00
echo " your runit boot settings."
2022-09-12 00:07:03 +02:00
zsh
2022-09-13 23:32:48 +02:00
echo " Enter to continue or Ctrl-C to abort the script"
2022-09-12 00:07:03 +02:00
read
clear && cat /etc/motd | grep -v joborun
echo " "
echo " 9.1 add s6 & 66 "
echo " "
echo " "
echo " To add 66 run the add.66 script then setup.66 to setup the system. "
echo " If you reboot and decide you don t want it, execute rm.66 and "
echo " s6/66 will be removed "
2022-09-13 23:32:48 +02:00
echo " Runit will still be there unaffected when you finish playing with 66, and you can"
echo " boot either system if 66 is installed. "
2022-09-13 23:32:48 +02:00
echo " "
echo " It is best you add s6/66 after your first successful boot with runit, unless you"
2022-09-13 23:32:48 +02:00
echo " are really proficient with both systems."
2023-04-10 23:04:40 +02:00
echo " After you boot 66 and if you ever need dbus and maybe consolekit for applications"
echo " see 66-user 66-user-up 66-user-down scripts that will help a minimal setup."
2022-09-13 23:32:48 +02:00
echo " "
echo " Enter to continue or Ctrl-C to abort the script"
2022-09-12 00:07:03 +02:00
read
clear && cat /etc/motd | grep -v joborun
echo " "
2022-09-13 23:32:48 +02:00
echo " "
2022-10-25 05:03:02 +02:00
echo " Enter to continue or Ctrl-C to abort the script"
read
clear && cat /etc/motd | grep -v joborun
echo " "
echo " "
echo " 10 Your .xinitrc "
2022-10-25 05:03:02 +02:00
echo " "
echo " Whether you use the xinit command, or startx, to start"
echo " your X session your ~/.xinitrc should have at least one"
echo " executable command in it."
2023-04-10 23:04:40 +02:00
echo " exec jwm &"
2022-10-25 05:03:02 +02:00
echo " for starting a jwm session "
echo " exec openbox-session"
echo " for starting an openbox session"
echo " exec vtwm"
echo " for starting a vtwm session "
2023-04-10 23:04:40 +02:00
echo " exec icewm-session"
echo " for starting an icewm session "
2022-10-25 05:03:02 +02:00
echo " "
echo " To do so, do it here, simply edit as user ~/.xinitrc then type exit to continue this script."
zsh
echo " "
echo " Now, next time you login to your shell type xinit or startx and your favorite window"
echo " manager will start up."
echo " "
echo " "
echo " Enter to finally get to the last step of your configuration."
read
clear && cat /etc/motd | grep -v joborun
echo " "
echo " 11 Exit chroot and Reboot "
2022-09-13 23:32:48 +02:00
echo " "
echo " You should now be able to exit the chroot, reboot the system, and try a true joborun system."
echo " "
echo " If you are unsure of everything done here re-run the script as many times as you like,"
echo " it doesn t hurt anything, it only guides you to do what you have to do. As user also "
2022-09-13 23:32:48 +02:00
echo " look at the scripts stored in the home directory ~/ or /home/make on how to have X wm"
2022-10-25 05:03:02 +02:00
echo " environment installed if you want it, or have s6 and 66 installed and set up."
2022-09-13 23:32:48 +02:00
echo " "
echo " Enter to finally exit"
2022-09-12 00:07:03 +02:00
read
clear && cat /etc/motd | grep -v joborun
2022-09-13 23:32:48 +02:00
echo " "
echo " "
echo " Thank you for trying Joborun"
2022-09-12 00:07:03 +02:00
cat /etc/fstab
echo " ______________________ "
cat /etc/locale.gen
echo " ______________________ "
cat /etc/timezone
echo " ______________________ "
ls -l /etc/localtime
echo " ______________________ "
cat /etc/hostname
echo " ______________________ "
grep -i hostname /etc/rc.conf
echo " ______________________ "
ls -l /boot
echo " ______________________ "
ls -l /boot/grub
echo " ______________________ "
ls -l /etc/runit/runsvdir/default
echo " ______________________ "
echo " This is what the system s configuration looks like now "
echo " Hit enter to see the picture before you started "
2022-09-12 00:07:03 +02:00
read
2022-09-13 23:32:48 +02:00
echo " __________________________________________________ "
2022-09-12 00:07:03 +02:00
cat /tmp/state.0
2022-09-13 23:32:48 +02:00
echo " __________________________________________________ "