Initial commit
This commit is contained in:
commit
295a111cec
89 changed files with 2897 additions and 0 deletions
38
config/scripts/FAIBASE/10-misc
Executable file
38
config/scripts/FAIBASE/10-misc
Executable file
|
|
@ -0,0 +1,38 @@
|
|||
#! /bin/bash
|
||||
|
||||
# (c) Thomas Lange, 2001-2012, lange@debian.org
|
||||
|
||||
error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
|
||||
|
||||
echo $TIMEZONE > $target/etc/timezone
|
||||
if [ -L $target/etc/localtime ]; then
|
||||
ln -sf /usr/share/zoneinfo/${TIMEZONE} $target/etc/localtime
|
||||
else
|
||||
cp -f /usr/share/zoneinfo/${TIMEZONE} $target/etc/localtime
|
||||
fi
|
||||
|
||||
if [ -f $target/etc/hosts.orig ]; then
|
||||
mv $target/etc/hosts.orig $target/etc/hosts
|
||||
fi
|
||||
if [ -n "$IPADDR" ]; then
|
||||
# ifclass DHCPC ||
|
||||
ainsl -s /etc/hosts "$IPADDR $HOSTNAME.$DOMAIN $HOSTNAME"
|
||||
else
|
||||
ifclass DHCPC && ainsl -s /etc/hosts "127.0.0.1 $HOSTNAME"
|
||||
fi
|
||||
fcopy -iM /etc/hosts /etc/motd
|
||||
|
||||
# make /root accessible only by root
|
||||
chmod -c 0700 $target/root
|
||||
chown -c root:root $target/root
|
||||
# copy default dotfiles for root account
|
||||
fcopy -ir /root
|
||||
|
||||
# use tmpfs for /tmp if not defined in disk_config
|
||||
if ! grep -Pq '\s/tmp\s' $target/etc/fstab; then
|
||||
ainsl /etc/fstab "tmpfs /tmp tmpfs nodev,nosuid,size=50%,mode=1777 0 0"
|
||||
fi
|
||||
chmod -c 1777 ${target}/tmp
|
||||
chown -c 0:0 ${target}/tmp
|
||||
|
||||
exit $error
|
||||
25
config/scripts/FAIBASE/20-removable_media
Executable file
25
config/scripts/FAIBASE/20-removable_media
Executable file
|
|
@ -0,0 +1,25 @@
|
|||
#! /bin/bash
|
||||
|
||||
# (c) Thomas Lange, 2006,2009, lange@debian.org
|
||||
# create entries for removable media in fstab and directories in /media
|
||||
|
||||
cdromlist() {
|
||||
[ -f /proc/sys/dev/cdrom/info ] || return
|
||||
devs=$(grep 'drive name:' /proc/sys/dev/cdrom/info | cut -d ":" -f 2)
|
||||
for d in $devs; do
|
||||
echo $d
|
||||
done
|
||||
}
|
||||
|
||||
fstabline () {
|
||||
line=$(printf "%-15s %-15s %-7s %-15s %-7s %s\n" "$1" "$2" "$3" "$4" "$5" "$6")
|
||||
ainsl /etc/fstab "$line"
|
||||
}
|
||||
|
||||
i=0
|
||||
for cdrom in $(cdromlist | tac); do
|
||||
[ $i -eq 0 ] && ln -sfn cdrom0 $target/media/cdrom
|
||||
mkdir -p $target/media/cdrom$i
|
||||
fstabline /dev/$cdrom /media/cdrom$i udf,iso9660 ro,user,noauto 0 0
|
||||
i=$((i + 1))
|
||||
done
|
||||
Reference in a new issue