Commit be945f4c authored by Cássio Kirch's avatar Cássio Kirch

First commit

# Copyright (c) 2018 Cássio Kirch <>
readonly MNT=/mnt
readonly ROOTDEV=/dev/sdd1
# Install debootstrap:
## sed -i 's/' /etc/apt/sources.list
apt update
apt install debootstrap -y
# Mount flash drive
mkdir $MNT -p
# Install packages:
debootstrap --include linux-image-amd64,grub-pc,locales,bash-completion,emacs25-nox,ncdu,htop --arch amd64 stretch $MNT
# Prepare to change root:
cp /etc/mtab $MNT/etc/mtab
mount -o bind /dev $MNT/dev
mount -o bind /proc $MNT/proc
mount -o bind /sys $MNT/sys
# Configure grub
chroot $MNT grub-install /dev/sdd
chroot $MNT update-grub
# Configure fstab
uuid=$(blkid $ROOTDEV | awk '{for (c=1; c<=NF; c=c+1) { print $c }}' | grep ^UUID | sed 's/"//g')
fs=$(blkid $ROOTDEV | awk '{for (c=1; c<=NF; c=c+1) { print $c }}' | grep ^TYPE | sed 's/"//g' | awk -F'=' '{print $2}')
echo $uuid / $fs defaults 0 1 > $MNT/etc/fstab
# Set hostname:
echo tropos > $MNT/etc/hostname
# Change language:
sed -i 's/# pt_BR.UTF-8 UTF-8/pt_BR.UTF-8 UTF-8/g' $MNT/etc/locale.gen
chroot $MNT dpkg-reconfigure locales -f noninteractive
#chroot $MNT passwd
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment