├── data ├── lang │ ├── keyboard │ │ ├── other │ │ ├── belgian │ │ ├── dutch │ │ ├── finnish │ │ ├── italian │ │ ├── polish │ │ ├── russian │ │ ├── spanish │ │ ├── swedish │ │ ├── turkish │ │ ├── us │ │ ├── french │ │ └── german │ └── locale │ │ ├── english │ │ ├── german │ │ ├── italian │ │ ├── polish │ │ ├── russian │ │ ├── spanish │ │ ├── finnish │ │ └── french └── packages │ ├── extra │ └── system ├── .gitignore ├── chroot ├── cacheclean.sh ├── publish.sh ├── clean.sh ├── swap.sh ├── chroot.sh └── drivers.sh ├── justfile ├── init └── init.sh ├── bootloader ├── config.sh ├── timeout.sh ├── install.sh └── efi.sh ├── disk ├── trim.sh ├── mount.sh └── disk.sh ├── questions.txt ├── user ├── flatpak.sh ├── shell.sh ├── modify.sh ├── appearance.sh └── user.sh ├── localinstall.sh ├── desktop └── lightdm.sh ├── lang ├── apply.sh ├── locale.sh ├── timezone.sh └── xorg.sh ├── topask.sh ├── postinstall.sh ├── iroot.sh ├── calamares.sh ├── manjaro.sh ├── instantos ├── version.sh └── install.sh ├── network └── network.sh ├── depend ├── system.sh ├── extras.sh ├── mirrors.sh └── depend.sh ├── manjaro └── shellprocess.conf ├── pacstrap └── pacstrap.sh ├── utils.sh ├── moduleutils.sh ├── systeminstall.sh ├── topinstall.sh ├── ask.sh ├── CONTRIBUTING.md ├── installutils.sh ├── README.md ├── askloop.sh ├── archinstall.sh ├── LICENSE └── askutils.sh /data/lang/keyboard/other: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/lang/keyboard/belgian: -------------------------------------------------------------------------------- 1 | 2 | be -------------------------------------------------------------------------------- /data/lang/keyboard/dutch: -------------------------------------------------------------------------------- 1 | 2 | nl -------------------------------------------------------------------------------- /data/lang/keyboard/finnish: -------------------------------------------------------------------------------- 1 | 2 | fi -------------------------------------------------------------------------------- /data/lang/keyboard/italian: -------------------------------------------------------------------------------- 1 | 2 | it -------------------------------------------------------------------------------- /data/lang/keyboard/polish: -------------------------------------------------------------------------------- 1 | 2 | pl -------------------------------------------------------------------------------- /data/lang/keyboard/russian: -------------------------------------------------------------------------------- 1 | 2 | ru -------------------------------------------------------------------------------- /data/lang/keyboard/spanish: -------------------------------------------------------------------------------- 1 | 2 | es -------------------------------------------------------------------------------- /data/lang/keyboard/swedish: -------------------------------------------------------------------------------- 1 | 2 | sv -------------------------------------------------------------------------------- /data/lang/keyboard/turkish: -------------------------------------------------------------------------------- 1 | 2 | tr -------------------------------------------------------------------------------- /data/lang/keyboard/us: -------------------------------------------------------------------------------- 1 | us 2 | us -------------------------------------------------------------------------------- /data/lang/keyboard/french: -------------------------------------------------------------------------------- 1 | fr-latin1 2 | fr -------------------------------------------------------------------------------- /data/lang/keyboard/german: -------------------------------------------------------------------------------- 1 | de-latin1 2 | de -------------------------------------------------------------------------------- /data/lang/locale/english: -------------------------------------------------------------------------------- 1 | en_US.UTF-8 UTF-8 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | keylayout 2 | config 3 | tags 4 | .nvimlog 5 | -------------------------------------------------------------------------------- /data/lang/locale/german: -------------------------------------------------------------------------------- 1 | en_US.UTF-8 UTF-8 2 | de_DE.UTF-8 UTF-8 -------------------------------------------------------------------------------- /data/lang/locale/italian: -------------------------------------------------------------------------------- 1 | en_US.UTF-8 UTF-8 2 | it_IT.UTF-8 UTF-8 -------------------------------------------------------------------------------- /data/lang/locale/polish: -------------------------------------------------------------------------------- 1 | en_US.UTF-8 UTF-8 2 | pl_PL.UTF-8 UTF-8 -------------------------------------------------------------------------------- /data/lang/locale/russian: -------------------------------------------------------------------------------- 1 | en_US.UTF-8 UTF-8 2 | ru_RU.UTF-8 UTF-8 -------------------------------------------------------------------------------- /data/lang/locale/spanish: -------------------------------------------------------------------------------- 1 | en_US.UTF-8 UTF-8 2 | es_ES.UTF-8 UTF-8 -------------------------------------------------------------------------------- /data/lang/locale/finnish: -------------------------------------------------------------------------------- 1 | en_US.UTF-8 UTF-8 2 | fi_FI.UTF-8 UTF-8 3 | -------------------------------------------------------------------------------- /data/lang/locale/french: -------------------------------------------------------------------------------- 1 | en_US.UTF-8 UTF-8 2 | fr_FR.UTF-8 UTF-8 3 | -------------------------------------------------------------------------------- /chroot/cacheclean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "cleaning pacman cache" 4 | command -v paccache && paccache -rk 0 5 | -------------------------------------------------------------------------------- /justfile: -------------------------------------------------------------------------------- 1 | default: 2 | @just --choose 3 | 4 | format: 5 | @find . -name "*.sh" -exec shfmt -w -i 4 -ci {} \; 6 | 7 | -------------------------------------------------------------------------------- /init/init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # ensure system time is correct 4 | 5 | echo "configuring time" 6 | if command -v timedatectl; then 7 | timedatectl set-ntp true 8 | fi 9 | -------------------------------------------------------------------------------- /data/packages/extra: -------------------------------------------------------------------------------- 1 | firefox 2 | udiskie 3 | gxkb 4 | gedit 5 | ttf-liberation 6 | xterm 7 | unzip 8 | engrampa 9 | unrar 10 | p7zip 11 | noto-fonts-emoji 12 | cups 13 | system-config-printer 14 | gnome-font-viewer 15 | noto-fonts 16 | -------------------------------------------------------------------------------- /bootloader/config.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if iroot nobootloader; then 4 | echo "skipping grub configuration" 5 | exit 6 | fi 7 | 8 | # update grub to detect operating systems and apply the instantOS theme 9 | grub-mkconfig -o /boot/grub/grub.cfg 10 | -------------------------------------------------------------------------------- /bootloader/timeout.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # sets default grub timeout to 2 4 | 5 | sed -i 's/^GRUB_TIMEOUT=.*/GRUB_TIMEOUT=2/g' /etc/default/grub 6 | echo 'GRUB_DISABLE_OS_PROBER=false' | tee -a /etc/default/grub 7 | update-grub 8 | 9 | grub-update 10 | -------------------------------------------------------------------------------- /disk/trim.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # enables trim if the root disk supports it 4 | 5 | 6 | 7 | DISK="$(iroot disk)" 8 | 9 | if hdparm -I "$DISK" | grep -i trim | grep -iq supported; then 10 | echo 'enabling trim' 11 | systemctl enable fstrim.timer 12 | fi 13 | -------------------------------------------------------------------------------- /questions.txt: -------------------------------------------------------------------------------- 1 | layout:Keyboard Layout 2 | locale:Application Language 3 | vm:VM settings 4 | region:Region 5 | mirrors:Mirror Location 6 | askpartitioning:Disk settings 7 | drivers:Graphics Drivers 8 | user:User account 9 | hostname:Hostname 10 | advanced:Advanced settings 11 | -------------------------------------------------------------------------------- /chroot/publish.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # make some iroot settings accessible by normal users 4 | 5 | mkdir /etc/iroot 6 | 7 | cp /root/instantARCH/config/* /etc/iroot/ 8 | chmod 755 /etc/iroot/* 9 | rm /etc/iroot/password 10 | 11 | echo "finished setting up config permissions" 12 | -------------------------------------------------------------------------------- /user/flatpak.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # add flathub remote 4 | 5 | USERNAME="$(iroot user)" 6 | if command -v flatpak; then 7 | echo "enabling flathub remote" 8 | sudo -u "$USERNAME" flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo 9 | fi 10 | -------------------------------------------------------------------------------- /bootloader/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # installs grub on legacy boot systems 4 | # runs from outside the installation 5 | 6 | if iroot nobootloader; then 7 | echo "skipping grub install" 8 | exit 9 | fi 10 | 11 | echo "installing grub for legacy bios" 12 | DISK="$(iroot grubdisk)" 13 | 14 | grub-install "${DISK}" 15 | -------------------------------------------------------------------------------- /localinstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source /root/instantARCH/installutils.sh 4 | 5 | escript depend/mirrors "configuring mirrors" 6 | escript init/init "configuring time" 7 | escript disk/disk "partitioning disk" 8 | escript disk/mount "mounting partitions" 9 | escript pacstrap/pacstrap "installing base packages" 10 | sleep 0.5 11 | -------------------------------------------------------------------------------- /desktop/lightdm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # this is run upon the first boot 4 | # for some reason lightdm doesn't get enabled sucessfully during installation 5 | 6 | if command -v lightdm; then 7 | echo "enabling lightdm" 8 | sudo systemctl enable --now lightdm 9 | else 10 | echo "lightdm not found" 11 | exit 1 12 | fi 13 | -------------------------------------------------------------------------------- /lang/apply.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # apply locale settings 4 | 5 | export INSTANTARCH="${INSTANTARCH:-/root/instantARCH}" 6 | 7 | SETLOCALE="$(grep '.' "$INSTANTARCH"/data/lang/locale/"$(iroot locale)" | tail -1 | grep -o '^[^ ]*')" 8 | 9 | echo "setting localectl locale to $SETLOCALE" 10 | localectl set-locale LANG="$SETLOCALE" 11 | 12 | echo "finished applying locale" 13 | -------------------------------------------------------------------------------- /user/shell.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # install instantSHELL and plugins 3 | 4 | echo "setting up user shell" 5 | USERNAME="$(iroot user)" 6 | [ -z "$USERNAME" ] && exit 7 | [ -e /home/"$USERNAME" ] || exit 8 | command -v instantshell || exit 9 | chown -R "$USERNAME" /home/* 10 | sudo -u "$USERNAME" instantshell install 11 | chown -R "$USERNAME" /home/* 12 | 13 | echo "finished setting up user shell" 14 | -------------------------------------------------------------------------------- /topask.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # all actions requiring user input for the installer 4 | # on top of an existing arch base 5 | 6 | source <(curl -Ls 'https://raw.githubusercontent.com/paperbenni/bash/master/import.sh') 7 | pb dialog 8 | 9 | source /root/instantARCH/askutils.sh 10 | 11 | asklayout 12 | askregion 13 | asklocale 14 | askdrivers 15 | 16 | if ! ls /home/ | grep -q ..; then 17 | askuser 18 | fi 19 | -------------------------------------------------------------------------------- /user/modify.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # modify existing users to work with instantOS 4 | 5 | echo "adding groups" 6 | groupadd video &>/dev/null 7 | groupadd wheel &>/dev/null 8 | groupadd docker &>/dev/null 9 | 10 | REALUSERS="$(ls /home/ | grep -v '+')" 11 | 12 | for i in $REALUSERS; do 13 | echo "processing user $i" 14 | usermod -a -G wheel "$i" 15 | usermod -a -G video "$i" 16 | usermod -a -G docker "$i" 17 | done 18 | -------------------------------------------------------------------------------- /lang/locale.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # read out user selected locale 4 | # generate it 5 | 6 | export INSTANTARCH="${INSTANTARCH:-/root/instantARCH}" 7 | 8 | # clear previous locale settings 9 | 10 | sed -i 's/^[^#].*//g' /etc/locale.gen 11 | cat "$INSTANTARCH"/data/lang/locale/"$(iroot locale)" >>/etc/locale.gen 12 | 13 | echo " 14 | # modified by instantARCH 15 | 16 | " >>/etc/locale.gen 17 | sleep 0.3 18 | echo "generating locales" 19 | locale-gen 20 | -------------------------------------------------------------------------------- /chroot/clean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # clean up installation leftovers 4 | 5 | echo "cleaning installation leftovers" 6 | 7 | if iroot hasnvidia || sudo lshw -C display | grep -i '^ *vendor' | grep -qi intel; then 8 | echo "clearing unneeded vulkan drivers" 9 | if pacman -Q amdvlk; then 10 | pacman -R --noconfirm amdvlk 11 | fi 12 | 13 | if pacman -Q lib32-amdvlk; then 14 | pacman -R --noconfirm lib32-amdvlk 15 | fi 16 | 17 | fi 18 | -------------------------------------------------------------------------------- /user/appearance.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # apply default theme 4 | 5 | echo "setting up default theme" 6 | 7 | # checking all requirements are there 8 | USERNAME="$(iroot user)" 9 | [ -z "$USERNAME" ] && exit 10 | [ -e /home/"$USERNAME" ] || exit 11 | command -v instantthemes || command -v imosid || exit 12 | chown -R "$USERNAME" /home/* 13 | 14 | sudo -u "$USERNAME" instantthemes apply instantos 15 | 16 | chown -R "$USERNAME" /home/* 17 | 18 | echo "finished setting up default themes" 19 | -------------------------------------------------------------------------------- /lang/timezone.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # symlink timezone from user selected region 4 | 5 | cd /usr/share/zoneinfo 6 | 7 | if iroot noregion; then 8 | echo "region is getting skipped" 9 | exit 10 | fi 11 | 12 | if ! iroot timezone; then 13 | echo "setting region failed" 14 | exit 15 | fi 16 | 17 | REGION="$(iroot timezone)" 18 | 19 | ln -sf /usr/share/zoneinfo/$REGION /etc/localtime 20 | timedatectl set-timezone "$REGION" 21 | timedatectl set-ntp true 22 | 23 | hwclock --systohc 24 | 25 | echo "set timezone to $REGION" 26 | -------------------------------------------------------------------------------- /postinstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This is run as root by instantautostart 4 | # on the actual installation after the first reboot 5 | 6 | cd /root/instantARCH || exit 1 7 | 8 | bash ./lang/xorg.sh 9 | sleep 0.5 10 | bash ./lang/locale.sh 11 | bash ./lang/apply.sh 12 | bash ./desktop/lightdm.sh 13 | 14 | # restore selected mirrorlist 15 | if [ -e "$IROOT"/mirrorlistbackup ] && grep -i "server" "$IROOT"/mirrorlistbackup; then 16 | echo "restoring mirrorlist" 17 | cat "$IROOT"/mirrorlistbackup >/etc/pacman.d/mirrorlist 18 | fi 19 | 20 | echo "instantARCH postinstall finished" 21 | -------------------------------------------------------------------------------- /lang/xorg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # apply user keymap 4 | 5 | KEYLANG=$(iroot keyboard) 6 | 7 | NEWXORG="$(tail -1 /root/instantARCH/data/lang/keyboard/"$KEYLANG")" 8 | 9 | if ! iroot otherkey; then 10 | NEWKEYMAP="$(head -1 /root/instantARCH/data/lang/keyboard/"$KEYLANG")" 11 | fi 12 | 13 | echo "setting xorg keymap to $NEWXORG" 14 | 15 | if pgrep Xorg; then 16 | setxkbmap -layout "$NEWXORG" 17 | fi 18 | 19 | localectl --no-convert set-x11-keymap "$NEWXORG" 20 | if [ -n "$NEWKEYMAP" ]; then 21 | echo "setting global keymap to $NEWKEYMAP" 22 | # set tty keymap 23 | localectl --no-convert set-keymap "$NEWKEYMAP" 24 | fi 25 | -------------------------------------------------------------------------------- /iroot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # utility to manage installer variables 4 | 5 | IROOT="${IROOT:-/root/instantARCH/config}" 6 | 7 | [ -e "$IROOT" ] || mkdir -p "$IROOT" 8 | 9 | if [ -z "$1" ]; then 10 | echo "usage: 11 | set value: iroot field value 12 | get value: iroot field 13 | remove/stdin: iroot r/i field" 14 | exit 15 | fi 16 | 17 | if [ "$1" = "i" ]; then 18 | cat /dev/stdin >"$IROOT/$2" 19 | elif [ "$1" = "r" ]; then 20 | [ -e "$IROOT/$2" ] && rm "$IROOT/$2" 21 | elif [ -n "$2" ]; then 22 | echo "$2" >"$IROOT/$1" 23 | else 24 | if [ -e "$IROOT/$1" ]; then 25 | cat "$IROOT/$1" 26 | else 27 | exit 1 28 | fi 29 | fi 30 | -------------------------------------------------------------------------------- /calamares.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # modify the calamares install of a manjaro session 4 | # to install instantOS manjaro edition 5 | 6 | if ! command -v calamares_polkit; then 7 | echo "please run this on a manjaro live session" 8 | exit 9 | fi 10 | 11 | sudo sed -i 's/postcfg/postcfg\n - shellprocess/g' \ 12 | /etc/calamares/settings.conf 13 | 14 | curl -s 'https://raw.githubusercontent.com/instantOS/instantARCH/main/manjaro/shellprocess.conf' | 15 | sudo tee /etc/calamares/modules/shellprocess.conf 16 | 17 | curl -s 'https://raw.githubusercontent.com/instantOS/instantARCH/main/calamares.sh' | sudo tee /usr/bin/instantcalamares 18 | sudo chmod +x /usr/bin/instantcalamares 19 | -------------------------------------------------------------------------------- /bootloader/efi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # installs grub on uefi systems 4 | # runs from inside the installation 5 | # unlike the legacy bios grub script 6 | 7 | source /root/instantARCH/moduleutils.sh 8 | 9 | if iroot nobootloader; then 10 | echo "skipping bootloader install" 11 | exit 12 | fi 13 | 14 | mkdir /efi 15 | echo 'trying to mount '"$(iroot partefi)" 16 | mount "$(iroot partefi)" /efi || exit 1 17 | 18 | pacloop efibootmgr grub 19 | 20 | if ! grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=GRUB; then 21 | umount /efi || exit 1 22 | mkfs.fat -F32 "$(iroot partefi)" || exit 1 23 | mount "$(iroot partefi)" /efi || exit 1 24 | grub-install --efi-directory=/efi || exit 1 25 | fi 26 | -------------------------------------------------------------------------------- /data/packages/system: -------------------------------------------------------------------------------- 1 | sudo 2 | lightdm 3 | bash 4 | zsh 5 | xterm 6 | hdparm 7 | pipewire 8 | pipewire-pulse 9 | pipewire-jack 10 | wireplumber 11 | granite 12 | alsa-utils 13 | usbutils 14 | lightdm-gtk-greeter 15 | noto-fonts 16 | otf-ipafont 17 | wqy-microhei 18 | inetutils 19 | xdg-desktop-portal-gtk 20 | xorg-xinit 21 | lshw 22 | gxkb 23 | ntfs-3g 24 | pamixer 25 | gedit 26 | ttf-liberation 27 | mpv 28 | bc 29 | gvfs-mtp 30 | exfat-utils 31 | unzip 32 | fastfetch 33 | lsb-release 34 | engrampa 35 | unrar 36 | sushi 37 | nano 38 | exa 39 | bat 40 | p7zip 41 | xdg-user-dirs-gtk 42 | noto-fonts-emoji 43 | xf86-input-evdev 44 | xf86-input-synaptics 45 | accountsservice 46 | cups 47 | samba 48 | gvfs-smb 49 | system-config-printer 50 | gnome-font-viewer 51 | trash-cli 52 | fd 53 | grub 54 | 55 | -------------------------------------------------------------------------------- /manjaro.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ###################################### 4 | ## an instantOS install script ## 5 | ## using calamares as a wrapper ## 6 | ## currently not actively developed ## 7 | ###################################### 8 | 9 | echo "installing instantOS manjaro edition" 10 | 11 | cd /root || exit 1 12 | [ -e instantARCH ] && rm -rf instantARCH 13 | git clone --depth=1 https://github.com/instantos/instantARCH.git 14 | cd instantARCH || exit 1 15 | chmod +x ./*.sh 16 | chmod 755 ./*/*.sh 17 | 18 | ./depend/depend.sh 19 | ./init/init.sh 20 | 21 | pacman -S --noconfirm --needed base \ 22 | linux linux-headers \ 23 | linux-lts linux-lts-headers \ 24 | linux-firmware 25 | 26 | ./depend/system.sh 27 | ./user/modify.sh 28 | ./instantos/install.sh 29 | 30 | echo "done installing instantOS" 31 | -------------------------------------------------------------------------------- /user/user.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # create user account 4 | # make user default lightdm user 5 | # add user to required groups 6 | 7 | NEWUSER="$(iroot user)" 8 | NEWPASS="$(iroot password)" 9 | 10 | groupadd video &>/dev/null 11 | groupadd wheel &>/dev/null 12 | groupadd docker &>/dev/null 13 | groupadd dav_group &>/dev/null 14 | groupadd plocate &>/dev/null 15 | 16 | useradd -m "$NEWUSER" -s /usr/bin/zsh -G wheel,docker,video,dav_group,plocate 17 | echo "root:$NEWPASS" | chpasswd 18 | echo "$NEWUSER:$NEWPASS" | chpasswd 19 | 20 | groupadd -r autologin 21 | gpasswd -a "$NEWUSER" autologin 22 | 23 | echo -ne "$NEWPASS\n$NEWPASS\n" | smbpasswd -a -s "$NEWUSER" 24 | 25 | # enable autologin 26 | if ! iroot noautologin; then 27 | sed -i "s/^\[Seat:\*\]/[Seat:*]\nautologin-user=$NEWUSER/g" /etc/lightdm/lightdm.conf 28 | fi 29 | -------------------------------------------------------------------------------- /disk/mount.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # mounts all partitions to to the installation medium 4 | 5 | # mountpart partname mountpoint 6 | mountpart() { 7 | if iroot "part$1"; then 8 | TMPPART="$(iroot "part$1")" 9 | echo "mounting $TMPPART to $2" 10 | 11 | if ! [ -e "$2" ]; then 12 | echo "creating mount point $2" 13 | mkdir -p "$2" 14 | fi 15 | 16 | mount "$TMPPART" "$2" 17 | else 18 | echo "using default partition for $2" 19 | fi 20 | } 21 | 22 | # todo: optional efi 23 | mountpart efi /efi 24 | 25 | mountpart root /mnt 26 | # home is optional 27 | mkdir /mnt/home 28 | mountpart home /mnt/home 29 | sleep 2 30 | 31 | if iroot partswap; then 32 | echo "activating swap" 33 | swapon "$(iroot partswap)" 34 | fi 35 | 36 | if ! mount | grep -q '/mnt'; then 37 | echo "mount failed" 38 | exit 1 39 | fi 40 | -------------------------------------------------------------------------------- /instantos/version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # record version info for upgrading purposes 4 | 5 | echo "getting installation information" 6 | INSTANTOSVERSION=8 7 | export INSTANTOSVERSION 8 | 9 | mkdir -p /etc/instantos 10 | cd /etc/instantos/ || exit 1 11 | 12 | echo "$INSTANTOSVERSION" >version 13 | 14 | if iroot liveversion; then 15 | LIVEVERSION="$(iroot liveversion)" 16 | echo "detected instllation iso version $LIVEVERSION" 17 | else 18 | echo 'old installation iso used, unversioned' 19 | fi 20 | 21 | { 22 | echo "DATE=$(date '+%Y%m%d%H%M')" 23 | if [ -n "$LIVEVERSION" ]; then 24 | echo "ISOVERSION=$LIVEVERSION" 25 | fi 26 | echo "VERSION=$INSTANTOSVERSION" 27 | INSTANTARCHVERSION="$(iroot instantarchversion)" 28 | if [ -n "$LIVEVERSION" ]; then 29 | echo "INSTANTARCHVERSION=$INSTANTARCHVERSION" 30 | fi 31 | } >/etc/instantos/installinfo 32 | 33 | echo "finished getting installation information" 34 | -------------------------------------------------------------------------------- /network/network.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # change hostname and 4 | # follow arch install guide for hosts 5 | 6 | NEWHOSTNAME=$(iroot hostname) 7 | 8 | # default hostname 9 | if [ -z "$NEWHOSTNAME" ]; then 10 | NEWHOSTNAME="instantos" 11 | fi 12 | 13 | echo "$NEWHOSTNAME" >/etc/hostname 14 | 15 | echo "127.0.0.1 localhost" >/etc/hosts 16 | { 17 | echo "::1 localhost" 18 | echo "127.0.1.1 $NEWHOSTNAME.localdomain $NEWHOSTNAME" 19 | echo ' 20 | # modified by instantARCH' 21 | 22 | } >>/etc/hosts 23 | curl -s 'https://git.samba.org/samba.git/?p=samba.git;a=blob_plain;f=examples/smb.conf.default;hb=HEAD' >/tmp/sambaconfigexample 24 | if grep -q 'example' /tmp/sambaconfigexample; then 25 | echo "installing samba example config" 26 | mkdir /etc/samba 27 | cat /tmp/sambaconfigexample >smb.conf 28 | fi 29 | pacman -S --noconfirm --needed networkmanager 30 | 31 | hostnamectl set-hostname "$NEWHOSTNAME" 32 | systemctl enable NetworkManager 33 | systemctl enable sshd 34 | -------------------------------------------------------------------------------- /chroot/swap.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # create swap 4 | 5 | if [ -e /opt/topinstall ] || grep -iq manjaro /etc/os-release; then 6 | echo "topinstall detected, not setting up swap" 7 | exit 8 | fi 9 | 10 | getswapfilesize() { 11 | SIZE="$(free -g | awk '/^Mem:/ {print int(($2 + 1) / 2)}')" 12 | if [ "$SIZE" -lt 1 ]; then 13 | echo "1" 14 | else 15 | echo "$SIZE" 16 | fi 17 | } 18 | 19 | genswapfile() { 20 | dd if=/dev/zero of=/swapfile bs=1M count="$(getswapfilesize)k" status=progress 21 | chmod 600 /swapfile 22 | mkswap /swapfile 23 | swapon /swapfile 24 | 25 | echo '/swapfile none swap defaults 0 0' >>/etc/fstab 26 | } 27 | 28 | if ! iroot swapmethod; then 29 | # needed to get internet to work 30 | gensystemdswap 31 | exit 32 | fi 33 | 34 | case $(iroot swapmethod) in 35 | swapfile) 36 | genswapfile 37 | ;; 38 | none) 39 | exit 40 | ;; 41 | *) 42 | genswapfile 43 | ;; 44 | esac 45 | -------------------------------------------------------------------------------- /depend/system.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # installs basic dependencies not specific to instantOS 4 | 5 | source /root/instantARCH/moduleutils.sh 6 | 7 | echo "installing additional system software" 8 | 9 | pacman -Sy --noconfirm 10 | 11 | while ! pacman -S xorg --noconfirm --needed; do 12 | dialog --msgbox "package installation failed \nplease reconnect to internet" 700 700 13 | iroot automirror && command -v reflector && 14 | reflector --latest 40 --protocol http --protocol https --sort rate --save /etc/pacman.d/mirrorlist 15 | 16 | done 17 | 18 | pacloop $(cat "$INSTANTARCH"/data/packages/system) 19 | 20 | 21 | 22 | # auto install processor microcode 23 | if uname -m | grep '^x'; then 24 | echo "installing microcode" 25 | if lscpu | grep -i 'name' | grep -i 'amd'; then 26 | echo "installing AMD microcode" 27 | pacloop amd-ucode 28 | elif lscpu | grep -i 'name' | grep -i 'intel'; then 29 | echo "installing Intel microcode" 30 | pacloop intel-ucode 31 | fi 32 | fi 33 | -------------------------------------------------------------------------------- /depend/extras.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # installs extra third party applications 4 | 5 | source /root/instantARCH/moduleutils.sh 6 | pacman -Sy --noconfirm 7 | 8 | pacloop lshw 9 | HWINFO=:$(lshw) 10 | if grep -q 'dvd' <<<"$HWINFO" || grep -q 'cdrom' <<<"$HWINFO"; then 11 | echo "fixing dvd playback" 12 | pacloop libdvdread libdvdcss libdvdnav 13 | fi 14 | 15 | # virtualbox guest additions 16 | if iroot guestadditions; then 17 | echo "installing virtualbox guest addidions" 18 | pacman -S --noconfirm --needed virtualbox-guest-dkms 19 | touch /opt/instantos/guestadditions 20 | fi 21 | 22 | # optional user defined packages 23 | if iroot packages &>/dev/null; then 24 | echo "installing extra packages" 25 | iroot packages | pacman -S --noconfirm --needed - 26 | fi 27 | 28 | while ! pacman -S --noconfirm firefox neovim-qt; do 29 | sleep 10 30 | command -v reflector && 31 | reflector --latest 40 --protocol http --protocol https --sort rate --save /etc/pacman.d/mirrorlist && 32 | pacman -Sy --noconfirm 33 | 34 | done 35 | -------------------------------------------------------------------------------- /instantos/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # install all instantOS software 4 | # and apply instantOS specific changes and workarounds 5 | source /root/instantARCH/moduleutils.sh 6 | 7 | cd || exit 1 8 | 9 | [ -e instantOS ] && rm -rf instantOS 10 | 11 | while ! git clone --depth 1 https://github.com/instantOS/instantOS; do 12 | imenu -m "pull failed, please connect to the internet" 13 | done 14 | 15 | cd instantOS || exit 1 16 | 17 | # install pacman repos 18 | bash repo.sh 19 | pacman -Sy --noconfirm 20 | 21 | pacloop instantos instantdepend 22 | 23 | echo "installing pamac" 24 | sudo pacman -S pamac-all --noconfirm 25 | sed -i 's/#EnableAUR/EnableAUR/g' /etc/pamac.conf 26 | sed -i 's/#CheckAURUpdates/CheckAURUpdates/g' /etc/pamac.conf 27 | echo 'EnableFlatpak' >>/etc/pamac.conf 28 | 29 | cd ~/instantOS || exit 1 30 | 31 | if iroot noplymouth; then 32 | touch /opt/instantos/noplymouth 33 | fi 34 | 35 | bash rootinstall.sh 36 | 37 | # change greeter appearance 38 | [ -e /etc/lightdm ] || mkdir -p /etc/lightdm 39 | cat /usr/share/instantdotfiles/rootconfig/lightdm-gtk-greeter.conf >/etc/lightdm/lightdm-gtk-greeter.conf 40 | 41 | if ! iroot nobootloader; then 42 | # custom grub theme 43 | sed -i 's~^#GRUB_THEME.*~GRUB_THEME=/usr/share/grub/themes/instantos/theme.txt~g' /etc/default/grub 44 | update-grub 45 | fi 46 | 47 | echo "setting up trigger for first boot" 48 | systemctl enable instantpostinstall 49 | -------------------------------------------------------------------------------- /disk/disk.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | IROOT="/root/instantARCH/config" 4 | 5 | if ! iroot manualpartitioning; then 6 | # automatic disk partitioning 7 | 8 | DISK="$(iroot disk)" 9 | 10 | if efibootmgr; then 11 | echo "efi system" 12 | echo "label: dos 13 | start= 4096, size= 614400, type=ef 14 | start=618496, type=83, bootable" | sfdisk "${DISK}" 15 | 16 | DISK1="$(fdisk -l | grep "^${DISK}" | grep -o '^[^ ]*' | head -1)" 17 | DISK2="$(fdisk -l | grep "^${DISK}" | grep -o '^[^ ]*' | tail -1)" 18 | 19 | mkfs.fat -F32 "$DISK1" 20 | mkfs.ext4 -F "$DISK2" 21 | 22 | echo "$DISK1" | iroot i partefi 23 | echo "$DISK2" | iroot i partroot 24 | 25 | else 26 | echo "legacy bios" 27 | echo "label: dos 28 | type=83, bootable" | sfdisk "${DISK}" 29 | DISK1="$(fdisk -l | grep "^${DISK}" | grep -o '^[^ ]*' | head -1)" 30 | 31 | mkfs.ext4 -F "$DISK1" 32 | echo "$DISK1" | iroot i partroot 33 | 34 | fi 35 | else 36 | 37 | echo "doing manual partitioning" 38 | if iroot parthome && iroot erasehome; then 39 | echo "creating ext4 file system for home in $(iroot parthome)" 40 | mkfs.ext4 -F "$(cat $IROOT/parthome)" 41 | fi 42 | 43 | if iroot partswap; then 44 | echo "creating swap" 45 | mkswap "$(iroot partswap)" 46 | fi 47 | 48 | mkfs.ext4 -F "$(iroot partroot)" 49 | 50 | fi 51 | -------------------------------------------------------------------------------- /manjaro/shellprocess.conf: -------------------------------------------------------------------------------- 1 | # Configuration for the shell process job. 2 | # 3 | # Executes a list of commands found under the key *script*. 4 | # If the top-level key *dontChroot* is true, then the commands 5 | # are executed in the context of the live system, otherwise 6 | # in the context of the target system. In all of the commands, 7 | # the following substitutions will take place: 8 | # - `@@ROOT@@` is replaced by the root mount point of the **target** 9 | # system from the point of view of the command (for chrooted 10 | # commands, that will be */*). 11 | # - `@@USER@@` is replaced by the username, set on the user page. 12 | # 13 | # The (global) timeout for the command list can be set with 14 | # the *timeout* key. The value is a time in seconds, default 15 | # is 10 seconds if not set. 16 | # 17 | # If a command starts with "-" (a single minus sign), then the 18 | # return value of the command following the - is ignored; otherwise, 19 | # a failing command will abort the installation. This is much like 20 | # make's use of - in a command. 21 | # 22 | # The value of *script* may be: 23 | # - a single string; this is one command that is executed. 24 | # - a list of strings; these are executed one at a time, by 25 | # separate shells (/bin/sh -c is invoked for each command). 26 | # - an object, specifying a key *command* and (optionally) 27 | # a key *timeout* to set the timeout for this specific 28 | # command differently from the global setting. 29 | 30 | --- 31 | dontChroot: false 32 | timeout: 100000 33 | script: 34 | - command: "/usr/bin/instantcalamares" 35 | -------------------------------------------------------------------------------- /pacstrap/pacstrap.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # install base system to target root partition 4 | 5 | export INSTANTARCH="${INSTANTARCH:-/root/instantARCH}" 6 | source "$INSTANTARCH"/moduleutils.sh 7 | 8 | if ! mount | grep '/mnt'; then 9 | echo "mount failed" 10 | exit 1 11 | fi 12 | 13 | pacman -Sy --noconfirm 14 | # needed to get pacstrap working on isos with expired keys 15 | pacloop archlinux-keyring 16 | 17 | # kernel selection 18 | if iroot kernel; then 19 | KERNEL="$(iroot kernel)" 20 | else 21 | # fallback to linux-lts 22 | KERNEL="linux-lts" 23 | fi 24 | 25 | # we're on arch 26 | if command -v pacstrap; then 27 | pacstraploop base 28 | pacstraploop ${KERNEL} 29 | pacstraploop ${KERNEL}-headers 30 | pacstraploop linux-firmware 31 | pacstraploop reflector 32 | else 33 | # manjaro probably 34 | pacstraploop base 35 | pacstraploop ${KERNEL} 36 | pacstraploop ${KERNEL}-headers 37 | pacstraploop linux-firmware 38 | fi 39 | 40 | # Some arch based distros have the command renamed to fstabgen 41 | if command -v genfstab; then 42 | genfstab -U /mnt >>/mnt/etc/fstab 43 | else 44 | fstabgen -U /mnt >>/mnt/etc/fstab 45 | fi 46 | 47 | cd /root || exit 1 48 | 49 | cp -r ./instantARCH /mnt/root/instantARCH 50 | 51 | # record installer iso version on installed system 52 | if [ -e /etc/instantos/liveversion ]; then 53 | cat /etc/instantos/liveversion >/mnt/root/instantARCH/config/liveversion 54 | else 55 | echo 'old iso used, unversioned' 56 | fi 57 | 58 | { 59 | cat /etc/pacman.d/mirrorlist 60 | echo '' 61 | echo '# modified by instantARCH' 62 | } >/mnt/etc/pacman.d/mirrorlist 63 | -------------------------------------------------------------------------------- /chroot/chroot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # enable all sorts of configuration concerning login, lightdm, networking and grub 4 | 5 | # enable lightdm greeter 6 | if grep -q 'greeter-session' /etc/lightdm/lightdm.conf; then 7 | LASTSESSION="$(grep 'greeter-session' /etc/lightdm/lightdm.conf | tail -1)" 8 | sed -i "s/$LASTSESSION/greeter-session=lightdm-gtk-greeter/g" /etc/lightdm/lightdm.conf 9 | else 10 | sed -i 's/^\[Seat:\*\]/\[Seat:\*\]\ngreeter-session=lightdm-gtk-greeter/g' /etc/lightdm/lightdm.conf 11 | fi 12 | 13 | # set up instantwm as a default user session 14 | if grep -q '^user-session.*' /etc/lightdm/lightdm.conf; then 15 | echo "adjusting user session" 16 | sed -i 's/^user-session=.*/user-session=instantwm/g' /etc/lightdm/lightdm.conf 17 | fi 18 | 19 | # fix gui not showing up 20 | sed -i 's/^#logind-check-graphical=.*/logind-check-graphical=true/' /etc/lightdm/lightdm.conf 21 | 22 | echo ' 23 | # modified by instantARCH' >>/etc/lightdm/lightdm.conf 24 | 25 | sed -i 's/# %wheel/%wheel/g' /etc/sudoers 26 | sed -i '/wheel.*NOPASSWD/s/^/# /g' /etc/sudoers 27 | 28 | echo 'Defaults env_reset,pwfeedback' >>/etc/sudoers 29 | 30 | systemctl enable lightdm 31 | systemctl enable NetworkManager 32 | 33 | if ! iroot nobootloader; then 34 | if ! command -v update-grub &>/dev/null; then 35 | # can't include this in package 36 | echo '#! /bin/sh 37 | grub-mkconfig -o /boot/grub/grub.cfg' >/usr/bin/update-grub 38 | chmod 755 /usr/bin/update-grub 39 | fi 40 | 41 | fi 42 | 43 | # indicator file 44 | if iroot kvm; then 45 | [ -e /opt/instantos ] || mkdir -p /opt/instantos 46 | echo "kvm" >/opt/instantos/kvm 47 | fi 48 | -------------------------------------------------------------------------------- /depend/mirrors.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # fetch up to date mirrorlist of selected country 4 | # and optionally sort them 5 | # auto detect all mirrors if no country is selected 6 | 7 | if ! iroot askmirrors; then 8 | echo "skipping mirrors" 9 | exit 10 | fi 11 | 12 | echo "fetching mirrors" 13 | 14 | if ! iroot automirrors; then 15 | COUNTRYCODE="$(iroot countrycode)" 16 | echo "fetching mirrors for $COUNTRYCODE" 17 | 18 | curl -s "https://archlinux.org/mirrorlist/?country=$COUNTRYCODE&protocol=http&protocol=https&ip_version=4&use_mirror_status=on" | 19 | grep -iE '(Server|generated)' | 20 | sed 's/^#Server /Server /g' >/tmp/mirrorlist 21 | 22 | cat /etc/pacman.d/mirrorlist >/tmp/oldmirrorlist 23 | 24 | if iroot sortmirrors; then 25 | head -20 /tmp/mirrorlist >/tmp/mirrorlist2 26 | rankmirrors -n 6 /tmp/mirrorlist2 >/tmp/topmirrors 27 | cat /tmp/topmirrors 28 | sleep 0.1 29 | cat /tmp/topmirrors >/etc/pacman.d/mirrorlist 30 | sleep 2 31 | clear 32 | else 33 | echo "" >/etc/pacman.d/mirrorlist 34 | fi 35 | 36 | cat /tmp/mirrorlist >>/etc/pacman.d/mirrorlist 37 | cat /tmp/oldmirrorlist >>/etc/pacman.d/mirrorlist 38 | mkdir /root/instantARCH/backup 39 | cat /etc/pacman.d/mirrorlist >/root/instantARCH/backup/mirrorlist 40 | else 41 | echo "ranking mirrors" 42 | reflector --latest 40 --protocol http --protocol https --sort rate --save /etc/pacman.d/mirrorlist 43 | fi 44 | 45 | cat /etc/pacman.d/mirrorlist >"$IROOT"/mirrorlistbackup 46 | grep '^[#S]' "$IROOT"/mirrorlistbackup >/etc/pacman.d/mirrorlist 47 | cat /etc/pacman.d/mirrorlist >"$IROOT"/mirrorlistbackup 48 | -------------------------------------------------------------------------------- /utils.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # general utils used by multiple parts of instantARCH 4 | updaterepos() { 5 | pacman -Sy --noconfirm || return 1 6 | if [ -z "$UPDATEDKEYRING" ]; then 7 | pacman -S archlinux-keyring --noconfirm || exit 1 8 | pacman-key --populate || exit 1 9 | export UPDATEDKEYRING="true" 10 | fi 11 | if pacman -Si bash 2>&1 | grep -iq 'unrecognized archive'; then 12 | echo 'getting new mirrorlist' 13 | curl -s 'https://archlinux.org/mirrorlist/?country=all&protocol=http&protocol=https&ip_version=4&use_mirror_status=on' | sed 's/^#//g' >/etc/pacman.d/mirrorlist 14 | rm /var/lib/pacman/sync/* 15 | pacman -Sy --noconfirm || return 1 16 | if pacman -Si bash 2>&1 | grep -iq 'unrecognized archive'; then 17 | echo 'still problems, shuffling mirrorlist' 18 | curl -s 'https://archlinux.org/mirrorlist/?country=all&protocol=http&protocol=https&ip_version=4&use_mirror_status=on' | sed 's/^#//g' | shuf >/etc/pacman.d/mirrorlist 19 | rm /var/lib/pacman/sync/* 20 | fi 21 | pacman -Sy --noconfirm || return 1 22 | fi 23 | } 24 | 25 | # check if installation is run from an instantOS gui session or 26 | # other desktop or tty 27 | # all instantMENU specific features are turned off without guimode 28 | checkguimode() { 29 | if [ -e /usr/share/liveutils ] && ! [ -e /tmp/nogui ] && [ -z "$CLIMODE" ]; then 30 | echo "GUI Mode active" 31 | export GUIMODE="True" 32 | GUIMODE="True" 33 | fi 34 | } 35 | 36 | guimode() { 37 | if [ -e /opt/noguimode ]; then 38 | return 1 39 | fi 40 | 41 | if [ -n "$GUIMODE" ]; then 42 | return 0 43 | else 44 | return 1 45 | fi 46 | } 47 | 48 | export IMPORTEDUTILS="true" 49 | -------------------------------------------------------------------------------- /moduleutils.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # utilities that are supposed to be imported into a mudule before running it 4 | 5 | export IROOT="${IROOT:-/root/instantARCH/config}" 6 | export INSTANTARCH="${INSTANTARCH:-/root/instantARCH}" 7 | 8 | source /root/instantARCH/utils.sh 9 | 10 | # install pacman packages and try a few things to fix pacman without user input 11 | # if installation fails 12 | pacloop() { 13 | while ! pacman -S --noconfirm --needed $@; do 14 | echo 'Package installation failed 15 | Please ensure you are connected to the internet' | imenu -M 16 | if { 17 | ! [ -e /root/instantARCH/refreshedkeyring ] || [ -z "$REFRESHEDKEYRING" ] 18 | } && ! [ "$1" = "archlinux-keyring" ]; then 19 | pacman -Sy archlinux-keyring --noconfirm 20 | export REFRESHEDKEYRING="true" 21 | mkdir /root/instantARCH 22 | touch /root/instantARCH/refreshedkeyring 23 | continue 24 | fi 25 | 26 | if command -v reflector; then 27 | reflector --latest 40 --protocol http --protocol https --sort rate --save /etc/pacman.d/mirrorlist 28 | else 29 | pacman-mirrors --geoip 30 | fi 31 | updaterepos 32 | echo "retrying package installation in 4 seconds" 33 | sleep 4 34 | done 35 | } 36 | 37 | # pacstrap wrapper to accomodate different arch based systems and install isos 38 | pacstraploop() { 39 | 40 | PACSTRAP_ARGLIST=() 41 | 42 | # use host package cache if installation disk is an instantOS iso 43 | # TODO function to better check if we are on an instantOS iso 44 | if [ -e /usr/share/liveutils ]; then 45 | PACSTRAP_ARGLIST+=("-c") 46 | fi 47 | 48 | while ! { 49 | if command -v pacstrap &>/dev/null; then 50 | pacstrap "${PACSTRAP_ARGLIST[@]}" /mnt $@ 51 | else 52 | basestrap "${PACSTRAP_ARGLIST[@]}" /mnt $@ 53 | fi 54 | }; do 55 | imenu -m "package installation failed. ensure you are connected to the internet" 56 | sleep 2 57 | done 58 | # clean up cache so ramfs doesn't fill up 59 | yes | pacman -Scc 60 | } 61 | -------------------------------------------------------------------------------- /systeminstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # installation steps after the base system has been installed 4 | 5 | source /root/instantARCH/installutils.sh || exit 1 6 | 7 | # running twice is necessary 8 | chrootscript "depend/depend" "preparing installer packages" 9 | chrootscript "depend/depend" "preparing installer packages" 10 | 11 | 12 | chrootscript "depend/system" "installing dependencies" 13 | chrootscript "chroot/chroot" "configuring system" 14 | chrootscript "chroot/drivers" "installing drivers" 15 | chrootscript "depend/extras" "installing extras" 16 | chrootscript "lang/timezone" "setting time" 17 | chrootscript "chroot/publish" "setting config permissions" 18 | chrootscript "disk/trim" "checking for trim support" 19 | 20 | # grub: install package, install, generate config 21 | if ! iroot nobootloader; then 22 | if efibootmgr; then 23 | chrootscript "bootloader/efi" "installing bootloader" 24 | else 25 | chrootscript "bootloader/install" "installing bootloader" 26 | fi 27 | fi 28 | 29 | chrootscript "network/network" "setting up networkmanager" && 30 | chrootscript "user/user" "setting up user" && 31 | chrootscript "bootloader/config" "configuring bootloader" 32 | 33 | touch /opt/noerror 34 | [ -e /opt/noerror ] && rm /opt/noerror 35 | 36 | # make instantOS packages optional 37 | if ! iroot onlyarch && 38 | ! [ -e /opt/onlyarch ]; then 39 | 40 | # important stuff 41 | chrootscript "instantos/install" "configuring instantOS, this will take a while" 42 | chrootscript "instantos/version" "collecting version info" 43 | chrootscript "user/shell" "setting up instantshell zsh configuration" 44 | chrootscript "user/appearance" "setting up default themes" 45 | chrootscript "user/flatpak" "setting up flatpak" 46 | 47 | if grep -iq 'manjaro' /etc/os-release; then 48 | echo "manjaro extra steps" 49 | chrootscript "chroot/chroot" "extra steps for manjaro" 50 | fi 51 | fi 52 | 53 | chrootscript "lang/locale" "setting locale" 54 | 55 | chrootscript "chroot/clean" "cleaning pacman cache" 56 | chrootscript "chroot/cacheclean" "cleaning pacman cache" 57 | 58 | # mark installation as susccessful 59 | touch /opt/installsuccess 60 | -------------------------------------------------------------------------------- /topinstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # install instantOS on top of an existing system 4 | # this is currently not stable, tested or supported 5 | # do not use (please) 6 | 7 | # print logo 8 | echo "" 9 | echo "" 10 | curl -s 'https://raw.githubusercontent.com/instantOS/instantLOGO/main/ascii.txt' | sed 's/^/ /g' 11 | echo "" 12 | echo "" 13 | 14 | if ! whoami | grep -iq '^root'; then 15 | echo "please run this as root" 16 | exit 17 | fi 18 | 19 | if ! command -v imenu; then 20 | curl -s https://raw.githubusercontent.com/instantOS/imenu/main/imenu.sh >/usr/local/bin/imenu 21 | chmod 755 /usr/local/bin/imenu 22 | fi 23 | 24 | touch /tmp/climenu 25 | 26 | # only runs on arch based distros 27 | if ! grep -Eiq '(arch|manjaro)' /etc/os-release; then 28 | echo "system does not appear to be arch based. 29 | instantARCH only works on arch based systems like Arch and Manjaro 30 | are you sure you want to run this?" | imenu -C || { 31 | imenu -m "installation canceled" 32 | exit 33 | } 34 | fi 35 | 36 | touch /opt/topinstall 37 | 38 | pacman -Sy --noconfirm 39 | 40 | # todo: askmirrors 41 | 42 | pacman -S git --noconfirm --needed 43 | 44 | cd /root 45 | [ -e instantARCH ] && rm -rf instantARCH 46 | git clone --depth=1 https://github.com/instantos/instantARCH.git 47 | cd instantARCH 48 | 49 | chmod +x *.sh 50 | chmod 755 ./*/*.sh 51 | 52 | mkdir config 53 | 54 | ./depend/depend.sh 55 | 56 | # do all actions requiring user input first 57 | ./topask.sh 58 | 59 | if ! command -v mhwd && iroot automirror; then 60 | pacman -S reflector --noconfirm --needed 61 | echo "selecting fastest mirror" 62 | reflector --latest 40 --protocol http --protocol https --sort rate --save /etc/pacman.d/mirrorlist 63 | pacman -Sy --noconfirm 64 | fi 65 | 66 | ./init/init.sh 67 | 68 | pacman -S --noconfirm --needed base \ 69 | linux linux-headers \ 70 | linux-lts linux-lts-headers \ 71 | linux-firmware 72 | 73 | ./depend/system.sh 74 | ./chroot/chroot.sh 75 | ./chroot/drivers.sh 76 | ./network/network.sh 77 | ./bootloader/config.sh 78 | 79 | if ! ls /home/ | grep -q ..; then 80 | ./user/modify.sh 81 | else 82 | ./user/user.sh 83 | fi 84 | 85 | ./user/shell.sh 86 | 87 | ./lang/timezone.sh 88 | ./lang/locale.sh 89 | ./lang/xorg.sh 90 | ./instantos/install.sh 91 | 92 | echo "finished installing instantOS" 93 | imenu -c "a reboot is required. reboot now?" && touch /tmp/instantosreboot 94 | rm /tmp/climenu 95 | 96 | [ -e /usr/local/bin/imenu ] && rm /usr/local/bin/imenu 97 | [ -e /tmp/instantosreboot ] && reboot 98 | -------------------------------------------------------------------------------- /ask.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This is the interactive part of the installer 4 | # Everything requiring user input is asked first, 5 | # NO INSTALLATION IS DONE IN THIS SCRIPT 6 | # Results get saved in $INSTANTARCH/config 7 | # and read out during installation 8 | # results also get copied to the target root partition 9 | 10 | mkdir -p "$INSTANTARCH"/config &>/dev/null 11 | mkdir config &>/dev/null 12 | 13 | source <(curl -Ls 'https://raw.githubusercontent.com/paperbenni/bash/master/import.sh') 14 | pb dialog 15 | 16 | source /root/instantARCH/utils.sh 17 | source /root/instantARCH/askutils.sh 18 | 19 | checkguimode 20 | 21 | # switch imenu to using fzf and dialog 22 | if ! guimode; then 23 | touch /tmp/climenu 24 | imenu -m "Welcome to the instantOS installer" 25 | else 26 | NEXTCHOICE="$(echo '>>h Welcome to the instantOS installer 27 | :g Next 28 | :r ﰸCancel' | instantmenu -q 'select using the mouse, keywords and arrow keys' -i -l 209 -h -1 -bw 8 -a 60 -w -1 -c)" 29 | 30 | if grep -iq 'cancel' <<<"$NEXTCHOICE"; then 31 | echo "canceling installation" 32 | mkdir /opt/instantos 33 | touch /opt/instantos/installcanceled 34 | touch /opt/instantos/statuscanceled 35 | exit 1 36 | fi 37 | if iroot installtest; then 38 | imenu -m "WARNING: you're running a test version of the installer 39 | branch: $TESTBRANCH 40 | pacman repo: ${CUSTOMINSTANTREPO:-default}" 41 | fi 42 | 43 | if [ -n "$INSTANTARCHTESTING" ]; then 44 | if imenu -c 'enable debug mode?'; then 45 | echo 'enabling debug mode' 46 | touch /tmp/installdebug 47 | export INSTALLDEBUG='true' 48 | fi 49 | fi 50 | 51 | fi 52 | 53 | /root/instantARCH/askloop.sh || { 54 | imenu -m "installation was canceled" 55 | iroot cancelinstall 1 56 | exit 0 57 | } 58 | 59 | if ! iroot confirm; then 60 | if ! iroot cancelinstall; then 61 | imenu -m 'there was an error, installation will not continue' 62 | # TODO offer uploading logs 63 | fi 64 | exit 1 65 | fi 66 | 67 | if guimode; then 68 | imenu -M <<<'The installation will now begin. 69 | This could take a while. 70 | You can check install progress and logs 71 | by clicking on "2" in the top left. 72 | Keep the machine powered and connected to the internet. 73 | When installation is finished the machine will automatically reboot' 74 | else 75 | imenu -M <<<'The installation will now begin. 76 | This could take a while. 77 | Keep the machine powered and connected to the internet. 78 | When installation is finished the machine will automatically reboot' 79 | fi 80 | -------------------------------------------------------------------------------- /chroot/drivers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # auto detect graphics card and install drivers accordingly 3 | # if the system uses nvidia, read out the user choice 4 | 5 | echo "installing video drivers" 6 | 7 | source /root/instantARCH/moduleutils.sh 8 | 9 | # works differently on manjaro 10 | if ! grep -iq '^name.*arch' /etc/os-release; then 11 | exit 12 | fi 13 | 14 | if iroot isvm; then 15 | echo "installing virtual machine drivers" 16 | if iroot kvm; then 17 | echo "installing QEMU drivers" 18 | pacloop xorg-drivers 19 | else 20 | if iroot vmware || lspci | grep -i vmware; then 21 | pacloop open-vm-tools 22 | sudo systemctl enable vmtoolsd.service 23 | fi 24 | pacloop mesa xf86-video-vmware 25 | fi 26 | else 27 | ## NVIDIA 28 | if lspci | grep -i vga | grep -i nvidia; then 29 | pacman -S --noconfirm dkms 30 | # user chooses open source, proprietary or no driver 31 | if iroot graphics; then 32 | DRIVERFILE="$IROOT/graphics" 33 | if grep -iq "nodriver" "$DRIVERFILE"; then 34 | exit 35 | elif grep -iq "dkms" "$DRIVERFILE"; then 36 | pacloop nvidia-dkms nvidia-utils 37 | 38 | if ! uname -m | grep -q '^i'; then 39 | pacloop lib32-nvidia-utils 40 | fi 41 | elif grep -iq "nvidia" "$DRIVERFILE"; then 42 | pacloop nvidia nvidia-utils nvidia-lts 43 | if ! uname -m | grep -q '^i'; then 44 | pacloop lib32-nvidia-utils 45 | fi 46 | elif grep -iq "open" "$DRIVERFILE"; then 47 | pacloop mesa xf86-video-nouveau 48 | fi 49 | 50 | if iroot graphics | grep -iEq '(|dkms)'; then 51 | echo "installing nvidia-settings" 52 | pacloop nvidia-settings 53 | fi 54 | else 55 | echo "defaulting to open source driver" 56 | pacloop mesa xf86-video-nouveau 57 | fi 58 | pacloop vulkan-icd-loader 59 | pacloop lib32-vulkan-icd-loader 60 | ## Intel 61 | elif lspci | grep -i vga | grep -i intel; then 62 | echo "intel integrated detected" 63 | pacloop mesa xf86-video-intel 64 | else 65 | echo "other graphics detected" 66 | pacloop mesa xorg-drivers 67 | fi 68 | fi 69 | 70 | # 32 bit mesa 71 | if ! uname -m | grep -q '^i'; then 72 | pacloop lib32-mesa 73 | fi 74 | 75 | if lspci | grep -i marvell; then 76 | echo "installing firmware needed for marvell wifi" 77 | pacloop linux-firmware-marvell 78 | fi 79 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing to instantARCH 2 | 3 | Before implementing a feature make sure the feature is actually wanted. 4 | You can do this by discussing it on our Discord or any of the other methods mentioned on the 5 | [support site](https://instantos.github.io/instantos.github.io/support) 6 | 7 | Any change to instantARCH should meet the following requirements. 8 | 9 | It should be available in both the CLI and the GUI version. 10 | A good starting point for that is the imenu script which creates menus that adapt to running in either GUI or CLI mode. 11 | 12 | It should keep the installer usable for people with little technical knowledge. 13 | instantARCH is meant to provide a similar experience to installers Calamares or Ubuntu's Ubiquity installer. 14 | Any features that require more technical skill to understand and use should not require mandatory user input during installation. 15 | Anything like that is an unavoidable obstacle for casual users. 16 | That said, any addition to instantARCH is more than welcome, all that means is that complex functionality should be put in an "advanced options" menu of some sort. 17 | 18 | Anything requiring user input should be asked before installation. 19 | This works by putting it in the ask.sh script and saving the result with the iroot utility. 20 | and later reading it out during installation. 21 | You should be able to answer all questions before installation and then letting the computer sit for a while. 22 | There's nothing more frustrating than letting your computer with german internet sit for an entire night to discover that it stopped at some confirmation prompt you didn't anticipate. 23 | 24 | ## Stability 25 | 26 | Because instantARCH is the onboarding process for instantOS, breaking it makes 27 | the entire rest inaccessible for new or reinstalling users, so it is crucial to 28 | keep uptime as high as possible. Before contributing any changes in 29 | functionality or architecture make sure you did at least one test installation 30 | to check that it doesn't prevent installing instantOS from working. If that is 31 | not possible for you or the feature might require some more testing, PR to the 32 | testing branch instead of main. The testing branch will not be distributed to 33 | the iso automatically and is safe to break as it is opt-in through the 34 | development tools. 35 | 36 | ## Getting started with instantARCH development 37 | 38 | instantARCH uses different modules for different stages of the installation. 39 | This allows for reordering them and potentially reusing them or making some of them optional (like the uefi grub module) 40 | The central installer script asks all questions using ask.sh first and then saves the answers using the iroot utility. 41 | Then it calls all the modules that read out the answers during installation. 42 | It is important to distinguish between escript modules that run in the installation medium and chrootscript modules 43 | that get executed inside the (unfinished) installation. 44 | -------------------------------------------------------------------------------- /depend/depend.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # this installs dependencies needed for the installer 4 | # like fzf for menus 5 | 6 | source /root/instantARCH/moduleutils.sh 7 | 8 | if [ -e /opt/instantos/buildmedium ]; then 9 | echo "skipping dependencies" 10 | exit 11 | fi 12 | 13 | echo "downloading installer dependencies" 14 | 15 | setinfo() { 16 | if [ -e /usr/share/liveutils ]; then 17 | pkill instantmenu 18 | fi 19 | echo "$@" >/opt/instantprogress 20 | echo "$@" 21 | } 22 | 23 | setinfo "downloading installer dependencies" 24 | 25 | # mark install as non-topinstall 26 | mkdir -p /opt/instantos 27 | touch /opt/instantos/realinstall 28 | 29 | # enable multilib 30 | # do it before updating mirrors 31 | if uname -m | grep -q '^i' || 32 | grep -qi '^\[multilib' /etc/pacman.conf || 33 | grep -qi 'manjaro' /etc/os-release; then 34 | echo "not enabling multilib" 35 | else 36 | echo "enabling multilib" 37 | echo "[multilib]" >>/etc/pacman.conf 38 | echo "Include = /etc/pacman.d/mirrorlist" >>/etc/pacman.conf 39 | fi 40 | 41 | updaterepos 42 | 43 | # install reflector for automirror 44 | if ! grep -i 'manjaro' /etc/os-release; then 45 | pacloop reflector 46 | fi 47 | 48 | checkpackage() { 49 | if command -v "$1" || pacman -Qi "$1" &>/dev/null; then 50 | echo "$1 is installed" 51 | else 52 | if [ -z "$CHECKPACKAGEKEYRING" ]; then 53 | pacman -Sy 54 | pacman -S archlinux-keyring --noconfirm || exit 1 55 | export CHECKPACKAGEKEYRING="true" 56 | fi 57 | pacloop "$1" 58 | fi 59 | } 60 | 61 | installdepends() { 62 | 63 | if ! [ -e /usr/share/liveutils ]; then 64 | pacloop fzf \ 65 | gum \ 66 | expect \ 67 | git \ 68 | os-prober \ 69 | dialog \ 70 | imvirt \ 71 | lshw \ 72 | bash \ 73 | pacman-contrib \ 74 | curl 75 | 76 | else 77 | echo "installing without upgrading" 78 | 79 | checkpackage gum || return 1 80 | checkpackage fzf || return 1 81 | checkpackage expect || return 1 82 | checkpackage git || return 1 83 | checkpackage os-prober || return 1 84 | checkpackage dialog || return 1 85 | checkpackage imvirt || return 1 86 | checkpackage lshw || return 1 87 | checkpackage bash || return 1 88 | checkpackage pacman-contrib || return 1 89 | checkpackage curl || return 1 90 | fi 91 | } 92 | 93 | pacman -Sy 94 | installdepends || exit 1 95 | 96 | # upgrade instantmenu 97 | if command -v instantmenu; then 98 | pacloop instantmenu 99 | fi 100 | 101 | if [ -e /usr/share/liveutils ]; then 102 | pkill instantmenu 103 | fi 104 | 105 | # installer variables utility 106 | cat /root/instantARCH/iroot.sh >/usr/bin/iroot 107 | chmod 755 /usr/bin/iroot 108 | -------------------------------------------------------------------------------- /installutils.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # functions used for the actual installation 4 | 5 | # reset working dir 6 | rcd() { 7 | cd /root/instantARCH 8 | } 9 | 10 | # this gets executed if a module fails 11 | # it marks the installation as failed 12 | serror() { 13 | # touching noerror skips error checking for one check 14 | if [ -e /opt/noerror ]; then 15 | echo "skipping error" 16 | rm /opt/noerror 17 | else 18 | # indicator file 19 | touch /opt/installfailed 20 | echo "script failed" 21 | exit 1 22 | fi 23 | } 24 | 25 | # this sets the status message 26 | # displayed at the bottom of the screen when using the GUI installer 27 | setinfo() { 28 | if [ -e /usr/share/liveutils ]; then 29 | pkill instantmenu 30 | fi 31 | echo "$@" >/opt/instantprogress 32 | echo "$@" 33 | } 34 | 35 | testecho() { 36 | if [ -n "$INSTANTARCHTESTING" ]; then 37 | echo "test-message:" "$@" 38 | notify-send "$@" 39 | fi 40 | } 41 | 42 | isdebug() { 43 | if { 44 | [ -n "$INSTALLDEBUG" ] || [ -e /tmp/installdebug ] 45 | }; then 46 | echo 'debugging mode is enabled' 47 | return 0 48 | else 49 | return 1 50 | fi 51 | } 52 | 53 | # run a script inside the installation medium 54 | escript() { 55 | STARTDURATION="$SECONDS" 56 | setinfo "${2:-info}" 57 | rcd 58 | testecho "running native script $1" 59 | ./"$1".sh || serror 60 | echo "$1" >>/tmp/instantprogress 61 | debugmenu "$1" 62 | } 63 | 64 | # scripts executed in installed environment 65 | chrootscript() { 66 | STARTDURATION="$SECONDS" 67 | setinfo "${2:-info}" 68 | # check if chroot environment is working 69 | if ! mount | grep -q '/mnt'; then 70 | echo "mount failed" 71 | exit 1 72 | fi 73 | 74 | rcd 75 | 76 | testecho "running chroot script $1" 77 | 78 | arch-chroot /mnt "/root/instantARCH/${1}.sh" || serror 79 | 80 | echo "chroot: $1" >>/tmp/instantprogress 81 | 82 | debugmenu "$1" 83 | } 84 | 85 | # allows pausing the installer after each step 86 | debugmenu() { 87 | { 88 | [ -n "$INSTALLDEBUG" ] || [ -e /tmp/installdebug ] 89 | } || return 0 90 | DURATION="$((SECONDS - STARTDURATION))" 91 | DEBUGCHOICE="$( 92 | { 93 | echo "> ran task $1" 94 | echo "> took $DURATION seconds" 95 | echo ":ypause" 96 | echo ":rcancel" 97 | echo ":gcontinue" 98 | } | imenu -l "debug menu" 99 | )" 100 | case "$DEBUGCHOICE" in 101 | *pause) 102 | echo 'pausing installation' 103 | touch /tmp/installpause 104 | echo 'installation paused, waiting for removal of /tmp/installpause' 105 | while [ -e /tmp/installpause ]; do 106 | sleep 10 107 | done 108 | ;; 109 | *cancel) 110 | echo 'quitting installation' 111 | echo 'TODO: implement' 112 | ;; 113 | *continue) 114 | echo "continuing installation" 115 | ;; 116 | esac 117 | STARTDURATION=0 118 | 119 | } 120 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

17 |
18 |