add nearly enter rw before installing DE

This commit is contained in:
Rudra Saraswat 2023-01-26 15:14:33 +05:30
parent 30ff683656
commit 5c22f497b3

10
blend
View file

@ -197,6 +197,8 @@ def install_de():
info(f'installing {name} on {args.container_name} (using {args.distro})') info(f'installing {name} on {args.container_name} (using {args.distro})')
print() print()
info('ignore any errors after this') info('ignore any errors after this')
try:
subprocess.run('sudo nearly enter rw', shell=True)
distrobox_run_container('sudo umount /run/systemd/system') distrobox_run_container('sudo umount /run/systemd/system')
distrobox_run_container('sudo rmdir /run/systemd/system') distrobox_run_container('sudo rmdir /run/systemd/system')
distrobox_run_container('sudo ln -s /run/host/run/systemd/system /run/systemd &> /dev/null') distrobox_run_container('sudo ln -s /run/host/run/systemd/system /run/systemd &> /dev/null')
@ -294,6 +296,14 @@ def install_de():
subprocess.run(f'sudo chmod 755 /usr/share/xsessions/gnome-xorg-{args.container_name}.desktop', stdout=subprocess.DEVNULL, shell=True) subprocess.run(f'sudo chmod 755 /usr/share/xsessions/gnome-xorg-{args.container_name}.desktop', stdout=subprocess.DEVNULL, shell=True)
distrobox_run_container('sudo mkdir -p /usr/share/applications /usr/local/share/applications') distrobox_run_container('sudo mkdir -p /usr/share/applications /usr/local/share/applications')
distrobox_run_container('''echo 'for dir in /usr/share/applications /usr/local/share/applications; do sudo find $dir -type f -exec sed -i -e '"'s/DBusActivatable=.*//g'"' {} '"';'"'; done' | sudo bash''') distrobox_run_container('''echo 'for dir in /usr/share/applications /usr/local/share/applications; do sudo find $dir -type f -exec sed -i -e '"'s/DBusActivatable=.*//g'"' {} '"';'"'; done' | sudo bash''')
subprocess.run('sudo nearly enter ro', shell=True)
except:
try:
subprocess.call(['sudo', 'nearly', 'enter', 'ro'])
except KeyboardInterrupt:
error('looks like you interrupted blend. your system is currently in read-write mode')
info('run `nearly enter ro\' to enable immutability again')
exit(1)
def copy_desktop_files(pkg): def copy_desktop_files(pkg):
distrobox_run_container(f'CONTAINER_ID={args.container_name} distrobox-export --app {pkg} &>/dev/null') distrobox_run_container(f'CONTAINER_ID={args.container_name} distrobox-export --app {pkg} &>/dev/null')