OSDN Git Service

fixed number and calamares bootloader
[alterlinux/LFBS.git] / channels / serene / airootfs / root / customize_airootfs_serene.sh
1 #!/usr/bin/env bash
2
3 while getopts 'p:bt:k:rxu:o:i:s:da:g:z:l:' arg; do
4     case "${arg}" in
5         p) password="${OPTARG}" ;;
6         b) boot_splash=true ;;
7         t) theme_name="${OPTARG}" ;;
8         k) kernel_config_line=(${OPTARG}) ;;
9         r) rebuild=true ;;
10         u) username="${OPTARG}" ;;
11         o) os_name="${OPTARG}" ;;
12         i) install_dir="${OPTARG}" ;;
13         s) usershell="${OPTARG}" ;;
14         d) debug=true ;;
15         x) debug=true; set -xv ;;
16         a) arch="${OPTARG}" ;;
17         g) localegen="${OPTARG}" ;;
18         z) timezone="${OPTARG}" ;;
19         l) language="${OPTARG}" ;;
20     esac
21 done
22 systemctl enable lightdm.service
23 sed -i s/%USERNAME%/${username}/g /etc/lightdm/lightdm.conf
24 dconf update
25 # Set os name
26 sed -i s/%OS_NAME%/"${os_name}"/g /etc/skel/Desktop/calamares.desktop
27 sed -i s/%OS_NAME%/"${os_name}"/g /home/${username}/Desktop/calamares.desktop
28
29 # Create Calamares Entry
30 cp -f /etc/skel/Desktop/calamares.desktop /usr/share/applications/calamares.desktop
31
32 unlink /usr/share/backgrounds/images/default.png
33 ln -s /usr/share/backgrounds/serene-wallpaper-1.png /usr/share/backgrounds/images/default.png
34
35 echo -e "sed -i \"s/^autologin/#autologin/g\" /etc/lightdm/lightdm.conf" >> /usr/share/calamares/final-process
36 sed -i "s/install_secureboot(efi_directory)/install_grub(efi_directory, fw_type)/g" /usr/lib64/calamares/modules/bootloader/main.py
37 sed -i "s/check_target_env_call(\\[libcalamares.job.configuration\\[\"grubInstall\"\\],/subprocess.call(\\[libcalamares.job.configuration\\[\"grubInstall\"\\],/g" /usr/lib64/calamares/modules/bootloader/main.py
38 sed -i "s/- grubcfg/# - grubcfg/g" /usr/share/calamares/settings.conf