[meego-commits] 5339: Changes to Trunk:Testing/installer

Vivian Zhang vivian.zhang at intel.com
Mon Jul 5 08:38:37 UTC 2010


Hi,
I have made the following changes to installer in project Trunk:Testing. Please review and accept ASAP.

Thank You,
Vivian Zhang

[This message was auto-generated]

---

Request #5339:

  submit:   home:vivian:branches:Trunk:Testing/installer(r18)(cleanup) -> Trunk:Testing/installer


Message:
    Clean the spec file and remove Requires for authconfig, squash-tools, isomd5sum, comps-extra, dmidecode, makebootfat, isomd5sum;Remove more packages after the installation completes (BMC #2954);Rewrite partition part to use sfdisk to remove the parted dependency(GPLv3) for installer-shell

State:   new          2010-07-04T20:34:32 vivian
Comment: None



changes files:
--------------
--- installer.changes
+++ installer.changes
@@ -0,0 +1,6 @@
+* Thu Jul 01 2010 Vivian Zhang <vivian.zhang at intel.com> - 0.56
+- Clean the spec file and remove Requires for authconfig, squash-tools, isomd5sum, comps-extra, dmidecode, makebootfat, isomd5sum.
+- Remove more packages after the installation completes (BMC #2954) 
+- Rewrite partition part to use sfdisk instead of parted in installer-shell
+- Remove dependency between installer and installer-shell to remove the depencency for parted (GPLV3)
+

new:
----
  fix-2954-remove-correct-packages.patch
  remove-authconfig-dependency.patch

spec files:
-----------
--- installer.spec
+++ installer.spec
@@ -11,10 +11,7 @@
 %define pykickstartver 1.46
 %define rpmpythonver 4.2-0.61
 %define rhplver 0.170
-%define partedver 1.8.1
 %define pypartedver 2.1.2
-%define syscfgdatever 1.9.0
-%define libbdevidver 5.1.2-1
 %define desktopfileutilsver 0.8
 %define e2fsver 1.41.0
 %define dbusver 1.2.3
@@ -38,44 +35,33 @@
 Source100:  installer.yaml
 Patch0:     launch-installer-shell.patch
 Patch1:     use-menu.c32-for-ivi-build.patch
+Patch2:     remove-authconfig-dependency.patch
+Patch3:     fix-2954-remove-correct-packages.patch
 Requires:   pygtk2-libglade
 Requires:   rpm-python >= %{rpmpythonver}
-Requires:   comps-extras
 Requires:   rhpl >= %{rhplver}
-Requires:   parted >= %{partedver}
 Requires:   pyparted >= %{pypartedver}
 Requires:   libxml2-python
 Requires:   python-urlgrabber
 Requires:   system-logos
 Requires:   pykickstart >= %{pykickstartver}
 Requires:   device-mapper >= %{dmver}
-Requires:   device-mapper-libs >= %{dmver}
 Requires:   dosfstools
 Requires:   e2fsprogs >= %{e2fsver}
 Requires:   btrfs-progs
 Requires:   gzip
-Requires:   dmidecode
 Requires:   libuser-python
-Requires:   authconfig
 Requires:   util-linux-ng
 Requires:   dbus-python
 Requires:   GConf-dbus
 Requires:   cracklib-python
 Requires:   usermode
-Requires:   zenity
-Requires:   squashfs-tools
-Requires:   syslinux
-Requires:   makebootfat
-Requires:   device-mapper
-Requires:   isomd5sum
 Requires:   connman
-Requires:   dhclient
-Requires:   dhcpv6-client
 Requires:   syslinux-extlinux
 Requires:   dbus-python
+Requires:   installer-launch
 Requires(post): desktop-file-utils >= %{desktopfileutilsver}
 Requires(post): /bin/touch
-Requires(post): gtk2
 Requires(postun): desktop-file-utils >= %{desktopfileutilsver}
 BuildRequires:  pkgconfig(devmapper)
 BuildRequires:  pkgconfig(xt)
@@ -125,12 +111,25 @@
 %package shell
 Summary:    A shell-script based installer
 Group:      Applications/System
-Requires:   %{name} = %{version}-%{release}
 Requires:   dialog
+Requires:   system-logos
+Requires:   e2fsprogs
+Requires:   btrfs-progs
+Requires:   util-linux-ng
+Requires:   syslinux-extlinux
+Requires:   installer-launch
 
 %description shell
 A shell-script based installer which implements the installation process in silent mode
 
+%package launch
+Summary:    Liveinst script to launch installer
+Group:      Applications/System
+Requires:   zenity
+
+%description launch
+A shell-script to launch installer
+
 
 %prep
 %setup -q -n %{name}-%{version}
@@ -139,6 +138,10 @@
 %patch0 -p1
 # use-menu.c32-for-ivi-build.patch
 %patch1 -p1
+# remove-authconfig-dependency.patch
+%patch2 -p1
+# fix-2954-remove-correct-packages.patch
+%patch3 -p1
 # >> setup
 # << setup
 
@@ -207,6 +210,9 @@
 
 
 
+
+
+
 %files -f anaconda.lang
 %defattr(-,root,root,-)
 # >> files
@@ -228,8 +234,6 @@
 %{_prefix}/lib/anaconda
 %{_prefix}/lib/anaconda-runtime
 %ifarch %livearches
-%{_bindir}/liveinst
-%{_sbindir}/liveinst
 %{_sysconfdir}/pam.d/*
 %exclude %{_sysconfdir}/X11/xinit/xinitrc.d/*
 %{_sysconfdir}/security/console.apps/*
@@ -244,7 +248,7 @@
 %defattr(-,root,root,-)
 # >> files basic
 /usr/sbin/installer-basic
-/etc/installer/en.install
+%config /etc/installer/en.install
 # << files basic
 
 %files shell
@@ -254,3 +258,10 @@
 /etc/installer/pre_install.sh
 # << files shell
 
+%files launch
+%defattr(-,root,root,-)
+# >> files launch
+%{_bindir}/liveinst
+%{_sbindir}/liveinst
+# << files launch
+

other changes:
--------------

++++++ fix-2954-remove-correct-packages.patch (new)
--- fix-2954-remove-correct-packages.patch
+++ fix-2954-remove-correct-packages.patch
+diff -Nur installer-0.55/backend.py installer-0.55-new/backend.py
+--- installer-0.55/backend.py	2010-05-16 21:47:42.000000000 -0400
++++ installer-0.55-new/backend.py	2010-07-02 01:34:00.248288782 -0400
+@@ -138,7 +138,10 @@
+     def deleteUnusedPackages(self, anaconda):
+         # check whether the installer package exists
+         if os.access(anaconda.rootPath + "/usr/sbin/anaconda", os.F_OK) :
+-            deletePackageList = ["installer", "moblin-live", "isomd5sum", "pykickstart", "squashfs-tools"]  
++            if os.access(anaconda.rootPath + "/usr/sbin/installer-shell", os.F_OK) :
++                deletePackageList = ["installer", "installer-shell", "installer-launch", "moblin-live", "pykickstart"]  
++            else:
++                deletePackageList = ["installer", "installer-launch", "moblin-live", "pykickstart"]  
+ 
+             log.info ("Delete unused package %s" % (deletePackageList, ) )

++++++ installer-shell
--- installer-shell
+++ installer-shell
@@ -62,11 +62,12 @@
     output "Check all disks and choose one to install"
     local DISK_LIST SIZE VENDOR MODEL DISKNAME i DEV_SIZE DISKNAME_LIST LIVE_DEV
     DISK_LIST=""
+    LIVE_DEV=""
     LIVE_DEV=`cat /etc/mtab | grep "/mnt/live" | cut -d " " -f1 | sed "s/[0-9]//"`
     echo $LIVE_DEV
 
     for i in `cat /proc/partitions | sed -n "s/\ *[0-9][0-9]*\ *[0-9][0-9]*\ *[0-9][0-9]*\ \([a-z]*\)$/\1/p"`; do
-        if test "/dev/$i" = $LIVE_DEV ; then
+        if test "/dev/$i" = "$LIVE_DEV" ; then
             output " * $i looks to be the live device, skip"
             continue
         fi
@@ -103,62 +104,35 @@
 }
 
 
-clear_all_partition_on_disk () {
-    local LOC_DISK="$1"
- 
-    output "Clear all partitions on /dev/$1"
-
-    for i in `parted -s /dev/$LOC_DISK print 2>/dev/null | sed 's/^ //' | grep ^[0-9] | cut -f1 -d' '`; do
-        dbglg "/sbin/parted /dev/$LOC_DISK rm $i"
-        output " * Remove partition /dev/$LOC_DISK$i"
-        /sbin/parted /dev/$LOC_DISK rm $i >> $LOGFILE 2>&1
-        ret=$?
-        if [ $ret -ne 0 ]; then
-            # Failed to delte partitions
-            output "Error: Failed to delete partition $i"
-            fail_exit
-        fi
-    done
-
-}
-
-create_fs() {
-
+create_partitions () {
     output "Create new partitions on /dev/$DEV"
-    DEV_SIZE=`sfdisk -s /dev/${DEV} | sed 's/\([0-9]*\)[0-9]\{3\}/\1/'`
+    DEV_SIZE=`sfdisk -s /dev/${DEV}`
+    DEV_SIZE=$((DEV_SIZE/1024))
     BOOT_SIZE=200
-    ROOT_SIZE=$((DEV_SIZE - BOOT_SIZE - SWAP_SIZE))
     SWAP_SIZE=256
+    ROOT_SIZE=$((DEV_SIZE - SWAP_SIZE - BOOT_SIZE))
 
-    dbglg "Got dev_size=$DEV_SIZE swap_size=$SWAP_SIZE"
+    output "Got dev_size=$DEV_SIZE swap_size=$SWAP_SIZE root_size=$ROOT_SIZE"
 
     ROOT_END=$((DEV_SIZE - SWAP_SIZE))
     SWAP_END=$DEV_SIZE
 
     
-    dbglg "/sbin/parted /dev/$DEV mkpart primary 0 $BOOT_SIZE"
-    /sbin/parted -s /dev/$DEV mkpart primary 0 $BOOT_SIZE>>$LOGFILE 2>&1
+    sfdisk -uM /dev/$DEV << EOF
+,$BOOT_SIZE,L,*
+,$ROOT_SIZE,L
+,,L
+EOF
+    
+    output "sfdisk finished"
     BOOTDEV=/dev/${DEV}1
-    output " * Create partition $BOOTDEV ${BOOT_SIZE}MB as /boot"
-
-    dbglg "/sbin/parted /dev/$DEV mkpart primary 200 $ROOT_END"
-    /sbin/parted /dev/$DEV mkpart primary 200 $ROOT_END>>$LOGFILE 2>&1
     ROOTDEV=/dev/${DEV}2
-    output " * Create partition $ROOTDEV ${ROOT_SIZE}MB as /"
-
-    if [ $((SWAP_SIZE)) > 0 ]; then
-        dbglg "/sbin/parted /dev/$DEV primary $ROOT_END $SWAP_END"
-        /sbin/parted /dev/$DEV mkpart primary $ROOT_END $SWAP_END>>$LOGFILE 2>&1
-        SWAPDEV=/dev/${DEV}3
-        output " * Create partition $SWAPDEV ${SWAP_SIZE} as swap"
-    fi
-
-    dbglg "parted -s /dev/$DEV set 1 boot on"
-    parted -s /dev/$DEV set 1 boot on >>$$LOGFILE 2>&1
-
-    dbglg "bootdev=$BOOTDEV  rootdev=$ROOTDEV swapdev=$SWAPDEV"
-
+    SWAPDEV=/dev/${DEV}3
+     
     sleep 1
+}
+
+create_fs() {
 
     output "Create filesystems"
     # if bootdev is not null
@@ -182,9 +156,6 @@
         dbglg "$FORMATSWAP $SWAPDEV"
         $FORMATSWAP $SWAPDEV >> $LOGFILE 2>&1
     fi
-
-    parted -s /dev/$DEV print 2>/dev/null | sed 's/^ //' | grep ^[0-9]
-    
 }
 
 progress_bar() {
@@ -258,21 +229,12 @@
         fail_exit
     fi
 
-    dbglg "mount /mnt/live/LiveOS/squashfs.img $INSTALL_DIR/sq"
-    mount -o loop /mnt/live/LiveOS/squashfs.img $INSTALL_DIR/sq
-    ret=$?
-    if [ $ret -ne 0 ]; then
-        # LiveOS is not mountable Return an error msg and exit
-        output  "Error: unable to mount squashfs on sq"
-        fail_exit
-    fi
-
-    dbglg "mount  -o loop  $INSTALL_DIR/sq/LiveOS/ext3fs.img $INSTALL_DIR/fs"
-    mount  -o loop $INSTALL_DIR/sq/LiveOS/ext3fs.img $INSTALL_DIR/fs
+    dbglg "mount  -o loop,ro  /dev/live-osimg $INSTALL_DIR/fs"
+    mount  -o loop,ro  /dev/live-osimg $INSTALL_DIR/fs
     ret=$?
     if [ $ret -ne 0 ]; then
         # LiveOS is not mountable Return an error msg and exit
-        output "Error: unable to mount ext3fs.img on fs"
+        output "Error: unable to mount /dev/live-osimg on fs"
         fail_exit
     fi
 
@@ -410,7 +372,9 @@
     dbglg "cp ${ROOTMNT}/usr/lib/anaconda-runtime/syslinux-vesa-splash.jpg ${CONF_DIR}/splash.jpg"            
     cp ${ROOTMNT}/usr/lib/anaconda-runtime/syslinux-vesa-splash.jpg ${CONF_DIR}/splash.jpg >> $LOGFILE 2>&1        
     dbglg "cp ${BOOTFS_DIR}/${KERN} ${CONF_DIR}"    
-    cp ${BOOTFS_DIR}/${KERN} ${CONF_DIR}    
+    dbglg "ln -s ../${KERN} ${CONF_DIR}/${KERN}"
+    ln -s ../${KERN} ${CONF_DIR}/${KERN}
+       
 }
 
 do_postinstall() {
@@ -475,7 +439,7 @@
 done
 echo ""
 
-clear_all_partition_on_disk $DEV
+create_partitions
 create_fs
 copy_fs
 write_fstab

++++++ installer.yaml
--- installer.yaml
+++ installer.yaml
@@ -17,6 +17,8 @@
 Patches:
     - launch-installer-shell.patch
     - use-menu.c32-for-ivi-build.patch
+    - remove-authconfig-dependency.patch
+    - fix-2954-remove-correct-packages.patch
 Description: |
     The installer package contains the program which was used to install your 
     system.  These files are of little use on an already installed system.
@@ -24,39 +26,27 @@
 Requires:
     - pygtk2-libglade
     - rpm-python >= %{rpmpythonver}
-    - comps-extras
     - rhpl >= %{rhplver}
-    - parted >= %{partedver}
     - pyparted >= %{pypartedver}
     - libxml2-python
     - python-urlgrabber
     - system-logos
     - pykickstart >= %{pykickstartver}
     - device-mapper >= %{dmver}
-    - device-mapper-libs >= %{dmver}
     - dosfstools
     - e2fsprogs >= %{e2fsver}
     - btrfs-progs
     - gzip
-    - dmidecode
     - libuser-python
-    - authconfig
     - util-linux-ng
     - dbus-python
     - GConf-dbus
     - cracklib-python
     - usermode
-    - zenity
-    - squashfs-tools
-    - syslinux
-    - makebootfat
-    - device-mapper
-    - isomd5sum
     - connman
-    - dhclient
-    - dhcpv6-client
     - syslinux-extlinux
     - dbus-python
+    - installer-launch
 RequiresPost:
     - desktop-file-utils >= %{desktopfileutilsver}
 RequiresPostUn:
@@ -109,5 +99,19 @@
       Description: A shell-script based installer which implements the installation process in silent mode
       Requires: 
         - dialog
+        - system-logos
+        - e2fsprogs
+        - btrfs-progs
+        - util-linux-ng
+        - syslinux-extlinux
+        - installer-launch
+    - Name: launch
+      Summary: Liveinst script to launch installer
+      Group: Applications/System
+      Description: A shell-script to launch installer
+      Requires:
+        - zenity
+      
+
 
 

++++++ launch-installer-shell.patch
--- launch-installer-shell.patch
+++ launch-installer-shell.patch
@@ -1,20 +1,88 @@
-diff -Nur installer-0.54/liveinst/liveinst.sh installer-0.54-new/liveinst/liveinst.sh
---- installer-0.54/liveinst/liveinst.sh	2010-05-17 09:47:42.475499787 +0800
-+++ installer-0.54-new/liveinst/liveinst.sh	2010-05-21 10:49:50.196834419 +0800
-@@ -30,6 +30,16 @@
- # Disable IM during installation
- unset GTK_IM_MODULE
+diff -Nur installer-0.55/liveinst/liveinst.sh installer-0.55-new/liveinst/liveinst.sh
+--- installer-0.55/liveinst/liveinst.sh	2010-05-16 21:47:42.000000000 -0400
++++ installer-0.55-new/liveinst/liveinst.sh	2010-07-02 04:05:29.358101200 -0400
+@@ -27,36 +27,14 @@
+ export ANACONDA_BUGURL=${ANACONDA_BUGURL:="http://bugzilla.meego.com/"}
+ export PATH=/sbin:/usr/sbin:$PATH
  
-+# if installer-shell script exists, launch it
-+if [ -x /usr/sbin/installer-shell ]; then
+-# Disable IM during installation
+-unset GTK_IM_MODULE
+-
+-# load modules that would get loaded by the loader... (#230945)
+-# for i in raid0 raid1 raid5 raid6 raid456 raid10 fat msdos gfs2 reiserfs ext2 ext3 jfs xfs dm-mod dm-zero dm-mirror dm-snapshot dm-multipath dm-round-robin vfat ; do /sbin/modprobe $i ; done
+-#if [ -n "$DISPLAY" -a -n "$LANG" ]; then
+-#    INSTLANG="--lang $LANG"
+-#fi
+-
+-uname=$(uname -r)
+-if strstr "$uname" moblin && strstr "$uname" netbook ; then
+-    echo "You are running an meego netbook image." > /dev/tty5
+-    gpuid=$(lspci -s 00:02.0 -n)
+-    if strstr "$gpuid" 8086; then
+-        echo "PCIInfo for your graphics: $gpuid" > /dev/tty5
+-    else
+-        echo "PCIInfo for your graphics: $gpuid"
+-        echo "WARNING: Your graphics card is not in our support list, the installation might be fail on your platform!"
+-    fi
+-fi
+-        
+-
+ if strstr "$cmdline" netinst ; then
+     ANACONDA="/usr/sbin/anaconda"
+ else
+     if [ -z "$LIVE_BLOCK" ]; then
+         if [ -b "/dev/mapper/live-osimg-min" ]; then
+-	    LIVE_BLOCK="/dev/mapper/live-osimg-min"
++            LIVE_BLOCK="/dev/mapper/live-osimg-min"
+         else
+-	    LIVE_BLOCK="/dev/live-osimg"
++            LIVE_BLOCK="/dev/live-osimg"
+         fi
+     fi
+ 
+@@ -68,14 +46,41 @@
+ fi
+ 
+ /sbin/swapoff -a
+-#/sbin/lvm vgchange -an --ignorelockingfailure
+ 
+-if [ -x /usr/bin/hal-lock -a -e /var/lock/subsys/haldaemon ]; then
+-    /usr/bin/hal-lock --interface org.freedesktop.Hal.Device.Storage --exclusive --run "$ANACONDA $* 2>/dev/null"
++# if installer-shell and anaconda script both exists, launch the dialog to choose 
++if [ -x /usr/sbin/installer-shell ] && [ -x /usr/sbin/anaconda ]; then
 +    MODE=`dialog --no-cancel --stdout --backtitle  "MeeGo Installer" --title "Installation mode selection" --menu "Choose the mode to start install" 0 40 0 1 "Text Mode" 2 "GUI Mode"`
 +    clear
 +    if [ $MODE = "1" ]; then
 +        /usr/sbin/installer-shell
 +        exit 0
 +    fi
+ else
+-    $ANACONDA $* 2>/dev/null
++    # only installer-shell exists
++    if [ -x /usr/sbin/installer-shell ]; then
++        /usr/sbin/installer-shell
++        exit 0
++    fi
+ fi
+ 
++
++# Disable IM during installation
++unset GTK_IM_MODULE
++
++uname=$(uname -r)
++if strstr "$uname" moblin && strstr "$uname" netbook ; then
++    echo "You are running an meego netbook image." > /dev/tty5
++    gpuid=$(lspci -s 00:02.0 -n)
++    if strstr "$gpuid" 8086; then
++        echo "PCIInfo for your graphics: $gpuid" > /dev/tty5
++    else
++        echo "PCIInfo for your graphics: $gpuid"
++        echo "WARNING: Your graphics card is not in our support list, the installation might be fail on your platform!"
++    fi
 +fi
 +
- # load modules that would get loaded by the loader... (#230945)
- # for i in raid0 raid1 raid5 raid6 raid456 raid10 fat msdos gfs2 reiserfs ext2 ext3 jfs xfs dm-mod dm-zero dm-mirror dm-snapshot dm-multipath dm-round-robin vfat ; do /sbin/modprobe $i ; done
- #if [ -n "$DISPLAY" -a -n "$LANG" ]; then
++$ANACONDA $* 2>/dev/null
++
+ # Reboot after installation is done
+ if strstr "$cmdline" liveinst || strstr "$cmdline" netinst || strstr "$cmdline" liveimg; then
+     # check whether the installation completed sucessfully

++++++ pre_install.sh
--- pre_install.sh
+++ pre_install.sh
@@ -1,8 +1,7 @@
 #!/bin/sh
 
 rpm -e installer-shell
-rpm -e installer
 rpm -e moblin-live
-rpm -e isomd5sum
+rpm -e installer-launch --nodeps
+rpm -e installer
 rpm -e pykickstart
-rpm -e squashfs-tools

++++++ remove-authconfig-dependency.patch (new)
--- remove-authconfig-dependency.patch
+++ remove-authconfig-dependency.patch
+diff -Nur installer-0.55/instdata.py installer-0.55-new/instdata.py
+--- installer-0.55/instdata.py	2010-05-16 21:47:42.000000000 -0400
++++ installer-0.55-new/instdata.py	2010-07-01 03:55:05.541104955 -0400
+@@ -194,15 +194,15 @@
+ 
+         args = ["--update", "--nostart"] + shlex.split(self.auth)
+ 
+-        try:
+-            if not flags.test:
+-                iutil.execWithRedirect("/usr/sbin/authconfig", args,
+-                                       stdout = "/dev/tty5", stderr = "/dev/tty5",
+-                                       root = self.anaconda.rootPath)
+-            else:
+-                log.error("Would have run: %s", args)
+-        except RuntimeError, msg:
+-                log.error("Error running %s: %s", args, msg)
++        #try:
++        #    if not flags.test:
++        #        iutil.execWithRedirect("/usr/sbin/authconfig", args,
++        #                               stdout = "/dev/tty5", stderr = "/dev/tty5",
++        #                               root = self.anaconda.rootPath)
++        #    else:
++        #        log.error("Would have run: %s", args)
++        #except RuntimeError, msg:
++        #        log.error("Error running %s: %s", args, msg)
+ 
+         self.network.write (instPath=self.anaconda.rootPath,
+                             anaconda=self.anaconda,



More information about the MeeGo-commits mailing list