File tree Expand file tree Collapse file tree 1 file changed +17
-8
lines changed
pkg/cidata/cidata.TEMPLATE.d/boot Expand file tree Collapse file tree 1 file changed +17
-8
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
- # Remove the user embedded in the image,
3
- # and use cloud-init for users and groups.
4
2
test -f /etc/alpine-release || exit 0
5
- test " $LIMA_CIDATA_USER " ! = " alpine" || exit 0
6
3
7
- if [ " $( id -u alpine 2>&1 ) " = " 1000" ]; then
8
- userdel alpine
9
- rmdir /home/alpine
10
- cloud-init clean --logs
11
- reboot
4
+ # Make sure that root is in the sudoers file.
5
+ # This is needed to run the user provisioning scripts.
6
+ SUDOERS=/etc/sudoers.d/00-root-user
7
+ if [ ! -f $SUDOERS ]; then
8
+ echo " root ALL=(ALL) NOPASSWD:ALL" > $SUDOERS
9
+ chmod 660 $SUDOERS
10
+ fi
11
+
12
+ # Remove the user embedded in the image,
13
+ # and use cloud-init for users and groups.
14
+ if [ " $LIMA_CIDATA_USER " != " alpine" ]; then
15
+ if [ " $( id -u alpine 2>&1 ) " = " 1000" ]; then
16
+ userdel alpine
17
+ rmdir /home/alpine
18
+ cloud-init clean --logs
19
+ reboot
20
+ fi
12
21
fi
You can’t perform that action at this time.
0 commit comments