Toastie 1 year ago
parent
commit
61f9008523
1 changed files with 17 additions and 7 deletions
  1. 17 7
      bootrap-bullseye.sh

+ 17 - 7
bootrap-bullseye.sh

@@ -34,15 +34,15 @@ netNTP=pool.ntp.org
 # Check if the function exists
 case $1 in
   grmlnetwork) grmlnetwork() ;;
-  prepare)     prepare()     ;;
   install)     install()     ;;
+  install2)    install2()     ;;
   bootloader)  bootloader()  ;;
   postinstall) postinstall() ;;
-  *) echo "Valid functions are: grmlnetwork, prepare, install, bootloader, postinstall" >&2  ;;
+  *) echo "Valid functions are: grmlnetwork, install, postinstall" >&2  ;;
 esac
 
 
-prepare(){
+install(){
 #----------
 # Prepare disks
 # Parition disks -- pkg: parted
@@ -92,19 +92,29 @@ EOL
 # Configure hostname
 echo "127.0.0.1       $hostname" >> /etc/hosts
 echo $hostname > /etc/hostname
-}
 
-install(){
 #----------
-# Chroot
+# Prepare chroot
 mount -o bind /dev $mnt/dev
 mount -o bind /dev/pts $mnt/dev/pts
 mount -t sysfs /sys $mnt/sys
 mount -t proc /proc $mnt/proc
 cp /proc/mounts $mnt/etc/mtab
 cp /etc/resolv.conf $mnt/etc/resolv.conf
-chroot $mnt /bin/bash
+mkdir -p $mnt/installer
+cp $(dirname `realpath $0`)/*.sh $mnt/installer
+
+# Run script in chroot
+chroot $mnt /bin/bash $mnt/installer/bootrap-bullseye.sh install2
 
+# Install bootloader
+$0 bootloader
+
+}
+
+#----------
+# Function executed within chroot
+install2(){
 # Install basic system
 apt-get update
 apt-get install --yes \