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

Last change on this file since 891 was 891, checked in by amain, 3 years ago

rootfs: fix dir permissions in / (skip /root)

  • Property svn:executable set to *
File size: 1.5 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 \
40 | grep -v "root"
41 | grep -v "lost+found"
42 | while read dir
43   do
44       chmod +rx ${dir}
45   done
46
47echo -n "I: syncing disks...."
48sync
49echo "done"
50echo
51
52cat <<EOF
53I: Next step is configuring the network and run apt-get update. Have fun!!
54
55EOF
Note: See TracBrowser for help on using the repository browser.