From e84e769d1a8ec1b669ee9bfa675c610b22a8b0c6 Mon Sep 17 00:00:00 2001 From: Guittet Thibault Date: Tue, 27 May 2014 15:00:12 +0200 Subject: [PATCH] Various fixes and improvements Signed-off-by: Guittet Thibault --- packaging/system-installer.spec | 11 ++++++++--- scripts/select-disk-util | 2 +- scripts/system-installer | 13 +++++++------ scripts/url-utils | 8 ++++---- scripts/wifi-config | 2 +- 5 files changed, 21 insertions(+), 15 deletions(-) diff --git a/packaging/system-installer.spec b/packaging/system-installer.spec index 7ec8570..375c9df 100644 --- a/packaging/system-installer.spec +++ b/packaging/system-installer.spec @@ -17,6 +17,8 @@ Requires: rsync Requires: snapper Requires: syslinux-extlinux Requires: util-linux +Requires(post): /sbin/ldconfig +Requires(postun): /sbin/ldconfig BuildRequires: autoconf >= 2.64, automake >= 1.11 BuildRequires: libtool BuildRequires: ncurses-devel @@ -61,8 +63,6 @@ tar --strip-components=1 -xvzf %{SOURCE2} --enable-included-msgs \ --enable-nls \ --enable-widec \ - --disable-Xdialog \ - --disable-Xdialog2 \ --with-libtool \ --with-ncurses \ --with-ncursesw @@ -80,7 +80,7 @@ rm -rf %{buildroot}%{_mandir} ## for system-installer ## install -d %{buildroot}/%{_sbindir} -install -d %{buildroot}/%{_unitdir} +install -d %{buildroot}/%{_unitdir}/default.target.wants install -d %{buildroot}/root install -m 0644 systemd/system-installer.service %{buildroot}/%{_unitdir} install -m 0775 scripts/system-installer %{buildroot}/%{_sbindir}/system-installer @@ -91,6 +91,7 @@ install -m 0775 scripts/wifi-config %{buildroot}/%{_sbindir}/wifi-config install -m 0775 scripts/installer.conf %{buildroot}/%{_sbindir}/installer.conf install -m 0775 scripts/wifi %{buildroot}/%{_sbindir}/wifi install -m 0644 scripts/.dialogrc %{buildroot}/root/.dialogrc +ln -sf ../systemd/system-installer.service %{buildroot}/%{_unitdir}/default.target.wants/system-installer.service ## for system-installer-dialog ##1 %post dialog -p /sbin/ldconfig @@ -101,11 +102,15 @@ install -m 0644 scripts/.dialogrc %{buildroot}/root/.dialogrc %postun dialog-devel -p /sbin/ldconfig +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig %files %manifest %{name}.manifest %defattr(-,root,root) %{_unitdir}/system-installer.service +%{_unitdir}/default.target.wants/system-installer.service %{_sbindir}/system-installer %{_sbindir}/dialog-helper %{_sbindir}/select-disk-util diff --git a/scripts/select-disk-util b/scripts/select-disk-util index fc93016..f9d373c 100755 --- a/scripts/select-disk-util +++ b/scripts/select-disk-util @@ -5,7 +5,7 @@ # If no devices are found, the program exit with error code 1 outfile=${1:-/dev/stdout} -. ./dialog-helper +. /usr/sbin/dialog-helper target_array=() for i in $(ls /sys/block/*/device/model); do diff --git a/scripts/system-installer b/scripts/system-installer index 9bee274..8205fd1 100755 --- a/scripts/system-installer +++ b/scripts/system-installer @@ -30,9 +30,9 @@ output_data_file="/tmp/system-installer.$$" # Mount point used to change the keymap layout of weston on the device mountpoint="/tmp/output_device_mount_point" # configuration file of system-installer -conf_file="./installer.conf" +conf_file="/usr/sbin/installer.conf" -. ./dialog-helper +. /usr/sbin/dialog-helper # Simply read the configuration in $conf_file, exit if not found function read_config { @@ -48,7 +48,7 @@ function read_config { # Download the raw image, decompress it and write it on the device # When the image is written, the partition size is modified function install_os { - curl -s -S "$IMAGE_URL" | bzcat | buffer -z 512k -m 32m -p 75 -o $OUTDEV + bmaptool copy "$IMAGE_URL" "$OUTDEV" local RESIZEFS=yes @@ -87,7 +87,7 @@ function test_connection { curl --connect-timeout 10 -s "http://download.tizen.org/" > /dev/null if [[ $? != 0 ]]; then [ -z "$KEYBOARD_LAYOUT" ] && select_keyboard_layout - ./wifi-config || exit 1 + /usr/sbin/wifi-config || exit 1 fi } @@ -102,7 +102,7 @@ read_config if [ -z "$IMAGE_URL" ] ;then test_connection - ./url-utils "$output_data_file" + /usr/sbin/url-utils "$output_data_file" IMAGE_URL=$(cat "$output_data_file") elif ! curl --fail -I "$IMAGE_URL" > /dev/null ; then echo "The image url couldn't be reached, please verify that the url is correct." @@ -110,7 +110,7 @@ elif ! curl --fail -I "$IMAGE_URL" > /dev/null ; then fi if [ -z "$OUTDEV" ] ;then - ./select-disk-util "$output_data_file" || exit 1 + /usr/sbin/select-disk-util "$output_data_file" || exit 1 OUTDEV=$(cat "$output_data_file") elif [ ! -b "$OUTDEV" ] ; then echo "The output device is not a block device." @@ -122,6 +122,7 @@ rm -f "$output_data_file" 2>/dev/null dialog --yesno "Do you whant to proceed with the installation ? All your data on the target device will be lost." 10 40 || exit 1 # Download and install the image +dialog --infobox "Installation in progress, hang tight..." 10 40 install_os # Mounting device diff --git a/scripts/url-utils b/scripts/url-utils index e7d67d7..f60f6ff 100755 --- a/scripts/url-utils +++ b/scripts/url-utils @@ -8,14 +8,14 @@ N=3 # Some images are excluded -BLACKLIST="-e unsafe -e emul -e efi -e testing" +BLACKLIST="-e unsafe -e emul -e efi -e testing -e installer" # Field number used to retrieve the href value in a listing # The fields are separated by " HREF_FIELD_NO=6 outfile=${1:-/dev/stdout} -. ./dialog-helper +. /usr/sbin/dialog-helper tmp_outfile="/tmp/url-utils.$$" # Print the href values of a directory listing @@ -60,7 +60,7 @@ dialog_helper --no-items --menu "Choose your image type" 10 30 2 "snapshot" "rel TYPE="$DIALOGRES" # Deduces the architecture if not set -[ -z "$ARCH" ] && ARCH=$(lscpu |grep "^Architecture" |awk '{print $2}') +[ -z "$ARCH" ] && ARCH=$(lscpu |grep -q "^CPU op-mode.*64-bit.*" && echo "x86_64") # "base" URL if [ "$TYPE" = "release" ]; then @@ -76,7 +76,7 @@ else fi # This follow the (odd) naming conventions of download.tizen.org -# Also, if you have ARCH = "x86_64", images of the "ia32" architecture will be printed +# Also, if you have ARCH = "x86_64", images of the "ia32" architecture also will be printed if [ "$PROFIL" = "IVI" ]; then URL1="${URL}ivi/ivi/" else diff --git a/scripts/wifi-config b/scripts/wifi-config index 3abe3d3..c930c22 100755 --- a/scripts/wifi-config +++ b/scripts/wifi-config @@ -3,7 +3,7 @@ # Offer a dialog interface for simple wifi connection data_out="/tmp/wifi-config.$$" -. ./dialog-helper +. /usr/sbin/dialog-helper ssid="" passphrase="" -- 2.7.4