6,534
edits
Changes
VE0->CT0, formatting fixes, other minor fixes
Edit settings of script "archbootstrap" :
{{Note|I suggest to place the build for OpenVZ templates to /vz/template/, schema: /vz/template/$DIST/$VERSION/$ARCH/}}
Built this OS-Template with:
== bootstrapping Archlinux ==
Syntax:
{{Note|Please use mirrors! A full list of Archlinux mirrors: http://wiki.archlinux.org/index.php/Mirror}}
== enter the Build with chroot ==
All the commands below are executed from the root shell. I this howto "chroot" is used to enter as NEWROOT, a BUILD-VE must not be created!
=== setting DNS server ===
For the chroot BUILD we also need to specify a DNS for it:
BUILD_# mv /etc/resolv.conf.pacorig /etc/resolv.conf
=== update and install packages ===
Update (sync) pacman cache and update installed packages
BUILD_# pacman -Syu
Install openssh (client and server) , quota-tools and iproute
BUILD_# pacman -S openssh quota-tools iproute
=== fix /etc/mtab ===
Add symlink /proc/mount /etc/mtab
BUILD_# ln -s /proc/mounts /etc/mtab
=== fix /etc/inittab ===
Remove getties getty lines from inittab BUILD_# sed -i -e '/getty/d' /etc/inittab:
BUILD_# sed -i -e '/getty/d' /etc/inittab
=== create device nodes ===
Create device nodes at /dev, like console, full, null, zero, urandom, ptmx and fifo of initctl
BUILD_# mknod -m 600 /dev/console c 5 1 BUILD_# mknod -m 666 /dev/tty c 5 0 BUILD_# mknod -m 666 /dev/full c 1 7 BUILD_# mknod -m 600 /dev/initctl p BUILD_# mknod -m 666 /dev/null c 1 3 BUILD_# mknod -m 666 /dev/ptmx c 5 2 BUILD_# mkdir pts BUILD_# mknod -m 666 /dev/random c 1 8 BUILD_# mknod -m 444 /dev/urandom c 1 9 BUILD_# mknod -m 666 /dev/zero c 1 5
=== sysinit script modification ===
Remove deleting of /etc/mtab in /etc/rc.sysinit and add mounting of /dev/pts
BUILD_# nano /etc/rc.sysinit
to
=== modify the main configuration file ===
# Localization
LOCALE="en_US.utf8"
# Add openssh to DAEMONS, start at bootup ; ssh-keys are build on first VE start !!!
DAEMONS=(syslog-ng network netfs crond ssh)
=== enable ssh connections ===
{{Note|All connection are disabled to VE, see /etc/hosts.deny, only affected server built-in with libwrap}}
Allow ssh : <pre>BUILD_# echo "ssh: ALL : ALLOW" >> /etc/hosts.allow}</pre>
BUILD_# echo "ssh: ALL : ALLOW" >> /etc/hosts.allow}
=== lock (disable) the root account ===
BUILD_# passwd -l root
=== exit the chroot to CT0 ===
== build a exclude list ==
Shrink the OS-Template, so not all files needed in a VE - OS - TEMPLATE
Remove unused pacman backup files:
<code>/etc/resolv.conf </code> is added by vzctl:
Don't add downloaded pkg to ostemplate:
CT0_# find ./var/cache/ -name '*.tar.gz' >> ../exlcude.list-$ARCH
CT0_# find ./root/.bash_history >> ../exclude.list-$ARCH
== use the OS template ==
== update the OS template ==
Update the exclude list, and pack upgraded OS - Template
== Links ==
[[Category: HOWTO]]
[[Category: Templates]]