[Moblin Dev] RE: the splash & initramfs patch for image-creator

Xu, Martin martin.xu at intel.com
Thu Aug 9 20:12:37 CDT 2007


JohnV:
Thank you very much for you reminding.
I have changed my mail to plain text mode and will provide the git link for your review.
:)

-----Original Message-----
From: dev-bounces at moblin.org [mailto:dev-bounces at moblin.org] On Behalf Of Villalovos, John L
Sent: 2007年8月10日 3:39
To: dev at moblin.org
Subject: [Moblin Dev] RE: the splash & initramfs patch for image-creator

Martin,
 
As Rusty stated, your patch is not really suitable for me to apply it.

#1 Problem.  You are sending emails with HTML.  Stop doing that!
Personally I think everyone should go set their emailer to use Plain
Text as the default email format.

It would be easiest if you tell me where to pull your tree from.  Then I
can easily merge your changes in.  Another option is to include the
patch as an attachment.

Oh one more thing.  Stop sending emails to dev-bounces at moblin.org.  That
doesn't work.  The email address is dev at moblin.org.

Thanks!
John


________________________________

	From: Xu, Martin 
	Sent: Thursday, August 09, 2007 1:49 AM
	To: Villalovos, John L; Lynch, Rusty
	Cc: Bryan, Shane; Spencer, Bob; 'dev-bounces at moblin.org'
	Subject: the splash & initramfs patch for image-creator
	
	

	Hi JohnV, Rusty:

	I want to add the patch into the image-creator, please help me
review it. If you accept it, please help me check into the
image-creator. I have verified it on q1-ultra platform. Thanks!

	1. the patch sync the target/etc/initramfs-tools with work
station /target/platforms/XXX/initramfs

	2. it makes initramfs at target jailroot, so 

	3. the image-creator can support all the debian package that
will update the initrd image 

	4. it adds the ubuntu boot usplash theme into the fset

	5, it also updates the install.sh scripts and let it support the
usplash. So the screen can show splash and text information when
installing image and booting.

	6. it also provide the feature that when user unplug the usb
key. System will reboot automatically

	7. select the "booting splashing ubuntu theme" item to add the
usplash theme

	 

	 

	diff --git a/libs/InstallImage.py b/libs/InstallImage.py

	index 53947af..f936961 100755

	--- a/libs/InstallImage.py

	+++ b/libs/InstallImage.py

	@@ -262,15 +262,10 @@ class InstallImage(object):

	 

	     def create_initramfs(self, initrd_file, kernel_mod_path,
fs_type='RAMFS'):

	         tmp = kernel_mod_path.split("/targets/%s/fs" %
(self.target.name))

	-        link = "%s%s" % (tmp[0], tmp[1])

	-

	-        if os.path.lexists(link):

	-            self.project.chroot("/bin/rm", tmp[1])

	-        args = "-s %s %s" % ("/targets/%s/fs%s" %
(self.target.name, tmp[1]), tmp[1])

	-        self.project.chroot("/bin/ln", args)

	-

	-        self.project.chroot("/usr/sbin/mkinitramfs", "-d %s -o
%s %s" % (os.path.join('/usr/share/pdk/platforms',
self.project.platform.name, 'initramfs'), initrd_file, tmp[1]))

	-

	+        self.target.chroot("/bin/rm", "-rf
/etc/initramfs-tools")

	+        self.target.chroot("/bin/cp", "-rf %s
/etc/initramfs-tools" %(os.path.join('/usr/share/pdk/platforms',
self.project.platform.name, 'initramfs')))

	+        self.target.chroot("/usr/sbin/mkinitramfs", "-o %s %s"
% (initrd_file , tmp[1]))

	+        

	     def create_grub_menu(self):

	         # remove previous menu.lst, since we are about to
create one

	         self.target.chroot("/bin/rm", " -f
/boot/grub/menu.lst")

	diff --git a/platforms/mccaslin/fsets/base.fset
b/platforms/mccaslin/fsets/base.fset

	index 11bbbb0..6e155e0 100644

	--- a/platforms/mccaslin/fsets/base.fset

	+++ b/platforms/mccaslin/fsets/base.fset

	@@ -1,3 +1,9 @@

	+[Booting Splashing ubuntu theme]

	+DESC=Booting Splash

	+PKGS=usplash-theme-ubuntu

	+DEBUG_PKGS=

	+DEPS=

	+

	 [Samsung-Full-Mobile-Stack-with-Proprietary]

	 DESC=The full samsung stack, including proprietary
(non-redistributable bits)

	 PKGS=flashplugin-nonfree

	diff --git a/platforms/mccaslin/hd_kernel_cmdline
b/platforms/mccaslin/hd_kernel_cmdline

	index 4057b7f..7e78d9f 100644

	--- a/platforms/mccaslin/hd_kernel_cmdline

	+++ b/platforms/mccaslin/hd_kernel_cmdline

	@@ -1 +1 @@

	-ro boot=disk

	+ro boot=disk splash quiet

	diff --git a/platforms/mccaslin/initramfs/modules
b/platforms/mccaslin/initramfs/modules

	index 773baa6..f319a32 100644

	--- a/platforms/mccaslin/initramfs/modules

	+++ b/platforms/mccaslin/initramfs/modules

	@@ -19,3 +19,4 @@ mbcache

	 jbd

	 ext2

	 ext3

	+fbcon

	diff --git a/platforms/mccaslin/install.sh
b/platforms/mccaslin/install.sh

	index c220f79..c0d3e22 100644

	--- a/platforms/mccaslin/install.sh

	+++ b/platforms/mccaslin/install.sh

	@@ -1,10 +1,60 @@

	 #!/bin/bash

	+splash=False

	+progress=0

	+#check the splash type

	+#currently check whether usplash has been installed

	 

	-echo -e '\nDeleting Partition Table on /dev/sda...\n'

	+splash_check_type(){

	+plash_write > /dev/null 2>/dev/null && splash=True

	+}

	+#show the progress at status bar.

	+#$1 0-100

	+splash_progress(){

	+    if [ splash = False ]; then

	+        return 0

	+    fi

	+    progress=$(( $progress + $1 ))

	+    usplash_write "PROGRESS $progress"

	+    return 0

	+}

	+#display the text no matter the verbose is set or not

	+splash_display(){

	+    if [ splash = False ]; then

	+         echo -n $1

	+         return 0

	+    fi

	+    usplash_write "TEXT-URGENT $1"

	+    return 0

	+}

	+#set the splash delay time

	+splash_delay(){

	+    if [ splash = False ]; then

	+          return 0

	+    fi

	+    usplash_write "TIMEOUT $1"

	+    return 0

	+}

	+

	+splash_display 'INSTALL..........'

	+#mount sys-filesystem

	+ls /sys/class/scsi_disk > /dev/null 2>&1

	+if [ $? != 0 ]; then

	+    ls /sys || mkdir /sys > /dev/null 2>&1

	+    mount -t sysfs /asfas /sys

	+fi

	+

	+pre_scsi_disk_number=$( ls /sys/class/scsi_disk | wc -l)

	+

	+splash_display 'Deleting Partition Table on /dev/sda...'

	+splash_delay 200

	 dd if=/dev/zero of=/dev/sda bs=512 count=2

	 sync

	+splash_progress 5

	+splash_delay 10

	 

	-echo -e 'Creating New Partiton Table on /dev/sda...\n'

	+splash_display 'Creating New Partiton Table on /dev/sda...'

	+splash_delay 200

	+type usplash_write >/dev/null 2>/dev/null && usplash_write
"TIMEOUT 200" || true

	 fdisk /dev/sda <<EOF

	 n

	 p

	@@ -22,37 +72,65 @@ w

	 EOF

	 

	 sync

	+splash_progress 5

	+splash_delay 10

	 

	-echo -e 'Formatting /dev/sda1 w/ ext2...\n'

	+splash_display 'Formatting /dev/sda1 w/ ext2...'

	+type usplash_write >/dev/null 2>/dev/null && usplash_write
"TIMEOUT 200" || true

	 mkfs.ext2 /dev/sda1

	 sync

	+splash_progress 5

	+splash_delay 10

	+

	 

	-echo -e 'Formatting /dev/sda2 w/ ext3...\n'

	+splash_display 'Formatting /dev/sda2 w/ ext3...'

	+splash_delay 200

	 mkfs.ext3 /dev/sda2

	 sync

	+splash_progress 50

	+splash_delay 10

	 

	-echo -e 'Mounting partitions...\n'

	+splash_display 'Mounting partitions...'

	+splash_delay 200

	 mkdir /tmp/boot

	 mount -o loop -t squashfs /tmp/install/bootfs.img /tmp/boot

	 

	+

	 mount /dev/sda2 /mnt

	 mkdir /mnt/boot

	 mount /dev/sda1 /mnt/boot

	+splash_progress 2

	+splash_delay 10

	 

	-echo -e 'Copying system files onto hard disk drive...\n'

	+splash_display 'Copying system files onto hard disk drive...'

	+splash_delay 200

	 cp -v /tmp/install/rootfs.img /mnt/boot

	 cp -av /tmp/boot /mnt

	 

	 /usr/sbin/grub-install --root-directory=/mnt /dev/sda

	+splash_progress 30

	+splash_delay 10

	+

	+splash_display 'Unmounting partitions...'

	+plash_delay 200

	 

	-echo -e 'Unmounting partitions...\n'

	 umount /mnt/boot

	 umount /mnt

	 umount /tmp/boot

	 umount /tmp/install

	+splash_progress 2

	+splash_delay 10

	+sleep 1

	+splash_delay 6000

	+splash_display "Install Successfully"

	+splash_display "Unplug USB Key, System Will Reboot
Automatically"

	 

	-echo "Installation complete.  Unplug the USB key and repower
the device."

	-while true; do

	-   sleep 100

	+while [ $pre_scsi_disk_number = $(ls /sys/class/scsi_disk | wc
-l) ]

	+do

	+    sleep 1

	 done

	 

	+splash_progress 1

	+splash_delay 1

	+

	+reboot -f

	diff --git a/platforms/mccaslin/usb_kernel_cmdline
b/platforms/mccaslin/usb_kernel_cmdline

	index 4b0ff07..ee5fd21 100644

	--- a/platforms/mccaslin/usb_kernel_cmdline

	+++ b/platforms/mccaslin/usb_kernel_cmdline

	@@ -1 +1 @@

	-initrd=initrd.img boot=usb 

	+initrd=initrd.img boot=usb splash quiet 

	 

	 
_______________________________________________
dev mailing list
dev at moblin.org
https://www.moblin.org/mailman/listinfo/dev



More information about the dev mailing list