Update test.sh

This commit is contained in:
fithwum
2018-12-31 13:03:17 -08:00
parent c79c0f0333
commit 000338106a

30
test.sh
View File

@@ -1,8 +1,30 @@
#!/bin/bash #!/bin/bash
# Copyright (c) 2018 fithwum # Copyright (c) 2018 fithwum
# All rights reserved # All rights reserved
# Setup the target partition for install
mkfs.ext4 -L Debian /dev/sda1 mkfs.ext4 -L Debian /dev/sda1
host# mkdir /mnt/deboot mkdir /mnt/deboot
mount -t ext4 /dev/sda1 /mnt/deboot mount -t ext4 /dev/sda1 /mnt/deboot
# Installing the base system with network access
debootstrap --include linux-image-amd64,grub-pc,locales --arch amd64 unstable /mnt/deboot http://ftp.us.debian.org/debian
# Preparing the chroot environment
cp /etc/mtab /mnt/deboot/etc/mtab
mount -o bind /dev /mnt/deboot/dev
mount -o bind /proc /mnt/deboot/proc
mount -o bind /sys /mnt/deboot/sys
# Continuing the installation within chroot
chroot /mnt/deboot /bin/bash
grub-install /dev/sda
update-grub
blkid /dev/sda1
UUID=79168060-9d9c-4cf6-8ee9-bb846aee589b / ext4 defaults,errors=remount-ro 0 1
echo "debian" > /etc/hostname
dpkg-reconfigure locales
passwd
adduser user
# Setting up the network (eth0)
dhclient -v eth0
# Finishing the install
apt-get clean
update-initramfs -u -k all
exit