From e22ba8caea98a92f50efb17204505cc880e8e974 Mon Sep 17 00:00:00 2001 From: NotKit Date: Thu, 2 Aug 2018 20:10:56 +0000 Subject: [PATCH] Change default user uid to 10000 --- .../APKBUILD | 4 ++-- .../pmos_install | 4 ++-- aports/main/postmarketos-ui-hildon/APKBUILD | 6 +++--- .../postmarketos-ui-hildon.post-install | 2 +- .../main/postmarketos-ui-hildon/start_hildon.sh | 2 +- aports/main/postmarketos-ui-matchbox/APKBUILD | 4 ++-- .../postmarketos-ui-matchbox.post-install | 2 +- .../postmarketos-ui-matchbox/start_matchbox.sh | 2 +- aports/main/postmarketos-ui-mate/APKBUILD | 4 ++-- .../postmarketos-ui-mate.post-install | 2 +- aports/main/postmarketos-ui-mate/start_mate.sh | 2 +- .../main/postmarketos-ui-plasma-mobile/APKBUILD | 2 +- .../postmarketos-ui-plasma-mobile.post-install | 2 +- aports/main/postmarketos-ui-weston/APKBUILD | 6 +++--- .../postmarketos-ui-weston.post-install | 4 ++-- .../main/postmarketos-ui-weston/start_weston.sh | 2 +- aports/main/postmarketos-ui-xfce4/APKBUILD | 4 ++-- .../postmarketos-ui-xfce4.post-install | 2 +- aports/main/postmarketos-ui-xfce4/start_xfce4.sh | 2 +- pmb/config/__init__.py | 2 +- pmb/helpers/other.py | 16 ++++++++++++++++ pmb/install/_install.py | 11 +++++++---- 22 files changed, 53 insertions(+), 34 deletions(-) diff --git a/aports/main/postmarketos-android-recovery-installer/APKBUILD b/aports/main/postmarketos-android-recovery-installer/APKBUILD index 4c926f79..0b6a8f27 100644 --- a/aports/main/postmarketos-android-recovery-installer/APKBUILD +++ b/aports/main/postmarketos-android-recovery-installer/APKBUILD @@ -1,6 +1,6 @@ pkgname=postmarketos-android-recovery-installer pkgver=0.1.7 -pkgrel=0 +pkgrel=1 pkgdesc="TWRP compatible postmarketOS installer script" url="https://postmarketos.org" # multipath-tools: kpartx @@ -29,6 +29,6 @@ package() { sha512sums="924f961e1a488134d265f43724d2b06a908ac1522706dc3f7118f0dec16453aa0a928fef6d9a31a6a747910df665e64f25c94c47a9e3f1d57db19abb0fd8210d build_zip.sh 6390fc1b1c7dc8e917bb675d2e59e479782ac7754e97c4781866360ff704afe2d04f173a0ac74e3129db45328fab4b6b77a8717ee2e17c6ff79febadaa8ea034 update-binary f19c15fd99cc806d088ddf9c954111e48635f971ca500beeaa4893eb25d19fe0601210a57e9ab1a1dc7a6d79a3154765e696ee3329bbb1875b6d6df36a7b3fb3 pmos_chroot -d65b72ffb1140425bf96b1e3ef75a517bebbfa70e6bdc584dbd91c2cbefce63377c744b3b33f1967bad37cb368aa746e25d25b10eebf464399b262f62378b0f4 pmos_install +94d06a7a73f76eb737e65ca2828f3c59d9cc532f2d2ec200e1407cd8fc266be192e33a8baa923e460a4335c7f5fb5232675d2e2e98a7e1ed07a257c67a0a5c5d pmos_install 514881d7812197830869c73428acc88f8a94dd02184634406ffe47884cd21d7b02ecc7806dae39308f026b1dbfca9ceee714fdfdc2bebc3ebcdeed71865de2b2 pmos_install_functions c6355b6d823dac883e1a352f59a9a2199e2934d78a73df72dc3c4fc14ef93765a15179203d4a8a2ca0d841b63cd4c25c4689b63c8cf4d4da2bcec1f8ff76bff5 pmos_setpw" diff --git a/aports/main/postmarketos-android-recovery-installer/pmos_install b/aports/main/postmarketos-android-recovery-installer/pmos_install index 5e794872..5bc22efa 100755 --- a/aports/main/postmarketos-android-recovery-installer/pmos_install +++ b/aports/main/postmarketos-android-recovery-installer/pmos_install @@ -113,9 +113,9 @@ 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)" +user="$(awk -F ':' '$3 == "10000" {print $1}' /mnt/pmOS/etc/passwd)" cp -a /mnt/pmOS/etc/skel /mnt/pmOS/home/"$user" -chown -R 1000 /mnt/pmOS/home/"$user" +chown -R 10000 /mnt/pmOS/home/"$user" ui_print "Configuring apk..." sed -i '/\/mnt\/pmbootstrap-packages/d' /mnt/pmOS/etc/apk/repositories diff --git a/aports/main/postmarketos-ui-hildon/APKBUILD b/aports/main/postmarketos-ui-hildon/APKBUILD index 6270b5ad..1677deec 100644 --- a/aports/main/postmarketos-ui-hildon/APKBUILD +++ b/aports/main/postmarketos-ui-hildon/APKBUILD @@ -1,6 +1,6 @@ pkgname=postmarketos-ui-hildon pkgver=1 -pkgrel=4 +pkgrel=5 pkgdesc="(X11) Lightweight GTK+2 UI (optimized for single-touch touchscreens)" url="https://postmarketos.org" arch="noarch" @@ -30,6 +30,6 @@ package() { install -D -m644 "$srcdir"/xinitrc_hildon.sh \ "$pkgdir"/etc/postmarketos-ui/xinitrc_hildon.sh } -sha512sums="6c446fd2c0c50b10bf3bd4da93520b975f3632dab24c34eb33f22af7fdd2d96b8d7b605a4aee0c8e2544f56b7fd2dfc0ad39dc57b11cb2eb8c952f823d1b2987 start_hildon.sh +sha512sums="614c36acb7932f86db4e189411404fac2d56bec7c4ebc0f4de336e7d46e1bde786a0f1b42be916ac43b47d3e7e7b32f4b5991212b0d452195e61ceba55d358f8 start_hildon.sh 5ef5710bee7bde99e1f240eb8873239c452b55c6dc943930e181d091835824094cf56bf29ae1b34d792ba0ce27f76e30ea69f3c125dda3bf286eaaaba8c8e6ae xinitrc_hildon.sh -64007cebcfbb9d8cdc4db7f889722509e1090af0712802300611fb805e00e1de474e4e6b538d0d99be05ca25f983e94aab57e04b4cc8282ba0ae44609d1a7366 postmarketos-ui-hildon.post-install" +733b9374e60bf6972d26da717dda039ab21b4052fe1a80881941971b9e1e99e315d184b48e9a064c36b1de5cbe3cfcf7b4819925b0a8948d447951ae8e580078 postmarketos-ui-hildon.post-install" diff --git a/aports/main/postmarketos-ui-hildon/postmarketos-ui-hildon.post-install b/aports/main/postmarketos-ui-hildon/postmarketos-ui-hildon.post-install index c87b4e9b..0311203c 100644 --- a/aports/main/postmarketos-ui-hildon/postmarketos-ui-hildon.post-install +++ b/aports/main/postmarketos-ui-hildon/postmarketos-ui-hildon.post-install @@ -1,7 +1,7 @@ #!/bin/sh # Autologin on tty1, let busybox autoconfigure 2-6 -autologin="$(getent passwd 1000 | cut -d ":" -f 1)" +autologin="$(getent passwd 10000 | cut -d ":" -f 1)" for i in 1 2 3 4 5 6; do old="^tty$i::respawn:/sbin/getty 38400 tty$i" new="# tty$i::respawn:/sbin/getty 38400 tty$i" diff --git a/aports/main/postmarketos-ui-hildon/start_hildon.sh b/aports/main/postmarketos-ui-hildon/start_hildon.sh index b1da4f44..df5c0fbe 100644 --- a/aports/main/postmarketos-ui-hildon/start_hildon.sh +++ b/aports/main/postmarketos-ui-hildon/start_hildon.sh @@ -4,7 +4,7 @@ # /etc/inittab by postmarketos-base post-install.hook). # This is a temporary solution, we'll need something like a # display manager in the long run (#656). -if [ "$(id -u)" = "1000" ] && [ "$(tty)" = "/dev/tty1" ]; then +if [ "$(id -u)" = "10000" ] && [ "$(tty)" = "/dev/tty1" ]; then # Start X11 with Hildon startx /etc/postmarketos-ui/xinitrc_hildon.sh 2>&1 | logger -t "$(whoami):x11" diff --git a/aports/main/postmarketos-ui-matchbox/APKBUILD b/aports/main/postmarketos-ui-matchbox/APKBUILD index b8a6567a..0267e7c0 100644 --- a/aports/main/postmarketos-ui-matchbox/APKBUILD +++ b/aports/main/postmarketos-ui-matchbox/APKBUILD @@ -1,6 +1,6 @@ pkgname=postmarketos-ui-matchbox pkgver=1 -pkgrel=2 +pkgrel=3 pkgdesc="(X11) Very basic user interface for handhelds" url="https://matchbox-project.org" arch="noarch" @@ -16,4 +16,4 @@ package() { "$pkgdir"/etc/profile.d/start_matchbox.sh } -sha512sums="9286e12744fc313fd3ed842dbc524226c2714cffb6fdd1327ff079527546a5c0b0738ce5a444fd534fb267fbde2759b552784cbed09ec988cd4abfa2d0001319 start_matchbox.sh" +sha512sums="c974333da4a4a829969df87edd737e8e1fca78ad9f9b38df10c9031317c4b06dcdf7666b31d39ca2e3ef1a8ac7b4bacdfda2d3e0fed57523489065cd7e5c9bb9 start_matchbox.sh" diff --git a/aports/main/postmarketos-ui-matchbox/postmarketos-ui-matchbox.post-install b/aports/main/postmarketos-ui-matchbox/postmarketos-ui-matchbox.post-install index c87b4e9b..0311203c 100644 --- a/aports/main/postmarketos-ui-matchbox/postmarketos-ui-matchbox.post-install +++ b/aports/main/postmarketos-ui-matchbox/postmarketos-ui-matchbox.post-install @@ -1,7 +1,7 @@ #!/bin/sh # Autologin on tty1, let busybox autoconfigure 2-6 -autologin="$(getent passwd 1000 | cut -d ":" -f 1)" +autologin="$(getent passwd 10000 | cut -d ":" -f 1)" for i in 1 2 3 4 5 6; do old="^tty$i::respawn:/sbin/getty 38400 tty$i" new="# tty$i::respawn:/sbin/getty 38400 tty$i" diff --git a/aports/main/postmarketos-ui-matchbox/start_matchbox.sh b/aports/main/postmarketos-ui-matchbox/start_matchbox.sh index 69e0cbfb..8c1a7f2f 100644 --- a/aports/main/postmarketos-ui-matchbox/start_matchbox.sh +++ b/aports/main/postmarketos-ui-matchbox/start_matchbox.sh @@ -4,7 +4,7 @@ # /etc/inittab by postmarketos-base post-install.hook). # This is a temporary solution, we'll need something like a # display manager in the long run (#656). -if [ "$(id -u)" = "1000" ] && [ "$(tty)" = "/dev/tty1" ]; then +if [ "$(id -u)" = "10000" ] && [ "$(tty)" = "/dev/tty1" ]; then # Start X11 with Mate startx /usr/bin/matchbox-session 2>&1 | logger -t "$(whoami):x11" diff --git a/aports/main/postmarketos-ui-mate/APKBUILD b/aports/main/postmarketos-ui-mate/APKBUILD index 1cfa295d..a0e45fcc 100644 --- a/aports/main/postmarketos-ui-mate/APKBUILD +++ b/aports/main/postmarketos-ui-mate/APKBUILD @@ -1,6 +1,6 @@ pkgname=postmarketos-ui-mate pkgver=1 -pkgrel=3 +pkgrel=4 pkgdesc="(X11) MATE Desktop Environment, fork of GNOME2 (stylus recommended)" url="http://mate-desktop.org/" arch="noarch" @@ -20,5 +20,5 @@ package() { "$pkgdir"/usr/share/glib-2.0/schemas/000-system-background.gschema.override } -sha512sums="a5a48821538b18069bad6528d488ed2dd5ae7d4f4fa095215c30d5399a41e645300f0c70bef1178be085e5fe8510fb4dda5446585663fd57193e938558b803de start_mate.sh +sha512sums="bc4d0fda2c95d375433b7a6ba327e747e0b58fb69dda12dbdd44fe99ebd961a78793e4fa17bc719d681aa2afdd7ab0c823ae874c3b7c5a6a254301cb9e6cb289 start_mate.sh b4eded3d1aba2086d53507d434da6f2d5aae24fa49c7a8619abb1d81f87898d7a6d813be777a285ce988d78db236bea7507e7868c39fe020e5d23c230dd36242 000-system-background.gschema.override" diff --git a/aports/main/postmarketos-ui-mate/postmarketos-ui-mate.post-install b/aports/main/postmarketos-ui-mate/postmarketos-ui-mate.post-install index 05afb457..c2845a30 100644 --- a/aports/main/postmarketos-ui-mate/postmarketos-ui-mate.post-install +++ b/aports/main/postmarketos-ui-mate/postmarketos-ui-mate.post-install @@ -1,7 +1,7 @@ #!/bin/sh # Autologin on tty1, let busybox autoconfigure 2-6 -autologin="$(getent passwd 1000 | cut -d ":" -f 1)" +autologin="$(getent passwd 10000 | cut -d ":" -f 1)" for i in 1 2 3 4 5 6; do old="^tty$i::respawn:/sbin/getty 38400 tty$i" new="# tty$i::respawn:/sbin/getty 38400 tty$i" diff --git a/aports/main/postmarketos-ui-mate/start_mate.sh b/aports/main/postmarketos-ui-mate/start_mate.sh index 5f1a9f84..473a7e40 100644 --- a/aports/main/postmarketos-ui-mate/start_mate.sh +++ b/aports/main/postmarketos-ui-mate/start_mate.sh @@ -4,7 +4,7 @@ # /etc/inittab by postmarketos-base post-install.hook). # This is a temporary solution, we'll need something like a # display manager in the long run (#656). -if [ "$(id -u)" = "1000" ] && [ "$(tty)" = "/dev/tty1" ]; then +if [ "$(id -u)" = "10000" ] && [ "$(tty)" = "/dev/tty1" ]; then # Start X11 with Mate startx /usr/bin/mate-session 2>&1 | logger -t "$(whoami):x11" diff --git a/aports/main/postmarketos-ui-plasma-mobile/APKBUILD b/aports/main/postmarketos-ui-plasma-mobile/APKBUILD index 3ac8539b..63714ed9 100644 --- a/aports/main/postmarketos-ui-plasma-mobile/APKBUILD +++ b/aports/main/postmarketos-ui-plasma-mobile/APKBUILD @@ -1,6 +1,6 @@ pkgname=postmarketos-ui-plasma-mobile pkgver=1 -pkgrel=14 +pkgrel=15 pkgdesc="(Wayland) Mobile variant of KDE Plasma, optimized for touchscreen (aarch64, x86_64 or hardware acceleration required!)" url="https://wiki.postmarketos.org/wiki/Plasma_Mobile" arch="noarch" diff --git a/aports/main/postmarketos-ui-plasma-mobile/postmarketos-ui-plasma-mobile.post-install b/aports/main/postmarketos-ui-plasma-mobile/postmarketos-ui-plasma-mobile.post-install index dff2ea98..3ab6a550 100644 --- a/aports/main/postmarketos-ui-plasma-mobile/postmarketos-ui-plasma-mobile.post-install +++ b/aports/main/postmarketos-ui-plasma-mobile/postmarketos-ui-plasma-mobile.post-install @@ -3,7 +3,7 @@ . /etc/deviceinfo # Autologin on tty1, let busybox autoconfigure 2-6 -autologin="$(getent passwd 1000 | cut -d ":" -f 1)" +autologin="$(getent passwd 10000 | cut -d ":" -f 1)" for i in 1 2 3 4 5 6; do old="^tty$i::respawn:/sbin/getty 38400 tty$i" new="# tty$i::respawn:/sbin/getty 38400 tty$i" diff --git a/aports/main/postmarketos-ui-weston/APKBUILD b/aports/main/postmarketos-ui-weston/APKBUILD index 30162c6c..6dfdf131 100644 --- a/aports/main/postmarketos-ui-weston/APKBUILD +++ b/aports/main/postmarketos-ui-weston/APKBUILD @@ -1,6 +1,6 @@ pkgname=postmarketos-ui-weston pkgver=4 -pkgrel=4 +pkgrel=5 pkgdesc="(Wayland) Reference compositor (demo, not a phone interface)" url="https://postmarketos.org" arch="noarch" @@ -21,6 +21,6 @@ package() { install -Dm644 "$srcdir"/weston.ini.default \ "$pkgdir"/etc/xdg/weston/weston.ini.default } -sha512sums="4de1a34464db86dd25b306efb676c292152df093daa7850af3cb1b9fe198c01f9ab6a02d171b61b43af4d60009991182f18b9727bad3fd3d763df3797cbdb716 start_weston.sh +sha512sums="6c278d6018e7a1eea1e7285a93dc2fc6c0598c96e8cc5dc094e98be4d07edc6a5a10332d6f12f64ae7a9489b375a67b24e553569e71b274d1b681a0c4658450d start_weston.sh b712c9d4c846437656781656ec15e9b7e238a9244e0b77bf84b67f6661d44f68718330706f69ccb8b4d7f6182b8f17f273018ca461c0c40e49b9185f6eec168d weston.ini.default -794827b6878cdca8231fc106ba649a3e9aa9f74df0ef7e5e3598462b3c93c67cb3b0af95cadb92a62471730a518024ae6be95c0fc59af6b929482148f16c2184 postmarketos-ui-weston.post-install" +d8f748b896c5cc474b76cc9d87a0becb4e44ae7220f5cb9468f2e0ecabdc2207739754064489b8e21cd87214058f2a5c6c24cff1688e2eb50999b2feea3f9217 postmarketos-ui-weston.post-install" diff --git a/aports/main/postmarketos-ui-weston/postmarketos-ui-weston.post-install b/aports/main/postmarketos-ui-weston/postmarketos-ui-weston.post-install index feb04993..44ee3f01 100644 --- a/aports/main/postmarketos-ui-weston/postmarketos-ui-weston.post-install +++ b/aports/main/postmarketos-ui-weston/postmarketos-ui-weston.post-install @@ -3,7 +3,7 @@ . /etc/deviceinfo # Autologin on tty1, let busybox autoconfigure 2-6 -autologin="$(getent passwd 1000 | cut -d ":" -f 1)" +autologin="$(getent passwd 10000 | cut -d ":" -f 1)" for i in 1 2 3 4 5 6; do old="^tty$i::respawn:/sbin/getty 38400 tty$i" new="# tty$i::respawn:/sbin/getty 38400 tty$i" @@ -13,5 +13,5 @@ done # Create weston-launch group and add user to it [ $(getent group weston-launch) ] || groupadd weston-launch -username="$(getent passwd 1000 | cut -d ":" -f 1)" +username="$(getent passwd 10000 | cut -d ":" -f 1)" usermod -a -G weston-launch "$username" diff --git a/aports/main/postmarketos-ui-weston/start_weston.sh b/aports/main/postmarketos-ui-weston/start_weston.sh index af6edf7d..8dea3e7d 100644 --- a/aports/main/postmarketos-ui-weston/start_weston.sh +++ b/aports/main/postmarketos-ui-weston/start_weston.sh @@ -12,7 +12,7 @@ if test -z "${XDG_RUNTIME_DIR}"; then # Weston autostart on tty1 (Autologin on tty1 is enabled in # /etc/inittab by postmarketos-base post-install.hook) - if [ "$(id -u)" = "1000" ] && [ $(tty) = "/dev/tty1" ]; then + if [ "$(id -u)" = "10000" ] && [ $(tty) = "/dev/tty1" ]; then # Find right weston.ini cfg="/etc/xdg/weston/weston.ini" diff --git a/aports/main/postmarketos-ui-xfce4/APKBUILD b/aports/main/postmarketos-ui-xfce4/APKBUILD index 2d6b3a5c..605ff800 100644 --- a/aports/main/postmarketos-ui-xfce4/APKBUILD +++ b/aports/main/postmarketos-ui-xfce4/APKBUILD @@ -1,6 +1,6 @@ pkgname=postmarketos-ui-xfce4 pkgver=0.2 -pkgrel=2 +pkgrel=3 pkgdesc="(X11) Lightweight GTK+2 desktop (stylus recommended)" url="https://gitlab.com/postmarketOS/xfce4-phone" arch="noarch" @@ -22,5 +22,5 @@ package() { cp -a "$builddir"/config "$pkgdir"/etc/skel/.config } -sha512sums="6cf45653ca0c96eb7fe0a7b78db1565e24e7893a2113b9eabf22285cb58b90a41b94c69de2b3a316ab759719f715555751cc51a30e00f358b940d694e7850625 start_xfce4.sh +sha512sums="14bc00ba8b4970f044753d648c3f4ac0a289c98c8586ab9eb79236eef93e771a3306694daa6e957d9c9e396e52bccfdfa3e88ea9e53e3c78b32470bc3b1ea5ff start_xfce4.sh 4321a2a24b45f0d33b586ef098cfb236d87f557e7e2fecb180774d1cb1bc9fa1edfe6ce8a1faa646adcb026b4ef1b03b477eae0c46f4c46c8488baabb9c382e3 postmarketos-ui-xfce4-0.2.tar.gz" diff --git a/aports/main/postmarketos-ui-xfce4/postmarketos-ui-xfce4.post-install b/aports/main/postmarketos-ui-xfce4/postmarketos-ui-xfce4.post-install index ffb794ce..b919f2df 100644 --- a/aports/main/postmarketos-ui-xfce4/postmarketos-ui-xfce4.post-install +++ b/aports/main/postmarketos-ui-xfce4/postmarketos-ui-xfce4.post-install @@ -3,7 +3,7 @@ . /etc/deviceinfo # Autologin on tty1, let busybox autoconfigure 2-6 -autologin="$(getent passwd 1000 | cut -d ":" -f 1)" +autologin="$(getent passwd 10000 | cut -d ":" -f 1)" for i in 1 2 3 4 5 6; do old="^tty$i::respawn:/sbin/getty 38400 tty$i" new="# tty$i::respawn:/sbin/getty 38400 tty$i" diff --git a/aports/main/postmarketos-ui-xfce4/start_xfce4.sh b/aports/main/postmarketos-ui-xfce4/start_xfce4.sh index 38e1b427..5148704c 100644 --- a/aports/main/postmarketos-ui-xfce4/start_xfce4.sh +++ b/aports/main/postmarketos-ui-xfce4/start_xfce4.sh @@ -4,7 +4,7 @@ # /etc/inittab by postmarketos-base post-install.hook). # This is a temporary solution, we'll need something like a # display manager in the long run (#656). -if [ "$(id -u)" = "1000" ] && [ "$(tty)" = "/dev/tty1" ]; then +if [ "$(id -u)" = "10000" ] && [ "$(tty)" = "/dev/tty1" ]; then # Start X11 with XFCE4 ck-launch-session dbus-launch --exit-with-session startxfce4 2>&1 | logger -t "$(whoami):x11" diff --git a/pmb/config/__init__.py b/pmb/config/__init__.py index 3e4818ef..9b16f85b 100644 --- a/pmb/config/__init__.py +++ b/pmb/config/__init__.py @@ -42,7 +42,7 @@ apk_tools_static_min_version = "2.9.0-r0" # Version of the work folder (as asked during 'pmbootstrap init'). Increase # this number, whenever migration is required and provide the migration code, # see migrate_work_folder()). -work_version = 2 +work_version = 3 # Only save keys to the config file, which we ask for in 'pmbootstrap init'. config_keys = ["ccache_size", "device", "extra_packages", "hostname", "jobs", diff --git a/pmb/helpers/other.py b/pmb/helpers/other.py index 9c1d7211..e2d65215 100644 --- a/pmb/helpers/other.py +++ b/pmb/helpers/other.py @@ -134,6 +134,22 @@ def migrate_work_folder(args): migrate_success(args, 2) current = 2 + if current == 2: + # Ask for confirmation + logging.info("Changelog:") + logging.info("* Device chroots have a different user UID (#1576)") + logging.info("Migration will do the following:") + logging.info("* Zap your chroots") + if not pmb.helpers.cli.confirm(args): + raise RuntimeError("Aborted.") + + # Zap chroots + pmb.chroot.zap(args, False) + + # Update version file + migrate_success(args, 3) + current = 3 + # Can't migrate, user must delete it if current != required: raise RuntimeError("Sorry, we can't migrate that automatically. Please" diff --git a/pmb/install/_install.py b/pmb/install/_install.py index 9b29fdef..03abb7f5 100644 --- a/pmb/install/_install.py +++ b/pmb/install/_install.py @@ -156,7 +156,7 @@ def create_home_from_skel(args): homedir = rootfs + "/home/" + args.user pmb.helpers.run.root(args, ["mkdir", rootfs + "/home"]) pmb.helpers.run.root(args, ["cp", "-a", rootfs + "/etc/skel", homedir]) - pmb.helpers.run.root(args, ["chown", "-R", "1000", homedir]) + pmb.helpers.run.root(args, ["chown", "-R", "10000", homedir]) def configure_apk(args): @@ -177,11 +177,14 @@ def configure_apk(args): def set_user(args): """ - Create user with UID 1000 if it doesn't exist + Create user with UID 10000 if it doesn't exist. + Usually the ID for the first user created is 1000, but higher ID is + chosen here to avoid conflict with Android UIDs/GIDs. + """ suffix = "rootfs_" + args.device if not pmb.chroot.user_exists(args, args.user, suffix): - pmb.chroot.root(args, ["adduser", "-D", "-u", "1000", args.user], + pmb.chroot.root(args, ["adduser", "-D", "-u", "10000", args.user], suffix) for group in pmb.config.install_user_groups: pmb.chroot.root(args, ["addgroup", "-S", group], suffix, @@ -238,7 +241,7 @@ def copy_ssh_keys(args): pmb.helpers.run.root(args, ["chmod", "700", target]) pmb.helpers.run.root(args, ["cp", authorized_keys, target + "/authorized_keys"]) pmb.helpers.run.root(args, ["rm", authorized_keys]) - pmb.helpers.run.root(args, ["chown", "-R", "1000:1000", target]) + pmb.helpers.run.root(args, ["chown", "-R", "10000:10000", target]) def setup_keymap(args):