mirror of
				https://git.launchpad.net/livecd-rootfs
				synced 2025-11-04 10:54:07 +00:00 
			
		
		
		
	Import patches-unapplied version 2.430 to ubuntu/yakkety-proposed
Imported using git-ubuntu import.
Changelog parent: 8d920803b00bef5b15a0315639a72f2338d6e490
New changelog entries:
  [ Michael Vogt ]
  * live-build/ubuntu-core/hooks/01-setup_user.chroot:
    - do not create "ubuntu" user for ubuntu-core anymore, the
      console-conf package will create this user now
  * live-build/ubuntu-core/hooks/02-add_user_to_groups.chroot
    - dropped
  [ Steve Langasek ]
  * live-build/ubuntu-cpc/hooks/042-vagrant.binary: fix unmount handling
    so that the teardown is done properly /before/ we try to make an
    image from our filesystem, since otherwise /etc/resolv.conf is broken.
    LP: #1621393.
			
			
This commit is contained in:
		
							parent
							
								
									8d920803b0
								
							
						
					
					
						commit
						326e7b0b97
					
				
							
								
								
									
										17
									
								
								debian/changelog
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										17
									
								
								debian/changelog
									
									
									
									
										vendored
									
									
								
							@ -1,3 +1,20 @@
 | 
			
		||||
livecd-rootfs (2.430) yakkety; urgency=medium
 | 
			
		||||
 | 
			
		||||
  [ Michael Vogt ]
 | 
			
		||||
  * live-build/ubuntu-core/hooks/01-setup_user.chroot:
 | 
			
		||||
    - do not create "ubuntu" user for ubuntu-core anymore, the
 | 
			
		||||
      console-conf package will create this user now
 | 
			
		||||
  * live-build/ubuntu-core/hooks/02-add_user_to_groups.chroot
 | 
			
		||||
    - dropped
 | 
			
		||||
 | 
			
		||||
  [ Steve Langasek ]
 | 
			
		||||
  * live-build/ubuntu-cpc/hooks/042-vagrant.binary: fix unmount handling
 | 
			
		||||
    so that the teardown is done properly /before/ we try to make an
 | 
			
		||||
    image from our filesystem, since otherwise /etc/resolv.conf is broken.
 | 
			
		||||
    LP: #1621393.
 | 
			
		||||
 | 
			
		||||
 -- Steve Langasek <steve.langasek@ubuntu.com>  Fri, 09 Sep 2016 15:57:27 -0700
 | 
			
		||||
 | 
			
		||||
livecd-rootfs (2.429) yakkety; urgency=medium
 | 
			
		||||
 | 
			
		||||
  * live-build/auto/build: Fix typo in netplan policy snippet.
 | 
			
		||||
 | 
			
		||||
@ -2,42 +2,23 @@
 | 
			
		||||
 | 
			
		||||
set -e
 | 
			
		||||
 | 
			
		||||
USER=ubuntu
 | 
			
		||||
UGID=1000
 | 
			
		||||
# There is no default user anymore, console-conf is responsible
 | 
			
		||||
# for creating one
 | 
			
		||||
 | 
			
		||||
echo "I: creating default user $USER"
 | 
			
		||||
adduser --gecos $USER --disabled-login $USER --uid $UGID
 | 
			
		||||
 | 
			
		||||
for extragroup in adm sudo; do
 | 
			
		||||
    adduser $USER $extragroup
 | 
			
		||||
# setup the required files for extrausers
 | 
			
		||||
for name in group gshadow passwd shadow subuid subgid; do
 | 
			
		||||
    touch /var/lib/extrausers/$name
 | 
			
		||||
done
 | 
			
		||||
 | 
			
		||||
chown -R $UGID:$UGID /home/$USER
 | 
			
		||||
for name in gshadow shadow; do
 | 
			
		||||
    chmod 640 /var/lib/extrausers/$name
 | 
			
		||||
    chown root:shadow /var/lib/extrausers/$name
 | 
			
		||||
done
 | 
			
		||||
 | 
			
		||||
# 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
 | 
			
		||||
touch /var/lib/extrausers/subuid
 | 
			
		||||
touch /var/lib/extrausers/subgid
 | 
			
		||||
 | 
			
		||||
# needs to run *after* the user was moved out to /var/lib/extrausers
 | 
			
		||||
echo "I: set user $USER password to $USER"
 | 
			
		||||
echo "$USER:$USER" | chpasswd
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,8 +0,0 @@
 | 
			
		||||
#!/bin/sh -x
 | 
			
		||||
 | 
			
		||||
USER=ubuntu
 | 
			
		||||
 | 
			
		||||
DEFGROUPS="docker,sudo"
 | 
			
		||||
 | 
			
		||||
echo "I: add $USER to ($DEFGROUPS) group(s)"
 | 
			
		||||
usermod -a -G ${DEFGROUPS} ${USER}
 | 
			
		||||
@ -39,7 +39,9 @@ create_derivative "disk" "vagrant" #sets ${derivative_img}
 | 
			
		||||
mount_disk_image ${derivative_img} ${mount_d}
 | 
			
		||||
 | 
			
		||||
cleanup_vagrant() {
 | 
			
		||||
    umount_disk_image ${mount_d}
 | 
			
		||||
    if [ -d "$mount_d" ]; then
 | 
			
		||||
        umount_disk_image "$mount_d"
 | 
			
		||||
    fi
 | 
			
		||||
    rm -rf ${box_d} ${seed_d} ${mount_d} ${derivative_img}
 | 
			
		||||
}
 | 
			
		||||
trap cleanup_vagrant EXIT
 | 
			
		||||
@ -49,6 +51,8 @@ chroot ${mount_d} apt-get update
 | 
			
		||||
# avoid pulling into a cloud image.
 | 
			
		||||
chroot ${mount_d} apt-get install --no-install-recommends -y virtualbox-guest-utils
 | 
			
		||||
chroot ${mount_d} apt-get clean
 | 
			
		||||
umount_disk_image "$mount_d"
 | 
			
		||||
rmdir "$mount_d"
 | 
			
		||||
 | 
			
		||||
# Used to identify bits
 | 
			
		||||
suite=$(chroot chroot lsb_release -c -s)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user