История изменений
Исправление ncrmnt, (текущая версия) :
На случай если пригодится, вот мои скрипты которыми варятся корневые фс raspbian и debian. Выглядит немного хакерски, но свое дело делает. Так как это не особенно документировано и не причесано, на гитхабе этого пока не лежит. Для распбиан:
#!/bin/bash -x
# $1 - proxychains
# $2 - release (wheezy, jessie)
# $3 - passwd
#
PC=$1
RELEASE=$2
HOSTNAME=$3
PASSWD=$4
shift
shift
shift
shift
PKGS="$*"
config_image() {
cat <<EOF
apt-get update
export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true
debconf-set-selections /preseed.txt
apt-get -y --force-yes install locales tzdata
apt-get -y --force-yes install ${PKGS}
echo -e "${PASSWD}\n${PASSWD}" | passwd root
dpkg-reconfigure locales tzdata
rm /etc/apt/apt.conf.d/proxy
rm /etc/resolv.conf
rm /preseed.txt
echo $HOSTNAME > /etc/hostname
echo "127.0.0.1 $HOSTNAME localhost" > /etc/hosts
echo "T0:23:respawn:/sbin/getty -L ttyS0 38400 vt100" >> /etc/inittab
EOF
}
rm -Rf raspbian-${RELEASE}
debootstrap --foreign --variant=minbase --arch=armhf --keyring /etc/apt/trusted.gpg ${RELEASE} raspbian-${RELEASE} http://archive.raspbian.org/raspbian || exit 1
cp `which qemu-arm-static` ./raspbian-${RELEASE}/usr/bin/
cd raspbian-${RELEASE}
cp ../proxy ./etc/apt/apt.conf.d
cp /etc/resolv.conf ./etc/resolv.conf
cp ../preseed.txt ./
echo "/debootstrap/debootstrap --second-stage" | chroot .
../sources.list raspbian ${RELEASE} > etc/apt/sources.list
config_image | chroot .
sed 's/PermitRootLogin without-password/PermitRootLogin yes/' -i etc/ssh/sshd_config
cp ../interfaces ./etc/network/interfaces
exit 0
Для debian:
#!/bin/bash -x
# $1 - proxychains
# $2 - release (wheezy, jessie)
# $3 - passwd
#
PC=$1
RELEASE=$2
HOSTNAME=$3
PASSWD=$4
shift
shift
shift
shift
PKGS="$*"
config_image() {
cat <<EOF
apt-get update
export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true
debconf-set-selections /preseed.txt
apt-get -y --force-yes install locales tzdata
apt-get -y --force-yes install ${PKGS}
echo -e "${PASSWD}\n${PASSWD}" | passwd root
dpkg-reconfigure locales tzdata
rm /etc/apt/apt.conf.d/proxy
rm /etc/resolv.conf
rm /preseed.txt
echo $HOSTNAME > /etc/hostname
echo "127.0.0.1 $HOSTNAME localhost" > /etc/hosts
echo "T0:23:respawn:/sbin/getty -L ttyS0 38400 vt100" >> /etc/inittab
EOF
}
rm -Rf debian-${RELEASE}
debootstrap --foreign --variant=minbase --arch=armel ${RELEASE} debian-${RELEASE} http://ftp.ru.debian.org/debian/ || exit 1
cp `which qemu-arm-static` ./debian-${RELEASE}/usr/bin/
cd debian-${RELEASE}
cp ../proxy ./etc/apt/apt.conf.d
cp /etc/resolv.conf ./etc/resolv.conf
cp ../preseed.txt ./
echo "/debootstrap/debootstrap --second-stage" | chroot .
../sources.list debian ${RELEASE} > etc/apt/sources.list
config_image | chroot .
sed 's/PermitRootLogin without-password/PermitRootLogin yes/' -i etc/ssh/sshd_config
cp ../interfaces ./etc/network/interfaces
exit 0
В виде дополнительных пакетов я ставлю:
wget curl ifupdown isc-dhcp-client openssh-server net-tools nano madplay nmc-utils-bin nmc-utils-abs nmc-utils-doc apt-utils
nmc-utils - это утилиты для работы с nmc, чтобы они поставились надо прописать доп. репозиторий.
sources.list генерируется таким скриптом:
#!/bin/bash
debrepo() {
cat <<EOF
#Debian official repositories
deb http://ftp.ru.debian.org/debian/ ${RELEASE} main contrib non-free" > /etc/apt/sources.list
deb-src http://ftp.ru.debian.org/debian/ ${RELEASE} main contrib non-free" >> /etc/apt/sources.list
EOF
}
rasprepo() {
cat <<EOF
#Raspbian official repositories
deb http://archive.raspbian.org/raspbian ${RELEASE} main contrib non-free rpi
deb-src http://archive.raspbian.org/raspbian ${RELEASE} main contrib non-free rpi
EOF
}
rcmrepo()
{
cat <<EOF
# RC Module's repository with MB77.07 packages
deb http://www.module.ru/mb7707/ stable updates
EOF
}
DISTRO=$1
RELEASE=$2
case $DISTRO in
"raspbian")
rasprepo
;;
"debian")
debrepo
;;
esac
rcmrepo
Исходная версия ncrmnt, :
На случай если пригодится, вот мои скрипты которыми варятся корневые фс raspbian и debian. Выглядит немного хакерски, но свое дело делает. Так как это не особенно документировано и не причесано, на гитхабе этого пока не лежит. Для распбиан:
#!/bin/bash -x
# $1 - proxychains
# $2 - release (wheezy, jessie)
# $3 - passwd
#
PC=$1
RELEASE=$2
HOSTNAME=$3
PASSWD=$4
shift
shift
shift
shift
PKGS="$*"
config_image() {
cat <<EOF
apt-get update
export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true
debconf-set-selections /preseed.txt
apt-get -y --force-yes install locales tzdata
apt-get -y --force-yes install ${PKGS}
echo -e "${PASSWD}\n${PASSWD}" | passwd root
dpkg-reconfigure locales tzdata
rm /etc/apt/apt.conf.d/proxy
rm /etc/resolv.conf
rm /preseed.txt
echo $HOSTNAME > /etc/hostname
echo "127.0.0.1 $HOSTNAME localhost" > /etc/hosts
echo "T0:23:respawn:/sbin/getty -L ttyS0 38400 vt100" >> /etc/inittab
EOF
}
rm -Rf raspbian-${RELEASE}
debootstrap --foreign --variant=minbase --arch=armhf --keyring /etc/apt/trusted.gpg ${RELEASE} raspbian-${RELEASE} http://archive.raspbian.org/raspbian || exit 1
cp `which qemu-arm-static` ./raspbian-${RELEASE}/usr/bin/
cd raspbian-${RELEASE}
cp ../proxy ./etc/apt/apt.conf.d
cp /etc/resolv.conf ./etc/resolv.conf
cp ../preseed.txt ./
echo "/debootstrap/debootstrap --second-stage" | chroot .
../sources.list raspbian ${RELEASE} > etc/apt/sources.list
config_image | chroot .
sed 's/PermitRootLogin without-password/PermitRootLogin yes/' -i etc/ssh/sshd_config
cp ../interfaces ./etc/network/interfaces
exit 0
Для debian:
#!/bin/bash -x
# $1 - proxychains
# $2 - release (wheezy, jessie)
# $3 - passwd
#
PC=$1
RELEASE=$2
HOSTNAME=$3
PASSWD=$4
shift
shift
shift
shift
PKGS="$*"
config_image() {
cat <<EOF
apt-get update
export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true
debconf-set-selections /preseed.txt
apt-get -y --force-yes install locales tzdata
apt-get -y --force-yes install ${PKGS}
echo -e "${PASSWD}\n${PASSWD}" | passwd root
dpkg-reconfigure locales tzdata
rm /etc/apt/apt.conf.d/proxy
rm /etc/resolv.conf
rm /preseed.txt
echo $HOSTNAME > /etc/hostname
echo "127.0.0.1 $HOSTNAME localhost" > /etc/hosts
echo "T0:23:respawn:/sbin/getty -L ttyS0 38400 vt100" >> /etc/inittab
EOF
}
rm -Rf debian-${RELEASE}
debootstrap --foreign --variant=minbase --arch=armel ${RELEASE} debian-${RELEASE} http://ftp.ru.debian.org/debian/ || exit 1
cp `which qemu-arm-static` ./debian-${RELEASE}/usr/bin/
cd debian-${RELEASE}
cp ../proxy ./etc/apt/apt.conf.d
cp /etc/resolv.conf ./etc/resolv.conf
cp ../preseed.txt ./
echo "/debootstrap/debootstrap --second-stage" | chroot .
../sources.list debian ${RELEASE} > etc/apt/sources.list
config_image | chroot .
sed 's/PermitRootLogin without-password/PermitRootLogin yes/' -i etc/ssh/sshd_config
cp ../interfaces ./etc/network/interfaces
exit 0
В виде дополнительных пакетов я ставлю:
wget curl ifupdown isc-dhcp-client openssh-server net-tools nano madplay nmc-utils-bin nmc-utils-abs nmc-utils-doc apt-utils
nmc-utils - это утилиты для работы с nmc, чтобы они поставились надо прописать доп. репозиторий.
sources.list генерируется таким скриптом:
#!/bin/bash
debrepo() {
cat <<EOF
#Debian official repositories
deb http://ftp.ru.debian.org/debian/ ${RELEASE} main contrib non-free" > /etc/apt/sources.list
deb-src http://ftp.ru.debian.org/debian/ ${RELEASE} main contrib non-free" >> /etc/apt/sources.list
EOF
}
rasprepo() {
cat <<EOF
#Raspbian official repositories
deb http://archive.raspbian.org/raspbian ${RELEASE} main contrib non-free rpi
deb-src http://archive.raspbian.org/raspbian ${RELEASE} main contrib non-free rpi
EOF
}
rcmrepo()
{
cat <<EOF
# RC Module's repository with MB77.07 packages
deb http://www.module.ru/mb7707/ stable updates
EOF
}
DISTRO=$1
RELEASE=$2
case $DISTRO in
"raspbian")
rasprepo
;;
"debian")
debrepo
;;
esac
rcmrepo