From 53348f641a11adf645093c0f3f999d871601e994 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Fri, 15 Oct 2021 22:56:18 +0100 Subject: sys-apps/baselayout : revision bump --- sys-apps/baselayout/baselayout-2.7-r10.ebuild | 318 ----------------------- sys-apps/baselayout/baselayout-2.7-r11.ebuild | 358 ++++++++++++++++++++++++++ sys-apps/baselayout/files/dmcryptcfg | 111 ++++++++ sys-apps/baselayout/files/dracutcfg | 14 + sys-apps/baselayout/files/grubcfg | 63 +++++ sys-apps/baselayout/files/nmcfg | 3 + sys-apps/baselayout/files/smbcfg | 20 ++ 7 files changed, 569 insertions(+), 318 deletions(-) delete mode 100644 sys-apps/baselayout/baselayout-2.7-r10.ebuild create mode 100644 sys-apps/baselayout/baselayout-2.7-r11.ebuild create mode 100644 sys-apps/baselayout/files/dmcryptcfg create mode 100644 sys-apps/baselayout/files/dracutcfg create mode 100644 sys-apps/baselayout/files/grubcfg create mode 100644 sys-apps/baselayout/files/nmcfg create mode 100644 sys-apps/baselayout/files/smbcfg (limited to 'sys-apps/baselayout') diff --git a/sys-apps/baselayout/baselayout-2.7-r10.ebuild b/sys-apps/baselayout/baselayout-2.7-r10.ebuild deleted file mode 100644 index 16850ca1..00000000 --- a/sys-apps/baselayout/baselayout-2.7-r10.ebuild +++ /dev/null @@ -1,318 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -inherit multilib versionator prefix - -DESCRIPTION="Filesystem baselayout and init scripts" -HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage" -if [[ ${PV} = 9999 ]]; then - EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/${PN}.git" - inherit git-r3 -else - SRC_URI="https://gitweb.gentoo.org/proj/${PN}.git/snapshot/${P}.tar.bz2" - KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" -fi - -LICENSE="GPL-2" -SLOT="0" -IUSE="build kernel_FreeBSD kernel_linux +split-usr" - -pkg_setup() { - multilib_layout -} - -# Create our multilib dirs - the Makefile has no knowledge of this -multilib_layout() { - local dir def_libdir libdir libdirs - local prefix prefix_lst - def_libdir=$(get_abi_LIBDIR $DEFAULT_ABI) - libdirs=$(get_all_libdirs) - : ${libdirs:=lib} # it isn't that we don't trust multilib.eclass... - - if [[ -z "${SYMLINK_LIB}" || ${SYMLINK_LIB} = no ]] ; then - prefix_lst=( "${EROOT}"{,usr/,usr/local/} ) - for prefix in "${prefix_lst[@]}"; do - for libdir in ${libdirs}; do - dir="${prefix}${libdir}" - if [[ -e "${dir}" ]]; then - [[ ! -d "${dir}" ]] && - die "${dir} exists but is not a directory" - continue - fi - if ! use split-usr && [[ ${prefix} = ${EROOT} ]]; then - einfo "symlinking ${dir} to usr/${libdir}" - ln -s usr/${libdir} ${dir} || - die " Unable to make ${dir} symlink" - else - einfo "creating directory ${dir}" - mkdir -p "${dir}" || - die "Unable to create ${dir} directory" - fi - done - done - return 0 - fi - - [ -z "${def_libdir}" ] && - die "your DEFAULT_ABI=$DEFAULT_ABI appears to be invalid" - - # figure out which paths should be symlinks and which should be directories - local dirs syms exp d - for libdir in ${libdirs} ; do - if use split-usr ; then - exp=( {,usr/,usr/local/}${libdir} ) - else - exp=( {usr/,usr/local/}${libdir} ) - fi - for d in "${exp[@]}" ; do - # most things should be dirs - if [ "${SYMLINK_LIB}" = "yes" ] && [ "${libdir}" = "lib" ] ; then - [ ! -h "${d}" ] && [ -e "${d}" ] && dirs+=" ${d}" - else - [ -h "${d}" ] && syms+=" ${d}" - fi - done - done - if [ -n "${syms}${dirs}" ] ; then - ewarn "Your system profile has SYMLINK_LIB=${SYMLINK_LIB:-no}, so that means you need to" - ewarn "have these paths configured as follows:" - [ -n "${dirs}" ] && ewarn "symlinks to '${def_libdir}':${dirs}" - [ -n "${syms}" ] && ewarn "directories:${syms}" - ewarn "The ebuild will attempt to fix these, but only for trivial conversions." - ewarn "If things fail, you will need to manually create/move the directories." - echo - fi - - # setup symlinks and dirs where we expect them to be; do not migrate - # data ... just fall over in that case. - if use split-usr ; then - prefix_lst=( "${EROOT}"{,usr/,usr/local/} ) - else - prefix_lst=( "${EROOT}"{usr/,usr/local/} ) - fi - for prefix in "${prefix_lst[@]}"; do - if [ "${SYMLINK_LIB}" = yes ] ; then - # we need to make sure "lib" points to the native libdir - if [ -h "${prefix}lib" ] ; then - # it's already a symlink! assume it's pointing to right place ... - continue - elif [ -d "${prefix}lib" ] ; then - # "lib" is a dir, so need to convert to a symlink - ewarn "Converting ${prefix}lib from a dir to a symlink" - rm -f "${prefix}lib"/.keep || die - if rmdir "${prefix}lib" 2>/dev/null ; then - ln -s ${def_libdir} "${prefix}lib" || die - else - die "non-empty dir found where we needed a symlink: ${prefix}lib" - fi - else - # nothing exists, so just set it up sanely - ewarn "Initializing ${prefix}lib as a symlink" - mkdir -p "${prefix}" || die - rm -f "${prefix}lib" || die - ln -s ${def_libdir} "${prefix}lib" || die - mkdir -p "${prefix}${def_libdir}" || die #423571 - fi - else - # we need to make sure "lib" is a dir - if [ -h "${prefix}lib" ] ; then - # "lib" is a symlink, so need to convert to a dir - ewarn "Converting ${prefix}lib from a symlink to a dir" - rm -f "${prefix}lib" || die - if [ -d "${prefix}lib32" ] ; then - ewarn "Migrating ${prefix}lib32 to ${prefix}lib" - mv "${prefix}lib32" "${prefix}lib" || die - else - mkdir -p "${prefix}lib" || die - fi - elif [ -d "${prefix}lib" ] && ! has lib32 ${libdirs} ; then - # make sure the old "lib" ABI location does not exist; we - # only symlinked the lib dir on systems where we moved it - # to "lib32" ... - case ${CHOST} in - *-gentoo-freebsd*) ;; # We want it the other way on fbsd. - i?86*|x86_64*|powerpc*|sparc*|s390*) - if [[ -d ${prefix}lib32 && ! -h ${prefix}lib32 ]] ; then - rm -f "${prefix}lib32"/.keep || die - if ! rmdir "${prefix}lib32" 2>/dev/null ; then - ewarn "You need to merge ${prefix}lib32 into ${prefix}lib" - die "non-empty dir found where there should be none: ${prefix}lib32" - fi - fi - ;; - esac - else - # nothing exists, so just set it up sanely - ewarn "Initializing ${prefix}lib as a dir" - mkdir -p "${prefix}lib" || die - fi - fi - done - if ! use split-usr ; then - for libdir in ${libdirs}; do - if [[ ! -e "${EROOT}${libdir}" ]]; then - ln -s usr/"${libdir}" "${EROOT}${libdir}" || - die " Unable to make ${EROOT}${libdir} symlink" - fi - done - fi -} - -pkg_preinst() { - # This is written in src_install (so it's in CONTENTS), but punt all - # pending updates to avoid user having to do etc-update (and make the - # pkg_postinst logic simpler). - rm -f "${EROOT}"/etc/._cfg????_gentoo-release || die - - # We need to install directories and maybe some dev nodes when building - # stages, but they cannot be in CONTENTS. - # Also, we cannot reference $S as binpkg will break so we do this. - multilib_layout - if use build ; then - if use split-usr ; then - emake -C "${ED}/usr/share/${PN}" DESTDIR="${EROOT}" layout - else - emake -C "${ED}/usr/share/${PN}" DESTDIR="${EROOT}" layout-usrmerge - fi - fi - rm -f "${ED}"/usr/share/${PN}/Makefile || die -} - -src_prepare() { - default - eapply "${FILESDIR}/${PN}-redcore.patch" - if use prefix; then - hprefixify -e "/EUID/s,0,${EUID}," -q '"' etc/profile - hprefixify etc/{env.d/50baselayout,shells} share.Linux/passwd - echo PATH=/usr/bin:/bin >> etc/env.d/99host - echo ROOTPATH=/usr/sbin:/sbin:/usr/bin:/bin >> etc/env.d/99host - fi - - # don't want symlinked directories in PATH on systems with usr-merge - if ! use split-usr; then - sed \ - -e 's|/usr/local/sbin:||g' \ - -e 's|:/usr/sbin:|:|g' \ - -e 's|:/sbin:|:|g' \ - -e 's|:/bin:|:|g' \ - -i etc/env.d/50baselayout || die - fi - - # handle multilib paths. do it here because we want this behavior - # regardless of the C library that you're using. we do explicitly - # list paths which the native ldconfig searches, but this isn't - # problematic as it doesn't change the resulting ld.so.cache or - # take longer to generate. similarly, listing both the native - # path and the symlinked path doesn't change the resulting cache. - local libdir ldpaths - for libdir in $(get_all_libdirs) ; do - use split-usr && ldpaths+=":${EPREFIX}/${libdir}" - ldpaths+=":${EPREFIX}/usr/${libdir}" - ldpaths+=":${EPREFIX}/usr/local/${libdir}" - done - echo "LDPATH='${ldpaths#:}'" >> etc/env.d/50baselayout - - # rc-scripts version for testing of features that *should* be present - echo "Redcore Linux Hardened - rolling" > etc/redcore-release -} - -src_install() { - emake \ - OS=$(usex kernel_FreeBSD BSD Linux) \ - DESTDIR="${ED}" \ - install - dodoc ChangeLog - rm "${ED}"/etc/sysctl.d/README || die - - # need the makefile in pkg_preinst - insinto /usr/share/${PN} - doins Makefile - - # This is needed for https://bugs.gentoo.org/732142 - dodir /usr/lib - mv "${ED}"/etc/os-release "${ED}"/usr/lib || die - dosym ../usr/lib/os-release /etc/os-release -} - -pkg_postinst() { - local x - - # We installed some files to /usr/share/baselayout instead of /etc to stop - # (1) overwriting the user's settings - # (2) screwing things up when attempting to merge files - # (3) accidentally packaging up personal files with quickpkg - # If they don't exist then we install them - for x in master.passwd passwd shadow group fstab ; do - [ -e "${EROOT}etc/${x}" ] && continue - [ -e "${EROOT}usr/share/baselayout/${x}" ] || continue - cp -p "${EROOT}usr/share/baselayout/${x}" "${EROOT}"etc || die - done - - # Force shadow permissions to not be world-readable #260993 - for x in shadow ; do - if [ -e "${EROOT}etc/${x}" ] ; then - chmod o-rwx "${EROOT}etc/${x}" || die - fi - done - - # Take care of the etc-update for the user - if [ -e "${EROOT}"etc/._cfg0000_redcore-release ] ; then - mv "${EROOT}"etc/._cfg0000_redcore-release "${EROOT}"etc/redcore-release || die - fi - - # whine about users that lack passwords #193541 - if [[ -e "${EROOT}"etc/shadow ]] ; then - local bad_users=$(sed -n '/^[^:]*::/s|^\([^:]*\)::.*|\1|p' "${EROOT}"/etc/shadow) - if [[ -n ${bad_users} ]] ; then - echo - ewarn "The following users lack passwords!" - ewarn ${bad_users} - fi - fi - - # whine about users with invalid shells #215698 - if [[ -e "${EROOT}"etc/passwd ]] ; then - local bad_shells=$(awk -F: 'system("test -e " $7) { print $1 " - " $7}' "${EROOT}"etc/passwd | sort) - if [[ -n ${bad_shells} ]] ; then - echo - ewarn "The following users have non-existent shells!" - ewarn "${bad_shells}" - fi - fi - - # https://bugs.gentoo.org/361349 - if use kernel_linux; then - mkdir -p "${EROOT}"run || die - - local found fstype mountpoint - while read -r _ mountpoint fstype _; do - [[ ${mountpoint} = /run ]] && [[ ${fstype} = tmpfs ]] && found=1 - done < "${ROOT}"proc/mounts - [[ -z ${found} ]] && - ewarn "You should reboot now to get /run mounted with tmpfs!" - fi - - for x in ${REPLACING_VERSIONS}; do - if ! version_is_at_least 2.4 ${x}; then - ewarn "After updating ${EROOT}etc/profile, please run" - ewarn "env-update && . /etc/profile" - fi - - if ! version_is_at_least 2.6 ${x}; then - ewarn "Please run env-update then log out and back in to" - ewarn "update your path." - fi - # clean up after 2.5 typos - # https://bugs.gentoo.org/show_bug.cgi?id=656380 - if [[ ${x} == 2.5 ]]; then - rm -fr "${EROOT}{,usr" || die - fi - done - - if [[ -e "${EROOT}"etc/env.d/00basic ]]; then - ewarn "${EROOT}etc/env.d/00basic is now ${EROOT}etc/env.d/50baselayout" - ewarn "Please migrate your changes." - fi -} diff --git a/sys-apps/baselayout/baselayout-2.7-r11.ebuild b/sys-apps/baselayout/baselayout-2.7-r11.ebuild new file mode 100644 index 00000000..1f771647 --- /dev/null +++ b/sys-apps/baselayout/baselayout-2.7-r11.ebuild @@ -0,0 +1,358 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit multilib versionator prefix + +DESCRIPTION="Filesystem baselayout and init scripts" +HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage" +if [[ ${PV} = 9999 ]]; then + EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/${PN}.git" + inherit git-r3 +else + SRC_URI="https://gitweb.gentoo.org/proj/${PN}.git/snapshot/${P}.tar.bz2" + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" +fi + +LICENSE="GPL-2" +SLOT="0" +IUSE="build kernel_FreeBSD kernel_linux +split-usr" + +DEPEND="acct-group/smbshare" +RDEPEND="${DEPEND}" + +pkg_setup() { + multilib_layout +} + +# Create our multilib dirs - the Makefile has no knowledge of this +multilib_layout() { + local dir def_libdir libdir libdirs + local prefix prefix_lst + def_libdir=$(get_abi_LIBDIR $DEFAULT_ABI) + libdirs=$(get_all_libdirs) + : ${libdirs:=lib} # it isn't that we don't trust multilib.eclass... + + if [[ -z "${SYMLINK_LIB}" || ${SYMLINK_LIB} = no ]] ; then + prefix_lst=( "${EROOT}"{,usr/,usr/local/} ) + for prefix in "${prefix_lst[@]}"; do + for libdir in ${libdirs}; do + dir="${prefix}${libdir}" + if [[ -e "${dir}" ]]; then + [[ ! -d "${dir}" ]] && + die "${dir} exists but is not a directory" + continue + fi + if ! use split-usr && [[ ${prefix} = ${EROOT} ]]; then + einfo "symlinking ${dir} to usr/${libdir}" + ln -s usr/${libdir} ${dir} || + die " Unable to make ${dir} symlink" + else + einfo "creating directory ${dir}" + mkdir -p "${dir}" || + die "Unable to create ${dir} directory" + fi + done + done + return 0 + fi + + [ -z "${def_libdir}" ] && + die "your DEFAULT_ABI=$DEFAULT_ABI appears to be invalid" + + # figure out which paths should be symlinks and which should be directories + local dirs syms exp d + for libdir in ${libdirs} ; do + if use split-usr ; then + exp=( {,usr/,usr/local/}${libdir} ) + else + exp=( {usr/,usr/local/}${libdir} ) + fi + for d in "${exp[@]}" ; do + # most things should be dirs + if [ "${SYMLINK_LIB}" = "yes" ] && [ "${libdir}" = "lib" ] ; then + [ ! -h "${d}" ] && [ -e "${d}" ] && dirs+=" ${d}" + else + [ -h "${d}" ] && syms+=" ${d}" + fi + done + done + if [ -n "${syms}${dirs}" ] ; then + ewarn "Your system profile has SYMLINK_LIB=${SYMLINK_LIB:-no}, so that means you need to" + ewarn "have these paths configured as follows:" + [ -n "${dirs}" ] && ewarn "symlinks to '${def_libdir}':${dirs}" + [ -n "${syms}" ] && ewarn "directories:${syms}" + ewarn "The ebuild will attempt to fix these, but only for trivial conversions." + ewarn "If things fail, you will need to manually create/move the directories." + echo + fi + + # setup symlinks and dirs where we expect them to be; do not migrate + # data ... just fall over in that case. + if use split-usr ; then + prefix_lst=( "${EROOT}"{,usr/,usr/local/} ) + else + prefix_lst=( "${EROOT}"{usr/,usr/local/} ) + fi + for prefix in "${prefix_lst[@]}"; do + if [ "${SYMLINK_LIB}" = yes ] ; then + # we need to make sure "lib" points to the native libdir + if [ -h "${prefix}lib" ] ; then + # it's already a symlink! assume it's pointing to right place ... + continue + elif [ -d "${prefix}lib" ] ; then + # "lib" is a dir, so need to convert to a symlink + ewarn "Converting ${prefix}lib from a dir to a symlink" + rm -f "${prefix}lib"/.keep || die + if rmdir "${prefix}lib" 2>/dev/null ; then + ln -s ${def_libdir} "${prefix}lib" || die + else + die "non-empty dir found where we needed a symlink: ${prefix}lib" + fi + else + # nothing exists, so just set it up sanely + ewarn "Initializing ${prefix}lib as a symlink" + mkdir -p "${prefix}" || die + rm -f "${prefix}lib" || die + ln -s ${def_libdir} "${prefix}lib" || die + mkdir -p "${prefix}${def_libdir}" || die #423571 + fi + else + # we need to make sure "lib" is a dir + if [ -h "${prefix}lib" ] ; then + # "lib" is a symlink, so need to convert to a dir + ewarn "Converting ${prefix}lib from a symlink to a dir" + rm -f "${prefix}lib" || die + if [ -d "${prefix}lib32" ] ; then + ewarn "Migrating ${prefix}lib32 to ${prefix}lib" + mv "${prefix}lib32" "${prefix}lib" || die + else + mkdir -p "${prefix}lib" || die + fi + elif [ -d "${prefix}lib" ] && ! has lib32 ${libdirs} ; then + # make sure the old "lib" ABI location does not exist; we + # only symlinked the lib dir on systems where we moved it + # to "lib32" ... + case ${CHOST} in + *-gentoo-freebsd*) ;; # We want it the other way on fbsd. + i?86*|x86_64*|powerpc*|sparc*|s390*) + if [[ -d ${prefix}lib32 && ! -h ${prefix}lib32 ]] ; then + rm -f "${prefix}lib32"/.keep || die + if ! rmdir "${prefix}lib32" 2>/dev/null ; then + ewarn "You need to merge ${prefix}lib32 into ${prefix}lib" + die "non-empty dir found where there should be none: ${prefix}lib32" + fi + fi + ;; + esac + else + # nothing exists, so just set it up sanely + ewarn "Initializing ${prefix}lib as a dir" + mkdir -p "${prefix}lib" || die + fi + fi + done + if ! use split-usr ; then + for libdir in ${libdirs}; do + if [[ ! -e "${EROOT}${libdir}" ]]; then + ln -s usr/"${libdir}" "${EROOT}${libdir}" || + die " Unable to make ${EROOT}${libdir} symlink" + fi + done + fi +} + +pkg_preinst() { + # This is written in src_install (so it's in CONTENTS), but punt all + # pending updates to avoid user having to do etc-update (and make the + # pkg_postinst logic simpler). + rm -f "${EROOT}"/etc/._cfg????_gentoo-release || die + + # We need to install directories and maybe some dev nodes when building + # stages, but they cannot be in CONTENTS. + # Also, we cannot reference $S as binpkg will break so we do this. + multilib_layout + if use build ; then + if use split-usr ; then + emake -C "${ED}/usr/share/${PN}" DESTDIR="${EROOT}" layout + else + emake -C "${ED}/usr/share/${PN}" DESTDIR="${EROOT}" layout-usrmerge + fi + fi + rm -f "${ED}"/usr/share/${PN}/Makefile || die +} + +src_prepare() { + default + eapply "${FILESDIR}/${PN}-redcore.patch" + if use prefix; then + hprefixify -e "/EUID/s,0,${EUID}," -q '"' etc/profile + hprefixify etc/{env.d/50baselayout,shells} share.Linux/passwd + echo PATH=/usr/bin:/bin >> etc/env.d/99host + echo ROOTPATH=/usr/sbin:/sbin:/usr/bin:/bin >> etc/env.d/99host + fi + + # don't want symlinked directories in PATH on systems with usr-merge + if ! use split-usr; then + sed \ + -e 's|/usr/local/sbin:||g' \ + -e 's|:/usr/sbin:|:|g' \ + -e 's|:/sbin:|:|g' \ + -e 's|:/bin:|:|g' \ + -i etc/env.d/50baselayout || die + fi + + # handle multilib paths. do it here because we want this behavior + # regardless of the C library that you're using. we do explicitly + # list paths which the native ldconfig searches, but this isn't + # problematic as it doesn't change the resulting ld.so.cache or + # take longer to generate. similarly, listing both the native + # path and the symlinked path doesn't change the resulting cache. + local libdir ldpaths + for libdir in $(get_all_libdirs) ; do + use split-usr && ldpaths+=":${EPREFIX}/${libdir}" + ldpaths+=":${EPREFIX}/usr/${libdir}" + ldpaths+=":${EPREFIX}/usr/local/${libdir}" + done + echo "LDPATH='${ldpaths#:}'" >> etc/env.d/50baselayout + + # rc-scripts version for testing of features that *should* be present + echo "Redcore Linux Hardened - rolling" > etc/redcore-release +} + +src_install() { + emake \ + OS=$(usex kernel_FreeBSD BSD Linux) \ + DESTDIR="${ED}" \ + install + dodoc ChangeLog + rm "${ED}"/etc/sysctl.d/README || die + + # need the makefile in pkg_preinst + insinto /usr/share/${PN} + doins Makefile + + # This is needed for https://bugs.gentoo.org/732142 + dodir /usr/lib + mv "${ED}"/etc/os-release "${ED}"/usr/lib || die + dosym ../usr/lib/os-release /etc/os-release + + ############### Redcore Linux ############### + # + # issue.logo + rm "${ED}"/etc/issue.logo + # + # NetworkManager + dodir /etc/NetworkManager + insinto /etc/NetworkManager + newins "${FILESDIR}"/nmcfg NetworkManager.conf + # + # dracut + dodir /etc/dracut.conf.d + insinto /etc/dracut.conf.d + newins "${FILESDIR}"/dracutcfg dracut-redcore.conf + # + # grub + dodir /etc/default + insinto /etc/default + newins "${FILESDIR}"/grubcfg grub + # + # samba + dodir /etc/samba + insinto /etc/samba + newins "${FILESDIR}"/smbcfg smb.conf + keepdir var/lib/samba/usershare + # cryptsetup + dodir /etc/conf.d + insinto /etc/conf.d + newins ${FILESDIR}/dmcryptcfg dmcrypt + # + ############################################## +} + +pkg_postinst() { + local x + + # We installed some files to /usr/share/baselayout instead of /etc to stop + # (1) overwriting the user's settings + # (2) screwing things up when attempting to merge files + # (3) accidentally packaging up personal files with quickpkg + # If they don't exist then we install them + for x in master.passwd passwd shadow group fstab ; do + [ -e "${EROOT}etc/${x}" ] && continue + [ -e "${EROOT}usr/share/baselayout/${x}" ] || continue + cp -p "${EROOT}usr/share/baselayout/${x}" "${EROOT}"etc || die + done + + # Force shadow permissions to not be world-readable #260993 + for x in shadow ; do + if [ -e "${EROOT}etc/${x}" ] ; then + chmod o-rwx "${EROOT}etc/${x}" || die + fi + done + + # whine about users that lack passwords #193541 + if [[ -e "${EROOT}"etc/shadow ]] ; then + local bad_users=$(sed -n '/^[^:]*::/s|^\([^:]*\)::.*|\1|p' "${EROOT}"/etc/shadow) + if [[ -n ${bad_users} ]] ; then + echo + ewarn "The following users lack passwords!" + ewarn ${bad_users} + fi + fi + + # whine about users with invalid shells #215698 + if [[ -e "${EROOT}"etc/passwd ]] ; then + local bad_shells=$(awk -F: 'system("test -e " $7) { print $1 " - " $7}' "${EROOT}"etc/passwd | sort) + if [[ -n ${bad_shells} ]] ; then + echo + ewarn "The following users have non-existent shells!" + ewarn "${bad_shells}" + fi + fi + + # https://bugs.gentoo.org/361349 + if use kernel_linux; then + mkdir -p "${EROOT}"run || die + + local found fstype mountpoint + while read -r _ mountpoint fstype _; do + [[ ${mountpoint} = /run ]] && [[ ${fstype} = tmpfs ]] && found=1 + done < "${ROOT}"proc/mounts + [[ -z ${found} ]] && + ewarn "You should reboot now to get /run mounted with tmpfs!" + fi + + for x in ${REPLACING_VERSIONS}; do + if ! version_is_at_least 2.4 ${x}; then + ewarn "After updating ${EROOT}etc/profile, please run" + ewarn "env-update && . /etc/profile" + fi + + if ! version_is_at_least 2.6 ${x}; then + ewarn "Please run env-update then log out and back in to" + ewarn "update your path." + fi + # clean up after 2.5 typos + # https://bugs.gentoo.org/show_bug.cgi?id=656380 + if [[ ${x} == 2.5 ]]; then + rm -fr "${EROOT}{,usr" || die + fi + done + + if [[ -e "${EROOT}"etc/env.d/00basic ]]; then + ewarn "${EROOT}etc/env.d/00basic is now ${EROOT}etc/env.d/50baselayout" + ewarn "Please migrate your changes." + fi + + ############### Redcore Linux ############### + mv "${EROOT}"etc/._cfg????_redcore-release "${EROOT}"etc/redcore-release || die + rm -rf "${EROOT}"etc/dracut.conf.d/._cfg????_dracut-redcore.conf + rm -rf "${EROOT}"etc/default/._cfg????_grub + rm -rf "${EROOT}"etc/samba/._cfg????_smb.conf + rm -rf "${EROOT}"etc/conf.d/._cfg???_dmcrypt + chown root:smbshare /var/lib/samba/usershare + chmod 1770 /var/lib/samba/usershare + ############################################ +} diff --git a/sys-apps/baselayout/files/dmcryptcfg b/sys-apps/baselayout/files/dmcryptcfg new file mode 100644 index 00000000..642ff087 --- /dev/null +++ b/sys-apps/baselayout/files/dmcryptcfg @@ -0,0 +1,111 @@ +# /etc/conf.d/dmcrypt + +# For people who run dmcrypt on top of some other layer (like raid), +# use rc_need to specify that requirement. See the runscript(8) man +# page for more information. + +#-------------------- +# Instructions +#-------------------- + +# Note regarding the syntax of this file. This file is *almost* bash, +# but each line is evaluated separately. Separate swaps/targets can be +# specified. The init-script which reads this file assumes that a +# swap= or target= line starts a new section, similar to lilo or grub +# configuration. + +# Note when using gpg keys and /usr on a separate partition, you will +# have to copy /usr/bin/gpg to /bin/gpg so that it will work properly +# and ensure that gpg has been compiled statically. +# See http://bugs.gentoo.org/90482 for more information. + +# Note that the init-script which reads this file detects whether your +# partition is LUKS or not. No mkfs is run unless you specify a makefs +# option. + +# Global options: +#---------------- + +# How long to wait for each timeout (in seconds). +dmcrypt_key_timeout=1 + +# Max number of checks to perform (see dmcrypt_key_timeout). +#dmcrypt_max_timeout=300 + +# Number of password retries. +dmcrypt_retries=5 + +# Arguments: +#----------- +# target= == Mapping name for partition. +# swap= == Mapping name for swap partition. +# source='' == Real device for partition. +# Note: You can (and should) specify a tag like UUID +# for blkid (see -t option). This is safer than using +# the full path to the device. +# key='[:]' == Fullpath from / or from inside removable media. +# remdev='' == Device that will be assigned to removable media. +# gpg_options='' == Default are --quiet --decrypt +# options='' == cryptsetup, for LUKS you can only use --readonly +# loop_file='' == Loopback file. +# Note: If you omit $source, then a free loopback will +# be looked up automatically. +# pre_mount='cmds' == commands to execute before mounting partition. +# post_mount='cmds' == commands to execute after mounting partition. +#----------- +# Supported Modes +# gpg == decrypt and pipe key into cryptsetup. +# Note: new-line character must not be part of key. +# Command to erase \n char: 'cat key | tr -d '\n' > cleanKey' + +#-------------------- +# dm-crypt examples +#-------------------- + +## swap +# Swap partitions. These should come first so that no keys make their +# way into unencrypted swap. +# If no options are given, they will default to: -c aes -h sha1 -d /dev/urandom +# If no makefs is given then mkswap will be assumed +#swap=crypt-swap +#source='/dev/hda2' + +## /home with passphrase +#target=crypt-home +#source='/dev/hda5' + +## /home with regular keyfile +#target=crypt-home +#source='/dev/hda5' +#key='/full/path/to/homekey' + +## /home with gpg protected key +#target=crypt-home +#source='/dev/hda5' +#key='/full/path/to/homekey:gpg' + +## /home with regular keyfile on removable media(such as usb-stick) +#target=crypt-home +#source='/dev/hda5' +#key='/full/path/to/homekey' +#remdev='/dev/sda1' + +## /home with gpg protected key on removable media(such as usb-stick) +#target=crypt-home +#source='/dev/hda5' +#key='/full/path/to/homekey:gpg' +#remdev='/dev/sda1' + +## /tmp with regular keyfile +#target=crypt-tmp +#source='/dev/hda6' +#key='/full/path/to/tmpkey' +#pre_mount='/sbin/mkreiserfs -f -f ${dev}' +#post_mount='chown root:root ${mount_point}; chmod 1777 ${mount_point}' + +## Loopback file example +#target='crypt-loop-home' +#source='/dev/loop0' +#loop_file='/mnt/crypt/home' + +# The file must be terminated by a newline. Or leave this comment last. diff --git a/sys-apps/baselayout/files/dracutcfg b/sys-apps/baselayout/files/dracutcfg new file mode 100644 index 00000000..279e9bed --- /dev/null +++ b/sys-apps/baselayout/files/dracutcfg @@ -0,0 +1,14 @@ +# Host-Only mode: Install only what is needed for booting the local host instead of a generic host and generate host-specific configuration. +hostonly="no" + +# Combine early microcode with ramdisk. Uncomment the line bellow, and run "dracut -f" if you want early microcode update. +# early_microcode="yes" + +# Dracut modules to add when building the iniframfs +add_dracutmodules+=" drm plymouth " + +# Dracut modules to ommit when building the initramfs. +omit_dracutmodules+=" systemd systemd-initrd systemd-networkd dracut-systemd " + +# Make sure we have vboxvideo && qxl inside the initramfs (Virtualbox/Qemu) +add_drivers+=" vboxvideo qxl " diff --git a/sys-apps/baselayout/files/grubcfg b/sys-apps/baselayout/files/grubcfg new file mode 100644 index 00000000..b88083b2 --- /dev/null +++ b/sys-apps/baselayout/files/grubcfg @@ -0,0 +1,63 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ +# +# To populate all changes in this file you need to regenerate your +# grub configuration file afterwards: +# 'grub2-mkconfig -o /boot/grub/grub.cfg' +# +# See the grub info page for documentation on possible variables and +# their associated values. + +GRUB_DISTRIBUTOR="Redcore" + +# Default menu entry +#GRUB_DEFAULT=0 + +# Boot the default entry this many seconds after the menu is displayed +GRUB_TIMEOUT="5" +#GRUB_TIMEOUT_STYLE=menu + +# Append parameters to the linux kernel command line for non-recovery entries +GRUB_CMDLINE_LINUX_DEFAULT="quiet loglevel=1 splash" + +# Uncomment to disable graphical terminal (grub-pc only) +#GRUB_TERMINAL=console + +# The resolution used on graphical terminal. +# Note that you can use only modes which your graphic card supports via VBE. +# You can see them in real GRUB with the command `vbeinfo'. +GRUB_GFXMODE="1366x768,1024x768,auto" + +# Set to 'text' to force the Linux kernel to boot in normal text +# mode, 'keep' to preserve the graphics mode set using +# 'GRUB_GFXMODE', 'WIDTHxHEIGHT'['xDEPTH'] to set a particular +# graphics mode, or a sequence of these separated by commas or +# semicolons to try several modes in sequence. +GRUB_GFXPAYLOAD_LINUX="keep" + +# Path to theme spec txt file. +# The starfield is by default provided with use truetype. +# NOTE: when enabling custom theme, ensure you have required font/etc. +GRUB_THEME="/usr/share/grub/themes/redcore/theme.txt" + +# Background image used on graphical terminal. +# Can be in various bitmap formats. +GRUB_BACKGROUND="/usr/share/grub/themes/redcore/terminal_bg.png" + +# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to kernel +#GRUB_DISABLE_LINUX_UUID=true + +# Uncomment to disable generation of recovery mode menu entries +#GRUB_DISABLE_RECOVERY=true + +# Uncomment to disable generation of the submenu and put all choices on +# the top-level menu. +# Besides the visual affect of no sub menu, this makes navigation of the +# menu easier for a user who can't see the screen. +#GRUB_DISABLE_SUBMENU=y + +# Uncomment to play a tone when the main menu is displayed. +# This is useful, for example, to allow users who can't see the screen +# to know when they can make a choice on the menu. +#GRUB_INIT_TUNE="60 800 1" diff --git a/sys-apps/baselayout/files/nmcfg b/sys-apps/baselayout/files/nmcfg new file mode 100644 index 00000000..a1c4b037 --- /dev/null +++ b/sys-apps/baselayout/files/nmcfg @@ -0,0 +1,3 @@ +[main] +plugins=keyfile +hostname-mode=none diff --git a/sys-apps/baselayout/files/smbcfg b/sys-apps/baselayout/files/smbcfg new file mode 100644 index 00000000..09276f94 --- /dev/null +++ b/sys-apps/baselayout/files/smbcfg @@ -0,0 +1,20 @@ +[global] + workgroup = WORKGROUP + server string = Samba Server + server role = standalone server + log file = /var/log/samba/log.%m + max log size = 50 + dns proxy = no + usershare path = /var/lib/samba/usershare + usershare max shares = 100 + usershare allow guests = yes + usershare owner only = yes + client max protocol = NT1 +[tmp] + comment = Temporary file space + path = /var/tmp + public = yes + writeable = yes + read only = no + printable = no + guest ok = yes -- cgit v1.2.3