2013-05-01 12:05:41 -07:00
|
|
|
#!/bin/sh -x
|
|
|
|
|
|
|
|
USER=phablet
|
Import patches-unapplied version 2.376 to ubuntu/xenial-proposed
Imported using git-ubuntu import.
Changelog parent: 80fddc56a2b4d6ed82dcce3ef56028b37e40705a
New changelog entries:
[ Michael Terry ]
* Change real name for phablet user to "Ubuntu" in ubuntu-touch.
[ Steve Langasek ]
* Drop BuildLiveCD from the examples; we now use launchpad-buildd to drive
livefs builds, so BuildLiveCD is obsolete and misleading.
* Add hooks to ubuntu-cpc to divert /bin/sync in the chroot and undivert it
at the end. This is a general-purpose change that should be applied to
all flavors and archs, but at the moment it's only needed on armhf+raspi2
to work around the raspberrypi2-firmware postinst calling sync, which is
actually warranted in the normal case.
* If a subarch is specified for a cloud image build, don't build rootfs
artifacts; these should come from the 'generic' build.
* Fix architecture handling in hooks. We know we're always being invoked
from a launchpad-buildd-like setup, which passes ARCH and SUBARCH in the
environment, because auto/config and auto/build both rely on this. So
don't scatter dpkg --print-architecture calls throughout, especially
when many of these are not cross-build-aware.
* Refactor ubuntu-cpc hooks to allow us to handle images where the root
partition should not be partition 1.
[ Ben Howard ]
* ubuntu-cpc: fix hooks/032-disk-image.binary call to
create_empty_partition, which requires five args due to "-u"
* ubuntu-cpc: in hooks/030-root-tarball.binary create /lib/modules to fix
(LP: 1543204).
[ Dimitri John Ledkov ]
* Do not remove linux-base, when purging all the linux-*, in the tarball
build. Otherwise ubuntu-minimal is removed, and things get crazy.
* Correct initrd.img symlink, kernel/hooks should actually produce the
right thing here, but meh.
* Chroot to execute zipl, because it's nice.
* Use the right loop device to install zipl onto.
[ Steve Langasek ]
* Refactor ubuntu-cpc hooks to always produce a 'plain' rootfs via
live-build and reuse this for the tarball, instead of lb_binary_rootfs
creating some artifact that we ignore / throw away.
* Initial support for raspi2 subarch.
* Import live-build/ubuntu-cpc/hooks/raspi2/mkknlimg from
https://github.com/raspberrypi/linux/blob/rpi-4.1.y/scripts/mkknlimg
and use it to install a bootable uboot.bin.
2016-02-12 21:14:49 +00:00
|
|
|
GECOS=Ubuntu
|
2013-05-01 12:05:41 -07:00
|
|
|
UGID=32011
|
|
|
|
|
|
|
|
echo "I: creating default user $USER"
|
Import patches-unapplied version 2.376 to ubuntu/xenial-proposed
Imported using git-ubuntu import.
Changelog parent: 80fddc56a2b4d6ed82dcce3ef56028b37e40705a
New changelog entries:
[ Michael Terry ]
* Change real name for phablet user to "Ubuntu" in ubuntu-touch.
[ Steve Langasek ]
* Drop BuildLiveCD from the examples; we now use launchpad-buildd to drive
livefs builds, so BuildLiveCD is obsolete and misleading.
* Add hooks to ubuntu-cpc to divert /bin/sync in the chroot and undivert it
at the end. This is a general-purpose change that should be applied to
all flavors and archs, but at the moment it's only needed on armhf+raspi2
to work around the raspberrypi2-firmware postinst calling sync, which is
actually warranted in the normal case.
* If a subarch is specified for a cloud image build, don't build rootfs
artifacts; these should come from the 'generic' build.
* Fix architecture handling in hooks. We know we're always being invoked
from a launchpad-buildd-like setup, which passes ARCH and SUBARCH in the
environment, because auto/config and auto/build both rely on this. So
don't scatter dpkg --print-architecture calls throughout, especially
when many of these are not cross-build-aware.
* Refactor ubuntu-cpc hooks to allow us to handle images where the root
partition should not be partition 1.
[ Ben Howard ]
* ubuntu-cpc: fix hooks/032-disk-image.binary call to
create_empty_partition, which requires five args due to "-u"
* ubuntu-cpc: in hooks/030-root-tarball.binary create /lib/modules to fix
(LP: 1543204).
[ Dimitri John Ledkov ]
* Do not remove linux-base, when purging all the linux-*, in the tarball
build. Otherwise ubuntu-minimal is removed, and things get crazy.
* Correct initrd.img symlink, kernel/hooks should actually produce the
right thing here, but meh.
* Chroot to execute zipl, because it's nice.
* Use the right loop device to install zipl onto.
[ Steve Langasek ]
* Refactor ubuntu-cpc hooks to always produce a 'plain' rootfs via
live-build and reuse this for the tarball, instead of lb_binary_rootfs
creating some artifact that we ignore / throw away.
* Initial support for raspi2 subarch.
* Import live-build/ubuntu-cpc/hooks/raspi2/mkknlimg from
https://github.com/raspberrypi/linux/blob/rpi-4.1.y/scripts/mkknlimg
and use it to install a bootable uboot.bin.
2016-02-12 21:14:49 +00:00
|
|
|
adduser --gecos $GECOS --disabled-login $USER --uid $UGID
|
2013-05-01 12:05:41 -07:00
|
|
|
|
2014-07-24 15:49:48 -07:00
|
|
|
echo "I: set user $USER password to blank"
|
|
|
|
passwd -d $USER
|
2013-08-14 11:01:47 +02:00
|
|
|
|
2013-05-01 12:05:41 -07:00
|
|
|
adduser --gecos system --no-create-home --disabled-login --disabled-password system --uid 1000
|
2013-07-25 11:14:34 +02:00
|
|
|
adduser --gecos radio --no-create-home --disabled-login --disabled-password radio --uid 1001
|
2013-05-01 12:05:41 -07:00
|
|
|
|
2014-07-24 15:49:48 -07:00
|
|
|
# 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
|
2014-09-22 16:02:58 -04:00
|
|
|
grep "^$USER" /etc/gshadow >> /var/lib/extrausers/gshadow
|
2014-07-24 15:49:48 -07:00
|
|
|
chmod 0644 /var/lib/extrausers/group
|
|
|
|
chmod 0644 /var/lib/extrausers/passwd
|
|
|
|
chmod 0640 /var/lib/extrausers/shadow
|
2014-09-22 16:02:58 -04:00
|
|
|
chmod 0640 /var/lib/extrausers/gshadow
|
2014-07-24 15:49:48 -07:00
|
|
|
chown root:shadow /var/lib/extrausers/shadow
|
2014-09-22 16:02:58 -04:00
|
|
|
chown root:shadow /var/lib/extrausers/gshadow
|
2014-07-24 15:49:48 -07:00
|
|
|
sed -i "/^$USER/d" /etc/group
|
|
|
|
sed -i "/^$USER/d" /etc/passwd
|
|
|
|
sed -i "/^$USER/d" /etc/shadow
|
2014-09-22 16:02:58 -04:00
|
|
|
sed -i "/^$USER/d" /etc/gshadow
|
2015-09-10 12:22:57 +01:00
|
|
|
touch /var/lib/extrausers/subuid
|
|
|
|
touch /var/lib/extrausers/subgid
|
2014-07-24 15:49:48 -07:00
|
|
|
|
2013-08-14 11:01:47 +02:00
|
|
|
# Prevent the system user from being presented in the greeter by bumping MIN_UID
|
|
|
|
sed -i 's/^\(UID_MIN\s\+\).*/\11002/g' /etc/login.defs
|
|
|
|
|
2013-05-01 12:05:41 -07:00
|
|
|
mkdir -p /home/$USER/Music
|
|
|
|
mkdir -p /home/$USER/Pictures
|
|
|
|
mkdir -p /home/$USER/Videos
|
|
|
|
mkdir -p /home/$USER/Downloads
|
|
|
|
mkdir -p /home/$USER/Documents
|
|
|
|
chown -R $UGID:$UGID /home/$USER
|