Browse Source

Add files via upload

nsITobin 5 months ago
commit
4f73aa1436
1 changed files with 129 additions and 0 deletions
  1. 129 0
      setupldr.sh

+ 129 - 0
setupldr.sh

@@ -0,0 +1,129 @@
+#!/bin/bash
+
+LFS=/mnt/lfs
+
+dossetup() {
+  read -p "For reasons, we assume the mount point is /mnt/lfs regardless of what we are doing. Press enter to prep the virtual filesystems."
+  mkdir -pv {$LFS/dev/pts,$LFS/dev/shm,$LFS/etc,$LFS/proc,$LFS/run,$LFS/sys}
+  cp -v /etc/resolv.conf $LFS/etc/resolv.conf
+}
+
+dosconfig() {
+  echo "Mounting virtual filesystems..."
+  mount -v --bind /dev $LFS/dev
+  mount -vt devpts devpts -o gid=5,mode=0620 $LFS/dev/pts
+  mount -vt proc proc $LFS/proc
+  mount -vt sysfs sysfs $LFS/sys
+  mount -vt tmpfs tmpfs $LFS/run
+
+  if [ -h $LFS/dev/shm ]; then
+    install -v -d -m 1777 $LFS$(realpath /dev/shm)
+  else
+    mount -vt tmpfs -o nosuid,nodev tmpfs $LFS/dev/shm
+  fi
+}
+
+dosexit() {
+  echo "Unmounting virtual filesystems..."
+  umount -v $LFS/dev/pts
+  mountpoint -q $LFS/dev/shm && umount -v $LFS/dev/shm
+  umount -v $LFS/dev
+  umount -v $LFS/run
+  umount -v $LFS/proc
+  umount -v $LFS/sys
+}
+
+winnt32() {
+  read -p "Press enter to begin the installation."
+
+  dnf install --installroot=$LFS --releasever=39 --setopt=install_weak_deps=False --setopt=keepcache=True --nodocs --refresh --assumeyes \
+    @custom-environment \
+    @c-development \
+    @development-libs \
+    @development-tools \
+    @fedora-packager \
+    bc \
+    systemd-resolved \
+    dbus-daemon \
+    curl \
+    htop \
+    httpd-tools \
+    nano \
+    fuse-sshfs \
+    ntfsprogs \
+    python2* \
+    rsyslog \
+    traceroute \
+    unzip \
+    wget \
+    zip \
+    screen \
+    net-tools \
+    dos2unix \
+    rsync \
+    time \
+    tree \
+    whois \
+    git \
+    curl \
+    wimlib* \
+    -x ccache \
+    -x plymouth* \
+    -x audit \
+    -x abrt* \
+    -x firewall* \
+    -x vim* \
+    -x audit \
+    -x zram*
+
+    systemd-firstboot \
+    --root=$LFS \
+    --locale=C.UTF-8 \
+    --keymap=us \
+    --hostname=linuxnt-$(date +%s).binaryoutcast.com \
+    --setup-machine-id
+
+    read -p "Press enter to continue."
+}
+
+ntldr() {
+  echo -e "\n================================================================================"
+  echo -e "\nOpen Source Linux NT [Version $(uname -r)]\n$(uname -v)\n"
+  chroot "$LFS" /usr/bin/env -i   \
+      HOME=/root                  \
+      TERM="$TERM"                \
+      PS1='(Linux NT) \u:\w \$ ' \
+      PATH=/usr/bin:/usr/sbin     \
+      MAKEFLAGS="-j$(nproc)"      \
+      TESTSUITEFLAGS="-j$(nproc)" \
+      /bin/bash --login
+  echo -e "\n================================================================================\n"
+}
+
+imagex-capture() {
+  if [ ! -f "/binoc/00-fc39-install.wim" ]; then
+    wimlib-imagex capture $LFS /binoc/00-fc39-install.wim "Fez Enterprising Linux - FC39 Base" --compress=LZMS:100 --unix-data
+  fi
+}
+
+# ====
+
+if [ ! -d "$LFS/dev/pts" ]; then
+  dossetup
+  dosconfig
+  winnt32
+  ntldr
+  dosexit
+  #imagex-capture
+else
+  dosconfig
+  ntldr
+  dosexit
+fi
+
+
+
+
+
+
+