From 603657a166bff4a16606a2575364446171466af6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 23 Mar 2017 20:08:19 +0200 Subject: Initial implementation of network configuration --- bootstrap | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'bootstrap') diff --git a/bootstrap b/bootstrap index 5ac3b46..18343be 100755 --- a/bootstrap +++ b/bootstrap @@ -29,7 +29,8 @@ id="$(id -un)" btrfs=/btrfs release="unstable" mirror="https://deb.debian.org/debian/" -passwd="123" #@@ TMP root passwd. +passwd="123" #@@ TMP root passwd. +macaddr="DE:AD:BE:EF:B8:DA" # Mac address for testing. root="$btrfs/$id/buildos" @@ -117,7 +118,7 @@ function nspawn () # # (Over)write or append to a file in the installation root, for example: # -# write <<<'unknown' /etc/hostname +# write <<<'localhost' /etc/hostname # function write () # { @@ -140,8 +141,10 @@ if [ "$stage" -eq "1" ]; then # - systemd-container seems to be required by host systemd-nspawn. # pkgs="locales,systemd-container" - pkgs+=",net-tools,iproute2,isc-dhcp-client,wget" - pkgs+=",linux-image-amd64" + pkgs+=",net-tools,iproute2,iptables,isc-dhcp-client,ifupdown,ntp" + pkgs+=",iputils-ping,wget,curl" + pkgs+=",linux-image-amd64,irqbalance,pciutils" + pkgs+=",less" sudo debootstrap \ --foreign \ @@ -153,7 +156,11 @@ if [ "$stage" -eq "1" ]; then # Post-phase 1 fixups. # - write <<<'unknown' /etc/hostname + + # Set the initial hostname to '(none)'. This value is detected and + # overriden by /sbin/dhclient-script if the DHCP server sends host-name. + # + write <<<'(none)' /etc/hostname # Set timezone to UTC (picked up by tzdata package during stage 2). # @@ -339,6 +346,10 @@ fi # Test. # +# To test PXE boot, replace -kernel/-initrd with '-boot n'. +# sudo kvm \ -m 8G \ + -netdev 'tap,id=net0,script=./qemu-ifup' \ + -device "e1000,netdev=net0,mac=$macaddr" \ -kernel buildos-image -initrd buildos-initrd -- cgit v1.1