Artigos‎ > ‎Instalação do Sistema‎ > ‎Outros‎ > ‎

debian debootstrap


Primeiramente gostaria de salientar que não sou o autor principal do conteúdo deste artigo. A minha intenção é de mostrar o que outros autores tem realizado (referenciando links para o conteúdo original) neste blog até como um guia pessoal para uso próprio e ainda compartilhar minhas anotações e pequenas modificações que realizo no conteúdo, desejando que possa ajudar mais alguém em algum lugar.
First and foremost, I take no credit for any of this post’s content. I am really just taking what others have done (which I have links to bellow) and am putting it on my blog for a personal reference and hopefully the small changes that I made to their guides will help someone somewhere.


link: http://willhaley.com/blog/create-a-custom-debian-live-environment/
link: https://gist.github.com/olavmrk/a0367b0b2b759dfcba02


mkdir -p /usr/local/chroots/jessie
cd /usr/local/chroots/

apt-get install debootstrap squashfs-tools

debootstrap --arch=armel --verbose --variant=minbase stable jessie http://ftp.br.debian.org/debian/

Caso queira inicar outro chroot, vamos fazer um backup
tar --create --numeric-owner --gzip --file rootcache.tar.gz --directory jessie .
Para utilizar o backup :
tar --extract --numeric-owner --gzip --file rootcache.tar.gz --directory jessie

# Disable installation of recommended packages
echo 'APT::Install-Recommends "false";' >"jessie/etc/apt/apt.conf.d/50norecommends"

# Configure networking
cat >>"jessie/etc/network/interfaces" <<'EOF'
auto lo
iface lo inet loopback
auto eth1
iface eth1 inet dhcp
EOF
cat >>"jessie/etc/resolv.conf" <<'EOF'
nameserver 8.8.8.8
nameserver 8.8.4.4
EOF

# Implement insecurity
chroot "jessie" passwd -d root
sed -i 's/pam_unix.so nullok_secure/pam_unix.so nullok/' "jessie/etc/pam.d/common-auth"
sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' "jessie/etc/ssh/sshd_config"
sed -i 's/PermitEmptyPasswords no/PermitEmptyPasswords yes/' "jessie/etc/ssh/sshd_config"

mount -o bind /dev jessie/dev

chroot jessie



mount none -t proc /proc
mount none -t sysfs /sys
mount none -t devpts /dev/pts
export HOME=/root
export LC_ALL=C
apt-get update
apt-get install dialog dbus --yes --force-yes
dbus-uuidgen > /var/lib/dbus/machine-id
echo "debian-live" > /etc/hostname

apt-get install --yes linux-image-kirkwood ifupdown isc-dhcp-client openssh-server less nano python lvm2 mdadm nfs-kernel-server nfs-common debootstrap
apt-get install --yes tcpdump wget pciutils usbutils gparted ntfsprogs rsync dosfstools mtools udisks2 netcat u-boot-tools gdisk hdparm xfsprogs partclone nano pv mtd-utils cloud-initramfs-rescuevol initramfs-tools

rm -f /var/lib/dbus/machine-id
apt-get clean 
rm -rf /tmp/*
rm /etc/resolv.conf 
umount -lf /proc 
umount -lf /sys
umount -lf /dev/pts

exit 

umount -lf jessie/dev

# Clean up temporary files
rm -rf jessie/var/cache/apt/*


# Build the root filesystem image, and extract the accompanying kernel and initramfs
mksquashfs jessie br.squashfs -noappend 

ls -lh br.squashfs







Comments