From 9ce005cf8872a8643bd39d153a93fc2766a910de Mon Sep 17 00:00:00 2001 From: Brandon Philips Date: Thu, 13 Mar 2014 12:04:10 -0700 Subject: [PATCH 1/4] fix(build_library): make the usr link relative Fix the problem of: "pecified switch root path %s does not seem to be an OS tree. /etc/os-release is missing" because dracut doesn't have an /usr/share/coreos/os-release file. --- build_library/set_lsb_release | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_library/set_lsb_release b/build_library/set_lsb_release index 5976ffb2da..0cc858adb3 100755 --- a/build_library/set_lsb_release +++ b/build_library/set_lsb_release @@ -115,7 +115,7 @@ EOF if [[ -a "${ROOT_FS_DIR}/etc/os-release" ]] ; then sudo rm "${ROOT_FS_DIR}/etc/os-release" fi -sudo ln -s "/usr/share/coreos/os-release" "${ROOT_FS_DIR}/etc/os-release" +sudo ln -s "../usr/share/coreos/os-release" "${ROOT_FS_DIR}/etc/os-release" # Create the defaults for the coreos configuration files in the usr directory sudo_clobber "${ROOT_FS_DIR}/usr/share/coreos/release" < Date: Thu, 13 Mar 2014 12:05:33 -0700 Subject: [PATCH 2/4] fix(build_library): use ln -sf instead of if we don't need an if statement when we can force. --- build_library/set_lsb_release | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/build_library/set_lsb_release b/build_library/set_lsb_release index 0cc858adb3..790c6b6244 100755 --- a/build_library/set_lsb_release +++ b/build_library/set_lsb_release @@ -112,10 +112,7 @@ EOF # The first time through the image, we have an os-release from a package, # the second time through this script, we don't, so we need to test if it's # present before trying to remove it. -if [[ -a "${ROOT_FS_DIR}/etc/os-release" ]] ; then - sudo rm "${ROOT_FS_DIR}/etc/os-release" -fi -sudo ln -s "../usr/share/coreos/os-release" "${ROOT_FS_DIR}/etc/os-release" +sudo ln -sf "../usr/share/coreos/os-release" "${ROOT_FS_DIR}/etc/os-release" # Create the defaults for the coreos configuration files in the usr directory sudo_clobber "${ROOT_FS_DIR}/usr/share/coreos/release" < Date: Thu, 13 Mar 2014 12:08:50 -0700 Subject: [PATCH 3/4] fix(build_library): put lsb-release in usr too --- build_library/set_lsb_release | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build_library/set_lsb_release b/build_library/set_lsb_release index 790c6b6244..1d615afefc 100755 --- a/build_library/set_lsb_release +++ b/build_library/set_lsb_release @@ -76,7 +76,7 @@ fi # update service. # DISTRIB_* are the standard names for the same values. sudo mkdir -p "${ROOT_FS_DIR}/etc" -sudo_clobber "${ROOT_FS_DIR}/etc/lsb-release" < Date: Thu, 13 Mar 2014 12:18:33 -0700 Subject: [PATCH 4/4] fix(build_library): mkdir /usr/share/coreos in the right order This is important otherwise things fail to create files because the directoreis don't exist. --- build_library/set_lsb_release | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build_library/set_lsb_release b/build_library/set_lsb_release index 1d615afefc..456ff5a53c 100755 --- a/build_library/set_lsb_release +++ b/build_library/set_lsb_release @@ -75,7 +75,7 @@ fi # COREOS_RELEASE_TRACK and COREOS_RELEASE_VERSION are used by the software # update service. # DISTRIB_* are the standard names for the same values. -sudo mkdir -p "${ROOT_FS_DIR}/etc" +sudo mkdir -p "${ROOT_FS_DIR}/usr/share/coreos" sudo_clobber "${ROOT_FS_DIR}/usr/share/coreos/lsb-release" <