Quick Install

From ArchBang

Jump to: navigation, search
Line 8: Line 8:
   #
   #
    
    
-
   # check for root
+
   # Are we root?
   [[ ${EUID} -ne 0 ]] && echo "::This script must be run as root::" && exit 1
   [[ ${EUID} -ne 0 ]] && echo "::This script must be run as root::" && exit 1
    
    
Line 15: Line 15:
   ROOT_DEV=$(df | grep -w /mnt | awk {'print $1'})
   ROOT_DEV=$(df | grep -w /mnt | awk {'print $1'})
    
    
-
  # copy live iso environment to /mnt (new install device)
 
   echo ":: Please wait, copying live root image to /mnt ::"
   echo ":: Please wait, copying live root image to /mnt ::"
   cp -ax / /mnt
   cp -ax / /mnt
    
    
-
  # copy kernel to new install
 
   echo "Add kernel to new install..."
   echo "Add kernel to new install..."
   cp -vaT /run/archiso/bootmnt/arch/boot/$(uname -m)/vmlinuz /mnt/boot/vmlinuz-linux
   cp -vaT /run/archiso/bootmnt/arch/boot/$(uname -m)/vmlinuz /mnt/boot/vmlinuz-linux
    
    
-
  # generate fstab for new device
 
   echo "Create /etc/fstab..."
   echo "Create /etc/fstab..."
   genfstab -U -p /mnt > /mnt/etc/fstab
   genfstab -U -p /mnt > /mnt/etc/fstab
    
    
-
  # remake boot image
 
   echo "Rebuild boot image..."
   echo "Rebuild boot image..."
   ${ACM} /usr/bin/mkinitcpio -p linux
   ${ACM} /usr/bin/mkinitcpio -p linux
    
    
-
  # Install syslinux bootloader (optional)
 
   echo "Add syslinux bootloader..."
   echo "Add syslinux bootloader..."
   ${ACM} /usr/bin/syslinux-install_update -iam
   ${ACM} /usr/bin/syslinux-install_update -iam
   sed -i "s|/dev/sda[0-9]|${ROOT_DEV}|g" ${MNT}/boot/syslinux/syslinux.cfg
   sed -i "s|/dev/sda[0-9]|${ROOT_DEV}|g" ${MNT}/boot/syslinux/syslinux.cfg
    
    
-
  # clean up new install, basically removing archiso files that are needed live
 
   echo "Clean new install..."
   echo "Clean new install..."
   rm /mnt/etc/mkinitcpio-archiso.conf
   rm /mnt/etc/mkinitcpio-archiso.conf

Revision as of 12:37, 20 March 2016

Personal tools