Fix to let the /mnt/cdrom/cdupdate.sh script run just before the chroot
authorEric Edgar <rocket@gentoo.org>
Mon, 11 Jul 2005 13:43:45 +0000 (13:43 +0000)
committerEric Edgar <rocket@gentoo.org>
Mon, 11 Jul 2005 13:43:45 +0000 (13:43 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@244 67a159dc-881f-0410-a524-ba9dfbe2cb84

generic/initrd.scripts
generic/linuxrc

index 4a1043d2c24585858bc1de4746318da86213a3e4..83b3c048cbf80b76664ef61326a5ba58659b880a 100644 (file)
@@ -473,16 +473,22 @@ verbose_kmsg() {
 
 
 cdupdate() {
-    if [ -x /${NEW_ROOT}/mnt/cdrom/cdupdate.sh ]
-    then
-       ${NEW_ROOT}/mnt/cdrom/cdupdate.sh
-       if [ "$?" != '0' ]
+       if [ "${CDROOT}" -eq '1' ]
        then
-           splash 'verbose'
-           bad_msg "FAILED TO EXECUTE cdupdate.sh"
-           run_shell
-       fi
-    fi
+               if [ -x /${NEW_ROOT}/mnt/cdrom/cdupdate.sh ]
+               then
+                       good_msg "Running cdupdate.sh"
+                       ${NEW_ROOT}/mnt/cdrom/cdupdate.sh
+                       if [ "$?" != '0' ]
+                       then
+                               splash 'verbose'
+                               bad_msg "FAILED TO EXECUTE cdupdate.sh"
+                               run_shell
+                       fi
+               else
+                       good_msg "no cdupdate.sh script found .... skipping"
+               fi
+       fi
 }
 
 rundebugshell(){
index c6ab10ed6b6f0b568cc0ab8fb417ee8919ed840e..1cd0c91ccb7a3644ac045c2f938e801bf81201fa 100644 (file)
@@ -486,6 +486,9 @@ else
        mkdir -p ${NEW_ROOT}/tmp/.initrd
 fi
 
+# Execute script on the cdrom just before boot to update things if necessary
+cdupdate
+
 if [ "${SUBDIR}" != '' -a -e "${CHROOT}/${SUBDIR}" ]
 then
     good_msg"Entering ${SUBDIR} to boot"