build-root-filesystem: Move "cp -R" block up.

I want to add a "chmod -R" right after the cp command.
This needs to happen before all the other chmods, to not
undo their effect.
This commit is contained in:
Nico Weber 2020-06-04 18:38:42 -04:00 committed by Andreas Kling
parent 8630ef6df6
commit 309a91847f

View file

@ -23,6 +23,29 @@ fi
umask 0022
printf "installing base system... "
cp -R "$SERENITY_ROOT"/Base/* mnt/
cp -R Root/* mnt/
chmod 400 mnt/res/kernel.map
chmod 660 mnt/etc/WindowServer/WindowServer.ini
chown $window_uid:$window_gid mnt/etc/WindowServer/WindowServer.ini
echo "/bin/sh" > mnt/etc/shells
chown 0:$wheel_gid mnt/bin/su
chown 0:$phys_gid mnt/bin/shutdown
chown 0:$phys_gid mnt/bin/reboot
chown 0:0 mnt/boot/Kernel
chown 0:0 mnt/res/kernel.map
chmod 0400 mnt/res/kernel.map
chmod 0400 mnt/boot/Kernel
chmod 4750 mnt/bin/su
chmod 4755 mnt/bin/ping
chmod 4750 mnt/bin/reboot
chmod 4750 mnt/bin/shutdown
echo "done"
printf "creating initial filesystem structure... "
for dir in bin etc proc mnt tmp boot mod; do
mkdir -p mnt/$dir
@ -83,29 +106,6 @@ ln -s /proc/self/fd/1 mnt/dev/stdout
ln -s /proc/self/fd/2 mnt/dev/stderr
echo "done"
printf "installing base system... "
cp -R "$SERENITY_ROOT"/Base/* mnt/
cp -R Root/* mnt/
chmod 400 mnt/res/kernel.map
chmod 660 mnt/etc/WindowServer/WindowServer.ini
chown $window_uid:$window_gid mnt/etc/WindowServer/WindowServer.ini
echo "/bin/sh" > mnt/etc/shells
chown 0:$wheel_gid mnt/bin/su
chown 0:$phys_gid mnt/bin/shutdown
chown 0:$phys_gid mnt/bin/reboot
chown 0:0 mnt/boot/Kernel
chown 0:0 mnt/res/kernel.map
chmod 0400 mnt/res/kernel.map
chmod 0400 mnt/boot/Kernel
chmod 4750 mnt/bin/su
chmod 4755 mnt/bin/ping
chmod 4750 mnt/bin/reboot
chmod 4750 mnt/bin/shutdown
echo "done"
printf "writing version file... "
GIT_HASH=$( (git log --pretty=format:'%h' -n 1 | head -c 7) || true )
printf "[Version]\nMajor=1\nMinor=0\nGit=%s\n" "$GIT_HASH" > mnt/res/version.ini