Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/create_hdd.sh
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2018-02-18 21:40:12 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2018-02-18 21:40:12 +0100
commit44f5b7af6444173b16d1495023d80aaef8a9c47a (patch)
treefb470c6efae079bfecfa25d92b3424dc6cfc0058 /create_hdd.sh
parent224768b40915233bf11a863946ffdcb2dda6a63f (diff)
work on stage 2
Diffstat (limited to 'create_hdd.sh')
-rwxr-xr-xcreate_hdd.sh20
1 files changed, 19 insertions, 1 deletions
diff --git a/create_hdd.sh b/create_hdd.sh
index 3170a64..94df476 100755
--- a/create_hdd.sh
+++ b/create_hdd.sh
@@ -53,7 +53,7 @@ mount -t devpts devpts /dev/pts
mount -t sysfs sys /sys
mount -o remount,rw /
ip link set up dev eth0
-ip addr add 192.168.1.127/24 dev eth0
+ip addr add ${STAGE1_MACHINE_IP}/24 dev eth0
ip route add default via 192.168.1.1 dev eth0
/usr/sbin/sshd
exec /usr/bin/bash
@@ -81,6 +81,21 @@ chmod 0400 etc/ssh/ssh_host_*_key
mkdir root/.ssh
cp "$HOME/.ssh/id_rsa.pub" root/.ssh/authorized_keys
+# install a build user and build directory
+cat >> etc/group <<EOF
+build:x:1001:
+EOF
+cat >> etc/passwd <<EOF
+build:x:1001:1001:build:/build:/bin/bash
+EOF
+mkdir -p build
+mkdir build/.ssh
+cp "$HOME/.ssh/id_rsa.pub" build/.ssh/authorized_keys
+chown 1001:1001 build
+# TODO: why does su require a password though we want to login via
+# SSH and key only!?
+#echo 'build:xx' | chpasswd
+
# add some test programs to test the C and C++ compiler
cat > root/test.c <<EOF
@@ -106,6 +121,9 @@ int main( void )
}
EOF
+# put proper pacman.conf in place
+mv etc/pacman.conf.pacnew etc/pacman.conf
+
# fix permissions (we only have root on the image)
chmod 0700 root/.ssh