mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-20 03:50:37 +02:00
fixup hooks
This commit is contained in:
parent
eb5490b2eb
commit
fa3e24e6ee
5 changed files with 35 additions and 35 deletions
|
@ -22,10 +22,10 @@ _run ()
|
||||||
_full_dir /usr/share/nano
|
_full_dir /usr/share/nano
|
||||||
_file /etc/nanorc
|
_file /etc/nanorc
|
||||||
# add syntax highlighting
|
# add syntax highlighting
|
||||||
echo "include \"/usr/share/nano/*.nanorc\"" >> "${BUILDROOT}/etc/nanorc"
|
echo "include \"/usr/share/nano/*.nanorc\"" >> "${_ROOTFS}/etc/nanorc"
|
||||||
|
|
||||||
### add machine-id
|
### add machine-id
|
||||||
: > "${BUILDROOT}"/etc/machine-id
|
: > "${_ROOTFS}"/etc/machine-id
|
||||||
|
|
||||||
### add file magic file
|
### add file magic file
|
||||||
_file /usr/share/file/misc/magic.mgc
|
_file /usr/share/file/misc/magic.mgc
|
||||||
|
@ -67,7 +67,7 @@ _run ()
|
||||||
# only support UTF-8
|
# only support UTF-8
|
||||||
_file /usr/share/i18n/charmaps/UTF-8.gz
|
_file /usr/share/i18n/charmaps/UTF-8.gz
|
||||||
# remove conflicting files from not installed packages: binutils, grub and gdbm
|
# remove conflicting files from not installed packages: binutils, grub and gdbm
|
||||||
find "${BUILDROOT}/usr/share/locale/" -type f \( -name 'grub*' -o -name 'binutils*' -o -name 'gdbm*' -o -name 'bfd*' \
|
find "${_ROOTFS}/usr/share/locale/" -type f \( -name 'grub*' -o -name 'binutils*' -o -name 'gdbm*' -o -name 'bfd*' \
|
||||||
-o -name 'gettext*' -o -name 'gas*' -o -name 'gold*' -o -name 'gprof*' -o -name 'ld*' \
|
-o -name 'gettext*' -o -name 'gas*' -o -name 'gold*' -o -name 'gprof*' -o -name 'ld*' \
|
||||||
-o -name 'man-db*' -o -name 'opcodes*' -o -name 'texinfo*' \) -delete
|
-o -name 'man-db*' -o -name 'opcodes*' -o -name 'texinfo*' \) -delete
|
||||||
fi
|
fi
|
||||||
|
@ -86,7 +86,7 @@ _run ()
|
||||||
_file "/etc/skel/${i}" "/root/${i}"
|
_file "/etc/skel/${i}" "/root/${i}"
|
||||||
done
|
done
|
||||||
# add custom bash options
|
# add custom bash options
|
||||||
echo ". /etc/profile.d/custom-bash-options.sh" >> "${BUILDROOT}/root/.bashrc"
|
echo ". /etc/profile.d/custom-bash-options.sh" >> "${_ROOTFS}/root/.bashrc"
|
||||||
# add /etc/skel
|
# add /etc/skel
|
||||||
_full_dir /etc/skel
|
_full_dir /etc/skel
|
||||||
### add kmod related config file(s)
|
### add kmod related config file(s)
|
||||||
|
@ -160,7 +160,7 @@ _run ()
|
||||||
# proc-sys-fs-binfmt_misc.automount
|
# proc-sys-fs-binfmt_misc.automount
|
||||||
_symlink /etc/systemd/system/proc-sys-fs-binfmt_misc.automount /dev/null
|
_symlink /etc/systemd/system/proc-sys-fs-binfmt_misc.automount /dev/null
|
||||||
# remove remote-fs.target from multi-user.target.wants
|
# remove remote-fs.target from multi-user.target.wants
|
||||||
rm -f "${BUILDROOT}"/etc/systemd/system/multi-user.target.wants/remote-fs.target
|
rm -f "${_ROOTFS}"/etc/systemd/system/multi-user.target.wants/remote-fs.target
|
||||||
# disable lastlog
|
# disable lastlog
|
||||||
_symlink /var/log/lastlog /dev/null
|
_symlink /var/log/lastlog /dev/null
|
||||||
_file /usr/share/archboot/base/etc/tmpfiles.d/var.conf /etc/tmpfiles.d/var.conf
|
_file /usr/share/archboot/base/etc/tmpfiles.d/var.conf /etc/tmpfiles.d/var.conf
|
||||||
|
@ -171,7 +171,7 @@ _run ()
|
||||||
_map _file /usr/lib/libnss_compat.so.2 /usr/lib/libnsl.so.1
|
_map _file /usr/lib/libnss_compat.so.2 /usr/lib/libnsl.so.1
|
||||||
## fix for systemd >=245 set default.target
|
## fix for systemd >=245 set default.target
|
||||||
# remove initrd-release to allow normal systemd boot without initrd.target
|
# remove initrd-release to allow normal systemd boot without initrd.target
|
||||||
rm -f "${BUILDROOT}"/etc/initrd-release
|
rm -f "${_ROOTFS}"/etc/initrd-release
|
||||||
# mask systemd-gpt-auto-generator, errors out on initramfs usage
|
# mask systemd-gpt-auto-generator, errors out on initramfs usage
|
||||||
_symlink /etc/systemd/system-generators/systemd-gpt-auto-generator /dev/null
|
_symlink /etc/systemd/system-generators/systemd-gpt-auto-generator /dev/null
|
||||||
### add udev
|
### add udev
|
||||||
|
@ -204,7 +204,7 @@ _run ()
|
||||||
cdrtools systemd-ukify python python-pefile limine man-pages libev libpipeline groff \
|
cdrtools systemd-ukify python python-pefile limine man-pages libev libpipeline groff \
|
||||||
man-db texinfo db db5.3 gc rpcbind"
|
man-db texinfo db db5.3 gc rpcbind"
|
||||||
for i in ${_RM_PACMAN_DB}; do
|
for i in ${_RM_PACMAN_DB}; do
|
||||||
rm -rf "${BUILDROOT}"/var/lib/pacman/local/"${i}"-*-[0-9]* &>"${_NO_LOG}"
|
rm -rf "${_ROOTFS}"/var/lib/pacman/local/"${i}"-*-[0-9]* &>"${_NO_LOG}"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
### add nss p11-kit and ca certificates
|
### add nss p11-kit and ca certificates
|
||||||
|
@ -223,20 +223,20 @@ _run ()
|
||||||
_file /usr/share/p11-kit/modules/p11-kit-trust.module
|
_file /usr/share/p11-kit/modules/p11-kit-trust.module
|
||||||
|
|
||||||
### remove conflicting grub, man-db, mkinitcpio and rpcbind files
|
### remove conflicting grub, man-db, mkinitcpio and rpcbind files
|
||||||
rm "${BUILDROOT}"/usr/lib/systemd/system/mkinitcpio-generate-shutdown-ramfs.service \
|
rm "${_ROOTFS}"/usr/lib/systemd/system/mkinitcpio-generate-shutdown-ramfs.service \
|
||||||
"${BUILDROOT}"/usr/lib/systemd/system/shutdown.target.wants/mkinitcpio-generate-shutdown-ramfs.service \
|
"${_ROOTFS}"/usr/lib/systemd/system/shutdown.target.wants/mkinitcpio-generate-shutdown-ramfs.service \
|
||||||
"${BUILDROOT}"/usr/lib/systemd/ukify \
|
"${_ROOTFS}"/usr/lib/systemd/ukify \
|
||||||
"${BUILDROOT}"/usr/lib/systemd/system/man-db* \
|
"${_ROOTFS}"/usr/lib/systemd/system/man-db* \
|
||||||
"${BUILDROOT}"/usr/lib/systemd/system/timers.target.wants/man-db* \
|
"${_ROOTFS}"/usr/lib/systemd/system/timers.target.wants/man-db* \
|
||||||
"${BUILDROOT}"/usr/lib/tmpfiles.d/man-db* \
|
"${_ROOTFS}"/usr/lib/tmpfiles.d/man-db* \
|
||||||
"${BUILDROOT}"/usr/lib/tmpfiles.d/mkinitcpio.conf \
|
"${_ROOTFS}"/usr/lib/tmpfiles.d/mkinitcpio.conf \
|
||||||
"${BUILDROOT}"/usr/share/bash-completion/completions/lsinitcpio \
|
"${_ROOTFS}"/usr/share/bash-completion/completions/lsinitcpio \
|
||||||
"${BUILDROOT}"/usr/share/bash-completion/completions/mkinitcpio \
|
"${_ROOTFS}"/usr/share/bash-completion/completions/mkinitcpio \
|
||||||
"${BUILDROOT}"/usr/share/bash-completion/completions/grub \
|
"${_ROOTFS}"/usr/share/bash-completion/completions/grub \
|
||||||
"${BUILDROOT}"/usr/lib/systemd/system/rpcbind* \
|
"${_ROOTFS}"/usr/lib/systemd/system/rpcbind* \
|
||||||
"${BUILDROOT}"/usr/lib/tmpfiles.d/rpcbind* \
|
"${_ROOTFS}"/usr/lib/tmpfiles.d/rpcbind* \
|
||||||
"${BUILDROOT}"/usr/lib/sysusers.d/rpcbind* \
|
"${_ROOTFS}"/usr/lib/sysusers.d/rpcbind* \
|
||||||
"${BUILDROOT}"/usr/lib/modules-load.d/cdrecord.conf
|
"${_ROOTFS}"/usr/lib/modules-load.d/cdrecord.conf
|
||||||
|
|
||||||
### fix licenses
|
### fix licenses
|
||||||
_map _file /usr/share/licenses/shadow/COPYING /usr/share/licenses/iana-etc/LICENSE \
|
_map _file /usr/share/licenses/shadow/COPYING /usr/share/licenses/iana-etc/LICENSE \
|
||||||
|
|
|
@ -8,9 +8,9 @@ _run ()
|
||||||
_map _full_dir "/lib/firmware" "/usr/share/licenses/linux-firmware"
|
_map _full_dir "/lib/firmware" "/usr/share/licenses/linux-firmware"
|
||||||
_all_modules "/firmware/"
|
_all_modules "/firmware/"
|
||||||
# remove not used firmware
|
# remove not used firmware
|
||||||
rm -rf "${BUILDROOT}"/lib/firmware/{amphion,as102*,atusb,av7110,cadence,cavium,cmmb*,cis,cpia2,cnm,ct*,cxgb*,cmmb*,dabusb,dpaa2,dsp56k,dvb*,edgeport,emi26,emi62,ess,f2255usb*,go7007,hfi1*,inside-secure,isdbt*,keyspan*,korg,meson,lgs8g75*,lt9611uxc*,moxa,mts*,myri10ge*,myricom,nxp,ositech,qat*,sb16,s2250*,s5p-*,sms1*,rtl_bt,tdmb*,ttusb-budget,ueagle-atm,usbdux*,ti,ti-keystone,v4l*,vicam,vxge,whiteheat*,yam,yamaha}
|
rm -rf "${_ROOTFS}"/lib/firmware/{amphion,as102*,atusb,av7110,cadence,cavium,cmmb*,cis,cpia2,cnm,ct*,cxgb*,cmmb*,dabusb,dpaa2,dsp56k,dvb*,edgeport,emi26,emi62,ess,f2255usb*,go7007,hfi1*,inside-secure,isdbt*,keyspan*,korg,meson,lgs8g75*,lt9611uxc*,moxa,mts*,myri10ge*,myricom,nxp,ositech,qat*,sb16,s2250*,s5p-*,sms1*,rtl_bt,tdmb*,ttusb-budget,ueagle-atm,usbdux*,ti,ti-keystone,v4l*,vicam,vxge,whiteheat*,yam,yamaha}
|
||||||
find "${BUILDROOT}/lib/firmware" -type f -name "*txt*" -exec rm {} \;
|
find "${_ROOTFS}/lib/firmware" -type f -name "*txt*" -exec rm {} \;
|
||||||
find "${BUILDROOT}/lib/firmware" -type f -name "*README*" -exec rm {} \;
|
find "${_ROOTFS}/lib/firmware" -type f -name "*README*" -exec rm {} \;
|
||||||
}
|
}
|
||||||
|
|
||||||
# vim: set ft=sh ts=4 sw=4 et:
|
# vim: set ft=sh ts=4 sw=4 et:
|
||||||
|
|
|
@ -24,13 +24,13 @@ _run() {
|
||||||
_file "/etc/skel/${i}" "/root/${i}"
|
_file "/etc/skel/${i}" "/root/${i}"
|
||||||
done
|
done
|
||||||
# add custom bash options
|
# add custom bash options
|
||||||
echo ". /root/.bashrc" >> "${BUILDROOT}/etc/bash.bashrc"
|
echo ". /root/.bashrc" >> "${_ROOTFS}/etc/bash.bashrc"
|
||||||
#shellcheck disable=SC2129
|
#shellcheck disable=SC2129
|
||||||
echo ". /etc/profile.d/custom-bash-options.sh" >> "${BUILDROOT}/root/.bashrc"
|
echo ". /etc/profile.d/custom-bash-options.sh" >> "${_ROOTFS}/root/.bashrc"
|
||||||
echo "alias reboot='echo b >/proc/sysrq-trigger'" >> "${BUILDROOT}/root/.bashrc"
|
echo "alias reboot='echo b >/proc/sysrq-trigger'" >> "${_ROOTFS}/root/.bashrc"
|
||||||
echo "alias poweroff='echo o >/proc/sysrq-trigger'" >> "${BUILDROOT}/root/.bashrc"
|
echo "alias poweroff='echo o >/proc/sysrq-trigger'" >> "${_ROOTFS}/root/.bashrc"
|
||||||
echo "root:x:0:root" > "${BUILDROOT}/etc/group"
|
echo "root:x:0:root" > "${_ROOTFS}/etc/group"
|
||||||
echo "root:x:0:0:/root:/bin/bash" > "${BUILDROOT}/etc/passwd"
|
echo "root:x:0:0:/root:/bin/bash" > "${_ROOTFS}/etc/passwd"
|
||||||
_file "/usr/share/archboot/base/etc/profile.d/custom-bash-options.sh" \
|
_file "/usr/share/archboot/base/etc/profile.d/custom-bash-options.sh" \
|
||||||
"/etc/profile.d/custom-bash-options.sh"
|
"/etc/profile.d/custom-bash-options.sh"
|
||||||
_BASIC_CONFIG="os-release modprobe.d/modprobe.conf"
|
_BASIC_CONFIG="os-release modprobe.d/modprobe.conf"
|
||||||
|
|
|
@ -11,7 +11,7 @@ _run ()
|
||||||
_file /usr/bin/archboot-update.sh /usr/bin/update
|
_file /usr/bin/archboot-update.sh /usr/bin/update
|
||||||
_file /usr/share/archboot/gpg/tpowa.gpg
|
_file /usr/share/archboot/gpg/tpowa.gpg
|
||||||
# use /etc/profile to launch login.sh
|
# use /etc/profile to launch login.sh
|
||||||
echo ". /usr/lib/archboot/login.sh" >> "${BUILDROOT}/root/.bashrc"
|
echo ". /usr/lib/archboot/login.sh" >> "${_ROOTFS}/root/.bashrc"
|
||||||
}
|
}
|
||||||
|
|
||||||
# vim: set ft=sh ts=4 sw=4 et:
|
# vim: set ft=sh ts=4 sw=4 et:
|
||||||
|
|
|
@ -14,8 +14,8 @@ _run ()
|
||||||
/etc/netconfig
|
/etc/netconfig
|
||||||
_file /etc/ssh/sshd_config
|
_file /etc/ssh/sshd_config
|
||||||
# allow root login and empty passwords
|
# allow root login and empty passwords
|
||||||
echo "PermitRootLogin yes" >> "${BUILDROOT}/etc/ssh/sshd_config"
|
echo "PermitRootLogin yes" >> "${_ROOTFS}/etc/ssh/sshd_config"
|
||||||
echo "PermitEmptyPasswords yes" >> "${BUILDROOT}/etc/ssh/sshd_config"
|
echo "PermitEmptyPasswords yes" >> "${_ROOTFS}/etc/ssh/sshd_config"
|
||||||
_full_dir /usr/lib/libnfsidmap
|
_full_dir /usr/lib/libnfsidmap
|
||||||
_map _dir /var/empty /var/lib/nfs/sm /var/lib/nfs/sm.bak /var/lib/nfs/v4recovery \
|
_map _dir /var/empty /var/lib/nfs/sm /var/lib/nfs/sm.bak /var/lib/nfs/v4recovery \
|
||||||
/var/lib/nfs/rpc_pipefs /var/log/gssproxy
|
/var/lib/nfs/rpc_pipefs /var/log/gssproxy
|
||||||
|
@ -26,8 +26,8 @@ _run ()
|
||||||
_map _full_dir /etc/gss /etc/gssproxy
|
_map _full_dir /etc/gss /etc/gssproxy
|
||||||
_map _dir /var/lib/gssproxy/{clients,rcache} /var/log/gssproxy
|
_map _dir /var/lib/gssproxy/{clients,rcache} /var/log/gssproxy
|
||||||
_dir /var/lib/openldap
|
_dir /var/lib/openldap
|
||||||
chmod 700 "${BUILDROOT}/var/lib/openldap"
|
chmod 700 "${_ROOTFS}/var/lib/openldap"
|
||||||
chown 439:439 "${BUILDROOT}/var/lib/openldap"
|
chown 439:439 "${_ROOTFS}/var/lib/openldap"
|
||||||
# start sshd on startup
|
# start sshd on startup
|
||||||
_symlink /etc/systemd/system/multi-user.target.wants/sshd.service /usr/lib/systemd/system/sshd.service
|
_symlink /etc/systemd/system/multi-user.target.wants/sshd.service /usr/lib/systemd/system/sshd.service
|
||||||
# start ttyd on startup
|
# start ttyd on startup
|
||||||
|
|
Loading…
Reference in a new issue