diff options
author | KoNicks | 2021-01-26 23:12:25 +0200 |
---|---|---|
committer | KoNicks | 2021-01-26 23:12:25 +0200 |
commit | 6a43cecf06e9dffaa535bd49389b56df0a252788 (patch) | |
tree | 651cfd0cb2532698fcd5c0debeb06d87f38f8a89 | |
download | aur-6a43cecf06e9dffaa535bd49389b56df0a252788.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 42 | ||||
-rw-r--r-- | PKGBUILD | 40 | ||||
-rwxr-xr-x | install | 52 | ||||
-rwxr-xr-x | koffe | 82 | ||||
-rw-r--r-- | pi.is | 69 |
5 files changed, 285 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..bca229cb78c3 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,42 @@ +pkgbase = koffe + pkgdesc = simple tool for creating easy to use and offline-friendly arch installers with aur support + pkgver = 1.0.0 + pkgrel = 1 + arch = x86_64 + arch = i686 + arch = ARM + license = GPL + depends = bash + depends = autoconf + depends = automake + depends = binutils + depends = bison + depends = fakeroot + depends = file + depends = findutils + depends = flex + depends = gawk + depends = gcc + depends = gettext + depends = grep + depends = groff + depends = gzip + depends = libtool + depends = m4 + depends = make + depends = pacman + depends = patch + depends = pkgconf + depends = sed + depends = sudo + depends = texinfo + depends = which + depends = archiso + depends = git + source = install + source = koffe + source = pi.is + md5sums = SKIP + +pkgname = koffe + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..10e6fbd5474c --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,40 @@ +# This is an example PKGBUILD file. Use this as a start to creating your own, +# and remove these comments. For more information, see 'man PKGBUILD'. +# NOTE: Please fill out the license field for your package! If it is unknown, +# then please put 'unknown'. + +# Maintainer: KoNicks <konicksdev@gmail.com> +pkgname=koffe +pkgver=1.0.0 +pkgrel=1 +epoch= +pkgdesc="simple tool for creating easy to use and offline-friendly arch installers with aur support" +arch=(x86_64 i686 ARM) +url="" +license=('GPL') +groups=() +depends=(bash autoconf automake binutils bison fakeroot file findutils flex gawk gcc gettext grep groff gzip libtool m4 make pacman patch pkgconf sed sudo texinfo which archiso git) +makedepends=() +checkdepends=() +optdepends=() +provides=() +conflicts=() +replaces=() +backup=() +options=() +install= +changelog= +source=('install' 'koffe' 'pi.is') +noextract=() +md5sums=(c0c0b373309e612ceb8b6ce030b81b0b 13f5f49c1da77a9421c77d0928286faa 2517bc633960b8e53d16806afde59bba) +validpgpkeys=() + +package() { + mkdir $pkgdir/usr/ + mkdir $pkgdir/usr/bin/ + mkdir $pkgdir/usr/share/ + cp $startdir/koffe $pkgdir/usr/bin/ + mkdir $pkgdir/usr/share/koffe/ + cp $startdir/install $pkgdir/usr/share/koffe/ + cp $startdir/pi.is $pkgdir/usr/share/koffe/ +} diff --git a/install b/install new file mode 100755 index 000000000000..1f8cc82662ce --- /dev/null +++ b/install @@ -0,0 +1,52 @@ +#!/bin/bash +whiptail --clear --backtitle "Koffe Offline Arch Installer - made by Konicks(GRI)" --title "Welcome screen" --msgbox "Welcome to Koffe, the offline arch installer, with your permission we'll get started :)" 0 0 +echo "Unpacking linux and the other stuff:" +echo '' > /etc/pacman.conf +echo '[options]' >> /etc/pacman.conf +echo 'Architecture = auto' >> /etc/pacman.conf +echo 'SigLevel = Never' >> /etc/pacman.conf +echo 'LocalFileSigLevel = Never' >> /etc/pacman.conf +echo '[koffe]' >> /etc/pacman.conf +echo 'Server = file:///root/pkg' >> /etc/pacman.conf +repo-add /root/pkg/koffe.db.tar.gz /root/pkg/* +pacman -Sy +whiptail --clear --backtitle "Koffe Offline Arch Installer - made by Konicks(GRI)" --title "CFdisk" --msgbox "So, we need to partition the disk. I'll launch cfdisk for you in just a sec, just choose the disk to partition" 0 0 +lsblk | grep disk | cut -f 1 -d ' ' > drvs +sed -e 's/$/ disk/' -i drvs +declare -a disks +disks=(`cat drvs`) +drv=$(whiptail --title "Select drive to partition" --menu "Select drive to partition" 16 78 10 "${disks[@]}" 3>&1 1>&2 2>&3 3>&-) +cfdisk /dev/$drv +lsblk | grep part | cut -f 1 -d ' ' | cut -c 3- > drvs +sed -e 's/$/ part/' -i drvs +declare -a parts +parts=(`cat drvs`) +ppart=$(whiptail --title "Select the partiton to install linux to:" --menu "Select the partiton to install linux to (this will wipe the partition):" 16 78 10 "${parts[@]}" 3>&1 1>&2 2>&3 3>&-) +mkfs.ext4 /dev/$ppart +mount /dev/$ppart /mnt +echo no disk >> drvs +parts=(`cat drvs`) +pswap=$(whiptail --title "Select the partiton to install swap to:" --menu "Select the partiton to install swap to (no disk if none):" 16 78 10 "${parts[@]}" 3>&1 1>&2 2>&3 3>&-) +mkswap /dev/$pswap +swapon /dev/$pswap +pefi=$(whiptail --title "Select the partiton to install EFI to:" --menu "Select the partiton to install EFI to (no disk if you have legacy bios):" 16 78 10 "${parts[@]}" 3>&1 1>&2 2>&3 3>&-) +mkdir /mnt/boot +mkfs.fat -F32 /dev/$pefi +mount /dev/$pefi /mnt/boot +extraparts=$(whiptail --inputbox "If you want to mount any other partition manually, enter the commands here like this: command 1 ; command 2 ; command 3" 0 0 0 3>&1 1>&2 2>&3 3>&-) +echo $extraparts > coms +bash coms +whiptail --clear --backtitle "Koffe Offline Arch Installer - made by Konicks(GRI)" --title "Initial setup ready" --msgbox "Well, that was it for the initial setup, now press ok, grab a cup of coffee and wait for linux to install. Be sure to stick around for the post-install configurations tho." 0 0 +#if one package errors out for whatever reason the whole pacstrap fails so i removed this implementation +#pacstrap /mnt - < install.list +for pac in $(cat install.list) +do + pacstrap /mnt $pac +done +genfstab -U /mnt >> /mnt/etc/fstab +cp pi.is /mnt/root/ +echo 'bash /root/pi.is' > /mnt/root/.bashrc +echo 'echo "" > /root/.bashrc' >> /mnt/root/.bashrc +arch-chroot /mnt +whiptail --clear --backtitle "Koffe Offline Arch Installer - made by Konicks(GRI)" --title "Goodbye screen" --msgbox "Well, that was everything. I'll reboot the system for you" 0 0 +reboot diff --git a/koffe b/koffe new file mode 100755 index 000000000000..56734c6dfcf8 --- /dev/null +++ b/koffe @@ -0,0 +1,82 @@ +#!/bin/bash +if [ $1 ]; +then + echo koffe is a tool for making simple and intuitive offline archlinux installers with support for most packages, package group or aur packages. +fi +if [ $(whoami) != root ]; +then + echo the program needs to be ran as root, no further warnings will be issued +fi +if [ $(whoami) == root ]; +then + whouser=$(who | cut -f 1 -d ' ') + cp /usr/share/koffe/* /usr/share/archiso/configs/releng/airootfs/root/ + echo '' > /usr/share/archiso/configs/releng/airootfs/root/install.list + pacman -Sy + mkdir /tmp/koffe/ + mkdir /tmp/koffe/l/ + mkdir /tmp/koffe/n/ + mkdir /tmp/koffe/aur/ + mkdir /tmp/koffe/aurbg/ + mkdir /usr/share/archiso/configs/releng/airootfs/root/pkg/ + mkdir ~/koffeiso + mkdir ~/out + rm -rf /var/cache/pacman/pkg/* + pactree -u -s libnewt > /tmp/koffe/n/libnewt + pacman -Sp --noconfirm - < /tmp/koffe/n/libnewt > /tmp/koffe/l/libnewt + echo libnewt >> /usr/share/archiso/configs/releng/airootfs/root/install.list + declare -a prog + prog=$(whiptail --inputbox "Please enter all the programs to be included in the installer separated by a space, you can also include package groups like gnome or xorg" 0 0 4 3>&1 1>&2 2>&3 3>&-) + for app in $prog + do + variable=$(pacman -Sg $app) + if [[ $variable == '' ]]; + then + #base + pactree -u -s $app > /tmp/koffe/n/$app + pacman -Sp --noconfirm - < /tmp/koffe/n/$app > /tmp/koffe/l/$app + echo $app >> /usr/share/archiso/configs/releng/airootfs/root/install.list + wget -nc -i /tmp/koffe/l/$app -P /usr/share/archiso/configs/releng/airootfs/root/pkg/ + fi + if [[ $variable != '' ]]; + then + #gnome + pacman -Sg $app > /tmp/koffe/generaltemp + cut -f 2- -d ' ' /tmp/koffe/generaltemp > /tmp/koffe/grlist + grlist=$(cat /tmp/koffe/grlist) + echo '' > /tmp/koffe/grtree + for component in $grlist + do + pactree -s -u $component >> /tmp/koffe/grtree + echo $component >> /usr/share/archiso/configs/releng/airootfs/root/install.list + done + pacman -Sp --noconfirm - < /tmp/koffe/grtree > /tmp/koffe/grlinks + wget -nc -i /tmp/koffe/grlinks -P /usr/share/archiso/configs/releng/airootfs/root/pkg/ + fi + done + aurpacs=$(whiptail --inputbox "Please enter all aur packages to be included in the install" 0 0 4 3>&1 1>&2 2>&3 3>&-) + for aurapp in $aurpacs + do + git clone https://aur.archlinux.org/$aurapp /tmp/koffe/aurbg/$aurapp + chown -hR $whouser /tmp/koffe/ + cd /tmp/koffe/aurbg/$aurapp + sudo -u $whouser makepkg --noconfirm + cp /tmp/koffe/aurbg/$aurapp/*.pkg.tar.zst /usr/share/archiso/configs/releng/airootfs/root/pkg + echo $aurapp >> /usr/share/archiso/configs/releng/airootfs/root/install.list + declare -a bb + bb=$(cat /tmp/koffe/aurbg/$aurapp/PKGBUILD | grep depends= | cut -f 2 -d '=' | cut -c 2- | rev | cut -c 2- | rev | sed -r 's/(\x27|&|\[|\])/\ /g' | cut -f 1 -d '>' | cut -f 1 -d ':') + bb=$bb' '$(cat /tmp/koffe/aurbg/$aurapp/PKGBUILD | grep depends_x86_64= | cut -f 2 -d '=' | cut -c 2- | rev | cut -c 2- | rev | sed -r 's/(\x27|&|\[|\])/\ /g' | cut -f 1 -d '>' | cut -f 1 -d ':') + bb=$bb' '$(cat /tmp/koffe/aurbg/$aurapp/PKGBUILD | grep depends_i686= | cut -f 2 -d '=' | cut -c 2- | rev | cut -c 2- | rev | sed -r 's/(\x27|&|\[|\])/\ /g' | cut -f 1 -d '>' | cut -f 1 -d ':') + for depend in $bb + do + pactree -u -s $depend > /tmp/koffe/n/$depend + pacman -Sp --noconfirm - < /tmp/koffe/n/$depend > /tmp/koffe/l/$depend + wget -nc -i /tmp/koffe/l/$depend -P /usr/share/archiso/configs/releng/airootfs/root/pkg/ + done + done + mkarchiso -v -w ~/koffeiso -o ~/out /usr/share/archiso/configs/releng + rm -rf ~/koffeiso + rm -rf /usr/share/archiso/configs/releng/airootfs/root/* + rm -rf /tmp/koffe/ +fi + diff --git a/pi.is b/pi.is new file mode 100644 index 000000000000..f7d3fd095525 --- /dev/null +++ b/pi.is @@ -0,0 +1,69 @@ +systemctl enable NetworkManager +systemctl enable sddm.service +systemctl enable gdm.service +systemctl enable lightdm +whiptail --clear --backtitle "Koffe Offline Arch Installer - made by Konicks(GRI)" --title "Finishing setup" --msgbox "Well, linux is installed (kinda), let's go through the final setup and configure it a bit" 0 0 +cd /usr/share/zoneinfo +echo */ | tr " " "\n" > ~/reg +sed -e 's/$/ region/' -i ~/reg +declare -a regs +regs=(`cat ~/reg`) +region_vague=$(whiptail --title "Finishing setup" --menu "Let's start with the region, select your region from below" 0 0 0 "${regs[@]}" 3>&1 1>&2 2>&3 3>&-) +echo $region_vague +cd /usr/share/zoneinfo/$region_vague +echo * | tr " " "\n" > ~/reg +sed -e 's/$/ region/' -i ~/reg +declare -a regs +regs=(`cat ~/reg`) +region_close=$(whiptail --title "Finishing setup" --menu "Select your city from below" 0 0 0 "${regs[@]}" 3>&1 1>&2 2>&3 3>&-) +ln -sf /usr/share/zoneinfo/$region_vague/$region_close /etc/localtime +hwclock --systohc +touch /etc/locale.conf +echo "LANG=en_US.UTF-8" > /etc/locale.conf +echo en_US.UTF-8 UTF-8 >> /etc/locale.gen +rm ~/reg +locale-gen +cd / +myhostname=$(whiptail --inputbox "Now choose a name for your computer" 0 0 4 3>&1 1>&2 2>&3 3>&-) +echo "127.0.0.1 localhost +::1 localhost +127.0.1.1 $myhostname.localdomain $myhostname" > /etc/hosts +echo "$myhostname" > /etc/hostname +archit=$(whiptail --backtitle "Koffe" --title "Architecture selector" --menu "Choose the bit count of your x86 chip" 0 0 4 \ + 64 "BIT" \ + 32 "BIT" 3>&1 1>&2 2>&3 3>&-) + efiornot=$(whiptail --backtitle "Koffe" --title "Boot selector" --menu "Is your soon-to-be-arch computer legacy or EUFI?" 0 0 4 \ + 1 "Bios/Legacy" \ + 2 "UEFI" 3>&1 1>&2 2>&3 3>&-) + pacman -S grub + if [[ "$efiornot" == "2" ]] + then + if [[ "$archit" == "64" ]] + then + grub-install --target=x86_64-efi --efi-directory=/boot + grub-mkconfig -o /boot/grub/grub.cfg + fi + if [[ "$archit" == "32" ]] + then + grub-install --target=i386-efi --efi-directory=/boot + grub-mkconfig -o /boot/grub/grub.cfg + fi + fi + if [[ "$efiornot" == "1" ]] + then + lsblk | grep disk | cut -f 1 -d ' ' > ~/drvs + sed -e 's/$/ disk/' -i ~/drvs + declare -a lname + disks=(`cat ~/drvs`) + lname=$(whiptail --title "Select drive to install grub to" --menu "Select drive to install grub to" 16 78 10 "${disks[@]}" 3>&1 1>&2 2>&3 3>&-) + grub-install --recheck /dev/$lname + grub-mkconfig -o /boot/grub/grub.cfg + fi +clear +echo Now choose a root password +passwd +myusername1=$(whiptail --inputbox "Now lets create a user, pick a username: " 0 0 4 3>&1 1>&2 2>&3 3>&-) +echo "%wheel ALL=(ALL) ALL" >> /etc/sudoers +useradd -m -G wheel $myusername1 +echo "and a password" +passwd $myusername1
\ No newline at end of file |