## , /dev/sda1 - root, /dev/sda2 - home mkdir /mnt/debian mount /dev/sda1 /mnt/debian mkdir /mnt/debian/home mount /dev/sda2 /mnt/debian/home
#!/bin/bash ARCH=i386 #ARCH=amd64 ## 64- - 32- ## debian OS=debian DISTRO=wheezy #DISTRO=stable ## ubuntu #OS=ubuntu #DISTRO=oneiric ## TARGET=/mnt/debian ## cdrom : #debootstrap --include=sudo,nano,wget --arch $ARCH $DISTRO $TARGET file:/media/cdrom ## debootstrap --include=sudo,nano,wget --arch $ARCH $DISTRO $TARGET http://$OS.mirror.vu.lt/$OS/ ## , / mount -o bind /dev $TARGET/dev mount -o bind /sys $TARGET/sys
# /etc/fstab: static file system information. # # Use 'vol_id --uuid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). # # <file system> <mount point> <type> <options> <dump> <pass> proc /proc proc defaults 0 0 # /dev/sda1 /boot ext2 defaults 0 0 /dev/sda2 / ext4 defaults 0 1 /dev/sda3 /home ext4 defaults 0 0 /dev/sda4 none swap sw 0 0
# /etc/fstab: static file system information. # <file system> <mount point> <type> <options> <dump> <pass> proc /proc proc defaults 0 0 /dev/sda1 / ext4 defaults 0 1 /dev/sda2 /home ext4 defaults 0 0
deb http://http.debian.net/debian $DISTRO main contrib non-free # deb-src http://http.debian.net/debian $DISTRO main deb http://security.debian.org $DISTRO/updates main contrib non-free # deb-src http://security.debian.org $DISTRO/updates main deb http://http.debian.net/debian-backports $DISTRO-backports main non-free # deb-src http://http.debian.net/debian-backports $DISTRO-backports main deb http://http.debian.net/debian $DISTRO-proposed-updates main contrib non-free # deb-src http://http.debian.net/debian $DISTRO-proposed-updates main
deb http://ru.archive.ubuntu.com/ubuntu $DISTRO main universe restricted multiverse # deb-src http://ru.archive.ubuntu.com/ubuntu $DISTRO main universe deb http://security.ubuntu.com/ubuntu $DISTRO-security main universe restricted multiverse # deb-src http://security.ubuntu.com/ubuntu $DISTRO-security main universe deb http://ru.archive.ubuntu.com/ubuntu $DISTRO-updates main universe restricted multiverse # deb-src http://ru.archive.ubuntu.com/ubuntu $DISTRO-updates main universe deb http://ru.archive.ubuntu.com/ubuntu $DISTRO-proposed main universe restricted multiverse # deb-src http://ru.archive.ubuntu.com/ubuntu $DISTRO-proposed main universe deb http://ru.archive.ubuntu.com/ubuntu $DISTRO-backports main universe restricted multiverse # deb-src http://ru.archive.ubuntu.com/ubuntu $DISTRO-backports main universe deb http://archive.canonical.com/ubuntu $DISTRO partner deb http://extras.ubuntu.com/ubuntu $DISTRO main # deb-src http://extras.ubuntu.com/ubuntu $DISTRO main
env LANG=C env HOME=/root chroot $TARGET /bin/bash /postinst.sh
#!/bin/bash ## apt-get update ## dpkg-reconfigure tzdata ## mount -t proc /proc /proc mount -a ## apt-get -y install popularity-contest ## , ## console-cyrillic , , UniCyr, «» apt-get -y install locales console-cyrillic dpkg-reconfigure locales dpkg-reconfigure console-cyrillic ## hostname, HOST='mysuperpc' echo "$HOST" > /etc/hostname echo -e "\n127.0.0.1 localhost $HOST" >> /etc/hosts ## , sudo USER='mynotsuperuser' echo ' ' adduser $USER usermod -a -G sudo $USER ## root echo ' root' passwd ## ARCH=i686 #: i386, i486, i686, amd64 ## Debian: apt-get -y install linux-base linux-image-$ARCH linux-headers grub ## Ubuntu: # apt-get -y install linux-image-generic linux-headers-generic ## apt-get -y install firmware-linux firmware-ralink firmware-realtek ## ## Debian: apt-get -y install xorg kde-full #KDE #apt-get -y install xorg kde # <= Lenny #apt-get -y install xorg gnome #apt-get -y install xorg xfce lxdm #XFCE #apt-get -y install xorg lxde lxdm #LXDE ## Debian, apt-get -y install pulseaudio apt-get -y install alsa-base alsa-tools alsa-utils alsa-oss ## Ubuntu: #apt-get -y install xorg kubuntu-desktop #KDE #apt-get -y install xorg ubuntu-desktop #Unity #apt-get -y install xorg gnome-shell gnome-themes-standard gnome-tweak-tool #Gnome3 #apt-get -y install xorg xubuntu-desktop #XFCE #apt-get -y install xorg lubuntu-desktop #LXDE
env LANG=C env HOME=/root chroot $TARGET /bin/bash
Source: https://habr.com/ru/post/147522/
All Articles