[update] Added outfile and --opt flag

Added outfile and (--opt) optional dependency inclusion flag for
building a more fleshed out arch install.
Also fixed and polished the scripts and the Docs a little.
main
Joaquin 3 years ago
parent ecb8ec7c89
commit 02dfdb1e7d
Signed by: puly
GPG Key ID: 9E9299CD96C65EC6
  1. 1
      Dockerfile
  2. 26
      README.md
  3. 8
      install
  4. 96
      koffe
  5. 2
      pi.is

@ -1,4 +1,5 @@
FROM archlinux FROM archlinux
ENV TERM='xterm'
RUN install -d /usr/bin/ RUN install -d /usr/bin/
RUN install -d /usr/share/koffe RUN install -d /usr/share/koffe
RUN install -d /finalimage RUN install -d /finalimage

@ -3,24 +3,30 @@
# Introduction # Introduction
koffe is a great tool for making intuitive, offline archlinux installers. Since some steps for mastering an arch iso require arch-linux, everything runs inside a container you have to create yourself. Every package installed to the new computer via the installer are from the repo, including base and linux, so no copying packages from the ISO filesystem like other offline installers that could cause issues later, everything is done as is reccommended in the official wiki, !!also remember to regenerate your koffee isos every few weeks to keep on-board packages fresh. koffe is a great tool for making intuitive, offline archlinux installers. Since some steps for mastering an arch iso require arch-linux, everything runs inside a container you have to create yourself. Every package installed to the new computer via the installer are from the repo, including base and linux, so no copying packages from the ISO filesystem like other offline installers that could cause issues later, everything is done as is reccommended in the official wiki, !!also remember to regenerate your koffee isos every few weeks to keep on-board packages fresh.
# Documentation # Documentation
```
koffe is a tool for making simple and intuitive offline archlinux installer iso's
koffe [options] <out folder>
Flags: Flags:
koffe --pacs=Prog1,Prog2 -----> starts koffe and creates
an iso that installs programs Prog1 and Prog2, koffe --pacs=Prog1,Prog2 --> starts koffe and creates
You should always include the basic kit of apps an iso with the programs Prog1 and Prog2
needed for an install (base,linux,grub). EFIBOOTMGR and the lib needed for menus are accounted for by koffe
IMPORTANT: Separate the progs with commas IMPORTANT: Separate the progs with commas
and do not use spaces and do not use spaces
koffe --clean ----------------> cleans building dirs after unexpected koffe --clean --> cleans building dirs after unexpected
exit or unsuccesful iso generation. Will exit or unsuccesful iso generation. Will
nullify any other args parsed with it and will nullify any other args parsed with it and will
not create an iso not create an iso
koffe --scripts=/path/path/ --> copies the scripts in the specified path koffe --scripts=/foo/bar --> copies the scripts in the specified path
and uses them instead of the default koffe and uses them instead of the default koffe
scripts in /usr/share/koffe/. Avoid paths with spaces scripts in /usr/share/koffe/. Avoid paths with spaces
koffe --opt --> Also downloads optional dependencies for packages
Use for a more complete installation.
```
# Installation # Installation
Installation is pretty easy, just boot from the iso and type `bash install`, the installer will do everything for you. Installation is pretty easy, just boot from the iso and type `bash install`, the installer will do everything for you.
@ -42,7 +48,7 @@ If you're using another distrbution create a chroot system (using the bootstrap
`sudo docker build -t koffe .` `sudo docker build -t koffe .`
(if prompted to import or update pgp keys, that means your docker archlinux img is heavily out of date, run `docker pull archlinux` to fix it. (if prompted to import or update pgp keys, that means your docker archlinux img is heavily out of date, run `docker pull archlinux` to fix it.)
## Then to run it: ## Then to run it:
@ -63,9 +69,9 @@ Koffe is not really made for installing vanilla arch quickly as much as it is fo
VM command line disk `--pacs=base,linux,grub` VM command line disk `--pacs=base,linux,grub`
Basic command line server `--pacs=base,linux,linux-firmware,grub` Basic command line server `--pacs=base,linux,linux-firmware,grub,efibootmgr`
Fully fleshed out ubuntu-like gnome install `--pacs=base,linux,linux-firmware,base-devel,grub,xorg,gnome,gdm,firefox,code,spotify,discord,minecraft-launcher,yay` (add and remove apps as needed) Fully fleshed out ubuntu-like gnome install `--opt --pacs=base,linux,linux-firmware,base-devel,grub,efibootmgr,xorg,gnome,gdm,firefox,code,spotify,discord,minecraft-launcher,yay` (add and remove apps as needed)

@ -49,5 +49,9 @@ echo 'echo "" > /root/.bashrc' >> /mnt/root/.bashrc
arch-chroot /mnt arch-chroot /mnt
whiptail --clear --backtitle "Koffe Offline Arch Installer - made by Konicks(GRI)" --title "Goodbye screen" --msgbox "Well, that was everything. Use reboot or poweroff to exit" 0 0 whiptail --clear --backtitle "Koffe Offline Arch Installer - made by Konicks(GRI)" --title "Goodbye screen" --msgbox "Well, that was everything. Use reboot or poweroff to exit" 0 0
umount -a umount -a
clear
echo "use poweroff or reboot to exit" if (whiptail --title "Koffe Finished" --yesno "Installation Finished, do you want to reboot?" 8 78); then
reboot
else
exit
fi

96
koffe

@ -1,43 +1,38 @@
#!/bin/bash #!/bin/bash
x=1 x=1
pts=/usr/share/koffe/ pts=/usr/share/koffe/
pathto=$(realpath ./) pathto=$PWD
optdep=0
pactree_command="pactree -su "
if [ $1 ]; if [ $1 ];
then then
for argument in $@ for argument in $@
do do
if [[ $argument == "--help" ]]; if [[ $argument == "--help" ]];
then then
echo "koffe is a tool for making simple and intuitive offline archlinux installers" echo "koffe is a tool for making simple and intuitive offline archlinux installer iso's"
echo "with support for most packages, package groups or aur packages." echo
echo echo "koffe [options] <out folder>"
echo "The programs you select are the only ones getting installed" echo
echo "(and the dependencies, of course), so make sure to include packages that are needed for a" echo "Flags:"
echo "healthy arch install. So smthng like " echo
echo "'koffe --pacs=base,linux,linux-firmware,sudo,grub,xorg,gnome,minecraft-launcher,code,yay'" echo " koffe --pacs=Prog1,Prog2 --> starts koffe and creates"
echo "and any other packages you want to install,"
echo "you can also use whatever WM or DE you want, just keep in mind if the greeter is anything"
echo "other than gdm, sddm or lightdm you need to enable it yourself. Also, if you're"
echo "making an archiso to be used on many computers and include multiple sets of drivers,"
echo "in the live disk you can edit 'install.list' to manage what programs to install"
echo
echo "Once you're done with the iso, to install arch just boot from it and do 'bash install'"
echo ---------------------------------------------------
echo
echo Flags:
echo "koffe --pacs=Prog1,Prog2 -----> starts koffe and creates"
echo " an iso with the programs Prog1 and Prog2" echo " an iso with the programs Prog1 and Prog2"
echo " IMPORTANT: Separate the progs with commas" echo " IMPORTANT: Separate the progs with commas"
echo " and do not use spaces" echo " and do not use spaces"
echo echo
echo "koffe --clean ----------------> cleans building dirs after unexpected" echo " koffe --clean --> cleans building dirs after unexpected"
echo " exit or unsuccesful iso generation. Will" echo " exit or unsuccesful iso generation. Will"
echo " nullify any other args parsed with it and will" echo " nullify any other args parsed with it and will"
echo " not create an iso" echo " not create an iso"
echo echo
echo "koffe --scripts=/path/path/ --> copies the scripts in the specified path" echo " koffe --scripts=/foo/bar --> copies the scripts in the specified path"
echo " and uses them instead of the default koffe" echo " and uses them instead of the default koffe"
echo " scripts in /usr/share/koffe/. Avoid paths with spaces" echo " scripts in /usr/share/koffe/. Avoid paths with spaces"
echo
echo " koffe --opt --> Also downloads optional dependencies for packages"
echo " Use for a more complete installation."
echo
exit exit
fi fi
if [[ $(echo $argument | cut -f 1 -d '=') == "--pacs" ]]; if [[ $(echo $argument | cut -f 1 -d '=') == "--pacs" ]];
@ -56,12 +51,17 @@ then
then then
if [[ $(whoami) == root ]]; if [[ $(whoami) == root ]];
then then
rm -rf ~/koffeiso rm -rf /tmp/koffe_workdir
rm -rf /tmp/koffe/rootfs/airootfs/root/* rm -rf /tmp/koffe/rootfs/airootfs/root/*
rm -rf /tmp/koffe/ rm -rf /tmp/koffe/
exit exit
fi fi
fi fi
if [[ $argument == "--opt" ]];
then
optdep=1
pactree_command="pactree -suo "
fi
done done
fi fi
if [ $(whoami) != root ]; if [ $(whoami) != root ];
@ -70,6 +70,20 @@ then
echo WARNING: the program needs to be ran as root echo WARNING: the program needs to be ran as root
echo $prog echo $prog
fi fi
for lastarg; do :; done
#GET LAST ARG ^^
if [[ $lastarg == -* ]];
then
#argument, no outfile, use PWD
pathto=$PWD
else
#outfile
pathto=$(realpath $lastarg)
fi
if [ $(whoami) == root ]; if [ $(whoami) == root ];
then then
mkdir /tmp/koffe/ mkdir /tmp/koffe/
@ -82,29 +96,16 @@ then
mkdir /tmp/koffe/rootfs/airootfs/root/pkg/ mkdir /tmp/koffe/rootfs/airootfs/root/pkg/
cp $pts/* /tmp/koffe/rootfs/airootfs/root/ cp $pts/* /tmp/koffe/rootfs/airootfs/root/
echo '' > /tmp/koffe/rootfs/airootfs/root/install.list echo '' > /tmp/koffe/rootfs/airootfs/root/install.list
mkdir ~/koffeiso mkdir /tmp/koffe_workdir
mkdir ~/out mkdir ~/out
rm -rf /var/cache/pacman/pkg/* rm -rf /var/cache/pacman/pkg/*
pactree -u -s libnewt > /tmp/koffe/n/libnewt
pacman -Spdd --noconfirm - < /tmp/koffe/n/libnewt > /tmp/koffe/l/libnewt
echo libnewt >> /tmp/koffe/rootfs/airootfs/root/install.list
wget -nc -i /tmp/koffe/l/libnewt -P /tmp/koffe/rootfs/airootfs/root/pkg/
pactree -u -s efibootmgr > /tmp/koffe/n/efibootmgr
pacman -Spdd --noconfirm - < /tmp/koffe/n/efibootmgr > /tmp/koffe/l/efibootmgr
echo efibootmgr >> /tmp/koffe/rootfs/airootfs/root/install.list
wget -nc -i /tmp/koffe/l/efibootmgr -P /tmp/koffe/rootfs/airootfs/root/pkg/
pactree -u -s grub > /tmp/koffe/n/grub if [[ x == 1 ]];
pacman -Spdd --noconfirm - < /tmp/koffe/n/grub > /tmp/koffe/l/grub
echo grub >> /tmp/koffe/rootfs/airootfs/root/install.list
wget -nc -i /tmp/koffe/l/grub -P /tmp/koffe/rootfs/airootfs/root/pkg/
if [[ x == 1 ]];
then then
declare -a prog 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 or AUR packages" 0 0 4 3>&1 1>&2 2>&3 3>&-) 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 or AUR packages" 0 0 4 3>&1 1>&2 2>&3 3>&-)
fi fi
prog="$prog libnewt"
for app in $prog for app in $prog
do do
PACAUR=0 PACAUR=0
@ -113,11 +114,11 @@ then
variable=$(pacman -Sg $app) variable=$(pacman -Sg $app)
if [[ $variable == '' ]]; if [[ $variable == '' ]];
then then
#base #simple package ex:base
aurornot=$(pactree -s -u $app 2>&1 >/dev/null | cut -f 1 -d ':') aurornot=$($pactree_command $app 2>&1 >/dev/null | cut -f 1 -d ':')
if [[ $auronnot != "error" ]]; if [[ $auronnot != "error" ]];
then then
pactree -u -s $app > /tmp/koffe/n/$app $pactree_command $app > /tmp/koffe/n/$app
pacman -Spdd --noconfirm - < /tmp/koffe/n/$app > /tmp/koffe/l/$app pacman -Spdd --noconfirm - < /tmp/koffe/n/$app > /tmp/koffe/l/$app
echo $app >> /tmp/koffe/rootfs/airootfs/root/install.list echo $app >> /tmp/koffe/rootfs/airootfs/root/install.list
wget -nc -i /tmp/koffe/l/$app -P /tmp/koffe/rootfs/airootfs/root/pkg/ wget -nc -i /tmp/koffe/l/$app -P /tmp/koffe/rootfs/airootfs/root/pkg/
@ -130,14 +131,14 @@ then
fi fi
if [[ $variable != '' ]]; if [[ $variable != '' ]];
then then
#gnome #group package ex:gnome
pacman -Sg $app > /tmp/koffe/generaltemp pacman -Sg $app > /tmp/koffe/generaltemp
cut -f 2- -d ' ' /tmp/koffe/generaltemp > /tmp/koffe/grlist cut -f 2- -d ' ' /tmp/koffe/generaltemp > /tmp/koffe/grlist
grlist=$(cat /tmp/koffe/grlist) grlist=$(cat /tmp/koffe/grlist)
echo '' > /tmp/koffe/grtree echo '' > /tmp/koffe/grtree
for component in $grlist for component in $grlist
do do
pactree -s -u $component >> /tmp/koffe/grtree $pactree_command $component >> /tmp/koffe/grtree
echo $component >> /tmp/koffe/rootfs/airootfs/root/install.list echo $component >> /tmp/koffe/rootfs/airootfs/root/install.list
done done
pacman -Spdd --noconfirm - < /tmp/koffe/grtree > /tmp/koffe/grlinks pacman -Spdd --noconfirm - < /tmp/koffe/grtree > /tmp/koffe/grlinks
@ -156,10 +157,11 @@ then
bb=$(cat /tmp/koffe/aurbg/$app/.SRCINFO | grep depends | cut -f 2 -d '=' | cut -f 1 -d '>' | cut -f 1 -d ':') bb=$(cat /tmp/koffe/aurbg/$app/.SRCINFO | grep depends | cut -f 2 -d '=' | cut -f 1 -d '>' | cut -f 1 -d ':')
for depend in $bb for depend in $bb
do do
aurdep_aur=$(pactree -s -u $depend 2>&1 >/dev/null | cut -f 1 -d ':') aurdep_aur=$($pactree_command $depend 2>&1 >/dev/null | cut -f 1 -d ':')
if [[ $aurdep_aur != "error" ]]; if [[ $aurdep_aur != "error" ]];
then then
pactree -u -s $depend > /tmp/koffe/n/$depend $pactree_command $depend > /tmp/koffe/n/$depend
pacman -Spdd --noconfirm - < /tmp/koffe/n/$depend > /tmp/koffe/l/$depend pacman -Spdd --noconfirm - < /tmp/koffe/n/$depend > /tmp/koffe/l/$depend
wget -nc -i /tmp/koffe/l/$depend -P /tmp/koffe/rootfs/airootfs/root/pkg/ wget -nc -i /tmp/koffe/l/$depend -P /tmp/koffe/rootfs/airootfs/root/pkg/
fi fi
@ -184,8 +186,8 @@ then
done done
repo-add /tmp/koffe/rootfs/airootfs/root/pkg/koffe.db.tar.gz /tmp/koffe/rootfs/airootfs/root/pkg/* repo-add /tmp/koffe/rootfs/airootfs/root/pkg/koffe.db.tar.gz /tmp/koffe/rootfs/airootfs/root/pkg/*
echo "bash ~/install" > /tmp/koffe/rootfs/airootfs/root/.zshrc echo "bash ~/install" > /tmp/koffe/rootfs/airootfs/root/.zshrc
mkarchiso -v -w ~/koffeiso -o $pathto/ /tmp/koffe/rootfs/ mkarchiso -v -w /tmp/koffe_workdir -o $pathto /tmp/koffe/rootfs/
rm -rf ~/koffeiso rm -rf /tmp/koffe_workdir
rm -rf /tmp/koffe/rootfs//airootfs/root/* rm -rf /tmp/koffe/rootfs//airootfs/root/*
rm -rf /tmp/koffe/ rm -rf /tmp/koffe/
fi fi

@ -62,8 +62,6 @@ archit=$(whiptail --backtitle "Koffe" --title "Architecture selector" --menu "Ch
grub-mkconfig -o /boot/grub/grub.cfg grub-mkconfig -o /boot/grub/grub.cfg
fi fi
clear 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>&-) 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 echo "%wheel ALL=(ALL) ALL" >> /etc/sudoers
useradd -m -G wheel $myusername1 useradd -m -G wheel $myusername1

Loading…
Cancel
Save