diff --git a/arch-chroot b/arch-chroot deleted file mode 100755 index 19bd631..0000000 --- a/arch-chroot +++ /dev/null @@ -1,357 +0,0 @@ -#!/bin/bash -mount --bind /usr/share/koffe/archbox/ /usr/share/koffe/archbox/ -shopt -s extglob - -# generated from util-linux source: libmount/src/utils.c -declare -A pseudofs_types=([anon_inodefs]=1 - [autofs]=1 - [bdev]=1 - [bpf]=1 - [binfmt_misc]=1 - [cgroup]=1 - [cgroup2]=1 - [configfs]=1 - [cpuset]=1 - [debugfs]=1 - [devfs]=1 - [devpts]=1 - [devtmpfs]=1 - [dlmfs]=1 - [efivarfs]=1 - [fuse.gvfs-fuse-daemon]=1 - [fusectl]=1 - [hugetlbfs]=1 - [mqueue]=1 - [nfsd]=1 - [none]=1 - [pipefs]=1 - [proc]=1 - [pstore]=1 - [ramfs]=1 - [rootfs]=1 - [rpc_pipefs]=1 - [securityfs]=1 - [sockfs]=1 - [spufs]=1 - [sysfs]=1 - [tmpfs]=1) - -# generated from: pkgfile -vbr '/fsck\..+' | awk -F. '{ print $NF }' | sort -declare -A fsck_types=([cramfs]=1 - [exfat]=1 - [ext2]=1 - [ext3]=1 - [ext4]=1 - [ext4dev]=1 - [jfs]=1 - [minix]=1 - [msdos]=1 - [reiserfs]=1 - [vfat]=1 - [xfs]=1) - -out() { printf "$1 $2\n" "${@:3}"; } -error() { out "==> ERROR:" "$@"; } >&2 -warning() { out "==> WARNING:" "$@"; } >&2 -msg() { out "==>" "$@"; } -msg2() { out " ->" "$@";} -die() { error "$@"; exit 1; } - -ignore_error() { - "$@" 2>/dev/null - return 0 -} - -in_array() { - local i - for i in "${@:2}"; do - [[ $1 = "$i" ]] && return 0 - done - return 1 -} - -chroot_add_mount() { - mount "$@" && CHROOT_ACTIVE_MOUNTS=("$2" "${CHROOT_ACTIVE_MOUNTS[@]}") -} - -chroot_maybe_add_mount() { - local cond=$1; shift - if eval "$cond"; then - chroot_add_mount "$@" - fi -} - -chroot_policyd() { - cat << EOF > "$1/usr/sbin/policy-rc.d" -#!/bin/sh -exit 101 -EOF - chmod +x "$1/usr/sbin/policy-rc.d" -} - -chroot_setup() { - CHROOT_ACTIVE_MOUNTS=() - [[ $(trap -p EXIT) ]] && die '(BUG): attempting to overwrite existing EXIT trap' - trap "chroot_teardown $1" EXIT - - chroot_add_mount proc "$1/proc" -t proc -o nosuid,noexec,nodev && - chroot_add_mount sys "$1/sys" -t sysfs -o nosuid,noexec,nodev,ro && - ignore_error chroot_maybe_add_mount "[[ -d '$1/sys/firmware/efi/efivars' ]]" \ - efivarfs "$1/sys/firmware/efi/efivars" -t efivarfs -o nosuid,noexec,nodev && - chroot_add_mount udev "$1/dev" -t devtmpfs -o mode=0755,nosuid && - chroot_add_mount devpts "$1/dev/pts" -t devpts -o mode=0620,gid=5,nosuid,noexec && - chroot_add_mount shm "$1/dev/shm" -t tmpfs -o mode=1777,nosuid,nodev && - chroot_add_mount /run "$1/run" --bind && - chroot_add_mount tmp "$1/tmp" -t tmpfs -o mode=1777,strictatime,nodev,nosuid - chroot_policyd "$1" -} - -chroot_teardown() { - if (( ${#CHROOT_ACTIVE_MOUNTS[@]} )); then - umount "${CHROOT_ACTIVE_MOUNTS[@]}" - fi - unset CHROOT_ACTIVE_MOUNTS - rm -f "$1/usr/sbin/policy-rc.d" -} - -try_cast() ( - _=$(( $1#$2 )) -) 2>/dev/null - -valid_number_of_base() { - local base=$1 len=${#2} i= - - for (( i = 0; i < len; i++ )); do - try_cast "$base" "${2:i:1}" || return 1 - done - - return 0 -} - -mangle() { - local i= chr= out= - local {a..f}= {A..F}= - - for (( i = 0; i < ${#1}; i++ )); do - chr=${1:i:1} - case $chr in - [[:space:]\\]) - printf -v chr '%03o' "'$chr" - out+=\\ - ;; - esac - out+=$chr - done - - printf '%s' "$out" -} - -unmangle() { - local i= chr= out= len=$(( ${#1} - 4 )) - local {a..f}= {A..F}= - - for (( i = 0; i < len; i++ )); do - chr=${1:i:1} - case $chr in - \\) - if valid_number_of_base 8 "${1:i+1:3}" || - valid_number_of_base 16 "${1:i+1:3}"; then - printf -v chr '%b' "${1:i:4}" - (( i += 3 )) - fi - ;; - esac - out+=$chr - done - - printf '%s' "$out${1:i}" -} - -optstring_match_option() { - local candidate pat patterns - - IFS=, read -ra patterns <<<"$1" - for pat in "${patterns[@]}"; do - if [[ $pat = *=* ]]; then - # "key=val" will only ever match "key=val" - candidate=$2 - else - # "key" will match "key", but also "key=anyval" - candidate=${2%%=*} - fi - - [[ $pat = "$candidate" ]] && return 0 - done - - return 1 -} - -optstring_remove_option() { - local o options_ remove=$2 IFS=, - - read -ra options_ <<<"${!1}" - - for o in "${!options_[@]}"; do - optstring_match_option "$remove" "${options_[o]}" && unset 'options_[o]' - done - - declare -g "$1=${options_[*]}" -} - -optstring_normalize() { - local o options_ norm IFS=, - - read -ra options_ <<<"${!1}" - - # remove empty fields - for o in "${options_[@]}"; do - [[ $o ]] && norm+=("$o") - done - - # avoid empty strings, reset to "defaults" - declare -g "$1=${norm[*]:-defaults}" -} - -optstring_append_option() { - if ! optstring_has_option "$1" "$2"; then - declare -g "$1=${!1},$2" - fi - - optstring_normalize "$1" -} - -optstring_prepend_option() { - local options_=$1 - - if ! optstring_has_option "$1" "$2"; then - declare -g "$1=$2,${!1}" - fi - - optstring_normalize "$1" -} - -optstring_get_option() { - local opts o - - IFS=, read -ra opts <<<"${!1}" - for o in "${opts[@]}"; do - if optstring_match_option "$2" "$o"; then - declare -g "$o" - return 0 - fi - done - - return 1 -} - -optstring_has_option() { - local "${2%%=*}" - - optstring_get_option "$1" "$2" -} - -dm_name_for_devnode() { - read dm_name <"/sys/class/block/${1#/dev/}/dm/name" - if [[ $dm_name ]]; then - printf '/dev/mapper/%s' "$dm_name" - else - # don't leave the caller hanging, just print the original name - # along with the failure. - print '%s' "$1" - error 'Failed to resolve device mapper name for: %s' "$1" - fi -} - -fstype_is_pseudofs() { - (( pseudofs_types["$1"] )) -} - -fstype_has_fsck() { - (( fsck_types["$1"] )) -} - - -usage() { - cat <[:group] Specify non-root user and optional group to use - -If 'command' is unspecified, ${0##*/} will launch /bin/bash. - -Note that when using arch-chroot, the target chroot directory *should* be a -mountpoint. This ensures that tools such as pacman(8) or findmnt(8) have an -accurate hierarchy of the mounted filesystems within the chroot. - -If your chroot target is not a mountpoint, you can bind mount the directory on -itself to make it a mountpoint, i.e. 'mount --bind /your/chroot /your/chroot'. - -EOF -} - -chroot_add_resolv_conf() { - local chrootdir=$1 resolv_conf=$1/etc/resolv.conf - - [[ -e /etc/resolv.conf ]] || return 0 - - # Handle resolv.conf as a symlink to somewhere else. - if [[ -L $chrootdir/etc/resolv.conf ]]; then - # readlink(1) should always give us *something* since we know at this point - # it's a symlink. For simplicity, ignore the case of nested symlinks. - resolv_conf=$(readlink "$chrootdir/etc/resolv.conf") - if [[ $resolv_conf = /* ]]; then - resolv_conf=$chrootdir$resolv_conf - else - resolv_conf=$chrootdir/etc/$resolv_conf - fi - - # ensure file exists to bind mount over - if [[ ! -f $resolv_conf ]]; then - install -Dm644 /dev/null "$resolv_conf" || return 1 - fi - elif [[ ! -e $chrootdir/etc/resolv.conf ]]; then - # The chroot might not have a resolv.conf. - return 0 - fi - - chroot_add_mount /etc/resolv.conf "$resolv_conf" --bind -} - -while getopts ':hu:' flag; do - case $flag in - h) - usage - exit 0 - ;; - u) - userspec=$OPTARG - ;; - :) - die '%s: option requires an argument -- '\''%s'\' "${0##*/}" "$OPTARG" - ;; - ?) - die '%s: invalid option -- '\''%s'\' "${0##*/}" "$OPTARG" - ;; - esac -done -shift $(( OPTIND - 1 )) - -(( EUID == 0 )) || die 'This script must be run with root privileges' -(( $# )) || die 'No chroot directory specified' -chrootdir=$1 -shift - -[[ -d $chrootdir ]] || die "Can't create chroot on non-directory %s" "$chrootdir" - -if ! mountpoint -q "$chrootdir"; then - warning "$chrootdir is not a mountpoint. This may have undesirable side effects." -fi - -chroot_setup "$chrootdir" || die "failed to setup chroot %s" "$chrootdir" -chroot_add_resolv_conf "$chrootdir" || die "failed to setup resolv.conf" - -chroot_args=() -[[ $userspec ]] && chroot_args+=(--userspec "$userspec") - -SHELL=/bin/bash unshare --fork --pid chroot "${chroot_args[@]}" -- "$chrootdir" "$@" diff --git a/install b/install deleted file mode 100644 index 53439e8..0000000 --- a/install +++ /dev/null @@ -1 +0,0 @@ -bash ~/koffe.is \ No newline at end of file diff --git a/install-box b/install-box deleted file mode 100755 index 44b5871..0000000 --- a/install-box +++ /dev/null @@ -1,26 +0,0 @@ -pacman-key --init -pacman-key --populate archlinux -pacman-key --refresh-keys -pacman -Sy --noconfirm wget pacman-contrib libnewt archiso nano gzip -rm ~/.bashrc -wget https://raw.githubusercontent.com/KoNickss/koffe/main/.bashrc -P ~/ -rm /usr/bin/pkgdown -wget https://raw.githubusercontent.com/KoNickss/koffe/main/pkgdown -P /usr/bin/ -chmod +x /usr/bin/pkgdown -rm /usr/bin/register2 -wget https://raw.githubusercontent.com/KoNickss/koffe/main/register2 -P /usr/bin/ -chmod +x /usr/bin/register2 -mkdir /arch -mkdir /iso -mkdir/arch/temp -mkdir /arch/scripts -mkdir /arch/pkgs -rm /arch/scripts/koffe.is -rm /arch/scripts/pi.is -rm /arch/scripts/install -rm /usr/bin/reregister -wget https://raw.githubusercontent.com/KoNickss/koffe/main/koffe.is -P /arch/scripts/ -wget https://raw.githubusercontent.com/KoNickss/koffe/main/pi.is -P /arch/scripts/ -wget https://raw.githubusercontent.com/KoNickss/koffe/main/install -P /arch/scripts/ -wget https://raw.githubusercontent.com/KoNickss/koffe/main/reregister -P /usr/bin/ -chmod +x /usr/bin/reregister diff --git a/install-host b/install-host deleted file mode 100644 index 67a91d5..0000000 --- a/install-host +++ /dev/null @@ -1,8 +0,0 @@ -mkdir /usr/share/koffe -rm /usr/share/koffe/arch-chroot -wget https://raw.githubusercontent.com/KoNickss/koffe/main/arch-chroot -P /usr/share/koffe/ -chmod +x /usr/share/koffe/arch-chroot -rm /usr/bin/koffe-shell -wget https://raw.githubusercontent.com/KoNickss/koffe/main/koffe-shell -P /usr/bin/ -chmod +x /usr/bin/koffe-shell -mkdir /usr/share/koffe/archbox diff --git a/koffe-shell b/koffe-shell deleted file mode 100755 index d29a11b..0000000 --- a/koffe-shell +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -sudo bash /usr/share/koffe/arch-chroot /usr/share/koffe/archbox -sudo mv /usr/share/koffe/archbox/out/* ~/. diff --git a/koffe.is b/koffe.is deleted file mode 100755 index 890b7cd..0000000 --- a/koffe.is +++ /dev/null @@ -1,48 +0,0 @@ -#!/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 -#to implement extras file -pacstrap /mnt - < install.list -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/pi.is b/pi.is deleted file mode 100644 index f7d3fd0..0000000 --- a/pi.is +++ /dev/null @@ -1,69 +0,0 @@ -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 diff --git a/pkgdown b/pkgdown deleted file mode 100755 index e528c52..0000000 --- a/pkgdown +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -touch /tmp/cll -declare -a programs -ls /arch/pkgs > /tmp/temporary33 -echo done >> /tmp/temporary33 -sed -e 's/$/ +/' -i /tmp/temporary33 -programs=(`cat /tmp/temporary33`) -pswap=$(whiptail --title "Select package to add to iso" --menu "Select package to add to iso" 16 78 10 "${programs[@]}" 3>&1 1>&2 2>&3 3>&-) -if [ $pswap != done ]; -then -if [ $(file /arch/pkgs/$pswap | cut -f 2 -d ' ') == directory ]; -then -echo d -cat /arch/pkgs/$pswap/* > /tmp/tgl -ls /arch/pkgs/$pswap/ >> /usr/share/archiso/configs/releng/airootfs/root/install.list -cat /tmp/tgl >> /tmp/cll -fi -if [ $(file /arch/pkgs/$pswap | cut -f 2 -d ' ') != directory ]; -then -echo f -echo $pswap >> /usr/share/archiso/configs/releng/airootfs/root/install.list -cat /arch/pkgs/$pswap >> /tmp/cll -fi -pkgdown -fi -wget -nc -i /tmp/cll -P /usr/share/archiso/configs/releng/airootfs/root/pkg/ diff --git a/register2 b/register2 deleted file mode 100755 index 995f899..0000000 --- a/register2 +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -pactree -s -u $2 > /tmp/temporary22 -pacman -Sp --noconfirm - < /tmp/temporary22 > /arch/pkgs/$1/$2 -echo $2 diff --git a/reregister b/reregister deleted file mode 100755 index 8c3f4f7..0000000 --- a/reregister +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -cat ~/.bashrc > /tmp/rereg -for file in $(ls /arch/pkgs/) -do - if [ $(file /arch/pkgs/$file | cut -f 2 -d ' ') == directory ]; - then - echo register-g $file >> /tmp/rereg - fi - - if [ $(file /arch/pkgs/$file | cut -f 2 -d ' ') != directory ]; - then - echo register $file >> /tmp/rereg - fi -done -bash /tmp/rereg -