summaryrefslogtreecommitdiffstats
path: root/config/chroot_local-hooks
diff options
context:
space:
mode:
authoramnesia <amnesia@boum.org>2009-06-20 21:09:15 +0200
committeramnesia <amnesia@boum.org>2009-06-20 21:09:15 +0200
commit345a927fbd6aa18a2bcd13331cbc2e22ef2e0639 (patch)
tree1e107ba0a446a2cb32322f8e9dee1704fe10e5fb /config/chroot_local-hooks
initial source tree import0.1
/home/amnesia is missing, as no clean way to include it is implemented yet.
Diffstat (limited to 'config/chroot_local-hooks')
-rwxr-xr-xconfig/chroot_local-hooks/01-password11
-rwxr-xr-xconfig/chroot_local-hooks/02-loopback4
-rwxr-xr-xconfig/chroot_local-hooks/03-noswap4
-rwxr-xr-xconfig/chroot_local-hooks/10-splashy4
-rwxr-xr-xconfig/chroot_local-hooks/20-remove_packages3
-rwxr-xr-xconfig/chroot_local-hooks/30-home_permissions4
-rwxr-xr-xconfig/chroot_local-hooks/99-resolv24
7 files changed, 54 insertions, 0 deletions
diff --git a/config/chroot_local-hooks/01-password b/config/chroot_local-hooks/01-password
new file mode 100755
index 0000000..eb5316d
--- /dev/null
+++ b/config/chroot_local-hooks/01-password
@@ -0,0 +1,11 @@
+#! /bin/sh
+
+# Change the root password to "amnesia"
+echo "I: update password"
+echo "root:amnesia" | chpasswd
+
+# Change the autogenerated user password to "amnesia"
+plain_password="amnesia"
+password=$(echo "${plain_password}" | mkpasswd -s)
+sed -i -e 's/\(user_crypted=\)\(.*\)\( #.*\)/\1\"'${password}'\"\3/' /usr/share/initramfs-tools/scripts/live-bottom/10adduser
+update-initramfs -tu -kall
diff --git a/config/chroot_local-hooks/02-loopback b/config/chroot_local-hooks/02-loopback
new file mode 100755
index 0000000..653d794
--- /dev/null
+++ b/config/chroot_local-hooks/02-loopback
@@ -0,0 +1,4 @@
+#! /bin/sh
+
+echo "
+iface lo inet loopback" >>/etc/network/interfaces
diff --git a/config/chroot_local-hooks/03-noswap b/config/chroot_local-hooks/03-noswap
new file mode 100755
index 0000000..cbb27d7
--- /dev/null
+++ b/config/chroot_local-hooks/03-noswap
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# We don't want to swap to the local machine
+rm -f /usr/share/initramfs-tools/scripts/live-bottom/13swap
diff --git a/config/chroot_local-hooks/10-splashy b/config/chroot_local-hooks/10-splashy
new file mode 100755
index 0000000..3861f73
--- /dev/null
+++ b/config/chroot_local-hooks/10-splashy
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+splashy_config --set-theme moreblue-orbit
+update-initramfs -u -k all
diff --git a/config/chroot_local-hooks/20-remove_packages b/config/chroot_local-hooks/20-remove_packages
new file mode 100755
index 0000000..9941cf1
--- /dev/null
+++ b/config/chroot_local-hooks/20-remove_packages
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+apt-get remove --yes --purge epiphany-browser epiphany-browser-data epiphany-extensions epiphany-gecko \ No newline at end of file
diff --git a/config/chroot_local-hooks/30-home_permissions b/config/chroot_local-hooks/30-home_permissions
new file mode 100755
index 0000000..a260ac0
--- /dev/null
+++ b/config/chroot_local-hooks/30-home_permissions
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+chown -R 1000:1000 /home/amnesia
+
diff --git a/config/chroot_local-hooks/99-resolv b/config/chroot_local-hooks/99-resolv
new file mode 100755
index 0000000..1e798b3
--- /dev/null
+++ b/config/chroot_local-hooks/99-resolv
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+# Nota bene: if the custom /etc/resolv.conf file was in
+# chroot_local-includes, it would be installed inside the chroot
+# before our chroot_local-hooks run. Some of these scripts, needing
+# a working networking setup, would then awfully break.
+
+# Including common functions
+. "${LH_BASE:-/usr/share/live-helper}"/functions.sh
+
+# Setting static variables
+DESCRIPTION="$(Echo 'setup custom /etc/resolv.conf')"
+HELP=""
+USAGE="${PROGRAM}"
+
+# Reading configuration files
+Read_conffiles config/all config/common config/chroot
+Set_defaults
+
+Echo_message "Configuring file /etc/resolv.conf"
+echo 'nameserver 127.0.0.1' > /etc/resolv.conf
+# make sure lh_chroot_resolv will not overwrite our nice,
+# custom /etc/resolv.conf with a random .orig one
+echo 'nameserver 127.0.0.1' > /etc/resolv.conf.orig