diff --git a/.build_dir b/.build_dir new file mode 100644 index 0000000..46f7482 --- /dev/null +++ b/.build_dir @@ -0,0 +1 @@ +/build/focal diff --git a/autoinstall b/autoinstall index 91b20dd..b793df7 100755 --- a/autoinstall +++ b/autoinstall @@ -41,8 +41,6 @@ create_completion create_backup -echo $LIVE_TYPE - # check number of args if [[ $# == 0 || $# > 3 ]]; then help; fi diff --git a/linux-live/buildconfig b/linux-live/buildconfig index fd5b950..e2e371a 100755 --- a/linux-live/buildconfig +++ b/linux-live/buildconfig @@ -21,8 +21,8 @@ DEV_SYSTEM="0" # если ="1", создаёт резервную копию в родительской папке CREATE_BACKUP="0" -DEBIAN_FRONTEND_TYPE="noninteractive" -#DEBIAN_FRONTEND_TYPE="ncurses" +#DEBIAN_FRONTEND_TYPE="noninteractive" +DEBIAN_FRONTEND_TYPE="dialog" APT_CMD="apt-get" diff --git a/linux-live/minioslib b/linux-live/minioslib index 0aaa3fb..d2584a9 100644 --- a/linux-live/minioslib +++ b/linux-live/minioslib @@ -664,21 +664,58 @@ EOF' touch $PARENT_DIR/image/ubuntu cat <$PARENT_DIR/image/isolinux/grub.cfg search --set=root --file /ubuntu + insmod all_video + set default="0" -set timeout=30 -menuentry "Try $SYSTEMNAME without installing" { - linux /casper/vmlinuz boot=casper nopersistent toram quiet splash --- +set timeout=10 + +menuentry "Try MiniOS without installing (persistent live)" { + linux /casper/vmlinuz boot=casper quiet splash persistent --- + initrd /casper/initrd +} + +menuentry "Try MiniOS without installing (live)" { + linux /casper/vmlinuz boot=casper quiet splash --- + initrd /casper/initrd +} + +menuentry "Try MiniOS without installing (persistent live to ram)" { + linux /casper/vmlinuz boot=casper toram quiet splash persistent --- initrd /casper/initrd } -menuentry "Install $SYSTEMNAME" { + +menuentry "Try MiniOS without installing (live to ram)" { + linux /casper/vmlinuz boot=casper toram quiet splash --- + initrd /casper/initrd +} + +menuentry "Install MiniOS" { linux /casper/vmlinuz boot=casper only-ubiquity quiet splash --- initrd /casper/initrd } + +menuentry "Install MiniOS (from ram)" { + linux /casper/vmlinuz boot=casper only-ubiquity toram quiet splash --- + initrd /casper/initrd +} + menuentry "Check disc for defects" { linux /casper/vmlinuz boot=casper integrity-check quiet splash --- initrd /casper/initrd } + +menuentry "Test memory Memtest86+ (BIOS)" { + linux16 /install/memtest86+ +} + +menuentry "Test memory Memtest86 (UEFI, long load time)" { + insmod part_gpt + insmod search_fs_uuid + insmod chain + loopback loop /install/memtest86 + chainloader (loop,gpt1)/efi/boot/BOOTX64.efi +} EOF # generate manifest sudo chroot $BUILD_DIR dpkg-query -W --showformat='${Package} ${Version}\n' | sudo tee $PARENT_DIR/image/casper/filesystem.manifest @@ -926,61 +963,133 @@ EOF function prereq_pkg_list() { echo -e "${YELLOW}=====> installing prerequested software for chroot system ...${ENDCOLOUR}" - if [ -f $SCRIPT_DIR/pkglists/prereq.list ]; then - $APT_CMD update >>$OUTPUT 2>&1 && - echo -e "${YELLOW}=====> upgrading chroot system ...${ENDCOLOUR}" && - $APT_CMD upgrade $APT_OPTIONS >>$OUTPUT 2>&1 && - echo -e "${YELLOW}=====> installing packages ...${ENDCOLOUR}" && - $APT_CMD install $APT_OPTIONS \ - $(grep -vE "^\s*#" $SCRIPT_DIR/pkglists/prereq.list | tr "\n" " ") >>$OUTPUT 2>&1 - else - # we need to install systemd first, to configure machine id - $APT_CMD update >>$OUTPUT 2>&1 && - echo -e "${YELLOW}=====> upgrading chroot system ...${ENDCOLOUR}" && - $APT_CMD upgrade $APT_OPTIONS >dev/null && - echo -e "${YELLOW}=====> installing packages ...${ENDCOLOUR}" && - $APT_CMD install $APT_OPTIONS sudo libterm-readline-gnu-perl systemd-sysv >>$OUTPUT 2>&1 + if [ $DEBIAN_FRONTEND_TYPE = "noninteractive" ]; then + if [ -f $SCRIPT_DIR/pkglists/prereq.list ]; then + $APT_CMD update >>$OUTPUT 2>&1 && + echo -e "${YELLOW}=====> upgrading chroot system ...${ENDCOLOUR}" && + $APT_CMD upgrade $APT_OPTIONS >>$OUTPUT 2>&1 && + echo -e "${YELLOW}=====> installing packages ...${ENDCOLOUR}" && + $APT_CMD install $APT_OPTIONS \ + $(grep -vE "^\s*#" $SCRIPT_DIR/pkglists/prereq.list | tr "\n" " ") >>$OUTPUT 2>&1 + else + # we need to install systemd first, to configure machine id + $APT_CMD update >>$OUTPUT 2>&1 && + echo -e "${YELLOW}=====> upgrading chroot system ...${ENDCOLOUR}" && + $APT_CMD upgrade $APT_OPTIONS >dev/null && + echo -e "${YELLOW}=====> installing packages ...${ENDCOLOUR}" && + $APT_CMD install $APT_OPTIONS sudo libterm-readline-gnu-perl systemd-sysv >>$OUTPUT 2>&1 + fi + elif [ $DEBIAN_FRONTEND_TYPE = "dialog" ]; then + if [ -f $SCRIPT_DIR/pkglists/prereq.list ]; then + $APT_CMD update >>$OUTPUT 2>&1 && + echo -e "${YELLOW}=====> upgrading chroot system ...${ENDCOLOUR}" && + $APT_CMD upgrade $APT_OPTIONS >>$OUTPUT 2>&1 && + echo -e "${YELLOW}=====> installing packages ...${ENDCOLOUR}" && + $APT_CMD install $APT_OPTIONS \ + $(grep -vE "^\s*#" $SCRIPT_DIR/pkglists/prereq.list | tr "\n" " ") + else + # we need to install systemd first, to configure machine id + $APT_CMD update >>$OUTPUT 2>&1 && + echo -e "${YELLOW}=====> upgrading chroot system ...${ENDCOLOUR}" && + $APT_CMD upgrade $APT_OPTIONS >dev/null && + echo -e "${YELLOW}=====> installing packages ...${ENDCOLOUR}" && + $APT_CMD install $APT_OPTIONS sudo libterm-readline-gnu-perl systemd-sysv + fi fi } function main_pkg_list() { echo -e "${YELLOW}=====> installing main packages for chroot system ...${ENDCOLOUR}" - if [ -f $SCRIPT_DIR/pkglists/main.list ]; then - sudo DEBIAN_FRONTEND=$DEBIAN_FRONTEND_TYPE \ - $APT_CMD update >>$OUTPUT 2>&1 && - $APT_CMD install $APT_OPTIONS \ - $(grep -vE "^\s*#" $SCRIPT_DIR/pkglists/main.list | tr "\n" " ") >>$OUTPUT 2>&1 - else - sudo DEBIAN_FRONTEND=$DEBIAN_FRONTEND_TYPE \ - $APT_CMD update >>$OUTPUT 2>&1 && - $APT_CMD install $APT_OPTIONS ubuntu-minimal resolvconf xz-utils linux-image-generic >>$OUTPUT 2>&1 - fi - if [ $LIVE_TYPE = "ubuntu" ]; then - if [ -f $SCRIPT_DIR/pkglists/ubuntu-main.list ]; then + if [ $DEBIAN_FRONTEND_TYPE = "noninteractive" ]; then + if [ -f $SCRIPT_DIR/pkglists/main.list ]; then sudo DEBIAN_FRONTEND=$DEBIAN_FRONTEND_TYPE \ $APT_CMD update >>$OUTPUT 2>&1 && $APT_CMD install $APT_OPTIONS \ - $(grep -vE "^\s*#" $SCRIPT_DIR/pkglists/ubuntu-main.list | tr "\n" " ") >>$OUTPUT 2>&1 - fi - $APT_CMD install $APT_OPTIONS tasksel >>$OUTPUT 2>&1 - tasksel install xubuntu-core - $APT_CMD autoremove $APT_OPTIONS tasksel >>$OUTPUT 2>&1 - if [ -f $SCRIPT_DIR/pkglists/ubuntu-other.list ]; then + $(grep -vE "^\s*#" $SCRIPT_DIR/pkglists/main.list | tr "\n" " ") >>$OUTPUT 2>&1 + else sudo DEBIAN_FRONTEND=$DEBIAN_FRONTEND_TYPE \ $APT_CMD update >>$OUTPUT 2>&1 && + $APT_CMD install $APT_OPTIONS ubuntu-minimal resolvconf xz-utils linux-image-generic >>$OUTPUT 2>&1 + fi + if [ $LIVE_TYPE = "ubuntu" ]; then + if [ -f $SCRIPT_DIR/pkglists/ubuntu-main.list ]; then + sudo DEBIAN_FRONTEND=$DEBIAN_FRONTEND_TYPE \ + $APT_CMD install $APT_OPTIONS \ + $(grep -vE "^\s*#" $SCRIPT_DIR/pkglists/ubuntu-main.list | tr "\n" " ") >>$OUTPUT 2>&1 + fi + if [ -f $SCRIPT_DIR/pkglists/ubuntu-gui.list ]; then + sudo DEBIAN_FRONTEND=$DEBIAN_FRONTEND_TYPE \ + $APT_CMD install $APT_OPTIONS \ + $(grep -vE "^\s*#" $SCRIPT_DIR/pkglists/ubuntu-gui.list | tr "\n" " ") >>$OUTPUT 2>&1 + fi + if [ -f $SCRIPT_DIR/pkglists/ubuntu-ubiquity.list ]; then + sudo DEBIAN_FRONTEND=$DEBIAN_FRONTEND_TYPE \ + $APT_CMD install $APT_OPTIONS \ + $(grep -vE "^\s*#" $SCRIPT_DIR/pkglists/ubuntu-ubiquity.list | tr "\n" " ") >>$OUTPUT 2>&1 + fi + fi + elif [ $DEBIAN_FRONTEND_TYPE = "dialog" ]; then + if [ -f $SCRIPT_DIR/pkglists/main.list ]; then + $APT_CMD update >>$OUTPUT 2>&1 && $APT_CMD install $APT_OPTIONS \ - $(grep -vE "^\s*#" $SCRIPT_DIR/pkglists/ubuntu-other.list | tr "\n" " ") >>$OUTPUT 2>&1 + $(grep -vE "^\s*#" $SCRIPT_DIR/pkglists/main.list | tr "\n" " ") + else + $APT_CMD update >>$OUTPUT 2>&1 && + $APT_CMD install $APT_OPTIONS ubuntu-minimal resolvconf xz-utils linux-image-generic + fi + if [ $LIVE_TYPE = "ubuntu" ]; then + if [ -f $SCRIPT_DIR/pkglists/ubuntu-main.list ]; then + $APT_CMD install $APT_OPTIONS \ + $(grep -vE "^\s*#" $SCRIPT_DIR/pkglists/ubuntu-main.list | tr "\n" " ") + fi + if [ -f $SCRIPT_DIR/pkglists/ubuntu-gui.list ]; then + $APT_CMD install $APT_OPTIONS \ + $(grep -vE "^\s*#" $SCRIPT_DIR/pkglists/ubuntu-gui.list | tr "\n" " ") + fi + if [ -f $SCRIPT_DIR/pkglists/ubuntu-ubiquity.list ]; then + $APT_CMD install $APT_OPTIONS \ + $(grep -vE "^\s*#" $SCRIPT_DIR/pkglists/ubuntu-ubiquity.list | tr "\n" " ") + fi fi fi } function other_pkg_list() { echo -e "${YELLOW}=====> installing other packages for chroot system ...${ENDCOLOUR}" - if [ -f $SCRIPT_DIR/pkglists/other.list ]; then - sudo DEBIAN_FRONTEND=$DEBIAN_FRONTEND_TYPE \ + if [ $DEBIAN_FRONTEND_TYPE = "noninteractive" ]; then + if [ $LIVE_TYPE = "ubuntu" ]; then + #$APT_CMD install $APT_OPTIONS tasksel >>$OUTPUT 2>&1 + #tasksel install xubuntu-core + #$APT_CMD autoremove $APT_OPTIONS tasksel >>$OUTPUT 2>&1 + if [ -f $SCRIPT_DIR/pkglists/ubuntu-other.list ]; then + sudo DEBIAN_FRONTEND=$DEBIAN_FRONTEND_TYPE \ + $APT_CMD update >>$OUTPUT 2>&1 && + $APT_CMD install $APT_OPTIONS \ + $(grep -vE "^\s*#" $SCRIPT_DIR/pkglists/ubuntu-other.list | tr "\n" " ") >>$OUTPUT 2>&1 + fi + fi + if [ -f $SCRIPT_DIR/pkglists/other.list ]; then + sudo DEBIAN_FRONTEND=$DEBIAN_FRONTEND_TYPE \ + $APT_CMD update >>$OUTPUT 2>&1 && + $APT_CMD install $APT_OPTIONS \ + $(grep -vE "^\s*#" $SCRIPT_DIR/pkglists/other.list | tr "\n" " ") >>$OUTPUT 2>&1 + fi + elif [ $DEBIAN_FRONTEND_TYPE = "dialog" ]; then + if [ $LIVE_TYPE = "ubuntu" ]; then + #$APT_CMD install $APT_OPTIONS tasksel >>$OUTPUT 2>&1 + #tasksel install xubuntu-core + #$APT_CMD autoremove $APT_OPTIONS tasksel >>$OUTPUT 2>&1 + if [ -f $SCRIPT_DIR/pkglists/ubuntu-other.list ]; then + $APT_CMD update >>$OUTPUT 2>&1 && + $APT_CMD install $APT_OPTIONS \ + $(grep -vE "^\s*#" $SCRIPT_DIR/pkglists/ubuntu-other.list | tr "\n" " ") + fi + fi + if [ -f $SCRIPT_DIR/pkglists/other.list ]; then $APT_CMD update >>$OUTPUT 2>&1 && - $APT_CMD install $APT_OPTIONS \ - $(grep -vE "^\s*#" $SCRIPT_DIR/pkglists/other.list | tr "\n" " ") >>$OUTPUT 2>&1 + $APT_CMD install $APT_OPTIONS \ + $(grep -vE "^\s*#" $SCRIPT_DIR/pkglists/other.list | tr "\n" " ") + fi fi } @@ -991,8 +1100,9 @@ function chroot_pkg_install() { other_pkg_list - # configure console and keyboard - cat </etc/default/console-setup + if [ $DEBIAN_FRONTEND_TYPE = "noninteractive" ]; then + # configure console and keyboard + cat </etc/default/console-setup # CONFIGURATION FILE FOR SETUPCON # Consult the console-setup(5) manual page. @@ -1010,7 +1120,7 @@ VIDEOMODE= # The following is an example how to use a braille font # FONT='lat9w-08.psf.gz brl-8x8.psf' EOF - cat </etc/default/keyboard + cat </etc/default/keyboard # KEYBOARD CONFIGURATION FILE # Consult the keyboard(5) manual page. @@ -1023,21 +1133,48 @@ XKBOPTIONS="grp:alt_shift_toggle,grp_led:scroll" BACKSPACE="guess" EOF - dpkg-reconfigure -f noninteractive console-setup >>$OUTPUT 2>&1 - - # configure timezone and locale - echo "Europe/Moscow" >/etc/timezone && - dpkg-reconfigure -f noninteractive tzdata >>$OUTPUT 2>&1 && - sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && - sed -i -e 's/# ru_RU.UTF-8 UTF-8/ru_RU.UTF-8 UTF-8/' /etc/locale.gen && - echo 'LANG="ru_RU.UTF-8"' >/etc/default/locale && - dpkg-reconfigure -f noninteractive locales >>$OUTPUT 2>&1 && - update-locale LANG=ru_RU.UTF-8 >>$OUTPUT 2>&1 - - # configure resolvconf - if grep resolvconf $SCRIPT_DIR/pkglists/main.list >>$OUTPUT 2>&1 || grep resolvconf $SCRIPT_DIR/pkglists/other.list || [ $DISTRIBUTION != "xenial" ] >>$OUTPUT 2>&1; then - echo "resolvconf resolvconf/linkify-resolvconf boolean true" | debconf-set-selections - dpkg-reconfigure resolvconf >>$OUTPUT 2>&1 + dpkg-reconfigure -f noninteractive console-setup >>$OUTPUT 2>&1 + + # configure timezone and locale + echo "Europe/Moscow" >/etc/timezone && + dpkg-reconfigure -f noninteractive tzdata >>$OUTPUT 2>&1 && + sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && + sed -i -e 's/# ru_RU.UTF-8 UTF-8/ru_RU.UTF-8 UTF-8/' /etc/locale.gen && + echo 'LANG="ru_RU.UTF-8"' >/etc/default/locale && + dpkg-reconfigure -f noninteractive locales >>$OUTPUT 2>&1 && + update-locale LANG=ru_RU.UTF-8 >>$OUTPUT 2>&1 + + # configure resolvconf + if grep resolvconf $SCRIPT_DIR/pkglists/main.list >>$OUTPUT 2>&1 || grep resolvconf $SCRIPT_DIR/pkglists/other.list || [ $DISTRIBUTION != "xenial" ] >>$OUTPUT 2>&1; then + echo "resolvconf resolvconf/linkify-resolvconf boolean true" | debconf-set-selections + dpkg-reconfigure resolvconf >>$OUTPUT 2>&1 + fi + elif [ $DEBIAN_FRONTEND_TYPE = "dialog" ]; then + + dpkg-reconfigure console-setup + + # configure timezone and locale + dpkg-reconfigure tzdata + dpkg-reconfigure locales + dpkg-reconfigure localepurge + localepurge + + # configure resolvconf + if grep resolvconf $SCRIPT_DIR/pkglists/main.list >>$OUTPUT 2>&1 || grep resolvconf $SCRIPT_DIR/pkglists/other.list || [ $DISTRIBUTION != "xenial" ] >>$OUTPUT 2>&1; then + dpkg-reconfigure resolvconf + fi + + # network manager + cat </etc/NetworkManager/NetworkManager.conf +[main] +rc-manager=resolvconf +plugins=ifupdown,keyfile +dns=dnsmasq +[ifupdown] +managed=false +EOF + dpkg-reconfigure network-manager + fi # remove unused @@ -1097,14 +1234,15 @@ EOF (cd /linux-live/rootcopy-ubuntu && cp --parents -afr * /) #rm /etc/alternatives/default.plymouth #rm /etc/alternatives/text.plymouth - update-alternatives --install /usr/share/plymouth/themes/default.plymouth default.plymouth /usr/share/plymouth/themes/minios-logo/minios-logo.plymouth 100 + update-alternatives --install /usr/share/plymouth/themes/default.plymouth default.plymouth /usr/share/plymouth/themes/minios-logo/minios-logo.plymouth 200 + update-alternatives --config default.plymouth --skip-auto #ln -s /usr/share/plymouth/themes/minios-logo/minios-logo.plymouth /etc/alternatives/default.plymouth #ln -s /usr/share/plymouth/themes/minios-logo/minios-text.plymouth /etc/alternatives/text.plymouth update-initramfs -u rm /usr/share/xfce4/backdrops/xubuntu-wallpaper.png ln -s /usr/share/backgrounds/MiniOS.png /usr/share/xfce4/backdrops/xubuntu-wallpaper.png - echo "Set up user 'ubuntu'" >>$OUTPUT 2>&1 + : 'echo "Set up user 'ubuntu'" >>$OUTPUT 2>&1 adduser --gecos '' ubuntu --disabled-password >>$OUTPUT 2>&1 echo "Set up password for user 'ubuntu'" >>$OUTPUT 2>&1 echo ubuntu:ubuntu | chpasswd >>$OUTPUT 2>&1 @@ -1113,7 +1251,7 @@ EOF addgroup ubuntu lpadmin >>$OUTPUT 2>&1 addgroup ubuntu plugdev >>$OUTPUT 2>&1 addgroup ubuntu dip >>$OUTPUT 2>&1 - #addgroup ubuntu samba >>$OUTPUT 2>&1 + #addgroup ubuntu samba >>$OUTPUT 2>&1' #sed -i "s,managed=false,managed=true,g" /etc/NetworkManager/NetworkManager.conf diff --git a/linux-live/pkglists/ubuntu-gui.list b/linux-live/pkglists/ubuntu-gui.list new file mode 100644 index 0000000..313da33 --- /dev/null +++ b/linux-live/pkglists/ubuntu-gui.list @@ -0,0 +1,10 @@ +xubuntu-core +mousepad +blueman +ristretto +onboard +gigolo +gparted +xfce4-taskmanager +xfce4-xkb-plugin +language-pack-gnome-ru \ No newline at end of file diff --git a/linux-live/pkglists/ubuntu-main.list b/linux-live/pkglists/ubuntu-main.list index b97c768..27f8eb1 100644 --- a/linux-live/pkglists/ubuntu-main.list +++ b/linux-live/pkglists/ubuntu-main.list @@ -5,4 +5,4 @@ laptop-detect os-prober network-manager net-tools -wireless-tools +wireless-tools \ No newline at end of file diff --git a/linux-live/pkglists/ubuntu-other.list b/linux-live/pkglists/ubuntu-other.list index e040bac..af72970 100644 --- a/linux-live/pkglists/ubuntu-other.list +++ b/linux-live/pkglists/ubuntu-other.list @@ -1,22 +1,2 @@ -#xubuntu-core -#lightdm -language-pack-gnome-ru -language-pack-gnome-en -ubiquity -ubiquity-casper -ubiquity-frontend-gtk -ubiquity-slideshow-xubuntu -ubiquity-ubuntu-artwork -#plymouth-theme-ubuntu-logo -#ubuntu-gnome-desktop -#ubuntu-gnome-wallpapers -mousepad -blueman -ristretto -onboard -gigolo -gparted -xfce4-taskmanager -xfce4-xkb-plugin open-vm-tools-desktop samba-common \ No newline at end of file diff --git a/linux-live/pkglists/ubuntu-ubiquity.list b/linux-live/pkglists/ubuntu-ubiquity.list new file mode 100644 index 0000000..8b519c8 --- /dev/null +++ b/linux-live/pkglists/ubuntu-ubiquity.list @@ -0,0 +1,5 @@ +ubiquity +ubiquity-casper +ubiquity-frontend-gtk +ubiquity-slideshow-xubuntu +ubiquity-ubuntu-artwork \ No newline at end of file