Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Tom Yan
archiso
Commits
66895375
Verified
Commit
66895375
authored
Jul 17, 2020
by
nl6720
Browse files
Set root user's shell and password with custom /etc/passwd and /etc/shadow
Correct shadow file permissions from build.sh.
parent
12b02406
Changes
6
Hide whitespace changes
Inline
Side-by-side
configs/baseline/airootfs/etc/shadow
0 → 100644
View file @
66895375
root::14871::::::
configs/baseline/build.sh
View file @
66895375
...
...
@@ -38,6 +38,16 @@ make_setup_mkinitcpio() {
-r
'mkinitcpio -c /etc/mkinitcpio-archiso.conf -k /boot/vmlinuz-linux -g /boot/archiso.img'
run
}
# Prepare working directory and copy custom airootfs files (airootfs)
make_custom_airootfs
()
{
local
_airootfs
=
"
${
work_dir
}
/airootfs"
if
[[
-d
"
${
script_path
}
/airootfs"
]]
;
then
cp
-af
--no-preserve
=
ownership
--
"
${
script_path
}
/airootfs/."
"
${
_airootfs
}
"
[[
-e
"
${
_airootfs
}
/etc/shadow"
]]
&&
chmod
-f
0400
--
"
${
_airootfs
}
/etc/shadow"
fi
}
# Prepare ${install_dir}/boot/
make_boot
()
{
mkdir
-p
"
${
work_dir
}
/iso/
${
install_dir
}
/boot/
${
arch
}
"
...
...
@@ -80,6 +90,7 @@ make_iso() {
run_once make_basefs
run_once make_setup_mkinitcpio
run_once make_custom_airootfs
run_once make_boot
run_once make_syslinux
run_once make_isolinux
...
...
configs/releng/airootfs/etc/passwd
0 → 100644
View file @
66895375
root:x:0:0:root:/root:/usr/bin/zsh
configs/releng/airootfs/etc/shadow
0 → 100644
View file @
66895375
root::14871::::::
configs/releng/airootfs/root/customize_airootfs.sh
View file @
66895375
...
...
@@ -5,10 +5,7 @@ set -e -u
sed
-i
's/#\(en_US\.UTF-8\)/\1/'
/etc/locale.gen
locale-gen
usermod
-s
/usr/bin/zsh root
cp
-aT
/etc/skel/ /root/
# unset the root password
passwd
-d
root
sed
-i
's/#\(PermitRootLogin \).\+/\1yes/'
/etc/ssh/sshd_config
sed
-i
"s/#Server/Server/g"
/etc/pacman.d/mirrorlist
configs/releng/build.sh
View file @
66895375
...
...
@@ -125,7 +125,8 @@ make_customize_airootfs() {
fi
rm
"
${
work_dir
}
/x86_64/airootfs/root/customize_airootfs.sh"
chmod
-f
750
"
${
work_dir
}
/x86_64/airootfs/root"
[[
-e
"
${
work_dir
}
/x86_64/airootfs/etc/shadow"
]]
&&
chmod
-f
0400
--
"
${
work_dir
}
/x86_64/airootfs/etc/shadow"
[[
-e
"
${
work_dir
}
/x86_64/airootfs/root"
]]
&&
chmod
-f
0750
--
"
${
work_dir
}
/x86_64/airootfs/root"
}
# Prepare kernel/initramfs ${install_dir}/boot/
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment