fix guest addition installation, fixes wallpaper that doesn't work before user creation, and add brand new buildozer.desktop

This commit is contained in:
Mathieu Virbel 2017-05-13 02:38:27 +02:00
parent b522bf9c49
commit 70995b1989
5 changed files with 44 additions and 15 deletions

1
buildozer/tools/packer/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
packer_cache

View file

@ -0,0 +1,7 @@
[Desktop Entry]
Version=1.0
Type=Application
Name=Buildozer
Exec=firefox -url "file:///usr/share/applications/buildozer-welcome/index.html" -width 600 -height 800
Icon=/usr/share/applications/buildozer-welcome/icon.png
Categories=Application;Development;favourite;

View file

@ -3,11 +3,10 @@
# Mount the disk image # Mount the disk image
cd /tmp cd /tmp
mkdir /tmp/isomount mkdir /tmp/isomount
mount -t iso9660 -o loop /root/VBoxGuestAdditions.iso /tmp/isomount mount -t iso9660 /dev/sr1 /tmp/isomount
# Install the drivers # Install the drivers
/tmp/isomount/VBoxLinuxAdditions.run /tmp/isomount/VBoxLinuxAdditions.run
# Cleanup # Cleanup
umount isomount umount isomount
rm -rf isomount /root/VBoxGuestAdditions.iso

View file

@ -1,5 +1,22 @@
#!/bin/bash #!/bin/bash
export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus" # xfconf doesn't work with sudo, even with XAUTHORITY + DISPLAY
# seems that the user need to log to be able to use them.
# keep them for reference for now.
# change theme (works better for this wallpaper)
# xfconf-query -c xfce4-desktop \
# --property /backdrop/screen0/monitor0/workspace0/last-image \
# --set /usr/share/backgrounds/kivy-wallpaper.png
# xfconf-query -c xsettings \
# --property /Net/ThemeName \
# --set Adwaita
# xfconf-query -c xsettings \
# --property /Net/IconThemeName \
# --set elementary-xfce-darker
set -x
# ensure the kivy user can mount shared folders # ensure the kivy user can mount shared folders
adduser kivy vboxsf adduser kivy vboxsf
@ -16,22 +33,27 @@ chown kivy.kivy /home/kivy/.face
# set wallpaper # set wallpaper
wget $PACKER_HTTP_ADDR/wallpaper.png wget $PACKER_HTTP_ADDR/wallpaper.png
mv wallpaper.png /usr/share/backgrounds/kivy-wallpaper.png mv wallpaper.png /usr/share/backgrounds/kivy-wallpaper.png
xfconf-query -c xfce4-desktop \ sed -i "s:/usr/share/xfce4/backdrops/xubuntu-wallpaper.png:/usr/share/backgrounds/kivy-wallpaper.png:g" /etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml
--property /backdrop/screen0/monitor0/workspace0/last-image \ sed -i "s:Greybird:Adwaita:g" /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml
--set /usr/share/backgrounds/kivy-wallpaper.png sed -i "s:Greybird:Adwaita:g" /etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml
sed -i "s:Greybird:Adwaita:g" /etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml
sed -i "s:Greybird:Adwaita:g" /etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/xfce4-notifyd.xml
sed -i "s:elementary-xfce-dark:elementary-xfce-darkest:g" /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml
# change theme (works better for this wallpaper) # add desktop icon
xfconf-query -c xsettings \ wget $PACKER_HTTP_ADDR/buildozer.desktop
--property /Net/ThemeName \ mkdir -p /home/kivy/Desktop
--set Adwaita cp buildozer.desktop /home/kivy/Desktop/
xfconf-query -c xsettings \ chown kivy.kivy /home/kivy/Desktop
--property /Net/IconThemeName \ mv buildozer.desktop /usr/share/applications/
--set elementary-xfce-darker sed -i "s:^favorites=.*$:favorites=buildozer.desktop,exo-terminal-emulator.desktop,exo-web-browser.desktop,exo-file-manager.desktop,org.gnome.Software.desktop,xfhelp4.desktop:g" /etc/xdg/xdg-xubuntu/xfce4/whiskermenu/defaults.rc
# copy welcome directory # copy welcome directory
mkdir -p /usr/share/applications/buildozer-welcome mkdir -p /usr/share/applications/buildozer-welcome
cd /usr/share/applications/buildozer-welcome cd /usr/share/applications/buildozer-welcome
wget $PACKER_HTTP_ADDR/welcome/milligram.min.css wget $PACKER_HTTP_ADDR/welcome/milligram.min.css
wget $PACKER_HTTP_ADDR/welcome/buildozer.css wget $PACKER_HTTP_ADDR/welcome/buildozer.css
wget $PACKER_HTTP_ADDR/welcome/index.css wget $PACKER_HTTP_ADDR/welcome/index.html
wget $PACKER_HTTP_ADDR/kivy-icon-96.png
mv kivy-icon-96.png icon.png
cd - cd -

View file

@ -33,7 +33,7 @@
"shutdown_command": "echo {{user `ssh_password`}} | sudo -S shutdown -P now", "shutdown_command": "echo {{user `ssh_password`}} | sudo -S shutdown -P now",
"vm_name": "Kivy/Buildozer VM", "vm_name": "Kivy/Buildozer VM",
"guest_os_type": "Ubuntu_64", "guest_os_type": "Ubuntu_64",
"guest_additions_path": "/root", "guest_additions_mode": "attach",
"ssh_wait_timeout": "120m" "ssh_wait_timeout": "120m"
}], }],
"provisioners": [{ "provisioners": [{