From 3698a57fdaed1a4e3ce074113bbe876c9609a0d4 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sun, 18 May 2014 17:33:09 +0200 Subject: reactivated --- LINKS | 23 +++++++++++++++ README | 60 +++++++-------------------------------- archauto.sh | 26 ++++++++++------- clean.sh | 2 ++ copy_local_packages.sh | 35 +++++++++++++++++++++++ tftproot/boot/x86_64/.placeholder | 0 6 files changed, 86 insertions(+), 60 deletions(-) create mode 100644 LINKS create mode 100755 copy_local_packages.sh create mode 100644 tftproot/boot/x86_64/.placeholder diff --git a/LINKS b/LINKS new file mode 100644 index 0000000..7b0df12 --- /dev/null +++ b/LINKS @@ -0,0 +1,23 @@ +Links +----- + +https://wiki.archlinux.org/index.php/Archiso +https://wiki.archlinux.org/index.php/PXE +https://wiki.archlinux.org/index.php/Archiso_as_pxe_server +https://kroweer.wordpress.com/2011/09/07/creating-a-custom-arch-linux-live-usb/ +http://pxeknife.erebor.org/ +https://github.com/altercation/archblocks +https://bbs.archlinux.org/viewtopic.php?id=149597 +https://github.com/jdodds/aif +https://wiki.archlinux.org/index.php/Autostarting +https://wiki.archlinux.org/index.php/Automatic_login_to_virtual_console +https://wiki.archlinux.org/index.php/Official_Arch_Linux_Install_Guide +https://bbs.archlinux.org/viewtopic.php?id=148790 (text mode boot from archiso) +http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=How_to_run_OVMF (UEFI BIOS) +https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2/EdkShellBinPkg/FullShell/X64/Shell_Full.efi +https://wiki.archlinux.org/index.php/GRUB2 +http://www.brianparsons.net/Best-Practices-For-Using-Arch-Linux-on-Servers/ + +Other projects +-------------- +https://github.com/roman-neuhauser/anarchinst diff --git a/README b/README index c97373c..0c729c2 100644 --- a/README +++ b/README @@ -6,7 +6,7 @@ pacman -S archiso qemu syslinux darkhttpd ArchISO and optional local cache -------------------------------- -We build a live Arch boot CD. +# We build a live Arch boot CD. export http_proxy=http://192.168.1.12:3128 mkdir archlive @@ -14,40 +14,32 @@ cp -r /usr/share/archiso/configs/releng/* archlive/. cd archlive # always had problem with keys, switch of signing (not good, I know) - sed -i 's/^SigLevel.*/SigLevel = Never/g' pacman.conf # build the live CDs, this take quite a while - ./build.sh -v build single cd .. -We mount it and make it accessible over a webserver: +# We mount it and make it accessible over a webserver: -mkdir archiso -mount -o loop,ro archlive/out/archlinux-2013.05.16-dual.iso archiso +mount -o loop,ro archlive/out/archlinux-2014.05.18-dual.iso archiso darkhttpd . --port 8080 & -We can also make available the packages on this webserver: - -mkdir -p {core,extra,community}/os/x86_64/ -repo-add core/os/x86_64/core.db.tar.gz core/os/x86_64/* -tar zcvfT extra/os/x86_64/extra.db.tar.gz /dev/null -ln -s extra.db.tar.gz extra/os/x86_64/extra.db -tar zcvfT community/os/x86_64/community.db.tar.gz /dev/null -ln -s community.db.tar.gz community/os/x86_64/community.db +# copy packages from host system (there is no need to build a full-fledged +# mirror now) +./copy_local_packages.sh TFTP root -------- Copy PXE bootstrap files to a TFTP root: -mkdir -p tftproot/boot/x86_64 cp archiso/arch/boot/x86_64/vmlinuz tftproot/boot/x86_64/ cp archiso/arch/boot/x86_64/archiso.img tftproot/boot/x86_64/ -cp /usr/lib/syslinux/pxelinux.0 tftproot +cp /usr/lib/syslinux/bios/pxelinux.0 tftproot +cp /usr/lib/syslinux/bios/ldlinux.c32 tftproot Custom software from AUR ------------------------ @@ -73,9 +65,10 @@ qemu-img create arch.img 4G qemu-system-x86_64 -hda arch.img -net nic \ -net user,tftp=$PWD/tftproot,bootfile=pxelinux.0 \ - -m 386 -display curses \ + -m 386 \ -machine accel=kvm -redir tcp:222::22 \ - -boot n + -display curses +# -nographic # remote install (manually), then follow docu # (this gives a rough idea of what should be automatized) @@ -109,34 +102,3 @@ systemctl start sshd # packages net-tools gdisk -Running the system ------------------- - -qemu-system-x86_64 -hda arch.img -net nic \ - -net user \ - -m 386 -display curses \ - -machine accel=kvm -redir tcp:222::22 - -Links ------ - -https://wiki.archlinux.org/index.php/Archiso -https://wiki.archlinux.org/index.php/PXE -https://wiki.archlinux.org/index.php/Archiso_as_pxe_server -https://kroweer.wordpress.com/2011/09/07/creating-a-custom-arch-linux-live-usb/ -http://pxeknife.erebor.org/ -https://github.com/altercation/archblocks -https://bbs.archlinux.org/viewtopic.php?id=149597 -https://github.com/jdodds/aif -https://wiki.archlinux.org/index.php/Autostarting -https://wiki.archlinux.org/index.php/Automatic_login_to_virtual_console -https://wiki.archlinux.org/index.php/Official_Arch_Linux_Install_Guide -https://bbs.archlinux.org/viewtopic.php?id=148790 (text mode boot from archiso) -http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=How_to_run_OVMF (UEFI BIOS) -https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2/EdkShellBinPkg/FullShell/X64/Shell_Full.efi -https://wiki.archlinux.org/index.php/GRUB2 -http://www.brianparsons.net/Best-Practices-For-Using-Arch-Linux-on-Servers/ - -Other projects --------------- -https://github.com/roman-neuhauser/anarchinst diff --git a/archauto.sh b/archauto.sh index 0463eac..cdf2e16 100755 --- a/archauto.sh +++ b/archauto.sh @@ -36,7 +36,7 @@ mkfs.ext4 ${INSTALL_DRIVE}${PARTITION_ROOT} mkdir -p ${MOUNT_PATH} mount ${INSTALL_DRIVE}${PARTITION_ROOT} ${MOUNT_PATH} -export http_proxy=http://192.168.1.12:3128 +#export http_proxy=http://192.168.1.12:3128 export no_proxy=localhost,10.0.2.2 # use our local cache @@ -55,7 +55,7 @@ sed -i '/\[extra\]/aServer = http://10.0.2.2:8080/$repo/os/$arch' ${MOUNT_PATH}/ sed -i '/\[community\]/aServer = http://10.0.2.2:8080/$repo/os/$arch' ${MOUNT_PATH}/etc/pacman.conf # add our local packages into a separate repository -printf "\n[aba]\nServer = http://10.0.2.2:8080/\044repo/os/\044arch\n" >> ${MOUNT_PATH}/etc/pacman.conf +#printf "\n[aba]\nServer = http://10.0.2.2:8080/\044repo/os/\044arch\n" >> ${MOUNT_PATH}/etc/pacman.conf # synchronize package databases for installed pacman arch-chroot ${MOUNT_PATH} pacman -Sy @@ -88,7 +88,7 @@ echo "archiso" > ${MOUNT_PATH}/etc/hostname arch-chroot ${MOUNT_PATH} systemctl enable dhcpcd@ens3.service -arch-chroot ${MOUNT_PATH} sh -c "echo 'root:xx' | chpasswd" +arch-chroot ${MOUNT_PATH} sh -c "echo 'root:123qwe' | chpasswd" # synchronized time is a requirement, install and configure ntp # we use a standard NTP server, later we can change that via cfengine @@ -97,23 +97,27 @@ arch-chroot ${MOUNT_PATH} ntpdate 0.pool.ntp.org arch-chroot ${MOUNT_PATH} systemctl enable ntpd.service # monitord needs netstat -arch-chroot ${MOUNT_PATH} pacman --noconfirm -S net-tools +#arch-chroot ${MOUNT_PATH} pacman --noconfirm -S net-tools # we use 'git' to manage our promises -arch-chroot ${MOUNT_PATH} pacman --noconfirm -S git-core +#arch-chroot ${MOUNT_PATH} pacman --noconfirm -S git-core -arch-chroot ${MOUNT_PATH} pacman --noconfirm -S cfengine +#arch-chroot ${MOUNT_PATH} pacman --noconfirm -S cfengine # install rules for the machine from git -arch-chroot ${MOUNT_PATH} git clone ${GIT_REPO} /srv/cfengine/masterfiles +#arch-chroot ${MOUNT_PATH} git clone ${GIT_REPO} /srv/cfengine/masterfiles # create machine keys -arch-chroot ${MOUNT_PATH} cf-key +#arch-chroot ${MOUNT_PATH} cf-key # enable cfengine -arch-chroot ${MOUNT_PATH} systemctl enable cf-execd.service -arch-chroot ${MOUNT_PATH} systemctl enable cf-monitord.service -arch-chroot ${MOUNT_PATH} systemctl enable cf-serverd.service +#arch-chroot ${MOUNT_PATH} systemctl enable cf-execd.service +#arch-chroot ${MOUNT_PATH} systemctl enable cf-monitord.service +#arch-chroot ${MOUNT_PATH} systemctl enable cf-serverd.service + +# for debugging +echo "Installation.. press any key to reboot." +read echo "Done." diff --git a/clean.sh b/clean.sh index 96da67a..27dac5f 100644 --- a/clean.sh +++ b/clean.sh @@ -1,3 +1,5 @@ +# This can be done in cfengine as rule as "must-be-absent" packages + # pacstrap ${MOUNT_PATH} base # leaves us with 111 packages, 715 MB diff --git a/copy_local_packages.sh b/copy_local_packages.sh new file mode 100755 index 0000000..6764c1c --- /dev/null +++ b/copy_local_packages.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +rm -rf core/os/x86_64/ +mkdir -p core/os/x86_64/ + +for p in `cat archiso/arch/pkglist.x86_64.txt`; do + case $p in + core/*) + pkgname=`echo $p | cut -f 2 -d /` + if test -f /var/cache/pacman/pkg/$pkgname*x86_64.pkg.tar.xz; then + cp /var/cache/pacman/pkg/$pkgname*x86_64.pkg.tar.xz core/os/x86_64/. + fi + if test -f /var/cache/pacman/pkg/$pkgname*any.pkg.tar.xz; then + cp /var/cache/pacman/pkg/$pkgname*any.pkg.tar.xz core/os/x86_64/. + fi + ;; + esac +done + +ADDITIONAL_PKGS="libunistring-0.9.3-6" +for pkgname in $ADDITIONAL_PKGS; do + if test -f /var/cache/pacman/pkg/$pkgname*x86_64.pkg.tar.xz; then + cp /var/cache/pacman/pkg/$pkgname*x86_64.pkg.tar.xz core/os/x86_64/. + fi + if test -f /var/cache/pacman/pkg/$pkgname*any.pkg.tar.xz; then + cp /var/cache/pacman/pkg/$pkgname*any.pkg.tar.xz core/os/x86_64/. + fi +done + +repo-add core/os/x86_64/core.db.tar.gz core/os/x86_64/* +ln -s core.db.tar.gz core/os/x86_64/core.db +tar zcvfT extra/os/x86_64/extra.db.tar.gz /dev/null +ln -s extra.db.tar.gz extra/os/x86_64/extra.db +tar zcvfT community/os/x86_64/community.db.tar.gz /dev/null +ln -s community.db.tar.gz community/os/x86_64/community.db diff --git a/tftproot/boot/x86_64/.placeholder b/tftproot/boot/x86_64/.placeholder new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3-54-g00ecf