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

Last change on this file since 881 was 881, checked in by amain, 2 years ago

rootfs: fix permissions / and /lib, fix subtarget in debwrt init script

  • 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 / and /lib"
39chmod +rx /
40chmod +rx /lib
41
42echo -n "I: syncing disks...."
43sync
44echo "done"
45echo
46
47cat <<EOF
48I: Next step is configuring the network and run apt-get update. Have fun!!
49
50EOF
Note: See TracBrowser for help on using the repository browser.