-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
hotdog-installerConfigureSystem.sh
executable file
·59 lines (47 loc) · 1.43 KB
/
hotdog-installerConfigureSystem.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/sh
#
# Adapted from Slackware and Slackware Live installer
#
ROOTDIR="/mntsystem"
if ! [ -d "$ROOTDIR" ]; then
echo "Error, $ROOTDIR either does not exist or is not a directory"
exit 1
fi
ROOTDEVICE=$( findmnt -P -M $ROOTDIR | sed 's/.*SOURCE="\([^"]*\)".*/\1/' )
if [ "x$ROOTDEVICE" = "x" ]; then
echo "Error, $ROOTDIR is not mounted with system"
exit 1
fi
#
# Set root password and create new user
#
hotdog-installerSetupAccounts.sh
#
# Run package setup scripts
#
# Disable making USB boot drive
chmod 644 $ROOTDIR/var/log/setup/setup.80.make-bootdisk
# Disable running of xwmconfig
chmod 644 $ROOTDIR/var/log/setup/setup.xwmconfig
# Make bind mounts for /dev, /proc, and /sys:
mount -o bind /dev $ROOTDIR/dev 2> /dev/null
mount -o bind /proc $ROOTDIR/proc 2> /dev/null
mount -o bind /sys $ROOTDIR/sys 2> /dev/null
# Post installation and setup scripts added by packages.
if [ -d $ROOTDIR/var/log/setup ]; then
for INSTALL_SCRIPTS in $ROOTDIR/var/log/setup/setup.* ; do
SCRIPT=`basename $INSTALL_SCRIPTS`
# Here, we call each script in /var/log/setup. Two arguments are provided:
# 1 -- the target prefix (normally /, but ${ROOTDIR} from the bootdisk)
# 2 -- the name of the root device.
( cd $ROOTDIR
if [ -x var/log/setup/$SCRIPT ]; then
COLOR=on ./var/log/setup/$SCRIPT $ROOTDIR $ROOTDEVICE
fi
)
done
fi
umount $ROOTDIR/dev
umount $ROOTDIR/proc
umount $ROOTDIR/sys
exit 0