mirror of
https://github.com/rancher/os.git
synced 2025-09-16 06:59:12 +00:00
make ros install --append work
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
0
cmd/control/dev.go
Executable file → Normal file
0
cmd/control/dev.go
Executable file → Normal file
@@ -248,6 +248,7 @@ func runInstall(image, installType, cloudConfig, device, kappend string, force,
|
||||
}
|
||||
|
||||
if mountiso {
|
||||
// TODO: I hope to remove this from here later.
|
||||
if err := mountBootIso(); err == nil {
|
||||
log.Infof("Mounted /dev/sr0")
|
||||
}
|
||||
@@ -423,7 +424,7 @@ func layDownOS(image, installType, cloudConfig, device, kappend string) error {
|
||||
//log.Debugf("pvGrubConfig")
|
||||
//pvGrubConfig(menu)
|
||||
log.Debugf("installRancher")
|
||||
err := installRancher(baseName, bootDir, VERSION, DIST)
|
||||
err := installRancher(baseName, bootDir, VERSION, DIST, kernelArgs+" "+kappend)
|
||||
if err != nil {
|
||||
log.Errorf("%s", err)
|
||||
return err
|
||||
@@ -842,23 +843,12 @@ DEFAULT RancherOS-current
|
||||
return nil
|
||||
}
|
||||
|
||||
func installRancher(baseName, bootDir, VERSION, DIST string) error {
|
||||
func installRancher(baseName, bootDir, VERSION, DIST, kappend string) error {
|
||||
log.Debugf("installRancher")
|
||||
|
||||
//cp ${DIST}/initrd ${baseName}/${bootDir}initrd-${VERSION}-rancheros
|
||||
//if err := dfs.CopyFile(DIST+"/initrd", filepath.Join(baseName, bootDir), "initrd-"+VERSION+"-rancheros"); err != nil {
|
||||
// log.Errorf("copy initrd: ", err)
|
||||
// return err
|
||||
//}
|
||||
// TODO detect if there already is a linux-current.cfg, if so, move it to linux-previous.cfg, and replace only current with the one in the image/iso
|
||||
|
||||
//cp ${DIST}/vmlinuz ${baseName}/${bootDir}vmlinuz-${VERSION}-rancheros
|
||||
//if err := dfs.CopyFile(DIST+"/vmlinuz", filepath.Join(baseName, bootDir), "vmlinuz-"+VERSION+"-rancheros"); err != nil {
|
||||
// log.Errorf("copy vmlinuz: %s", err)
|
||||
// return err
|
||||
//}
|
||||
//return nil
|
||||
|
||||
// The ISO has all the files in it - the syslinux cfg's and the kernel&initrd, so we can copy them all from there
|
||||
// The image/ISO have all the files in it - the syslinux cfg's and the kernel&initrd, so we can copy them all from there
|
||||
files, _ := ioutil.ReadDir(DIST)
|
||||
for _, file := range files {
|
||||
if file.IsDir() {
|
||||
@@ -874,6 +864,12 @@ func installRancher(baseName, bootDir, VERSION, DIST string) error {
|
||||
log.Errorf("copy %s: %s", "syslinux.cfg", err)
|
||||
return err
|
||||
}
|
||||
// The global.cfg INCLUDE - useful for over-riding the APPEND line
|
||||
err := ioutil.WriteFile(filepath.Join(filepath.Join(baseName, bootDir), "global.cfg"), []byte("APPEND "+kappend), 0644)
|
||||
if err != nil {
|
||||
log.Errorf("write (%s) %s", "global.cfg", err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@@ -1,6 +1,9 @@
|
||||
TIMEOUT 20 #2s
|
||||
PROMPT 1
|
||||
|
||||
# doesn't appear to work here?
|
||||
INCLUDE ../global.cfg
|
||||
|
||||
# each INCLUDEd file has a `DEFAULT mylabel` in it, and the last one wins
|
||||
INCLUDE ../linux-previous.cfg
|
||||
INCLUDE ../linux-current.cfg
|
||||
|
@@ -6,5 +6,6 @@ LABEL rancheros-${LABEL}
|
||||
KERNEL /boot/vmlinuz-${KERNEL_VERSION}
|
||||
INITRD /boot/initrd
|
||||
#TODO - once we work out how to append it for qemu-dev,/boot/linuxmods-${KERNEL_VERSION}
|
||||
APPEND quiet rancher.autologin=tty1 rancher.autologin=ttyS0 ${APPEND}
|
||||
#APPEND quiet rancher.autologin=tty1 rancher.autologin=ttyS0 ${APPEND}
|
||||
#INCLUDE global.cfg
|
||||
|
||||
|
@@ -28,7 +28,8 @@ cp ${ARTIFACTS}/vmlinuz-${KERNEL_VERSION} ${CD}/boot/
|
||||
|
||||
cat scripts/isolinux.cfg | envsubst > ${CD}/boot/isolinux/isolinux.cfg
|
||||
cat scripts/isolinux_label.cfg | LABEL=${VERSION} envsubst > ${CD}/boot/linux-current.cfg
|
||||
cat scripts/isolinux_label.cfg | LABEL=debug APPEND="rancher.debug=true" envsubst > ${CD}/boot/linux-previous.cfg
|
||||
#cat scripts/isolinux_label.cfg | LABEL=debug APPEND="rancher.debug=true" envsubst > ${CD}/boot/linux-previous.cfg
|
||||
cat scripts/global.cfg | LABEL=${VERSION} envsubst > ${CD}/boot/global.cfg
|
||||
|
||||
cp /usr/lib/ISOLINUX/isolinux.bin ${CD}/boot/isolinux/
|
||||
cp /usr/lib/syslinux/modules/bios/ldlinux.c32 ${CD}/boot/isolinux/
|
||||
|
Reference in New Issue
Block a user