From a0972dd60ffabf1342c3a232749da719d9b75fa0 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Fri, 17 May 2013 10:13:02 +0200 Subject: playing with local package repo --- README | 11 +++++++++-- archauto.sh | 22 ++++++++++++++++------ 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/README b/README index 9c6b19b..cfdc8b5 100644 --- a/README +++ b/README @@ -3,8 +3,8 @@ Requirements pacman -S archiso qemu syslinux darkhttpd -ArchISO -------- +ArchISO and optional local cache +-------------------------------- We build a live Arch boot CD. @@ -29,6 +29,13 @@ mkdir archiso mount -o loop,ro archlive/out/archlinux-2013.05.16-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 +tar zcvfT community/os/x86_64/community.db.tar.gz /dev/null + TFTP root -------- diff --git a/archauto.sh b/archauto.sh index 643edc4..3974678 100755 --- a/archauto.sh +++ b/archauto.sh @@ -37,9 +37,22 @@ mkdir -p ${MOUNT_PATH} mount ${INSTALL_DRIVE}${PARTITION_ROOT} ${MOUNT_PATH} export http_proxy=http://192.168.1.12:3128 +export no_proxy=localhost,10.0.2.2 + +# use our local cache +sed -i '/\[core\]/aServer = http://10.0.2.2:8080/$repo/os/$arch' /etc/pacman.conf + +# switch off signature for now +sed -i 's/^SigLevel.*/SigLevel = Never/g' /etc/pacman.conf pacstrap ${MOUNT_PATH} filesystem grep findutils coreutils glibc bash pacman mkinitcpio kernel26 dhcpcd +# use our local cache in installed pacman +sed -i '/\[core\]/aServer = http://10.0.2.2:8080/$repo/os/$arch' ${MOUNT_PATH}/etc/pacman.conf + +# switch off signature for now in installed pacman +sed -i 's/^SigLevel.*/SigLevel = Never/g' ${MOUNT_PATH}/etc/pacman.conf + arch-chroot ${MOUNT_PATH} pacman --noconfirm -S grub-bios arch-chroot ${MOUNT_PATH} grub-install --target=i386-pc --recheck ${INSTALL_DRIVE} cp ${MOUNT_PATH}/usr/share/locale/en@quot/LC_MESSAGES/grub.mo ${MOUNT_PATH}/boot/grub/locale/en.mo @@ -67,9 +80,6 @@ arch-chroot ${MOUNT_PATH} systemctl enable dhcpcd@ens3.service arch-chroot ${MOUNT_PATH} sh -c "echo 'root:xx' | chpasswd" -# switch off signature for now -sed -i 's/^SigLevel.*/SigLevel = Never/g' ${MOUNT_PATH}/etc/pacman.conf - # synchronized time is a requirement, install and configure ntp # we use a standard NTP server, later we can change that via cfengine arch-chroot ${MOUNT_PATH} pacman --noconfirm -S ntp @@ -82,15 +92,15 @@ 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 -# switch proxy off now, we go local now -unset http_proxy - arch-chroot ${MOUNT_PATH} pacman --noconfirm -v -U http://10.0.2.2:8080/qdbm-1.8.78-1-x86_64.pkg.tar.xz arch-chroot ${MOUNT_PATH} pacman --noconfirm -v -U http://10.0.2.2:8080/cfengine-3.4.4-2-x86_64.pkg.tar.xz # install rules for the machine from git arch-chroot ${MOUNT_PATH} git clone ${GIT_REPO} /srv/cfengine/masterfiles +# create machine keys +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 -- cgit v1.2.3-54-g00ecf