aboutsummaryrefslogtreecommitdiff
path: root/bootstrap
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-03-23 20:08:19 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-03-23 20:08:19 +0200
commit603657a166bff4a16606a2575364446171466af6 (patch)
treead31cfff7432d5846d8a40505c1943a6fb1d1718 /bootstrap
parent6b3c6b23a16869012c934c0df6244885b22e0aa1 (diff)
Initial implementation of network configuration
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap21
1 files changed, 16 insertions, 5 deletions
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 () # <systemd-nspawn-args>
# (Over)write or append to a file in the installation root, for example:
#
-# write <<<'unknown' /etc/hostname
+# write <<<'localhost' /etc/hostname
#
function write () # <path>
{
@@ -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