From 465166a80fd6add7fa1cb981665ecf5acc96d35b Mon Sep 17 00:00:00 2001 From: Rui Abreu Ferreira Date: Mon, 18 Jan 2016 15:18:30 +0000 Subject: mkrootfs: Added -k to run post hook New flag -k . " " is executed after the rootfs is created, points to the new rootfs. --- mkrootfs.sh.in | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mkrootfs.sh.in b/mkrootfs.sh.in index bedcb0c..472cec9 100644 --- a/mkrootfs.sh.in +++ b/mkrootfs.sh.in @@ -56,6 +56,7 @@ Options -h Show this help -p Additional packages to install into the rootfs (separated by blanks) -r Set XBPS repository (may be set multiple times) + -k Call "cmd " after building the rootfs -V Show version _EOF } @@ -104,7 +105,7 @@ register_binfmt() { # # main() # -while getopts "b:C:c:hp:r:V" opt; do +while getopts "b:C:c:hp:r:k:V" opt; do case $opt in b) PKGBASE="$OPTARG";; C) XBPS_CONFFILE="-C $OPTARG";; @@ -112,6 +113,7 @@ while getopts "b:C:c:hp:r:V" opt; do h) usage; exit 0;; p) EXTRA_PKGS="$OPTARG";; r) XBPS_REPOSITORY="$XBPS_REPOSITORY --repository=$OPTARG";; + k) POST_HOOK="$OPTARG";; V) echo "$PROGNAME @@MKLIVE_VERSION@@"; exit 0;; esac done @@ -226,6 +228,9 @@ fi # Setup default root password. # run_cmd "chroot $rootfs sh -c 'echo "root:voidlinux" | chpasswd -c SHA512'" +if [ -n "$POST_HOOK" ]; then + run_cmd "$POST_HOOK $rootfs" +fi umount_pseudofs # # Cleanup rootfs. -- cgit 1.4.1 From ca6559e8ba58bc7464b8bbde8ddd6e9181772988 Mon Sep 17 00:00:00 2001 From: lxb Date: Fri, 29 Jan 2016 17:49:48 -0500 Subject: installer: check network configured on source --- installer.sh.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/installer.sh.in b/installer.sh.in index 6705f09..00ae948 100644 --- a/installer.sh.in +++ b/installer.sh.in @@ -947,7 +947,10 @@ menu_source() { "Network" "Packages from official remote reposity" case "$(cat $ANSWER)" in "Local") src="local";; - "Network") src="net"; menu_network;; + "Network") src="net"; + if [ -z "$NETWORK_DONE" ]; then + menu_network; + fi;; *) return 1;; esac SOURCE_DONE=1 -- cgit 1.4.1 From f11d98ae3c22ae77ab29e79fa905a78e2344267e Mon Sep 17 00:00:00 2001 From: Enguerrand de Rochefort Date: Fri, 29 Jan 2016 00:10:10 +0100 Subject: mklive: add -I directory inclusion option --- mklive.sh.in | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/mklive.sh.in b/mklive.sh.in index 55751dd..38a9bd1 100644 --- a/mklive.sh.in +++ b/mklive.sh.in @@ -39,6 +39,10 @@ die() { info_msg "ERROR: $@" error_out 1 } +print_step() { + ((CURRENT_STEP=CURRENT_STEP+1)) + info_msg "[${CURRENT_STEP}/${STEP_COUNT}] $@" +} mount_pseudofs() { for f in sys dev proc; do mkdir -p $ROOTFS/$f @@ -72,6 +76,7 @@ Options: -S Allocate this free size (MB) for the rootfs. -o Output file name for the ISO image (auto if unset). -p "pkg pkgN ..." Install additional packages into the ISO image. + -I Include directory structure under given path into rootfs -C "cmdline args" Add additional kernel command line arguments. -T "title" Modify the bootloader title. @@ -135,6 +140,10 @@ install_packages() { rm -rf $ROOTFS/var/cache/* $ROOTFS/run/* $ROOTFS/var/run/* } +copy_include_directory() { + find $INCLUDE_DIRECTORY -mindepth 1 -maxdepth 1 -exec cp -rfpPv {} $ROOTFS/ \; +} + generate_initramfs() { local _args @@ -283,7 +292,7 @@ generate_iso_image() { # # main() # -while getopts "a:b:r:c:C:T:Kk:l:i:s:S:o:p:h" opt; do +while getopts "a:b:r:c:C:T:Kk:l:i:I:s:S:o:p:h" opt; do case $opt in a) BASE_ARCH="$OPTARG";; b) BASE_SYSTEM_PKG="$OPTARG";; @@ -293,6 +302,7 @@ while getopts "a:b:r:c:C:T:Kk:l:i:s:S:o:p:h" opt; do k) KEYMAP="$OPTARG";; l) LOCALE="$OPTARG";; i) INITRAMFS_COMPRESSION="$OPTARG";; + I) INCLUDE_DIRECTORY="$OPTARG";; s) SQUASHFS_COMPRESSION="$OPTARG";; S) ROOTFS_FREESIZE="$OPTARG";; o) OUTPUT_FILE="$OPTARG";; @@ -343,6 +353,9 @@ BOOT_DIR="$IMAGEDIR/boot" ISOLINUX_DIR="$BOOT_DIR/isolinux" GRUB_DIR="$BOOT_DIR/grub" ISOLINUX_CFG="$ISOLINUX_DIR/isolinux.cfg" +CURRENT_STEP=0 +STEP_COUNT=9 +[ -n "${INCLUDE_DIRECTORY}" ] && ((STEP_COUNT=STEP_COUNT+1)) : ${SYSLINUX_DATADIR:=$VOIDHOSTDIR/usr/share/syslinux} : ${GRUB_DATADIR:=$VOIDHOSTDIR/usr/share/grub} @@ -356,7 +369,7 @@ ISOLINUX_CFG="$ISOLINUX_DIR/isolinux.cfg" mkdir -p $ROOTFS $VOIDHOSTDIR $ISOLINUX_DIR $GRUB_DIR -info_msg "[1/8] Synchronizing XBPS repository data..." +print_step "Synchronizing XBPS repository data..." copy_void_keys $ROOTFS copy_void_keys $VOIDHOSTDIR XBPS_ARCH=$BASE_ARCH $XBPS_INSTALL_CMD -r $ROOTFS ${XBPS_REPOSITORY} -S @@ -368,32 +381,37 @@ KERNELVERSION=$($XBPS_UHELPER_CMD getpkgversion ${_kver}) : ${OUTPUT_FILE="void-live-${BASE_ARCH}-${KERNELVERSION}-$(date +%Y%m%d).iso"} -info_msg "[2/9] Installing software to generate the image: ${REQUIRED_PKGS} ..." +print_step "Installing software to generate the image: ${REQUIRED_PKGS} ..." install_prereqs mkdir -p "$ROOTFS"/etc [ -s data/motd ] && cp data/motd $ROOTFS/etc [ -s data/issue ] && cp data/issue $ROOTFS/etc -info_msg "[3/9] Installing void pkgs into the rootfs: ${PACKAGE_LIST} ..." +print_step "Installing void pkgs into the rootfs: ${PACKAGE_LIST} ..." install_packages -info_msg "[4/9] Generating initramfs image ($INITRAMFS_COMPRESSION)..." +if [ -n "${INCLUDE_DIRECTORY}" ];then + print_step "Copying directory structure into the rootfs: ${INCLUDE_DIRECTORY} ..." + copy_include_directory +fi + +print_step "Generating initramfs image ($INITRAMFS_COMPRESSION)..." generate_initramfs -info_msg "[5/9] Generating isolinux support for PC-BIOS systems..." +print_step "Generating isolinux support for PC-BIOS systems..." generate_isolinux_boot -info_msg "[6/9] Generating GRUB support for EFI systems..." +print_step "Generating GRUB support for EFI systems..." generate_grub_efi_boot -info_msg "[7/9] Cleaning up rootfs..." +print_step "Cleaning up rootfs..." cleanup_rootfs -info_msg "[8/9] Generating squashfs image ($SQUASHFS_COMPRESSION) from rootfs..." +print_step "Generating squashfs image ($SQUASHFS_COMPRESSION) from rootfs..." generate_squashfs -info_msg "[9/9] Generating ISO image..." +print_step "Generating ISO image..." generate_iso_image hsize=$(du -sh "$CURDIR/$OUTPUT_FILE"|awk '{print $1}') -- cgit 1.4.1 From 3b448665e92702331edf069afeae7afd7ee2479d Mon Sep 17 00:00:00 2001 From: jbu Date: Wed, 23 Sep 2015 01:58:26 +0200 Subject: installer.sh.in: avoid scrolling for wep/wpa input --- installer.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer.sh.in b/installer.sh.in index 00ae948..a04f076 100644 --- a/installer.sh.in +++ b/installer.sh.in @@ -476,7 +476,7 @@ configure_wifi() { DIALOG --form "Wireless configuration for ${dev}\n(encryption type: wep or wpa)" 0 0 0 \ "SSID:" 1 1 "" 1 16 30 0 \ - "Encryption:" 2 1 "" 2 16 3 0 \ + "Encryption:" 2 1 "" 2 16 4 3 \ "Password:" 3 1 "" 3 16 50 0 || return 1 set -- $(cat $ANSWER) ssid="$1"; enc="$2"; pass="$3"; -- cgit 1.4.1 From 678fabe87eb24ccaa548d42861188b948cb3e8a9 Mon Sep 17 00:00:00 2001 From: jbu Date: Thu, 4 Feb 2016 07:40:59 +0100 Subject: installer.sh.in: add user account dialog --- installer.sh.in | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/installer.sh.in b/installer.sh.in index a04f076..71818c1 100644 --- a/installer.sh.in +++ b/installer.sh.in @@ -32,6 +32,8 @@ KEYBOARD_DONE= LOCALE_DONE= TIMEZONE_DONE= ROOTPASSWORD_DONE= +USERNAME_DONE= +USERPASSWORD_DONE= BOOTLOADER_DONE= PARTITIONS_DONE= NETWORK_DONE= @@ -421,6 +423,55 @@ set_rootpassword() { echo "root:$(get_option ROOTPASSWORD)" | chpasswd -R $TARGETDIR -c SHA512 } +menu_useraccount() { + local _firstpass= _secondpass= _desc= + + while true; do + DIALOG --inputbox "Select primary user name:" ${INPUTSIZE} "void" + if [ $? -eq 0 ]; then + set_option USERNAME "$(cat $ANSWER)" + USERNAME_DONE=1 + break + else + return + fi + done + + while true; do + if [ -n "${_firstpass}" ]; then + _desc="Enter the password for '$(get_option USERNAME)' again (password won't be displayed)" + else + _desc="Enter the password for '$(get_option USERNAME)' (password won't be displayed)" + fi + DIALOG --passwordbox "${_desc}" ${MSGBOXSIZE} + if [ $? -eq 0 ]; then + if [ -z "${_firstpass}" ]; then + _firstpass="$(cat $ANSWER)" + else + _secondpass="$(cat $ANSWER)" + fi + if [ -n "${_firstpass}" -a -n "${_secondpass}" ]; then + if [ "${_firstpass}" != "${_secondpass}" ]; then + DIALOG --infobox "Passwords do not match! please reenter it again" 6 80 + unset _firstpass _secondpass + sleep 2 && continue + fi + set_option USERPASSWORD "${_firstpass}" + USERPASSWORD_DONE=1 + break + fi + else + return + fi + done +} + +set_useraccount() { + useradd -R $TARGETDIR -m -G wheel,audio,video,floppy,cdrom,optical,kvm,xbuilder \ + "$(get_option USERNAME)" + echo "$(get_option USERNAME):$(get_option USERPASSWORD)" | chpasswd -R $TARGETDIR -c SHA512 +} + menu_bootloader() { while true; do DIALOG --title " Select the disk to install the bootloader" \ @@ -889,6 +940,7 @@ ${BOLD}Do you want to continue?${RESET}" 20 80 || return set_timezone set_hostname set_rootpassword + set_useraccount # Copy /etc/skel files for root. cp $TARGETDIR/etc/skel/.[bix]* $TARGETDIR/root @@ -973,6 +1025,7 @@ menu() { "Locale" "Set system locale" \ "Timezone" "Set system time zone" \ "RootPassword" "Set system root password" \ + "UserAccount" "Set primary user name and password" \ "BootLoader" "Set disk to install bootloader" \ "Partition" "Partition disk(s)" \ "Filesystems" "Configure filesystems and mount points" \ @@ -995,7 +1048,9 @@ menu() { "Hostname") menu_hostname && [ -n "$HOSTNAME_DONE" ] && DEFITEM="Locale";; "Locale") menu_locale && [ -n "$LOCALE_DONE" ] && DEFITEM="Timezone";; "Timezone") menu_timezone && [ -n "$TIMEZONE_DONE" ] && DEFITEM="RootPassword";; - "RootPassword") menu_rootpassword && [ -n "$ROOTPASSWORD_DONE" ] && DEFITEM="BootLoader";; + "RootPassword") menu_rootpassword && [ -n "$ROOTPASSWORD_DONE" ] && DEFITEM="UserAccount";; + "UserAccount") menu_useraccount && [ -n "$USERNAME_DONE" ] && [ -n "$USERPASSWORD_DONE" ] \ + && DEFITEM="BootLoader";; "BootLoader") menu_bootloader && [ -n "$BOOTLOADER_DONE" ] && DEFITEM="Partition";; "Partition") menu_partitions && [ -n "$PARTITIONS_DONE" ] && DEFITEM="Filesystems";; "Filesystems") menu_filesystems && [ -n "$FILESYSTEMS_DONE" ] && DEFITEM="Install";; -- cgit 1.4.1 From f5a75aeb136598b46cb30df4be2a6bcdde4bebfe Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 7 Feb 2016 09:41:40 +0100 Subject: mklive: fix print_step()... --- mklive.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mklive.sh.in b/mklive.sh.in index 38a9bd1..ed710f9 100644 --- a/mklive.sh.in +++ b/mklive.sh.in @@ -40,7 +40,7 @@ die() { error_out 1 } print_step() { - ((CURRENT_STEP=CURRENT_STEP+1)) + CURRENT_STEP=$((CURRENT_STEP+1)) info_msg "[${CURRENT_STEP}/${STEP_COUNT}] $@" } mount_pseudofs() { -- cgit 1.4.1 From 11000d9f3c99eb58e43c7f14ce08b75022b5cfb9 Mon Sep 17 00:00:00 2001 From: Ron Damen Date: Wed, 24 Feb 2016 14:35:13 +0100 Subject: mkimage.sh.in: fix truncate size argument --- mkimage.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkimage.sh.in b/mkimage.sh.in index 4888c66..26007dd 100644 --- a/mkimage.sh.in +++ b/mkimage.sh.in @@ -131,7 +131,7 @@ case "$DD_VERSION" in esac info_msg "Creating disk image ($IMGSIZE) ..." -truncate -s "${IMGSIZE}M" $FILENAME >/dev/null 2>&1 +truncate -s "${IMGSIZE}" $FILENAME >/dev/null 2>&1 ROOTFSDIR=$(mktemp -d) -- cgit 1.4.1 From fcafd53f10432a1fbe2077c42ecee20df1e9055d Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 16 Mar 2016 10:45:17 +0100 Subject: build-x86-images: also pass -r arg to mklive. --- build-x86-images.sh.in | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/build-x86-images.sh.in b/build-x86-images.sh.in index 5ea5b04..9d89c8c 100644 --- a/build-x86-images.sh.in +++ b/build-x86-images.sh.in @@ -49,36 +49,36 @@ if [ -z "$IMAGE" -o "$IMAGE" = base ]; then fi if [ -z "$IMAGE" -o "$IMAGE" = e ]; then if [ ! -e $E_IMG ]; then - ./mklive.sh -a $ARCH -o $E_IMG -p "$E_PKGS" $@ + ./mklive.sh -a $ARCH -o $E_IMG -p "$E_PKGS" ${REPO} $@ fi fi if [ -z "$IMAGE" -o "$IMAGE" = xfce ]; then if [ ! -e $XFCE_IMG ]; then - ./mklive.sh -a $ARCH -o $XFCE_IMG -p "$XFCE_PKGS" $@ + ./mklive.sh -a $ARCH -o $XFCE_IMG -p "$XFCE_PKGS" ${REPO} $@ fi fi if [ -z "$IMAGE" -o "$IMAGE" = mate ]; then if [ ! -e $MATE_IMG ]; then - ./mklive.sh -a $ARCH -o $MATE_IMG -p "$MATE_PKGS" $@ + ./mklive.sh -a $ARCH -o $MATE_IMG -p "$MATE_PKGS" ${REPO} $@ fi fi if [ -z "$IMAGE" -o "$IMAGE" = cinnamon ]; then if [ ! -e $CINNAMON_IMG ]; then - ./mklive.sh -a $ARCH -o $CINNAMON_IMG -p "$CINNAMON_PKGS" $@ + ./mklive.sh -a $ARCH -o $CINNAMON_IMG -p "$CINNAMON_PKGS" ${REPO} $@ fi fi if [ -z "$IMAGE" -o "$IMAGE" = lxde ]; then if [ ! -e $LXDE_IMG ]; then - ./mklive.sh -a $ARCH -o $LXDE_IMG -p "$LXDE_PKGS" $@ + ./mklive.sh -a $ARCH -o $LXDE_IMG -p "$LXDE_PKGS" ${REPO} $@ fi fi if [ -z "$IMAGE" -o "$IMAGE" = lxqt ]; then if [ ! -e $LXQT_IMG ]; then - ./mklive.sh -a $ARCH -o $LXQT_IMG -p "$LXQT_PKGS" $@ + ./mklive.sh -a $ARCH -o $LXQT_IMG -p "$LXQT_PKGS" ${REPO} $@ fi fi if [ "$IMAGE" = kde ]; then if [ ! -e $KDE_IMG ]; then - ./mklive.sh -a $ARCH -o $KDE_IMG -p "$KDE_PKGS" $@ + ./mklive.sh -a $ARCH -o $KDE_IMG -p "$KDE_PKGS" ${REPO} $@ fi fi -- cgit 1.4.1 From afc400fec7619c9f6d090e5f67c62900ff0a01a3 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 16 Mar 2016 11:08:50 +0100 Subject: build-x86-images: switch to firefox-esr. --- build-x86-images.sh.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build-x86-images.sh.in b/build-x86-images.sh.in index 9d89c8c..6a7bae3 100644 --- a/build-x86-images.sh.in +++ b/build-x86-images.sh.in @@ -32,12 +32,12 @@ esac readonly BASE_PKGS="dialog cryptsetup lvm2 mdadm $GRUB" readonly X_PKGS="$BASE_PKGS xorg-minimal xorg-input-drivers xorg-video-drivers setxkbmap xauth font-misc-misc terminus-font alsa-plugins-pulseaudio" -readonly E_PKGS="$X_PKGS lxdm enlightenment terminology econnman udisks2 firefox" -readonly XFCE_PKGS="$X_PKGS lxdm xfce4 gnome-themes-standard gnome-keyring network-manager-applet gvfs-afc gvfs-mtp gvfs-smb udisks2 firefox" -readonly MATE_PKGS="$X_PKGS lxdm mate mate-extra gnome-keyring network-manager-applet gvfs-afc gvfs-mtp gvfs-smb udisks2 firefox" -readonly CINNAMON_PKGS="$X_PKGS lxdm cinnamon gnome-keyring colord gnome-terminal gvfs-afc gvfs-mtp gvfs-smb udisks2 firefox" +readonly E_PKGS="$X_PKGS lxdm enlightenment terminology econnman udisks2 firefox-esr" +readonly XFCE_PKGS="$X_PKGS lxdm xfce4 gnome-themes-standard gnome-keyring network-manager-applet gvfs-afc gvfs-mtp gvfs-smb udisks2 firefox-esr" +readonly MATE_PKGS="$X_PKGS lxdm mate mate-extra gnome-keyring network-manager-applet gvfs-afc gvfs-mtp gvfs-smb udisks2 firefox-esr" +readonly CINNAMON_PKGS="$X_PKGS lxdm cinnamon gnome-keyring colord gnome-terminal gvfs-afc gvfs-mtp gvfs-smb udisks2 firefox-esr" readonly KDE_PKGS="$X_PKGS kde" -readonly LXDE_PKGS="$X_PKGS lxdm lxde gvfs-afc gvfs-mtp gvfs-smb udisks2 firefox" +readonly LXDE_PKGS="$X_PKGS lxdm lxde gvfs-afc gvfs-mtp gvfs-smb udisks2 firefox-esr" readonly LXQT_PKGS="$X_PKGS lxdm lxqt gvfs-afc gvfs-mtp gvfs-smb udisks2 qupzilla" [ ! -x mklive.sh ] && exit 0 -- cgit 1.4.1 From 53f25b6937ab33ed8eae69330428d6da338d04f1 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 16 Mar 2016 11:20:01 +0100 Subject: build-x86-images: added dejavu-fonts-ttf as suggested by chris2. --- build-x86-images.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-x86-images.sh.in b/build-x86-images.sh.in index 6a7bae3..7bd84b1 100644 --- a/build-x86-images.sh.in +++ b/build-x86-images.sh.in @@ -31,7 +31,7 @@ case "$ARCH" in esac readonly BASE_PKGS="dialog cryptsetup lvm2 mdadm $GRUB" -readonly X_PKGS="$BASE_PKGS xorg-minimal xorg-input-drivers xorg-video-drivers setxkbmap xauth font-misc-misc terminus-font alsa-plugins-pulseaudio" +readonly X_PKGS="$BASE_PKGS xorg-minimal xorg-input-drivers xorg-video-drivers setxkbmap xauth font-misc-misc terminus-font dejavu-fonts-ttf alsa-plugins-pulseaudio" readonly E_PKGS="$X_PKGS lxdm enlightenment terminology econnman udisks2 firefox-esr" readonly XFCE_PKGS="$X_PKGS lxdm xfce4 gnome-themes-standard gnome-keyring network-manager-applet gvfs-afc gvfs-mtp gvfs-smb udisks2 firefox-esr" readonly MATE_PKGS="$X_PKGS lxdm mate mate-extra gnome-keyring network-manager-applet gvfs-afc gvfs-mtp gvfs-smb udisks2 firefox-esr" -- cgit 1.4.1 From 6edaeb29a6549efab1c813d04da0078abb27d6af Mon Sep 17 00:00:00 2001 From: jbu Date: Mon, 28 Mar 2016 17:37:32 +0200 Subject: installer.sh.in: improve primary user setup + change shebang to #!/bin/bash because we use bashisms + add --insecure to password inputs to make them display asterisks (*) + add input for full user name (as opposed to login name) + add a checklist for primary login group memberships + enable /etc/sudoers line for members of group wheel + let the user choose grub input/output by console instead of graphics --- installer.sh.in | 117 +++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 98 insertions(+), 19 deletions(-) diff --git a/installer.sh.in b/installer.sh.in index 71818c1..ce2ba00 100644 --- a/installer.sh.in +++ b/installer.sh.in @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash #- # Copyright (c) 2012-2015 Juan Romero Pardines . # 2012 Dave Elusive . @@ -32,8 +32,10 @@ KEYBOARD_DONE= LOCALE_DONE= TIMEZONE_DONE= ROOTPASSWORD_DONE= -USERNAME_DONE= +USERLOGIN_DONE= USERPASSWORD_DONE= +USERNAME_DONE= +USERGROUPS_DONE= BOOTLOADER_DONE= PARTITIONS_DONE= NETWORK_DONE= @@ -388,15 +390,15 @@ set_hostname() { } menu_rootpassword() { - local _firstpass= _secondpass= _desc= + local _firstpass _secondpass _desc while true; do if [ -n "${_firstpass}" ]; then - _desc="Enter the root password again (password won't be displayed)" + _desc="Enter the root password again" else - _desc="Enter the root password (password won't be displayed)" + _desc="Enter the root password" fi - DIALOG --passwordbox "${_desc}" ${MSGBOXSIZE} + DIALOG --insecure --passwordbox "${_desc}" ${INPUTSIZE} if [ $? -eq 0 ]; then if [ -z "${_firstpass}" ]; then _firstpass="$(cat $ANSWER)" @@ -405,7 +407,7 @@ menu_rootpassword() { fi if [ -n "${_firstpass}" -a -n "${_secondpass}" ]; then if [ "${_firstpass}" != "${_secondpass}" ]; then - DIALOG --infobox "Passwords do not match! please reenter it again" 6 80 + DIALOG --infobox "Passwords do not match! Please enter again." 6 80 unset _firstpass _secondpass sleep 2 && continue fi @@ -424,10 +426,23 @@ set_rootpassword() { } menu_useraccount() { - local _firstpass= _secondpass= _desc= + local _firstpass _secondpass _desc + local _groups _status _group _checklist + + while true; do + DIALOG --inputbox "Enter a primary login name:" ${INPUTSIZE} "void" + if [ $? -eq 0 ]; then + set_option USERLOGIN "$(cat $ANSWER)" + USERLOGIN_DONE=1 + break + else + return + fi + done while true; do - DIALOG --inputbox "Select primary user name:" ${INPUTSIZE} "void" + DIALOG --inputbox "Enter a user name for login '$(get_option USERLOGIN)' :" \ + ${INPUTSIZE} "$(get_option USERLOGIN)" if [ $? -eq 0 ]; then set_option USERNAME "$(cat $ANSWER)" USERNAME_DONE=1 @@ -439,11 +454,11 @@ menu_useraccount() { while true; do if [ -n "${_firstpass}" ]; then - _desc="Enter the password for '$(get_option USERNAME)' again (password won't be displayed)" + _desc="Enter the password for login '$(get_option USERLOGIN)' again" else - _desc="Enter the password for '$(get_option USERNAME)' (password won't be displayed)" + _desc="Enter the password for login '$(get_option USERLOGIN)'" fi - DIALOG --passwordbox "${_desc}" ${MSGBOXSIZE} + DIALOG --insecure --passwordbox "${_desc}" ${INPUTSIZE} if [ $? -eq 0 ]; then if [ -z "${_firstpass}" ]; then _firstpass="$(cat $ANSWER)" @@ -452,7 +467,7 @@ menu_useraccount() { fi if [ -n "${_firstpass}" -a -n "${_secondpass}" ]; then if [ "${_firstpass}" != "${_secondpass}" ]; then - DIALOG --infobox "Passwords do not match! please reenter it again" 6 80 + DIALOG --infobox "Passwords do not match! Please enter again." 6 80 unset _firstpass _secondpass sleep 2 && continue fi @@ -464,12 +479,45 @@ menu_useraccount() { return fi done + + _groups="wheel,audio,video,floppy,cdrom,optical,kvm,xbuilder" + while true; do + _desc="Select group membership for login '$(get_option USERLOGIN)':" + for _group in $(cat /etc/group); do + _gid="$(echo ${_group} | cut -d: -f3)" + _group="$(echo ${_group} | cut -d: -f1)" + _status="$(echo ${_groups} | grep -w ${_group})" + if [ -z "${_status}" ]; then + _status=off + else + _status=on + fi + if [ -z "${_checklist}" ]; then + _checklist="${_group} ${_group}:${_gid} ${_status}" + else + _checklist="${_checklist} ${_group} ${_group}:${_gid} ${_status}" + fi + done + DIALOG --no-tags --checklist "${_desc}" 20 60 18 ${_checklist} + if [ $? -eq 0 ]; then + set_option USERGROUPS $(cat $ANSWER | sed -e's| |,|g') + USERGROUPS_DONE=1 + break + else + return + fi + done } set_useraccount() { - useradd -R $TARGETDIR -m -G wheel,audio,video,floppy,cdrom,optical,kvm,xbuilder \ - "$(get_option USERNAME)" - echo "$(get_option USERNAME):$(get_option USERPASSWORD)" | chpasswd -R $TARGETDIR -c SHA512 + [ -z "$USERLOGIN_DONE" ] && return + [ -z "$USERPASSWORD_DONE" ] && return + [ -z "$USERNAME_DONE" ] && return + [ -z "$USERGROUPS_DONE" ] && return + useradd -R $TARGETDIR -m -G $(get_option USERGROUPS) \ + -c "$(get_option USERNAME)" $(get_option USERLOGIN) + echo "$(get_option USERLOGIN):$(get_option USERPASSWORD)" | \ + chpasswd -R $TARGETDIR -c SHA512 } menu_bootloader() { @@ -484,6 +532,18 @@ menu_bootloader() { return fi done + while true; do + DIALOG --yesno "Use a graphical terminal for the boot loader?" ${YESNOSIZE} + if [ $? -eq 0 ]; then + set_option TEXTCONSOLE 0 + break + elif [ $? -eq 1 ]; then + set_option TEXTCONSOLE 1 + break + else + return + fi + done } set_bootloader() { @@ -934,7 +994,7 @@ ${BOLD}Do you want to continue?${RESET}" 20 80 || return echo "tmpfs /tmp tmpfs defaults,nosuid,nodev 0 0" >> $TARGETDIR/etc/fstab - # set up keymap, locale, timezone, hostname and root passwd. + # set up keymap, locale, timezone, hostname, root passwd and user account. set_keymap set_locale set_timezone @@ -973,6 +1033,25 @@ ${BOLD}Do you want to continue?${RESET}" 20 80 || return fi fi + if [ -f $TARGETDIR/etc/sudoers ]; then + if [ -z "$(echo $(get_option USERGROUPS) | grep -w wheel)" ]; then + # enable sudo for primary user USERLOGIN + echo "# Enable sudo for login '$(get_option USERLOGIN)'" >> $TARGETDIR/etc/sudoers + echo "$(get_option USERLOGIN) ALL=(ALL) ALL" >> $TARGETDIR/etc/sudoers + else + # enable sudoers entry for members of group wheel for primary user + sed -i $TARGETDIR/etc/sudoers \ + -e "s;#.*%wheel ALL=(ALL) ALL;%wheel ALL=(ALL) ALL;" + fi + fi + + # enable text console for grub if chosen + if [ "$(get_option TEXTCONSOLE)" = "1" ]; then + sed -i $TARGETDIR/etc/default/grub \ + -e 's|#\(GRUB_TERMINAL_INPUT\).*|\1=console|' \ + -e 's|#\(GRUB_TERMINAL_OUTPUT\).*|\1=console|' + fi + # install bootloader. set_bootloader sync && sync && sync @@ -1071,8 +1150,8 @@ DIALOG --title "${BOLD}${RED} Enter the void ... ${RESET}" --msgbox "\n Welcome to the Void Linux installation. A simple and minimal \ Linux distribution made from scratch and built from the source package tree \ available for XBPS, a new alternative binary package system.\n\n -The installation should be pretty straightforward, if you are in trouble \ -please join us at ${BOLD}#xbps on irc.freenode.org${RESET}.\n\n +The installation should be pretty straightforward. If you are in trouble \ +please join us at ${BOLD}#xbps${RESET} on ${BOLD}irc.freenode.org${RESET}.\n\n ${BOLD}http://www.voidlinux.eu${RESET}\n\n" 16 80 while true; do -- cgit 1.4.1 From a15f8c0300399021d26b0428cfc441cbd237b43a Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 20 Apr 2016 14:36:57 +0200 Subject: mkrootfs: generate x86 tarballs correctly, requested by scaleway. --- mkrootfs.sh.in | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/mkrootfs.sh.in b/mkrootfs.sh.in index 472cec9..bdd76e9 100644 --- a/mkrootfs.sh.in +++ b/mkrootfs.sh.in @@ -76,7 +76,11 @@ umount_pseudofs() { run_cmd_target() { info_msg "Running $@ for target $_ARCH ..." - eval XBPS_TARGET_ARCH=${_TARGET_ARCH:=${_ARCH}} "$@" + if [ "${_TARGET_ARCH}" != "${_ARCH}" ]; then + eval XBPS_TARGET_ARCH=${_TARGET_ARCH:=${_ARCH}} "$@" + else + eval XBPS_ARCH=${_ARCH} "$@" + fi [ $? -ne 0 ] && die "Failed to run $@" } @@ -123,9 +127,9 @@ PLATFORM="$1" SUBPLATFORM=$PLATFORM case "$PLATFORM" in - i686-musl) _TARGET_ARCH="$PLATFORM"; _ARCH="i386";; - i686) _TARGET_ARCH="$PLATFORM"; _ARCH="i386";; - x86_64-musl) _TARGET_ARCH="$PLATFORM"; _ARCH="x86_64";; + i686-musl) _TARGET_ARCH="$PLATFORM"; _ARCH="i686-musl";; + i686) _TARGET_ARCH="$PLATFORM"; _ARCH="i686";; + x86_64-musl) _TARGET_ARCH="$PLATFORM"; _ARCH="x86_64-musl";; x86_64) _TARGET_ARCH="$PLATFORM"; _ARCH="x86_64";; dockstar) _TARGET_ARCH="armv5tel"; _ARCH="armv5tel";; rpi-musl) _TARGET_ARCH="armv6l-musl"; _ARCH="armv6l";; @@ -136,7 +140,10 @@ esac : ${XBPS_REPOSITORY:=--repository=http://repo.voidlinux.eu/current --repository=http://muslrepo.voidlinux.eu/current} : ${XBPS_CACHEDIR:=--cachedir=$PWD/xbps-cachedir-${_TARGET_ARCH}} -: ${PKGBASE:=base-system} +case "$PLATFORM" in + i686*|x86_64*) PKGBASE="base-voidstrap";; + *) PKGBASE="base-system";; +esac if [ -z "$PLATFORM" ]; then echo "$PROGNAME: platform was not set!" @@ -186,7 +193,7 @@ run_cmd_target "xbps-query -R -r $rootfs $XBPS_CONFFILE $XBPS_CACHEDIR $XBPS_REP chmod 755 $rootfs case "$PLATFORM" in - i686*|x86_64*) PKGS="${PKGBASE} grub" ;; + i686*|x86_64*) PKGS="${PKGBASE}" ;; *) PKGS="${PKGBASE} ${SUBPLATFORM}-base" ;; esac [ -n "$EXTRA_PKGS" ] && PKGS="${PKGS} ${EXTRA_PKGS}" -- cgit 1.4.1 From 06f8beb62844d34e2c310d80f9f0721e34e0934f Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 20 Apr 2016 16:19:55 +0200 Subject: *rootfs: fix remaining x86 rootfs issues. --- build-rootfs.sh.in | 10 +++++++--- mkrootfs.sh.in | 17 +++++++---------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/build-rootfs.sh.in b/build-rootfs.sh.in index 526ae96..ae6985e 100644 --- a/build-rootfs.sh.in +++ b/build-rootfs.sh.in @@ -3,10 +3,10 @@ TARGET="$1" [ -n "$TARGET" ] && shift -: ${PLATFORMS:="beaglebone cubieboard2 odroid-u2 rpi rpi2 usbarmory"} +: ${PLATFORMS:="beaglebone cubieboard2 odroid-u2 rpi rpi2 usbarmory x86_64 i686"} DATE=$(date '+%Y%m%d') -for f in ${PLATFORMS} x ${PLATFORMS} ; do +for f in ${PLATFORMS} x ${PLATFORMS}; do if [ "$f" = "x" ]; then musl=1 continue @@ -15,7 +15,11 @@ for f in ${PLATFORMS} x ${PLATFORMS} ; do if [ -n "$musl" ]; then target=${f}-musl fi - if [ -z "$ARGET" -o "$TARGET" = "$target" ]; then + if [ "$target" = "i686-musl" ]; then + # XXX no i686-musl repo yet + continue + fi + if [ -z "$TARGET" -o "$TARGET" = "$target" ]; then ./mkrootfs.sh $@ $target fi done diff --git a/mkrootfs.sh.in b/mkrootfs.sh.in index bdd76e9..583044c 100644 --- a/mkrootfs.sh.in +++ b/mkrootfs.sh.in @@ -76,11 +76,10 @@ umount_pseudofs() { run_cmd_target() { info_msg "Running $@ for target $_ARCH ..." - if [ "${_TARGET_ARCH}" != "${_ARCH}" ]; then - eval XBPS_TARGET_ARCH=${_TARGET_ARCH:=${_ARCH}} "$@" - else - eval XBPS_ARCH=${_ARCH} "$@" - fi + case "${_TARGET_ARCH}" in + i686*|x86_64*) eval XBPS_ARCH=${_TARGET_ARCH} "$@";; + *) eval XBPS_TARGET_ARCH=${_TARGET_ARCH:=${_ARCH}} "$@";; + esac [ $? -ne 0 ] && die "Failed to run $@" } @@ -127,10 +126,8 @@ PLATFORM="$1" SUBPLATFORM=$PLATFORM case "$PLATFORM" in - i686-musl) _TARGET_ARCH="$PLATFORM"; _ARCH="i686-musl";; - i686) _TARGET_ARCH="$PLATFORM"; _ARCH="i686";; - x86_64-musl) _TARGET_ARCH="$PLATFORM"; _ARCH="x86_64-musl";; - x86_64) _TARGET_ARCH="$PLATFORM"; _ARCH="x86_64";; + i686*) _TARGET_ARCH="$PLATFORM"; _ARCH="i686";; + x86_64*) _TARGET_ARCH="$PLATFORM"; _ARCH="x86_64";; dockstar) _TARGET_ARCH="armv5tel"; _ARCH="armv5tel";; rpi-musl) _TARGET_ARCH="armv6l-musl"; _ARCH="armv6l";; rpi) _TARGET_ARCH="armv6l"; _ARCH="armv6l";; @@ -218,7 +215,7 @@ if [ -n "${_ARCH}" ]; then info_msg "Reconfiguring packages for ${_ARCH} ..." case "$PLATFORM" in i686*|x86_64*) - run_cmd "XBPS_ARCH=$_ARCH xbps-reconfigure -r $rootfs base-files" + run_cmd "XBPS_ARCH=${PLATFORM} xbps-reconfigure -r $rootfs base-files" ;; *) register_binfmt -- cgit 1.4.1