diff options
Diffstat (limited to 'bootstrap')
-rwxr-xr-x | bootstrap | 33 |
1 files changed, 17 insertions, 16 deletions
@@ -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" |