tools-hardened/desktop Cleans up code of .sh files
This clean-up includes removing trailing white-spaces and ensuring function structure consistency.
This commit is contained in:
parent
8914b1f9c9
commit
6b03011ea2
4 changed files with 9 additions and 14 deletions
|
@ -54,7 +54,7 @@ setup_usergroups() {
|
||||||
|
|
||||||
setup_confs() {
|
setup_confs() {
|
||||||
local IMAGE="http://dev.gentoo.org/~blueness/lilblue/gentoo1600x1200.jpg"
|
local IMAGE="http://dev.gentoo.org/~blueness/lilblue/gentoo1600x1200.jpg"
|
||||||
|
|
||||||
sed -i 's/^\(DISPLAYMANAGER="\)xdm/\1slim/' "${ROOTFS}"/etc/conf.d/xdm
|
sed -i 's/^\(DISPLAYMANAGER="\)xdm/\1slim/' "${ROOTFS}"/etc/conf.d/xdm
|
||||||
sed -i 's/^\(login.*\)/# \1/' "${ROOTFS}"/etc/slim.conf
|
sed -i 's/^\(login.*\)/# \1/' "${ROOTFS}"/etc/slim.conf
|
||||||
sed -i '/# login_cmd.*Xsession/ a\login_cmd exec /bin/bash -login ~/.xinitrc' "${ROOTFS}"/etc/slim.conf
|
sed -i '/# login_cmd.*Xsession/ a\login_cmd exec /bin/bash -login ~/.xinitrc' "${ROOTFS}"/etc/slim.conf
|
||||||
|
|
|
@ -4,8 +4,7 @@ WORKING=$(pwd)
|
||||||
CHROOTS=${CHROOTS:-"${WORKING}"}
|
CHROOTS=${CHROOTS:-"${WORKING}"}
|
||||||
MYROOT=${MYROOT:-""}
|
MYROOT=${MYROOT:-""}
|
||||||
|
|
||||||
cleanup()
|
cleanup() {
|
||||||
{
|
|
||||||
cd ${WORKING}
|
cd ${WORKING}
|
||||||
rm -f ramdisk.iso
|
rm -f ramdisk.iso
|
||||||
rm -f tinhat.igz
|
rm -f tinhat.igz
|
||||||
|
@ -14,8 +13,7 @@ cleanup()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
mkinitramfs()
|
mkinitramfs() {
|
||||||
{
|
|
||||||
local BUSYBOX="http://dev.gentoo.org/~twitch153/tinhat/busybox"
|
local BUSYBOX="http://dev.gentoo.org/~twitch153/tinhat/busybox"
|
||||||
|
|
||||||
cd ${WORKING}
|
cd ${WORKING}
|
||||||
|
@ -27,7 +25,7 @@ mkinitramfs()
|
||||||
wget -O ${WORKING}/init/bin/busybox "${BUSYBOX}"
|
wget -O ${WORKING}/init/bin/busybox "${BUSYBOX}"
|
||||||
cp ../configs/init .
|
cp ../configs/init .
|
||||||
chmod 755 bin/busybox
|
chmod 755 bin/busybox
|
||||||
chmod 755 init
|
chmod 755 init
|
||||||
|
|
||||||
chroot . /bin/busybox --install -s
|
chroot . /bin/busybox --install -s
|
||||||
|
|
||||||
|
@ -38,8 +36,7 @@ mkinitramfs()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
mkiso()
|
mkiso() {
|
||||||
{
|
|
||||||
cd ${WORKING}
|
cd ${WORKING}
|
||||||
mkdir -p iso/boot/grub
|
mkdir -p iso/boot/grub
|
||||||
|
|
||||||
|
@ -57,8 +54,7 @@ mkiso()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
nameit()
|
nameit() {
|
||||||
{
|
|
||||||
DATE=$(date +%Y%m%d)
|
DATE=$(date +%Y%m%d)
|
||||||
NAME="${MYROOT}-${DATE}.iso"
|
NAME="${MYROOT}-${DATE}.iso"
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,7 @@ mount_dirs() {
|
||||||
mount --rbind /sys/ "${ROOTFS}"/sys/
|
mount --rbind /sys/ "${ROOTFS}"/sys/
|
||||||
}
|
}
|
||||||
|
|
||||||
populate_kernel_src()
|
populate_kernel_src() {
|
||||||
{
|
|
||||||
cp -f files/kernel-config "${KERNEL_SOURCE}"
|
cp -f files/kernel-config "${KERNEL_SOURCE}"
|
||||||
cp -Rf "${KERNEL_SOURCE}"/ "${ROOTFS}"/usr/src/
|
cp -Rf "${KERNEL_SOURCE}"/ "${ROOTFS}"/usr/src/
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,7 @@ setup_usergroups() {
|
||||||
|
|
||||||
setup_confs() {
|
setup_confs() {
|
||||||
local IMAGE="http://dev.gentoo.org/~blueness/lilblue/gentoo1600x1200.jpg"
|
local IMAGE="http://dev.gentoo.org/~blueness/lilblue/gentoo1600x1200.jpg"
|
||||||
|
|
||||||
sed -i 's/^\(DISPLAYMANAGER="\)xdm/\1slim/' "${ROOTFS}"/etc/conf.d/xdm
|
sed -i 's/^\(DISPLAYMANAGER="\)xdm/\1slim/' "${ROOTFS}"/etc/conf.d/xdm
|
||||||
sed -i 's/^\(login.*\)/# \1/' "${ROOTFS}"/etc/slim.conf
|
sed -i 's/^\(login.*\)/# \1/' "${ROOTFS}"/etc/slim.conf
|
||||||
sed -i '/# login_cmd.*Xsession/ a\login_cmd exec /bin/bash -login ~/.xinitrc' "${ROOTFS}"/etc/slim.conf
|
sed -i '/# login_cmd.*Xsession/ a\login_cmd exec /bin/bash -login ~/.xinitrc' "${ROOTFS}"/etc/slim.conf
|
||||||
|
@ -67,7 +67,7 @@ setup_confs() {
|
||||||
chroot "${ROOTFS}"/ locale-gen
|
chroot "${ROOTFS}"/ locale-gen
|
||||||
chroot "${ROOTFS}"/ eselect locale set en_US.utf8
|
chroot "${ROOTFS}"/ eselect locale set en_US.utf8
|
||||||
cp -a files/locale/02locale "${ROOTFS}"/etc/conf.d/
|
cp -a files/locale/02locale "${ROOTFS}"/etc/conf.d/
|
||||||
# In kernels 3.9 and above, we must disallow-other-stacks because of SO_REUSEPORT
|
# In kernels 3.9 and above, we must disallow-other-stacks because of SO_REUSEPORT
|
||||||
sed -i 's/^#\(disallow-other-stacks=\)no/\1yes/g' "${ROOTFS}"/etc/avahi/avahi-daemon.conf
|
sed -i 's/^#\(disallow-other-stacks=\)no/\1yes/g' "${ROOTFS}"/etc/avahi/avahi-daemon.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue