new lfs: lfs/baselayout-0.1
This commit is contained in:
180
lfs/baselayout-0.1.PKGBUILD
Normal file
180
lfs/baselayout-0.1.PKGBUILD
Normal file
@@ -0,0 +1,180 @@
|
||||
pkgname=baselayout
|
||||
pkgver=0.1
|
||||
pkgdesc="basic layout of filesystem"
|
||||
license=("GPL")
|
||||
sources=()
|
||||
urls=()
|
||||
sha512sums=()
|
||||
|
||||
src_install() {
|
||||
install -vd "${pkgdir}/etc"
|
||||
ln -sv ../proc/self/mounts "${pkgdir}"/etc/mtab
|
||||
cat > "${pkgdir}"/etc/hosts << EOF
|
||||
127.0.0.1 localhost
|
||||
::1 localhost
|
||||
EOF
|
||||
cat > "${pkgdir}"/etc/passwd << "EOF"
|
||||
root:x:0:0:root:/root:/bin/bash
|
||||
bin:x:1:1:bin:/dev/null:/usr/bin/false
|
||||
daemon:x:6:6:Daemon User:/dev/null:/usr/bin/false
|
||||
messagebus:x:18:18:D-Bus Message Daemon User:/run/dbus:/usr/bin/false
|
||||
systemd-journal-gateway:x:73:73:systemd Journal Gateway:/:/usr/bin/false
|
||||
systemd-journal-remote:x:74:74:systemd Journal Remote:/:/usr/bin/false
|
||||
systemd-journal-upload:x:75:75:systemd Journal Upload:/:/usr/bin/false
|
||||
systemd-network:x:76:76:systemd Network Management:/:/usr/bin/false
|
||||
systemd-resolve:x:77:77:systemd Resolver:/:/usr/bin/false
|
||||
systemd-timesync:x:78:78:systemd Time Synchronization:/:/usr/bin/false
|
||||
systemd-coredump:x:79:79:systemd Core Dumper:/:/usr/bin/false
|
||||
uuidd:x:80:80:UUID Generation Daemon User:/dev/null:/usr/bin/false
|
||||
systemd-oom:x:81:81:systemd Out Of Memory Daemon:/:/usr/bin/false
|
||||
nobody:x:65534:65534:Unprivileged User:/dev/null:/usr/bin/false
|
||||
leaf:x:101:101::/var/lib/leaf/home:/bin/bash
|
||||
EOF
|
||||
cat > "${pkgdir}"/etc/group << "EOF"
|
||||
root:x:0:
|
||||
bin:x:1:daemon
|
||||
sys:x:2:
|
||||
kmem:x:3:
|
||||
tape:x:4:
|
||||
tty:x:5:
|
||||
daemon:x:6:
|
||||
floppy:x:7:
|
||||
disk:x:8:
|
||||
lp:x:9:
|
||||
dialout:x:10:
|
||||
audio:x:11:
|
||||
video:x:12:
|
||||
utmp:x:13:
|
||||
cdrom:x:15:
|
||||
adm:x:16:
|
||||
messagebus:x:18:
|
||||
systemd-journal:x:23:
|
||||
input:x:24:
|
||||
mail:x:34:
|
||||
kvm:x:61:
|
||||
systemd-journal-gateway:x:73:
|
||||
systemd-journal-remote:x:74:
|
||||
systemd-journal-upload:x:75:
|
||||
systemd-network:x:76:
|
||||
systemd-resolve:x:77:
|
||||
systemd-timesync:x:78:
|
||||
systemd-coredump:x:79:
|
||||
uuidd:x:80:
|
||||
systemd-oom:x:81:
|
||||
wheel:x:97:
|
||||
users:x:999:
|
||||
nogroup:x:65534:
|
||||
leaf:x:101:
|
||||
EOF
|
||||
install -vdm700 "${pkgdir}"/var/lib/leaf/home
|
||||
chown -R 101:101 "${pkgdir}"/var/lib/leaf/home
|
||||
|
||||
install -vdm755 "${pkgdir}"/var/log
|
||||
touch "${pkgdir}"/var/log/{btmp,lastlog,faillog,wtmp}
|
||||
chgrp -v 13 "${pkgdir}"/var/log/lastlog
|
||||
chmod -v 664 "${pkgdir}"/var/log/lastlog
|
||||
chmod -v 600 "${pkgdir}"/var/log/btmp
|
||||
|
||||
cat > "${pkgdir}"/etc/inputrc << "EOF"
|
||||
# Begin /etc/inputrc
|
||||
# Modified by Chris Lynn <roryo@roryo.dynup.net>
|
||||
|
||||
# Allow the command prompt to wrap to the next line
|
||||
set horizontal-scroll-mode Off
|
||||
|
||||
# Enable 8-bit input
|
||||
set meta-flag On
|
||||
set input-meta On
|
||||
|
||||
# Turns off 8th bit stripping
|
||||
set convert-meta Off
|
||||
|
||||
# Keep the 8th bit for display
|
||||
set output-meta On
|
||||
|
||||
# none, visible or audible
|
||||
set bell-style none
|
||||
|
||||
# All of the following map the escape sequence of the value
|
||||
# contained in the 1st argument to the readline specific functions
|
||||
"\eOd": backward-word
|
||||
"\eOc": forward-word
|
||||
|
||||
# for linux console
|
||||
"\e[1~": beginning-of-line
|
||||
"\e[4~": end-of-line
|
||||
"\e[5~": beginning-of-history
|
||||
"\e[6~": end-of-history
|
||||
"\e[3~": delete-char
|
||||
"\e[2~": quoted-insert
|
||||
|
||||
# for xterm
|
||||
"\eOH": beginning-of-line
|
||||
"\eOF": end-of-line
|
||||
|
||||
# for Konsole
|
||||
"\e[H": beginning-of-line
|
||||
"\e[F": end-of-line
|
||||
|
||||
# End /etc/inputrc
|
||||
EOF
|
||||
|
||||
echo 12.4-systemd > "${pkgdir}"/etc/lfs-release
|
||||
cat > "${pkgdir}"/etc/lsb-release << "EOF"
|
||||
DISTRIB_ID="Linux From Scratch"
|
||||
DISTRIB_RELEASE="12.4-systemd"
|
||||
DISTRIB_CODENAME="Manifold"
|
||||
DISTRIB_DESCRIPTION="Linux From Scratch"
|
||||
EOF
|
||||
cat > "${pkgdir}"/etc/os-release << "EOF"
|
||||
NAME="Linux From Scratch"
|
||||
VERSION="12.4-systemd"
|
||||
ID=lfs
|
||||
PRETTY_NAME="Linux From Scratch 12.4-systemd"
|
||||
VERSION_CODENAME="Manifold"
|
||||
HOME_URL="https://www.linuxfromscratch.org/lfs/"
|
||||
RELEASE_TYPE="stable"
|
||||
EOF
|
||||
|
||||
cat > "${pkgdir}"/etc/profile << "EOF"
|
||||
# Begin /etc/profile
|
||||
|
||||
if [[ "$TERM" = linux ]]; then
|
||||
export LANG=C.UTF-8
|
||||
else
|
||||
[ -f "/etc/locale.conf" ] && source /etc/locale.conf
|
||||
|
||||
for i in $(locale); do
|
||||
key=${i%=*}
|
||||
if [[ -v $key ]]; then
|
||||
export $key
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -e /etc/profile.env ] ; then
|
||||
. /etc/profile.env
|
||||
fi
|
||||
# You should override these in your ~/.bashrc (or equivalent) for per-user
|
||||
# settings. For system defaults, you can add a new file in /etc/profile.d/.
|
||||
export EDITOR=${EDITOR:-/bin/vim}
|
||||
export PAGER=${PAGER:-/usr/bin/less}
|
||||
|
||||
# End /etc/profile
|
||||
EOF
|
||||
install -vdm755 "${pkgdir}"/etc/profiles.d
|
||||
|
||||
install -vdm755 "${pkgdir}"/etc/env.d
|
||||
cat > "${pkgdir}"/etc/env.d/50baselayout << "EOF"
|
||||
# /etc/env.d/50baselayout
|
||||
# Do not edit this file
|
||||
|
||||
PATH="/usr/local/sbin:/usr/local/bin:/usr/bin:/opt/bin"
|
||||
ROOTPATH="/usr/local/sbin:/usr/local/bin:/usr/bin:/opt/bin"
|
||||
MANPATH="/usr/local/share/man:/usr/share/man"
|
||||
INFOPATH="/usr/share/info"
|
||||
LDPATH='/usr/lib64:/usr/local/lib64:/usr/lib:/usr/local/lib'
|
||||
EOF
|
||||
}
|
||||
|
||||
# vim:ft=sh syn=sh et sw=2:
|
||||
Reference in New Issue
Block a user