From ac8c5d214551f898b3448a578070f45c13e29b15 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sat, 6 Feb 2016 20:04:02 +0100 Subject: tons of bugfixes force output via serial --- README | 23 ++++++++++++----------- archauto.sh | 27 ++++++++++++++++++++------- copy_local_packages.sh | 4 ++-- tftproot/pxelinux.cfg/01-52-54-00-12-34-56 | 4 ++-- 4 files changed, 36 insertions(+), 22 deletions(-) diff --git a/README b/README index e81df79..19b7ffb 100644 --- a/README +++ b/README @@ -23,7 +23,8 @@ cd .. # We mount it and make it accessible over a webserver: -mount -o loop,ro archlive/out/archlinux-2014.05.18-dual.iso archiso +mkdir archiso +mount -o loop,ro archlive/out/archlinux-2016.02.06-dual.iso archiso darkhttpd . --port 8080 & # copy packages from host system (there is no need to build a full-fledged @@ -46,16 +47,15 @@ Custom software from AUR Build the following packages from AUR: +useradd -g users build rm -rf INSTALL mkdir INSTALL -cd install -yaourt -G qdbm -cd qdbm -makepkg --asroot -if -cd .. +cd INSTALL + yaourt -G cfengine +chown -R build:users cfengine cd cfengine -makepkg --asroot -if +su build -c 'makepkg -f' cd .. Put them into a local repository 'aba': @@ -75,12 +75,13 @@ the archiso kernel as script to execute after auto-login: qemu-img create arch.img 4G -qemu-system-x86_64 -hda arch.img -net nic \ +qemu-system-x86_64 -drive file=arch.img,index=0,media=disk,format=raw -net nic \ -net user,tftp=$PWD/tftproot,bootfile=pxelinux.0 \ - -m 386 \ + -m 512 \ -machine accel=kvm -redir tcp:222::22 \ - -display curses -# -nographic + -nographic -serial mon:stdio |& tee log +# -curses +# -nographic -serial mon:stdio # remote install (manually), then follow docu # (this gives a rough idea of what should be automatized) diff --git a/archauto.sh b/archauto.sh index 6a247af..6d1c2ff 100755 --- a/archauto.sh +++ b/archauto.sh @@ -1,4 +1,6 @@ -#!/bin/sh +#!/bin/sh -x + +{ INSTALL_DRIVE=/dev/sda PARTITION_BOOT=1 @@ -35,6 +37,8 @@ mkfs.ext4 ${INSTALL_DRIVE}${PARTITION_ROOT} mkdir -p ${MOUNT_PATH} mount ${INSTALL_DRIVE}${PARTITION_ROOT} ${MOUNT_PATH} +mkdir ${MOUNT_PATH}/boot +mount ${INSTALL_DRIVE}${PARTITION_BOOT} ${MOUNT_PATH}/boot #export http_proxy=http://192.168.1.12:3128 export no_proxy=localhost,10.0.2.2 @@ -47,7 +51,7 @@ sed -i '/\[community\]/aServer = http://10.0.2.2:8080/$repo/os/$arch' /etc/pacma # 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 +pacstrap ${MOUNT_PATH} filesystem grep findutils coreutils glibc bash pacman mkinitcpio linux dhcpcd systemd # 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 @@ -63,17 +67,19 @@ arch-chroot ${MOUNT_PATH} pacman -Sy # 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} +arch-chroot ${MOUNT_PATH} pacman --noconfirm -S grub-bios sed +mkdir ${MOUNT_PATH}/boot/grub/locale/ cp ${MOUNT_PATH}/usr/share/locale/en@quot/LC_MESSAGES/grub.mo ${MOUNT_PATH}/boot/grub/locale/en.mo # disable quiet mode, set text mode instead of graphical mode # also ban cirrus KVM # set correct path of systemd binary (symlink /sbin/init has gone) -sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="quiet"/GRUB_CMDLINE_LINUX_DEFAULT="modprobe.blacklist=cirrus init=\/usr\/lib\/systemd\/systemd"/g' ${MOUNT_PATH}/etc/default/grub +sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="quiet"/GRUB_CMDLINE_LINUX_DEFAULT="modprobe.blacklist=cirrus init=\/usr\/lib\/systemd\/systemd" console=ttyS0,9600n8/g' ${MOUNT_PATH}/etc/default/grub sed -i 's/GRUB_GFXMODE=auto/GRUB_GFXMODE=text/g' ${MOUNT_PATH}/etc/default/grub -sed -i 's/#GRUB_TERMINAL_OUTPUT=console/GRUB_TERMINAL_OUTPUT=console/g' ${MOUNT_PATH}/etc/default/grub - +sed -i 's/GRUB_TERMINAL_INPUT=console/GRUB_TERMINAL_INPUT=serial/g' ${MOUNT_PATH}/etc/default/grub +sed -i 's/GRUB_TERMINAL_OUTPUT=console/GRUB_TERMINAL_OUTPUT=serial/g' ${MOUNT_PATH}/etc/default/grub +echo 'GRUB_SERIAL_COMMAND="serial --speed=9600 --unit=0 --word=8 --parity=no --stop=1"' >> ${MOUNT_PATH}/etc/default/grub arch-chroot ${MOUNT_PATH} grub-mkconfig -o /boot/grub/grub.cfg +arch-chroot ${MOUNT_PATH} grub-install --target=i386-pc --recheck ${INSTALL_DRIVE} genfstab -p ${MOUNT_PATH} >> ${MOUNT_PATH}/etc/fstab @@ -120,7 +126,14 @@ arch-chroot ${MOUNT_PATH} systemctl enable cf-serverd.service #echo "Installation.. press any key to reboot." #read +echo "Unmounting installation mount points.." +umount ${MOUNT_PATH}/boot +umount ${MOUNT_PATH} + echo "Done.. Rebooting system.." sleep 3 systemctl reboot + +} 2>&1 | tee -a /dev/ttyS0 + diff --git a/copy_local_packages.sh b/copy_local_packages.sh index 99609db..776d74a 100755 --- a/copy_local_packages.sh +++ b/copy_local_packages.sh @@ -1,7 +1,7 @@ #!/bin/sh -rm -rf core/os/x86_64/ -mkdir -p core/os/x86_64/ +rm -rf {core,extra,community}/os/x86_64/ +mkdir -p {core,extra,community}/os/x86_64/ for p in `cat archiso/arch/pkglist.x86_64.txt`; do case $p in diff --git a/tftproot/pxelinux.cfg/01-52-54-00-12-34-56 b/tftproot/pxelinux.cfg/01-52-54-00-12-34-56 index 9401dd8..801d482 100644 --- a/tftproot/pxelinux.cfg/01-52-54-00-12-34-56 +++ b/tftproot/pxelinux.cfg/01-52-54-00-12-34-56 @@ -3,7 +3,7 @@ TIMEOUT 10 DEFAULT arch64_http_cfengine -#SERIAL 0 9600 0x303 +SERIAL 0 9600 0x303 LABEL arch64_http_cfengine TEXT HELP @@ -13,5 +13,5 @@ ENDTEXT MENU LABEL Boot Arch Linux (x86_64) (HTTP) LINUX boot/x86_64/vmlinuz INITRD boot/x86_64/archiso.img -APPEND archisobasedir=archiso/arch archiso_http_srv=http://10.0.2.2:8080/ ip=dhcp modprobe.blacklist=cirrus script=http://10.0.2.2:8080/archauto.sh +APPEND archisobasedir=archiso/arch archiso_http_srv=http://10.0.2.2:8080/ ip=dhcp modprobe.blacklist=cirrus script=http://10.0.2.2:8080/archauto.sh console=ttyS0,9600n8 IPAPPEND 3 -- cgit v1.2.3-54-g00ecf