source: trunk/debian/rootfs/files/all/usr/sbin/PostInstall @ 890

Last change on this file since 890 was 890, checked in by amain, 21 months ago

rootfs: fix dir permissions in /

  • Property svn:executable set to *
File size: 1.4 KB
Line 
1#!/bin/bash
2#
3# DebWrt PostInstall
4#
5# Copyright (C) 2011 Geert Stappers  <stappers@stappers.nl>
6# Copyright (C) 2011 Johan van Zoomeren <amain@debwrt.net>
7#
8# Licenced GNU General Public License v2
9
10# hack for Debian sid
11[ -e /var/run/sshd ] && mv /var/run/sshd /tmp
12
13if [ -x /debootstrap/debootstrap ] ; then
14  echo "I: Running second stage of debootstap (may take some time)"
15  /debootstrap/debootstrap --second-stage
16else
17  echo "I: No debootstrap executable found, assuming 'second stage debootstrap' is already done"
18fi
19
20echo "I: Cleaning up /var/cache/apt/archives"
21rm -rf /var/cache/apt/archives
22mkdir -p /var/cache/apt/archives/partial
23
24# hack for Debian sid
25[ -e /tmp/sshd -a ! -e /var/run/sshd ] && mv /tmp/sshd /var/run
26
27# disable systemd services
28echo "I: Disabling services"
29find /etc/systemd -name "inetd.service"   -delete
30find /etc/systemd -name "dnsmasq.service" -delete
31
32echo "I: Setting root password"
33sed -i 's!^root:.*!root:$1$Rm/q9RCm$khpJ819vFteZqYNdf60wb1:14254:0:99999:7:::!' /etc/shadow
34
35# Probably a (new) safety measure from debian, but currently simple
36# programs like ping and dnsmasq (as nobody) fail to run will various
37# file system access errors.
38echo "I: Setting +rx on all directories in /"
39find / -maxdepth 1 -mindepth 1 -type d -exec chmod +rx {} \;
40
41echo -n "I: syncing disks...."
42sync
43echo "done"
44echo
45
46cat <<EOF
47I: Next step is configuring the network and run apt-get update. Have fun!!
48
49EOF
Note: See TracBrowser for help on using the repository browser.