aboutsummaryrefslogtreecommitdiff
path: root/bootstrap
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-10-12 09:03:03 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-10-12 09:03:03 +0200
commitc15d3d5be4011f9bfc7e36fb1629529c1eb2e009 (patch)
treeb9795c693cbbd7d1ee2d6af666981ac861d57517 /bootstrap
parent86f6a19d36b1738c1e9d4a95a1c7e7d310f9960c (diff)
Various fixes and cleanups for base upgrade
systemd 234 qemu 2.10 linux 4.13
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap33
1 files changed, 17 insertions, 16 deletions
diff --git a/bootstrap b/bootstrap
index 63ebd32..380ae5e 100755
--- a/bootstrap
+++ b/bootstrap
@@ -28,10 +28,9 @@ usage="usage: $0"
id="$(id -un)"
btrfs=/btrfs
-release="testing"
+release="unstable"
mirror="https://deb.debian.org/debian/"
-passwd="123" #@@ TMP root passwd.
-macaddr="de:ad:be:ef:b8:da" # Mac address for testing.
+macaddr="de:ad:be:ef:b8:da" # Mac address for testing.
root="$btrfs/$id/buildos"
@@ -166,6 +165,8 @@ if [ "$stage" -eq "1" ]; then
pkgs+=",intel-microcode,amd64-microcode"
+ #pkgs+=",lsof,auditd"
+
pkgs+=",hdparm,btrfs-progs"
pkgs+=",net-tools,iproute2,iptables,isc-dhcp-client"
@@ -179,7 +180,7 @@ if [ "$stage" -eq "1" ]; then
pkgs+=",qemu-kvm,qemu-utils,socat"
- pkgs+=",g++,pkg-config"
+ pkgs+=",g++,make,pkg-config"
sudo debootstrap \
--foreign \
@@ -193,10 +194,10 @@ if [ "$stage" -eq "1" ]; then
# Post-phase 1 fixups.
#
- # Set the initial hostname to '(none)'. This value is detected and
+ # Set the initial hostname to 'localhost'. This value is detected and
# overriden by /sbin/dhclient-script if the DHCP server sends host-name.
#
- write <<<'(none)' /etc/hostname
+ write <<<'localhost' /etc/hostname
# Set timezone to UTC (picked up by tzdata package during stage 2).
#
@@ -264,9 +265,9 @@ Welcome to Build OS 0.6.0 (https://build2.org)!
EOF1
-# Set root password.
+# Make root login passwordless (we disable SSH root login in init).
#
-chpasswd <<<'root:$passwd'
+passwd -d root
# Enable IPv4 forwarding (used for private bridge NAT).
#
@@ -311,7 +312,7 @@ if [ "$stage" -le "3" ]; then
write <<EOF /usr/lib/systemd/system/buildos-setup.service
[Unit]
Description=build os setup
-After=default.target
+After=multi-user.target
Conflicts=console-getty.service
[Service]
@@ -327,12 +328,12 @@ TTYReset=yes
TTYVHangup=yes
[Install]
-WantedBy=default.target
+WantedBy=multi-user.target
EOF
- sudo mkdir -p "$root/usr/lib/systemd/system/default.target.wants"
+ sudo mkdir -p "$root/etc/systemd/system/multi-user.target.wants"
sudo ln -sf "$root/usr/lib/systemd/system/buildos-setup.service" \
- "$root/usr/lib/systemd/system/default.target.wants/buildos-setup.service"
+ "$root/etc/systemd/system/multi-user.target.wants/buildos-setup.service"
# Create the kernel build snapshot, write the script that does the build
# from within the installation and boot it up via systemd-nspawn --boot.
@@ -439,7 +440,7 @@ apt-get clean
# Clean up /bootstrap.
#
-rm /usr/lib/systemd/system/default.target.wants/buildos-setup.service
+rm /etc/systemd/system/multi-user.target.wants/buildos-setup.service
rm /usr/lib/systemd/system/buildos-setup.service
rm -r /bootstrap
@@ -496,9 +497,9 @@ if [ "$stage" -le "6" ]; then
#
sudo install -m 755 ./init "$root/"
sudo install -m 755 ./buildos "$root/usr/sbin/"
- sudo install -m 755 ./buildos.service "$root/usr/lib/systemd/system/"
+ sudo install -m 644 ./buildos.service "$root/usr/lib/systemd/system/"
sudo ln -sf "$root/usr/lib/systemd/system/buildos.service" \
- "$root/usr/lib/systemd/system/default.target.wants/buildos.service"
+ "$root/etc/systemd/system/multi-user.target.wants/buildos.service"
info "generating buildos-init.cpio.gz..."
@@ -509,7 +510,7 @@ usr/lib/os-release
init
usr/sbin/buildos
usr/lib/systemd/system/buildos.service
-usr/lib/systemd/system/default.target.wants/buildos.service
+etc/systemd/system/multi-user.target.wants/buildos.service
EOF
cd "$owd"