From d1b1d9e6c18be9ab93e3e899778b00ed5b3af2f4 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 14 Jan 2015 18:04:34 +0100 Subject: [PATCH] * live-build/ubuntu-core/hooks/00-uid-gid-fix.chroot_early: - port static uid/gid setup from ubuntu-touch * live-build/ubuntu-core/hooks/15-pycompile-snappy.chroot: - byte compile .pyc files for snappy --- debian/changelog | 9 ++++++++ .../ubuntu-core/hooks/01-setup_user.chroot | 21 +++++++++++++++++++ .../hooks/15-pycompile-snappy.chroot | 6 ++++++ 3 files changed, 36 insertions(+) create mode 100644 live-build/ubuntu-core/hooks/15-pycompile-snappy.chroot diff --git a/debian/changelog b/debian/changelog index 938ef59e..b1f04778 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +livecd-rootfs (2.275+ppa1) vivid; urgency=low + + * live-build/ubuntu-core/hooks/00-uid-gid-fix.chroot_early: + - port static uid/gid setup from ubuntu-touch + * live-build/ubuntu-core/hooks/15-pycompile-snappy.chroot: + - byte compile .pyc files for snappy + + -- Michael Vogt Wed, 07 Jan 2015 09:36:11 +0100 + livecd-rootfs (2.275) vivid; urgency=low [ Michael Vogt ] diff --git a/live-build/ubuntu-core/hooks/01-setup_user.chroot b/live-build/ubuntu-core/hooks/01-setup_user.chroot index a8689e3b..c4a35f05 100755 --- a/live-build/ubuntu-core/hooks/01-setup_user.chroot +++ b/live-build/ubuntu-core/hooks/01-setup_user.chroot @@ -10,3 +10,24 @@ echo "I: set user $USER password to $USER" echo "$USER:$USER" | chpasswd chown -R $UGID:$UGID /home/$USER + +# Enable libnss-extrusers +sed -i 's/^group:.*compat/\0 extrausers/' /etc/nsswitch.conf +sed -i 's/^passwd:.*compat/\0 extrausers/' /etc/nsswitch.conf +sed -i 's/^shadow:.*compat/\0 extrausers/' /etc/nsswitch.conf + +# Move user from /etc to extrausers location +grep "^$USER" /etc/group >> /var/lib/extrausers/group +grep "^$USER" /etc/passwd >> /var/lib/extrausers/passwd +grep "^$USER" /etc/shadow >> /var/lib/extrausers/shadow +grep "^$USER" /etc/gshadow >> /var/lib/extrausers/gshadow +chmod 0644 /var/lib/extrausers/group +chmod 0644 /var/lib/extrausers/passwd +chmod 0640 /var/lib/extrausers/shadow +chmod 0640 /var/lib/extrausers/gshadow +chown root:shadow /var/lib/extrausers/shadow +chown root:shadow /var/lib/extrausers/gshadow +sed -i "/^$USER/d" /etc/group +sed -i "/^$USER/d" /etc/passwd +sed -i "/^$USER/d" /etc/shadow +sed -i "/^$USER/d" /etc/gshadow diff --git a/live-build/ubuntu-core/hooks/15-pycompile-snappy.chroot b/live-build/ubuntu-core/hooks/15-pycompile-snappy.chroot new file mode 100644 index 00000000..1b8b391c --- /dev/null +++ b/live-build/ubuntu-core/hooks/15-pycompile-snappy.chroot @@ -0,0 +1,6 @@ +#!/bin/sh + +set -e + +# ensure python create the byte .pyc files for snappy +snappy -v \ No newline at end of file