Editing Archlinux Template creation
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | + | Instructions manually create a minimal Archlinux (0.8) "Voodoo" OS Template. | |
− | + | == Prerequisites == | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
I used a modified archbootstrap script which can be found at http://forzza.systs.org/openvz-misc/ | I used a modified archbootstrap script which can be found at http://forzza.systs.org/openvz-misc/ | ||
Line 121: | Line 30: | ||
|} | |} | ||
− | + | == bootstrapping Archlinux == | |
Syntax: | Syntax: | ||
Line 129: | Line 38: | ||
{{Note|Please use mirrors! A full list of Archlinux mirrors: http://wiki.archlinux.org/index.php/Mirror}} | {{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! | 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! | ||
Line 135: | Line 44: | ||
CT0_# chroot /vz/template/$DIST/$VERSION/$ARCH/ | CT0_# chroot /vz/template/$DIST/$VERSION/$ARCH/ | ||
− | + | === setting DNS server === | |
For the chroot BUILD we also need to specify a DNS for it: | For the chroot BUILD we also need to specify a DNS for it: | ||
Line 141: | Line 50: | ||
BUILD_# mv /etc/resolv.conf.pacorig /etc/resolv.conf | BUILD_# mv /etc/resolv.conf.pacorig /etc/resolv.conf | ||
− | + | === update and install packages === | |
Update (sync) pacman cache and update installed packages | Update (sync) pacman cache and update installed packages | ||
Line 151: | Line 60: | ||
BUILD_# pacman -S openssh quota-tools iproute | BUILD_# pacman -S openssh quota-tools iproute | ||
− | + | === fix /etc/mtab === | |
Add symlink /proc/mount /etc/mtab | Add symlink /proc/mount /etc/mtab | ||
Line 157: | Line 66: | ||
BUILD_# ln -s /proc/mounts /etc/mtab | BUILD_# ln -s /proc/mounts /etc/mtab | ||
− | + | === fix /etc/inittab === | |
Remove getty lines from inittab: | Remove getty lines from inittab: | ||
Line 163: | Line 72: | ||
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 | Create device nodes at /dev, like console, full, null, zero, urandom, ptmx and fifo of initctl | ||
Line 178: | Line 87: | ||
BUILD_# mknod -m 666 /dev/zero c 1 5 | 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 | Remove deleting of /etc/mtab in /etc/rc.sysinit and add mounting of /dev/pts | ||
Line 195: | Line 104: | ||
[...] | [...] | ||
− | + | === modify the main configuration file === | |
BUILD_# nano /etc/rc.conf | BUILD_# nano /etc/rc.conf | ||
Line 219: | Line 128: | ||
DAEMONS=(syslog-ng network netfs crond ssh) | 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}} | {{Note|All connection are disabled to VE, see /etc/hosts.deny, only affected server built-in with libwrap}} | ||
Line 227: | Line 136: | ||
BUILD_# echo "ssh: ALL : ALLOW" >> /etc/hosts.allow | BUILD_# echo "ssh: ALL : ALLOW" >> /etc/hosts.allow | ||
− | + | === lock (disable) the root account === | |
BUILD_# passwd -l root | BUILD_# passwd -l root | ||
− | + | === exit the chroot to CT0 === | |
BUILD_# exit | BUILD_# exit | ||
− | + | == build a exclude list == | |
Shrink the OS-Template, so not all files needed in a VE - OS - TEMPLATE | Shrink the OS-Template, so not all files needed in a VE - OS - TEMPLATE | ||
Line 256: | Line 165: | ||
CT0_# find ./root/.bash_history >> ../exclude.list-$ARCH | CT0_# find ./root/.bash_history >> ../exclude.list-$ARCH | ||
− | + | == create OS template == | |
CT0_# tar --numeric-owner -X ../exclude.list-$ARCH -czf /vz/template/cache/arch-0.8-$ARCH-minimal.tar.gz ./ | CT0_# tar --numeric-owner -X ../exclude.list-$ARCH -czf /vz/template/cache/arch-0.8-$ARCH-minimal.tar.gz ./ | ||
− | + | == use the OS template == | |
CT0_# vzctl create <VEID> --ostemplate arch-0.8-$ARCH-minimal ... | CT0_# vzctl create <VEID> --ostemplate arch-0.8-$ARCH-minimal ... | ||
− | + | == update the OS template == | |
To update a template is really easy, enter the build with chroot, performing upgrade task | To update a template is really easy, enter the build with chroot, performing upgrade task | ||
Line 272: | Line 181: | ||
Update the exclude list, and pack upgraded OS - Template | Update the exclude list, and pack upgraded OS - Template | ||
− | + | == Links == | |
− | * [http://wiki.archlinux.org/index.php/Main_Page | + | * [http://wiki.archlinux.org/index.php/Main_Page Archlinux wiki] |
[[Category: HOWTO]] | [[Category: HOWTO]] | ||
[[Category: Templates]] | [[Category: Templates]] |