Skip to content

Commit 9c6ced9

Browse files
committed
CLOUDSTACK-1340: Fix path issues in postinstall.sh, zerodisk on all partitions
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
1 parent 51f66e2 commit 9c6ced9

2 files changed

Lines changed: 14 additions & 12 deletions

File tree

tools/appliance/definitions/systemvmtemplate/postinstall.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,24 +91,24 @@ EOF
9191

9292
fix_inittab() {
9393
# Fix inittab
94-
cat >> etc/inittab << EOF
94+
cat >> /etc/inittab << EOF
9595
9696
vc:2345:respawn:/sbin/getty 38400 hvc0
9797
EOF
9898
}
9999

100100
fix_acpid() {
101101
# Fix acpid
102-
mkdir -p etc/acpi/events
103-
cat >> etc/acpi/events/power << EOF
102+
mkdir -p /etc/acpi/events
103+
cat >> /etc/acpi/events/power << EOF
104104
event=button/power.*
105105
action=/usr/local/sbin/power.sh "%e"
106106
EOF
107-
cat >> usr/local/sbin/power.sh << EOF
107+
cat >> /usr/local/sbin/power.sh << EOF
108108
#!/bin/bash
109109
/sbin/poweroff
110110
EOF
111-
chmod a+x usr/local/sbin/power.sh
111+
chmod a+x /usr/local/sbin/power.sh
112112
}
113113

114114
fix_hostname() {
@@ -149,8 +149,8 @@ configure_services() {
149149

150150
# Get config files from master
151151
snapshot_url="https://git-wip-us.apache.org/repos/asf?p=incubator-cloudstack.git;a=snapshot;h=HEAD;sf=tgz"
152-
snapshot_dir="/tmp/incubator-cloudstack*"
153-
cd /tmp
152+
snapshot_dir="/opt/incubator-cloudstack*"
153+
cd /opt
154154
wget $snapshot_url -O cloudstack.tar.gz
155155
tar -zxvf cloudstack.tar.gz
156156
cp -rv $snapshot_dir/patches/systemvm/debian/config/* /
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
#clean up stuff copied in by veewee
1+
# Clean up stuff copied in by veewee
22
rm -f /root/*
33

44
# Zero out the free space to save space in the final image:
5-
dd if=/dev/zero of=/EMPTY bs=1M
6-
sync
7-
rm -f /EMPTY
8-
5+
for path in / /boot /usr /var /opt /tmp
6+
do
7+
dd if=/dev/zero of=$path/zero bs=1M
8+
sync
9+
rm -f $i/zero
10+
done

0 commit comments

Comments
 (0)