File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
live-build/config/hooks/vm-artifacts Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -304,6 +304,18 @@ cat <<-EOF >"$DIRECTORY/etc/fstab"
304304 rpool/crashdump /var/crash zfs defaults,x-systemd.before=zfs-import-cache.service,x-systemd.before=kdump-tools.service 0 0
305305EOF
306306
307+ #
308+ # Check if DIR_MODE is present (either commented or uncommented) in file where new user
309+ # configurations are stored If DIR_MODE is found, update its value to 0750 (uncomment if needed)
310+ # If DIR_MODE is not found, add it to the file with value 0750
311+ #
312+ NEW_USER_FILE=" $DIRECTORY /etc/adduser.conf"
313+ if grep -q " ^#\?DIR_MODE" " $NEW_USER_FILE " ; then
314+ sed -i ' s/^#\?DIR_MODE.*/DIR_MODE=0750/' " $NEW_USER_FILE "
315+ else
316+ echo " DIR_MODE=0750" >> " $NEW_USER_FILE "
317+ fi
318+
307319#
308320# Now we need to install the bootloader. In order to do that, we'll chroot
309321# into the newly populated root filesystem, so that we use the grub-install
Original file line number Diff line number Diff line change @@ -595,6 +595,18 @@ if ! systemd-detect-virt -qc && [[ "$opt_p" == "aws" ]]; then
595595 generate_interface_to_mac_address_map
596596fi
597597
598+ #
599+ # Check if DIR_MODE is present (either commented or uncommented) in file where new user
600+ # configurations are stored If DIR_MODE is found, update its value to 0750 (uncomment if needed)
601+ # If DIR_MODE is not found, add it to the file with value 0750
602+ #
603+ NEW_USER_FILE=" /etc/adduser.conf"
604+ if grep -q " ^#\?DIR_MODE" " $NEW_USER_FILE " ; then
605+ sed -i ' s/^#\?DIR_MODE.*/DIR_MODE=0750/' " $NEW_USER_FILE "
606+ else
607+ echo " DIR_MODE=0750" >> " $NEW_USER_FILE "
608+ fi
609+
598610#
599611# We use a seperate ZFS dataset for GRUB, and this dataset is generally
600612# not mounted when we update pacakges on the system. Thus, when a new
You can’t perform that action at this time.
0 commit comments