[recovery-installer] Copy contents of /etc/skel to home directory (#1114)

This commit is contained in:
Attila Szöllősi 2018-01-12 22:53:15 +01:00 committed by Oliver Smith
parent 95ed32bd4e
commit 75bfddbc3b
3 changed files with 9 additions and 4 deletions

View File

@ -1,5 +1,5 @@
pkgname=postmarketos-android-recovery-installer
pkgver=0.1.2
pkgver=0.1.3
pkgrel=0
pkgdesc="TWRP compatible postmarketOS installer script"
url="https://github.com/postmarketOS"
@ -29,6 +29,6 @@ package() {
sha512sums="f02e67d26f4f977c5098ff6eee51b53ec962982c41b8b33c1a206c218c483bd20f782c06622cf8d724a9a1cdb5b9cc1b76d3bf32e562c9b558747ca3f3408ffd build_zip.sh
6390fc1b1c7dc8e917bb675d2e59e479782ac7754e97c4781866360ff704afe2d04f173a0ac74e3129db45328fab4b6b77a8717ee2e17c6ff79febadaa8ea034 update-binary
f19c15fd99cc806d088ddf9c954111e48635f971ca500beeaa4893eb25d19fe0601210a57e9ab1a1dc7a6d79a3154765e696ee3329bbb1875b6d6df36a7b3fb3 pmos_chroot
46956667e215bf29940b532bf91220167858e3c8dd4bda977ce6ae1829143317784c303247e97a527322b2d4cadaae3d0d73f6c42319872d39398e34be941a82 pmos_install
895e5790924cf9deb74517627c78618eda5f0d53b5aa494b16f679c84cf414d6a2ec6847ef93158a5afdd70c5e2b053b3d4cd47047bab1c21790da08a4b45232 pmos_install
36d8ca5ae092f8de0a9e2658581d3d1f83483b5076446aebaf5e1ab377e49615c31b81c00a23bc74d569de12a73977291c9a73e4f19b2faa694d981010c3eb35 pmos_install_functions
c6355b6d823dac883e1a352f59a9a2199e2934d78a73df72dc3c4fc14ef93765a15179203d4a8a2ca0d841b63cd4c25c4689b63c8cf4d4da2bcec1f8ff76bff5 pmos_setpw"

View File

@ -98,6 +98,11 @@ mount -t ext2 -rw "$PMOS_BOOT" /mnt/pmOS/boot || {
}
ui_print "Installing rootfs..."
unzip -p pmos.zip rootfs.tar.gz | tar -xz -C /mnt/pmOS
ui_print "Creating home folder..."
mkdir /mnt/pmOS/home
user="$(awk -F ':' '$3 == "1000" {print $1}' /mnt/pmOS/etc/passwd)"
cp -a /mnt/pmOS/etc/skel /mnt/pmOS/home/"$user"
chown -R 1000 /mnt/pmOS/home/"$user"
if [ "$FLASH_KERNEL" = "true" ]
then
if [ "$ISOREC" = "true" ]

View File

@ -66,8 +66,8 @@ def create_zip(args, suffix):
# Move config file from /tmp/ to zip root
["mv", "/tmp/install_options", "chroot/install_options"],
# Create tar archive of the rootfs
["tar", "-pcf", "rootfs.tar", "--exclude",
"./home/" + args.user + "/*", "-C", rootfs, "."],
["tar", "-pcf", "rootfs.tar", "--exclude", "./home", "-C", rootfs,
"."],
# Append packages keys
["tar", "-prf", "rootfs.tar", "-C", "/", "./etc/apk/keys"],
# Compress with -1 for speed improvement